Skip to content

Commit ace7603

Browse files
committed
new step as an include
1 parent 43134b6 commit ace7603

File tree

2 files changed

+45
-20
lines changed

2 files changed

+45
-20
lines changed

articles/azure-functions/create-first-function-azd-cli.md

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ You can use the `azd init` command to create a local Azure Functions code projec
6060
azd init --template functions-quickstart-dotnet-azd
6161
cd FunctionHttp
6262
```
63+
[!INCLUDE [functions-quickstart-azd-env](../../includes/functions-quickstart-azd-env.md)]
6364
64-
1. Create a file named _local.settings.json_ in the app's root folder (`/FunctionHttp`), and add this JSON data to the file:
65+
3. Create a file named _local.settings.json_ in the app's root folder (`/FunctionHttp`), and add this JSON data to the file:
6566
6667
```json
6768
{
@@ -83,13 +84,15 @@ You can use the `azd init` command to create a local Azure Functions code projec
8384
cd http
8485
```
8586
86-
1. Run this command in the app's root folder (`/http`):
87+
[!INCLUDE [functions-quickstart-azd-env](../../includes/functions-quickstart-azd-env.md)]
88+
89+
3. Run this command in the app's root folder (`/http`):
8790
8891
```command
8992
func init --worker-runtime java
9093
```
9194
92-
This restores the _local.settings.json_ file in the app's root folder (`/http`), which is required when running locally.
95+
This command restores the _local.settings.json_ file in the app's root folder (`/http`), which is required when running locally.
9396
::: zone-end
9497
::: zone pivot="programming-language-javascript"
9598
1. In your local terminal or command prompt, run this `azd init` command in an empty folder:
@@ -98,13 +101,15 @@ You can use the `azd init` command to create a local Azure Functions code projec
98101
azd init --template functions-quickstart-javascript-azd
99102
```
100103
101-
1. Run this command in the root folder:
104+
[!INCLUDE [functions-quickstart-azd-env](../../includes/functions-quickstart-azd-env.md)]
105+
106+
3. Run this command in the root folder:
102107
103108
```command
104109
func init --worker-runtime javascript
105110
```
106111
107-
This restores the _local.settings.json_ file in the root folder, which is required when running locally.
112+
This command restores the _local.settings.json_ file in the root folder, which is required when running locally.
108113
::: zone-end
109114
::: zone pivot="programming-language-powershell"
110115
1. In your local terminal or command prompt, run this `azd init` command in an empty folder:
@@ -113,27 +118,33 @@ You can use the `azd init` command to create a local Azure Functions code projec
113118
azd init --template functions-quickstart-powershell-azd
114119
cd src
115120
```
116-
1. Run this command in the app's root folder (`/src`):
121+
122+
[!INCLUDE [functions-quickstart-azd-env](../../includes/functions-quickstart-azd-env.md)]
123+
124+
3. Run this command in the app's root folder (`/src`):
117125
118126
```command
119127
func init --worker-runtime powershell
120128
```
121129
122-
This restores the _local.settings.json_ file in the app's root folder (`/src`), which is required when running locally.
130+
This command restores the _local.settings.json_ file in the app's root folder (`/src`), which is required when running locally.
123131
::: zone-end
124132
::: zone pivot="programming-language-typescript"
125133
1. In your local terminal or command prompt, run this `azd init` command in an empty folder:
126134
127135
```azd
128136
azd init --template functions-quickstart-typescript-azd
129137
```
130-
1. Run this command in the root folder:
138+
139+
[!INCLUDE [functions-quickstart-azd-env](../../includes/functions-quickstart-azd-env.md)]
140+
141+
3. Run this command in the root folder:
131142
132143
```command
133144
func init --worker-runtime typescript
134145
```
135146
136-
This restores the _local.settings.json_ file in the root folder, which is required when running locally.
147+
This command restores the _local.settings.json_ file in the root folder, which is required when running locally.
137148
::: zone-end
138149
::: zone pivot="programming-language-python"
139150
1. In your local terminal or command prompt, run this `azd init` command in an empty folder:
@@ -142,12 +153,14 @@ You can use the `azd init` command to create a local Azure Functions code projec
142153
azd init --template functions-quickstart-python-http-azd
143154
```
144155
145-
1. Run this command in the root folder:
156+
[!INCLUDE [functions-quickstart-azd-env](../../includes/functions-quickstart-azd-env.md)]
157+
158+
3. Run this command in the root folder:
146159
147160
```bash
148161
func init --worker-runtime python
149162
```
150-
This restores the _local.settings.json_ file in the root folder, which is required when running locally.
163+
This command restores the _local.settings.json_ file in the root folder, which is required when running locally.
151164
152165
## Create and activate a virtual environment
153166
@@ -220,8 +233,6 @@ py -m venv .venv
220233

221234
1. When you're done, press Ctrl+C in the terminal window to stop the `func.exe` host process.
222235
223-
::: zone-end
224-
225236
## Review the code (optional)
226237
227238
If you choose to, review the code that defines the two HTTP trigger function endpoints:
@@ -240,7 +251,7 @@ If you choose to, review the code that defines the two HTTP trigger function end
240251
:::code language="typescript" source="~/functions-quickstart-typescript-azd/src/functions/httpGetFunction.ts" :::
241252
::: zone-end
242253
::: zone pivot="programming-language-powershell"
243-
This is the `function.json` file that defines the `httpget` function:
254+
This code is the `function.json` file that defines the `httpget` function:
244255
:::code language="json" source="~/functions-quickstart-powershell-azd/src/httpGetFunction/function.json" :::
245256
This is the `run.ps1` file that implements the function code:
246257
:::code language="powershell" source="~/functions-quickstart-powershell-azd/src/httpGetFunction/run.ps1" :::
@@ -275,7 +286,7 @@ This is the `run.ps1` file that implements the function code:
275286
276287
---
277288
278-
After you've verified your functions run locally, it's time to publish them to Azure.
289+
After you verified your functions run locally, it's time to publish them to Azure.
279290

280291
## Deploy to Azure
281292

@@ -294,11 +305,12 @@ This project is configured to use the `azd up` command to deploy this project to
294305

295306
1. When prompted, provide these required deployment parameters:
296307

297-
+ _Environment name_:
298-
+ _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.
299308
+ _Azure subscription_: Subscription in which your resources are created.
309+
+ _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.
300310

301-
The `azd up` command applies your reponse to these prompts to the Bicep configuration files and create Azure resources. Your response 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 your
311+
The `azd up` command applies your response to these prompts to the Bicep configuration files and create Azure resources.
312+
313+
302314

303315
these deployment tasks:
304316

@@ -310,11 +322,13 @@ these deployment tasks:
310322
* Virtual network to securely run both the function app and the other Azure resources.
311323
* Package and deploy your code to the deployment container ([`azd deploy`](/azure/developer/azure-developer-cli/reference#azd-deploy)).
312324

313-
1. Create the Azure resources required to host the project in a function app running in the Flex Consmption plan.
325+
1. Create the Azure resources required to host the project in a function app running in the Flex Consumption plan.
314326
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.
315327

316328
After the command completes successfully, you see links to the resources created.
317329

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.
331+
318332

319333

320334
## Invoke the function on Azure
@@ -335,7 +349,7 @@ Because your function uses an HTTP trigger, you invoke it by making an HTTP requ
335349
336350
## Clean up resources
337351
338-
When you are done working with your function app and related resources, you can use this command to delete the function app and its related resources from Azure and avoid incurring any further costs:
352+
When you're done working with your function app and related resources, you can use this command to delete the function app and its related resources from Azure and avoid incurring any further costs:
339353
340354
```azd
341355
azd down
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
author: ggailey777
3+
ms.service: azure-functions
4+
ms.topic: include
5+
ms.date: 08/27/2024
6+
ms.author: glenga
7+
---
8+
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+
11+
After you specify the environment, `azd` clones the template files to your machine and initializes a local project.

0 commit comments

Comments
 (0)