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/how-to-create-function-azure-cli.md
+87-3Lines changed: 87 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -213,17 +213,101 @@ To enable the Functions host to connect to the default storage account using sha
213
213
214
214
At this point, the Functions host is able to connect to the storage account securely using managed identities instead of shared secrets. You can now deploy your project code to the Azure resources.
215
215
216
+
::: zone pivot="programming-language-csharp,programming-language-javascript,programming-language-typescript,programming-language-powershell,programming-language-python"
After you've successfully created your function app in Azure, you must update the pom.xml file. In this way, Maven can deploy to your new app instead of trying to create new Azure resources.
223
+
224
+
1. In Azure Cloud Shell, use this [`az functionapp show`](/cli/azure/functionapp#az-functionapp-show) command to get the deployment container URL and ID of the new user-assigned managed identity:
225
+
226
+
```azurecli
227
+
az functionapp show --name <APP_NAME> --resource-group AzureFunctionsQuickstart-rg \
1. In the new `configuration` element, make these specific replacements of the elipses (`...`) values:
270
+
271
+
| Configuration | Value |
272
+
| ---- | ---- |
273
+
|`region` | The region code of your existing function app, such as `eastus`. |
274
+
|`deploymentStorageAccount`| The name of your storage account. |
275
+
|`deploymentStorageContainer`| The name of the deployment share, which comes after the `\` in the `containerUrl` value you just obtained. |
276
+
|`userAssignedIdentityResourceId`| The fully-qualified ID of your managed identity, which you just obtained. |
277
+
278
+
1. Save your changes to the _pom.xml_ file.
279
+
280
+
You can now use Maven to deploy your code project to your existing app.
281
+
282
+
## Deploy the function project to Azure
283
+
284
+
1. From the command prompt, run this command:
285
+
286
+
```console
287
+
mvn clean package azure-functions:deploy
288
+
```
217
289
218
290
## Invoke the function on Azure
219
291
220
292
Because your function uses an HTTP trigger and supports GET requests, you invoke it by making an HTTP request to its URL. It's easiest to do this in a browser.
221
293
222
-
Copy the complete **Invoke URL** shown in the output of the publish command into a browser address bar. When you navigate to this URL, the browser should display similar output as when you ran the function locally.
294
+
1. Use this [`az functionapp function show`](/cli/azure/functionapp/function#az-functionapp-function-show) to get the URL for the `HttpExample` function endpoint:
295
+
296
+
```azurecli
297
+
az functionapp function show --name <APP_NAME> --resource-group "AzureFunctionsQuickstart-rg" \
In this example, replace `<APP_NAME>` with the names of your function app.
223
302
224
-
::: zone pivot="programming-language-csharp,programming-language-javascript,programming-language-typescript,programming-language-powershell,programming-language-java"
1. Copy and paste the returned endpoint URL in your browser address bar and run the function.
226
304
::: zone-end
305
+
::: zone pivot="programming-language-csharp,programming-language-javascript,programming-language-typescript,programming-language-powershell,programming-language-python"
306
+
## Invoke the function on Azure
307
+
308
+
Because your function uses an HTTP trigger and supports GET requests, you invoke it by making an HTTP request to its URL. It's easiest to do this in a browser. Copy the complete **Invoke URL** shown in the output of the publish command into a browser address bar. When you navigate to this URL, the browser should display similar output as when you ran the function locally.
0 commit comments