In this hands-on lab, we will configure an Azure Function proxy.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Log In to the Azure Portal
Log in to the Azure Portal using the username and password supplied by the lab.
- Open a browser.
- Navigate to the provided Azure Portal URL.
- Use the supplied username and password to authenticate.
- Create the HTTP-Triggered Function
Starting in the Azure dashboard, perform the following tasks:
- Open the navigation menu in the upper-left of the Portal.
- Click All resources
Wait for all the resources to appear.
In the list, click the app service that has a name starting with fa-. This will open the overview page of the function app service.
On the function app overview page, click Functions in the function apps navigation tree on the left of the page.
Click + New function at the top of the empty list of functions.
In the list of triggers, click on HTTP trigger.
Name the function "HttpTrigger1".
Click Create.
Wait for the function code to open in the browser.
- Create the Function Proxy
On the code page for the HTTP-triggered function, click Get function URL near the top of the page. On the popup, click Copy to copy the URL to the clipboard. Close the popup.
In the Function apps navigation tree, click Proxies.
When the empty list of proxies displays, click + New proxy. In the configuration form, enter the following information:
- Name: proxy
- Route template: /myfunc
In the Backend URL field, paste in the function URL copied earlier.
Click Create.
- Run the Function via the Proxy
After the Create function task returns, the field Proxy URL will contain a URL. Click Copy to copy the URL to the clipboard.
Open a new browser tab. Paste the URL into the address bar and press enter.
The browser will display the following:
Please pass a name on the query string or in the request body
The function has been run via the proxy, but we need to add the name parameter to the URL, so add
?name=Me
to the URL and press enter.The browser will then display the following:
Hello, Me