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
#Customer intent: As a developer, I need to know how to use the Azure Developer CLI to create and deploy my function code securely to a new function app in the Flex Consumption plan in Azure by using azd templates and the azd up command.
@@ -23,8 +23,6 @@ Because of the Flex Consumption plan, completing this quickstart incurs a small
1. In a separate terminal or command prompt, start `azurite`. You need to use a separate terminal because the Azurite process blocks the thread while it runs.
202
-
203
-
1. Run this command in your project's root folder:
193
+
1. Run this command from your project's root folder in a terminal or command prompt:
204
194
205
195
::: zone pivot="programming-language-csharp, programming-language-powershell,programming-language-python,programming-language-javascript"
After you verified your functions run locally, it's time to publish them to Azure.
282
+
After you verify your functions locally, it's time to publish them to Azure.
290
283
291
284
## Deploy to Azure
292
285
293
286
This project is configured to use the `azd up`command to deploy this project to a new functionappin a Flex Consumption plan in Azure.
294
287
295
288
>[!TIP]
296
-
>This project uses best practices forsecuring your app by runningin a Flex consumption plan, using only managed identities instead of stored connection strings, and running in a virtual network.
289
+
>This project includes a set of Bicep files that `azd` uses to create a best practices secure deployment to a Flex consumption plan.
297
290
298
291
1. Run this command to create the Azure resources and deploy your app to Azure.
299
292
@@ -308,44 +301,41 @@ This project is configured to use the `azd up` command to deploy this project to
308
301
+ _Azure subscription_: Subscription in which your resources are created.
309
302
+ _Azure location_: Azure region in which to create the resource group that contains the new Azure resources. Only regions that currently support the Flex Consumption plan are shown.
310
303
311
-
The `azd up`commandapplies your response to these prompts to the Bicep configuration files and create Azure resources.
304
+
The `azd up`commanduses your response to these prompts with the Bicep configuration files to complete these deployment tasks:
312
305
313
-
306
+
+ Create and configure these required Azure resources (equivalent to [`azd provision`](/azure/developer/azure-developer-cli/reference#azd-provision)):
314
307
315
-
these deployment tasks:
316
-
317
-
+ Create and configure all required Azure resources for secure deployment ([`azd provision`](/azure/developer/azure-developer-cli/reference#azd-provision)), which includes:
318
-
* Flex Consumption plan and functionapp.
319
-
* Azure Storage (required) and Application Insights (recommended).
320
-
* Access policies and roles for your account.
321
-
* Service-to-service connections using managed identities (instead of stored connection strings).
322
-
* Virtual network to securely run both the functionapp and the other Azure resources.
323
-
* Package and deploy your code to the deployment container ([`azd deploy`](/azure/developer/azure-developer-cli/reference#azd-deploy)).
324
-
325
-
1. Create the Azure resources required to host the project in a functionapp running in the Flex Consumption plan.
326
-
1. Package and deploy this code project to the deployment container after the resources are provisioned. The app is then started and runs in the deployment container.
327
-
328
-
After the command completes successfully, you see links to the resources created.
329
-
330
-
Your responses to the prompts are stored, and you can run the `azd up`command as many times as you like to both provision and deploy updates to your application. During subsequent executions, existing resources are skipped, but deployed code files are always overwritten by the latest deployment package. Use the `azd env get-values`command to review all of the variables used when creating Azure resources.
308
+
+ Flex Consumption plan and functionapp
309
+
+ Azure Storage (required) and Application Insights (recommended)
310
+
+ Access policies and roles for your account
311
+
+ Service-to-service connections using managed identities (instead of stored connection strings)
312
+
+ Virtual network to securely run both the functionapp and the other Azure resources
331
313
314
+
+ Package and deploy your code to the deployment container (equivalent to [`azd deploy`](/azure/developer/azure-developer-cli/reference#azd-deploy)). The app is then started and runs in the deployed package.
332
315
316
+
1. After the command completes successfully, you see links to the resources created. Make a copy of the **Function App** name. If you forgot to save the app name, you can always get it again using the `azd env get-values`command and copying `AZURE_FUNCTION_NAME`.
333
317
334
318
## Invoke the function on Azure
335
319
336
-
Because your functionuses an HTTP trigger, you invoke it by making an HTTP request to its URL inthe browser or with a tool like curl.
320
+
You can now invoke your functionendpointsin Azure by making HTTP requests to their URLs using your HTTP test tool or from the browser (for GET requests). When your functions run in Azure, access key authorization is enforced, and you must provide a functionaccess key with your request.
337
321
338
-
1. From your HTTP test tool in a second terminal or from a browser, call the HTTP GET endpoint, which should look like this URL:
322
+
You can use the Core Tools to obtain the URL endpoints of your functions running in Azure, along with their required access key values.
339
323
340
-
<http://localhost:7071/api/httpget>
324
+
1. In your local terminal or command prompt, run this `func azure functionapp list-functions` command:
In this example, replace `<APP_NAME>` with the name of the functionapp created by azd during deployment. Using the `--show-keys` option means that the returned **Invoke URL:** value for each endpoint includes a function-level access key.
341
331
342
-
1. From your HTTP test tool in a second terminal, send an HTTP POST request like this example:
332
+
1. As before, use your HTTP test tool to validate these URLs in your functionapp running in Azure.
Your responses to `azd` prompts and other environment variables generated by `azd` are stored in your named environment. This means that you can run the `azd up`command as many times as you need to both reprovision your functionapp and deploy updates to your source code. During subsequent executions, existing resources are skipped. Deployed code files are always overwritten by the latest deployment package.
347
337
348
-
`<<to-do>>`
338
+
Use the `azd env get-values`command to review all of the variables in your environment that were used when creating Azure resources.
349
339
350
340
## Clean up resources
351
341
@@ -355,7 +345,11 @@ When you're done working with your function app and related resources, you can u
355
345
azd down
356
346
```
357
347
358
-
This command doesn't affect your source code repository. For more information about Functions costs, see [Estimating Flex Consumption plan costs](./flex-consumption-plan.md#billing).
348
+
This command doesn't affect your local code project.
Copy file name to clipboardExpand all lines: includes/functions-quickstart-azd-env.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,4 +8,4 @@ ms.author: glenga
8
8
9
9
2. Enter an environment name when prompted, such as `flexquickstart`. In `azd`, the environment is used to maintain a unique deployment context for your app, and you can define more than one. It's also used in the name of the resource group you create in Azure.
10
10
11
-
After you specify the environment, `azd` clones the template files to your machine and initializes a local project.
11
+
After you specify the environment, `azd` clones the template files to your machine and initializes a local project in your current folder.
0 commit comments