You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-create-serverless-api.md
+18-8Lines changed: 18 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,13 +46,22 @@ For more information about customizing HTTP functions, see [Azure Functions HTTP
46
46
47
47
### Test your API
48
48
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:
50
50
1. On the function page, select **Code + Test** from the left menu.
51
+
51
52
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.
56
65
57
66
## Proxies overview
58
67
@@ -76,7 +85,7 @@ Repeat the steps to [Create a function app](https://docs.microsoft.com/azure/azu
76
85
77
86
1. Navigate to your new frontend function app in the portal.
78
87
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.
80
89
81
90
> [!NOTE]
82
91
> 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
96
105
| Name | HelloProxy | A friendly name used only for management |
97
106
| Route template | /api/remotehello | Determines what route is used to invoke this proxy |
98
107
| Backend URL | https://%HELLO_HOST%/api/hello | Specifies the endpoint to which the request should be proxied |
108
+
99
109
100
110
:::image type="content" source="./media/functions-create-serverless-api/creating-proxy.png" alt-text="Creating a proxy":::
101
111
102
112
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.
103
113
104
114
1. Try out your new proxy by copying the proxy URL and testing it in the browser or with your favorite HTTP client:
0 commit comments