Skip to content

Commit 37f7376

Browse files
author
dksimpson
committed
Edits
1 parent 2051c6a commit 37f7376

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

articles/azure-functions/functions-create-serverless-api.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,22 @@ For more information about customizing HTTP functions, see [Azure Functions HTTP
4646

4747
### Test your API
4848

49-
Next, test your function to see how it works with the new API surface.
49+
Next, test your function to see how it works with the new API surface:
5050
1. On the function page, select **Code + Test** from the left menu.
51+
5152
1. Select **Get function URL** from the top menu and copy the URL. Confirm that it now uses the `/api/hello` path.
52-
1. Copy the URL into a new browser tab or your preferred REST client. Browsers use GET by default.
53-
2. Add parameters to the query string in your URL. For example, `/api/hello/?name=John`.
54-
3. Press Enter to confirm that it's working. You should see the response, "*Hello John*."
55-
4. You can also try calling the endpoint with another HTTP method to confirm that the function isn't executed. To do so, use a REST client, such as cURL, Postman, or Fiddler.
53+
54+
1. Copy the URL into a new browser tab or your preferred REST client.
55+
56+
Browsers use GET by default.
57+
58+
1. Add parameters to the query string in your URL.
59+
60+
For example, `/api/hello/?name=John`.
61+
62+
1. Press Enter to confirm that it's working. You should see the response, "*Hello John*."
63+
64+
1. You can also try calling the endpoint with another HTTP method to confirm that the function isn't executed. To do so, use a REST client, such as cURL, Postman, or Fiddler.
5665

5766
## Proxies overview
5867

@@ -76,7 +85,7 @@ Repeat the steps to [Create a function app](https://docs.microsoft.com/azure/azu
7685

7786
1. Navigate to your new frontend function app in the portal.
7887
1. Select **Platform Features** and choose **Application Settings**.
79-
1. Scroll down to **Application settings** where key/value pairs are stored and create a new setting with the key "HELLO_HOST". Set its value to the host of your backend function app, such as `<YourBackendApp>.azurewebsites.net`. This value is part of the URL that you copied earlier when testing your HTTP function. You'll reference this setting in the configuration later.
88+
1. Scroll down to **Application settings**, where key/value pairs are stored, and create a new setting with the key `HELLO_HOST`. Set its value to the host of your backend function app, such as `<YourBackendApp>.azurewebsites.net`. This value is part of the URL that you copied earlier when testing your HTTP function. You'll reference this setting in the configuration later.
8089

8190
> [!NOTE]
8291
> App settings are recommended for the host configuration to prevent a hard-coded environment dependency for the proxy. Using app settings means that you can move the proxy configuration between environments, and the environment-specific app settings will be applied.
@@ -96,16 +105,17 @@ Repeat the steps to [Create a function app](https://docs.microsoft.com/azure/azu
96105
| Name | HelloProxy | A friendly name used only for management |
97106
| Route template | /api/remotehello | Determines what route is used to invoke this proxy |
98107
| Backend URL | https://%HELLO_HOST%/api/hello | Specifies the endpoint to which the request should be proxied |
108+
99109

100110
:::image type="content" source="./media/functions-create-serverless-api/creating-proxy.png" alt-text="Creating a proxy":::
101111

102112
Azure Functions Proxies doesn't provide the `/api` base path prefix, which must be included in the route template. The `%HELLO_HOST%` syntax references the app setting you created earlier. The resolved URL will point to your original function.
103113

104114
1. Try out your new proxy by copying the proxy URL and testing it in the browser or with your favorite HTTP client:
105115
- For an anonymous function use:
106-
`https://YOURPROXYAPP.azurewebsites.net/api/remotehello?name="Proxies"`
116+
`https://YOURPROXYAPP.azurewebsites.net/api/remotehello?name="Proxies"`.
107117
- For a function with authorization use:
108-
`https://YOURPROXYAPP.azurewebsites.net/api/remotehello?code=YOURCODE&name="Proxies"`
118+
`https://YOURPROXYAPP.azurewebsites.net/api/remotehello?code=YOURCODE&name="Proxies"`.
109119

110120
## Create a mock API
111121

0 commit comments

Comments
 (0)