hi and welcome to another episode of cloud in five minutes today I want to
talk you about a sure function proxies and show you some tricks that I do with
it also if you prefer I have a French version of
this video. you just have to click the the link that will show up in the top right corner
hello again let me introduce myself so I'm Frank Boucher Microsoft Azure MVP
based at Montreal today I want to take a few minutes to show you what we can do
or what I do with as your function proxy let's do it
so I'm already in the azure portal and I created a function app now I was waiting
for you guys to create custom functions in today's example I will create an HTTP
trigger but we can use many different things so HTTP trigger and since I'm
comfortable with C sharp or you C sharp so let's call it Frank demo oops
so now the function is created and everything is ok so I will click here to
get the URL and we note that I'm using security functions level so I have the
code so I will use postman Ari praise many times postman if you don't know
that tool I invite you to download it it's free I will put the URL in the
description of this video so in postman I'll just paste so we note that code is
passed so I should already hit my function of course it's complaining that
I didn't pass the name so let's had a name so name and then Frank and now I
should get my hello perfect it work exactly as expected
now let's had a proxy so back in the azure portal the proxies are just here
under functions and to create a new one I click the plus button so we'll give it
a name sanitation and then I will put a root set Edition again and for my
back-end URL I will use the function URL I just created so let's create that
so we see now the proxy has is only rare or you are Pell and if I try to use it
let's let's use this button and I go in postman and I paste this URL we know
that I'm not passing the security code right now right now but if I send it
howdy it my function why because the proxy is taking care of that so it could
be very useful if you want to manage some parameters you know you could give
different URL to your clients and it could use different proxy and then the
proxy will integrate some feature and pass it to the function but it will
still work for any other parameter so if I add my name in it it will still work
perfectly hello Frank cool so now we have a proxy and one
thing that could be interesting if what else can we do and where all that
information is safe so in fact guys all this information is a big decent file
and you can it go all I did it quickly so let's go back so here in the right
top right corner we have the advanced editor and if I go there this is our
jisun pretty cool so one thing that I do really often instead of having this
domain name that come over and over I just use a settings a variable
settings that I have in my app settings of my functions and by enclosing it with
the percent symbol then it's a way to specify to add a function to go check in
my application settings let's have a quick look so if I go back here then I
can go here and I will have my application settings just here so I
click then if I scroll I see that I configure already owes name and I put my
host name name here that's nice right so now if I I hit again it will still
work without any problem and by the way this file is automatically saved so I
don't need to save it you will see the status in the top right corner let's
let's go a little bit further and had a fake proxy or just that yips
this is one okay so for this proxy the match condition will be fake and what I
do is I override completely the response so I don't care about any function and
just like I will generate my own result so let's try this so see it's saved so I
like I will go in postman and I will create let's take this thing and then go
here and it will change the salutation by fake and if I click send
it doesn't care about my name or anything because it doesn't hit any
functions so it will be very very useful if you're trying to mock it to do some
mocking and test your API soar functions now you have a way to not even hit your
functions but just like return whatever you want and be sure to test all your
scenarios okay let's go one thing further I think that I will probably use
in a new website that I'm building for a func called in five minutes okay so
let's have another proxy this one is static five so the match condition that
is the mètode' get and I'm ruling root and then I pass using the same technique
that I show you before the blog URL pointing to an HTML file that I put in
my blob storage so what happened if so it's saved so what happened if I go in
postman and I use this thing yep so I'm using the get and then I point to the
root of my I function and I get HTML code and if I go in the browser and I
tried this then I will see the result this is really useful and it's also fun
because now since I can put a domain name to my functions I could clearly
have like cloud in five minutes calm pointing to this and
so have some functions helping me in my static website we know that you know
Azure storage is really cheap so now we could have like a little website running
over there and there will be a very cheap version so that's it in few
minutes I showed you how it was easy to use the function proxy in your dev and
test I hope you liked this video and I hope it was useful I'm very curious let
me know how you use the function f proxy in the comment below here are two
suggestions of video the one on top is another video where I talk about as your
function the one below is another great video from cloud in five minutes thanks
for watching see you next time you