Skip to content

Commit 6df9167

Browse files
authored
Merge pull request #174892 from mikefrobbins/mr-azps-prerequisites-100721
Clarified Azure PowerShell prerequisites
2 parents 5e13343 + ecfeb89 commit 6df9167

8 files changed

+203
-203
lines changed

articles/azure-functions/create-first-function-cli-csharp-ieux.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ There is also a [Visual Studio Code-based version](create-first-function-vs-code
3535

3636
+ [Azure CLI](/cli/azure/install-azure-cli) version 2.4 or later.
3737

38-
+ [Azure PowerShell](/powershell/azure/install-az-ps) version 5.0 or later.
38+
+ The Azure [Az PowerShell module](/powershell/azure/install-az-ps) version 5.9.0 or later.
3939

4040
---
4141

@@ -57,7 +57,7 @@ Verify your prerequisites, which depend on whether you are using the Azure CLI o
5757

5858
+**Run** `func --version` to check that the Azure Functions Core Tools are version 3.x.
5959

60-
+ **Run** `(Get-Module -ListAvailable Az).Version` and verify version 5.0 or later.
60+
+ **Run** `(Get-Module -ListAvailable Az).Version` and verify version 5.0 or later.
6161

6262
+ **Run** `Connect-AzAccount` to sign in to Azure and verify an active subscription.
6363

@@ -69,7 +69,7 @@ Verify your prerequisites, which depend on whether you are using the Azure CLI o
6969

7070
In this section, you create a local <abbr title="A logical container for one or more individual functions that can be deployed and managed together.">Azure Functions project</abbr> in C#. Each function in the project responds to a specific <abbr title="An event that invokes the function’s code, such as an HTTP request, a queue message, or a specific time.">trigger</abbr>.
7171

72-
1. Run the `func init` command to create a functions project in a folder named *LocalFunctionProj* with the specified runtime:
72+
1. Run the `func init` command to create a functions project in a folder named *LocalFunctionProj* with the specified runtime:
7373

7474
```csharp
7575
func init LocalFunctionProj --dotnet
@@ -83,24 +83,24 @@ In this section, you create a local <abbr title="A logical container for one or
8383
<br/>
8484

8585
1. Add a function to your project by using the following command:
86-
86+
8787
```console
8888
func new --name HttpExample --template "HTTP trigger" --authlevel "anonymous"
89-
```
89+
```
9090
The `--name` argument is the unique name of your function (HttpExample).
9191

9292
The `--template` argument specifies the function's trigger (HTTP).
9393

94-
95-
<br/>
96-
<details>
97-
<summary><strong>Optional: Code for HttpExample.cs</strong></summary>
98-
94+
95+
<br/>
96+
<details>
97+
<summary><strong>Optional: Code for HttpExample.cs</strong></summary>
98+
9999
*HttpExample.cs* contains a `Run` method that receives request data in the `req` variable is an [HttpRequest](/dotnet/api/microsoft.aspnetcore.http.httprequest) that's decorated with the **HttpTriggerAttribute**, which defines the trigger behavior.
100100

101101
:::code language="csharp" source="~/functions-docs-csharp/http-trigger-template/HttpExample.cs":::
102-
103-
The return object is an [ActionResult](/dotnet/api/microsoft.aspnetcore.mvc.actionresult) that returns a response message as either an [OkObjectResult](/dotnet/api/microsoft.aspnetcore.mvc.okobjectresult) (200) or a [BadRequestObjectResult](/dotnet/api/microsoft.aspnetcore.mvc.badrequestobjectresult) (400). To learn more, see [Azure Functions HTTP triggers and bindings](./functions-bindings-http-webhook.md?tabs=csharp).
102+
103+
The return object is an [ActionResult](/dotnet/api/microsoft.aspnetcore.mvc.actionresult) that returns a response message as either an [OkObjectResult](/dotnet/api/microsoft.aspnetcore.mvc.okobjectresult) (200) or a [BadRequestObjectResult](/dotnet/api/microsoft.aspnetcore.mvc.badrequestobjectresult) (400). To learn more, see [Azure Functions HTTP triggers and bindings](./functions-bindings-http-webhook.md?tabs=csharp).
104104
</details>
105105

106106
<br/>
@@ -115,7 +115,7 @@ In this section, you create a local <abbr title="A logical container for one or
115115
func start
116116
```
117117

118-
Toward the end of the output, the following lines should appear:
118+
Toward the end of the output, the following lines should appear:
119119

120120
<pre class="is-monospace is-size-small has-padding-medium has-background-tertiary has-text-tertiary-invert">
121121
...
@@ -147,7 +147,7 @@ In this section, you create a local <abbr title="A logical container for one or
147147
<br/>
148148

149149
---
150-
150+
151151
## 5. Create supporting Azure resources for your function
152152

153153
Before you can deploy your function code to Azure, you need to create a <abbr title="A logical container for related Azure resources that you can manage as a unit.">resource group</abbr>, a <abbr title="An account that contains all your Azure storage data objects. The storage account provides a unique namespace for your storage data.">storage account</abbr>, and a <abbr title="The cloud resource that hosts serverless functions in Azure, which provides the underlying compute environment in which functions run.">function app</abbr> by using the following commands:
@@ -160,15 +160,15 @@ Before you can deploy your function code to Azure, you need to create a <abbr ti
160160
```
161161

162162

163-
# [Azure PowerShell](#tab/azure-powershell)
163+
# [Azure PowerShell](#tab/azure-powershell)
164164
```azurepowershell
165165
Connect-AzAccount
166166
```
167167

168168

169169
---
170170

171-
1. Create a resource group named `AzureFunctionsQuickstart-rg` in the `westeurope` region.
171+
1. Create a resource group named `AzureFunctionsQuickstart-rg` in the `westeurope` region.
172172

173173
# [Azure CLI](#tab/azure-cli)
174174

@@ -188,7 +188,7 @@ Before you can deploy your function code to Azure, you need to create a <abbr ti
188188
---
189189

190190
You can't host Linux and Windows apps in the same resource group. If you have an existing resource group named `AzureFunctionsQuickstart-rg` with a Windows function app or web app, you must use a different resource group.
191-
191+
192192
1. Create a general-purpose Azure Storage account in your resource group and region:
193193

194194
# [Azure CLI](#tab/azure-cli)
@@ -215,24 +215,24 @@ Before you can deploy your function code to Azure, you need to create a <abbr ti
215215
**Replace** '<APP_NAME>' with a globally unique name.
216216

217217
# [Azure CLI](#tab/azure-cli)
218-
218+
219219
```azurecli
220220
az functionapp create --resource-group AzureFunctionsQuickstart-rg --consumption-plan-location westeurope --runtime dotnet --functions-version 3 --name <APP_NAME> --storage-account <STORAGE_NAME>
221221
```
222-
223-
222+
223+
224224
# [Azure PowerShell](#tab/azure-powershell)
225-
225+
226226
```azurepowershell
227227
New-AzFunctionApp -Name <APP_NAME> -ResourceGroupName AzureFunctionsQuickstart-rg -StorageAccount <STORAGE_NAME> -Runtime dotnet -FunctionsVersion 3 -Location 'West Europe'
228228
```
229-
230-
229+
230+
231231
---
232-
232+
233233
Replace `<STORAGE_NAME>` with the name of the account you used in the previous step.
234234

235-
Replace `<APP_NAME>` with a <abbr title="A name that must be unique across all Azure customers globally. For example, you can use a combination of your personal or organization name, application name, and a numeric identifier, as in contoso-bizapp-func-20.">unique name</abbr>. The `<APP_NAME>` is also the default DNS domain for the function app.
235+
Replace `<APP_NAME>` with a <abbr title="A name that must be unique across all Azure customers globally. For example, you can use a combination of your personal or organization name, application name, and a numeric identifier, as in contoso-bizapp-func-20.">unique name</abbr>. The `<APP_NAME>` is also the default DNS domain for the function app.
236236

237237
<br/>
238238
<details>
@@ -281,7 +281,7 @@ Functions in msdocs-azurefunctions-qs:
281281

282282
## 7. Invoke the function on Azure
283283

284-
Copy the complete **Invoke URL** shown in the output of the `publish` command into a browser address bar. **Append** the query parameter **&name=Functions**.
284+
Copy the complete **Invoke URL** shown in the output of the `publish` command into a browser address bar. **Append** the query parameter **&name=Functions**.
285285

286286
![The output of the function run on Azure in a browser](../../includes/media/functions-run-remote-azure-cli/function-test-cloud-browser.png)
287287

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

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Before you begin, you must have the following:
3131
[!INCLUDE [functions-cli-dotnet-prerequisites](../../includes/functions-cli-dotnet-prerequisites.md)]
3232
::: zone-end
3333
::: zone pivot="programming-runtime-functions-v4"
34-
# [In-process](#tab/in-process)
34+
# [In-process](#tab/in-process)
3535

3636
+ [.NET 6.0 SDK](https://dotnet.microsoft.com/download)
3737

@@ -41,7 +41,7 @@ Before you begin, you must have the following:
4141

4242
+ [Azure CLI](/cli/azure/install-azure-cli) version 2.4 or later.
4343

44-
+ [Azure PowerShell](/powershell/azure/install-az-ps) version 5.0 or later.
44+
+ The Azure [Az PowerShell module](/powershell/azure/install-az-ps) version 5.9.0 or later.
4545

4646
# [Isolated process](#tab/isolated-process)
4747

@@ -55,7 +55,7 @@ Before you begin, you must have the following:
5555

5656
+ [Azure CLI](/cli/azure/install-azure-cli) version 2.4 or later.
5757

58-
+ [Azure PowerShell](/powershell/azure/install-az-ps) version 5.0 or later.
58+
+ The Azure [Az PowerShell module](/powershell/azure/install-az-ps) version 5.9.0 or later.
5959
---
6060
::: zone-end
6161

@@ -81,7 +81,7 @@ Verify your prerequisites, which depend on whether you are using Azure CLI or Az
8181

8282
+ Run `dotnet --list-sdks` to check that the required versions are installed.
8383

84-
+ Run `(Get-Module -ListAvailable Az).Version` and verify version 5.0 or later.
84+
+ Run `(Get-Module -ListAvailable Az).Version` and verify version 5.0 or later.
8585

8686
+ Run `Connect-AzAccount` to sign in to Azure and verify an active subscription.
8787

@@ -91,9 +91,9 @@ Verify your prerequisites, which depend on whether you are using Azure CLI or Az
9191

9292
In Azure Functions, a function project is a container for one or more individual functions that each responds to a specific trigger. All functions in a project share the same local and hosting configurations. In this section, you create a function project that contains a single function.
9393

94-
1. Run the `func init` command, as follows, to create a functions project in a folder named *LocalFunctionProj* with the specified runtime:
94+
1. Run the `func init` command, as follows, to create a functions project in a folder named *LocalFunctionProj* with the specified runtime:
9595

96-
# [In-process](#tab/in-process)
96+
# [In-process](#tab/in-process)
9797

9898
```console
9999
func init LocalFunctionProj --dotnet
@@ -118,7 +118,7 @@ In Azure Functions, a function project is a container for one or more individual
118118

119119
```console
120120
func new --name HttpExample --template "HTTP trigger" --authlevel "anonymous"
121-
```
121+
```
122122

123123
`func new` creates a HttpExample.cs code file.
124124

@@ -128,23 +128,23 @@ If desired, you can skip to [Run the function locally](#run-the-function-locally
128128

129129
#### HttpExample.cs
130130

131-
The function code generated from the template depends on the type of compiled C# project.
131+
The function code generated from the template depends on the type of compiled C# project.
132132

133-
# [In-process](#tab/in-process)
133+
# [In-process](#tab/in-process)
134134

135135
*HttpExample.cs* contains a `Run` method that receives request data in the `req` variable is an [HttpRequest](/dotnet/api/microsoft.aspnetcore.http.httprequest) that's decorated with the **HttpTriggerAttribute**, which defines the trigger behavior.
136136

137137
:::code language="csharp" source="~/functions-docs-csharp/http-trigger-template/HttpExample.cs":::
138138

139-
The return object is an [ActionResult](/dotnet/api/microsoft.aspnetcore.mvc.actionresult) that returns a response message as either an [OkObjectResult](/dotnet/api/microsoft.aspnetcore.mvc.okobjectresult) (200) or a [BadRequestObjectResult](/dotnet/api/microsoft.aspnetcore.mvc.badrequestobjectresult) (400).
139+
The return object is an [ActionResult](/dotnet/api/microsoft.aspnetcore.mvc.actionresult) that returns a response message as either an [OkObjectResult](/dotnet/api/microsoft.aspnetcore.mvc.okobjectresult) (200) or a [BadRequestObjectResult](/dotnet/api/microsoft.aspnetcore.mvc.badrequestobjectresult) (400).
140140

141141
# [Isolated process](#tab/isolated-process)
142142

143-
*HttpExample.cs* contains a `Run` method that receives request data in the `req` variable is an [HttpRequestData](/dotnet/api/microsoft.azure.functions.worker.http.httprequestdata) object that's decorated with the **HttpTriggerAttribute**, which defines the trigger behavior. Because of the isolated process model, `HttpRequestData` is a representation of the actual `HttpRequest`, and not the request object itself.
143+
*HttpExample.cs* contains a `Run` method that receives request data in the `req` variable is an [HttpRequestData](/dotnet/api/microsoft.azure.functions.worker.http.httprequestdata) object that's decorated with the **HttpTriggerAttribute**, which defines the trigger behavior. Because of the isolated process model, `HttpRequestData` is a representation of the actual `HttpRequest`, and not the request object itself.
144144

145145
:::code language="csharp" source="~/functions-docs-csharp/http-trigger-isolated/HttpExample.cs":::
146146

147-
The return object is an [HttpResponseData](/dotnet/api/microsoft.azure.functions.worker.http.httpresponsedata) object that contains the data that's handed back to the HTTP response.
147+
The return object is an [HttpResponseData](/dotnet/api/microsoft.azure.functions.worker.http.httpresponsedata) object that contains the data that's handed back to the HTTP response.
148148

149149
---
150150

@@ -158,28 +158,28 @@ To learn more, see [Azure Functions HTTP triggers and bindings](./functions-bind
158158
func start
159159
```
160160

161-
Toward the end of the output, the following lines should appear:
162-
161+
Toward the end of the output, the following lines should appear:
162+
163163
<pre>
164164
...
165-
165+
166166
Now listening on: http://0.0.0.0:7071
167167
Application started. Press Ctrl+C to shut down.
168-
168+
169169
Http Functions:
170-
170+
171171
HttpExample: [GET,POST] http://localhost:7071/api/HttpExample
172172
...
173-
173+
174174
</pre>
175-
176-
>[!NOTE]
175+
176+
>[!NOTE]
177177
> If HttpExample doesn't appear as shown above, you likely started the host from outside the root folder of the project. In that case, use **Ctrl**+**C** to stop the host, navigate to the project's root folder, and run the previous command again.
178178

179179
1. Copy the URL of your `HttpExample` function from this output to a browser:
180180

181181
# [In-process](#tab/in-process)
182-
182+
183183
To the function URL, append the query string `?name=<YOUR_NAME>`, making the full URL like `http://localhost:7071/api/HttpExample?name=Functions`. The browser should display a response message that echoes back your query string value. The terminal in which you started your project also shows log output as you make requests.
184184

185185
# [Isolated process](#tab/isolated-process)
@@ -199,50 +199,50 @@ To learn more, see [Azure Functions HTTP triggers and bindings](./functions-bind
199199
```azurecli
200200
az functionapp create --resource-group AzureFunctionsQuickstart-rg --consumption-plan-location <REGION> --runtime dotnet --functions-version 3 --name <APP_NAME> --storage-account <STORAGE_NAME>
201201
```
202-
The [az functionapp create](/cli/azure/functionapp#az_functionapp_create) command creates the function app in Azure.
202+
The [az functionapp create](/cli/azure/functionapp#az_functionapp_create) command creates the function app in Azure.
203203

204204
# [Azure CLI](#tab/azure-cli/isolated-process)
205205

206206
```azurecli
207207
az functionapp create --resource-group AzureFunctionsQuickstart-rg --consumption-plan-location <REGION> --runtime dotnet-isolated --functions-version 3 --name <APP_NAME> --storage-account <STORAGE_NAME>
208-
```
209-
210-
The [az functionapp create](/cli/azure/functionapp#az_functionapp_create) command creates the function app in Azure.
208+
```
209+
210+
The [az functionapp create](/cli/azure/functionapp#az_functionapp_create) command creates the function app in Azure.
211211

212212
# [Azure PowerShell](#tab/azure-powershell/in-process)
213-
213+
214214
```azurepowershell
215215
New-AzFunctionApp -Name <APP_NAME> -ResourceGroupName AzureFunctionsQuickstart-rg -StorageAccount <STORAGE_NAME> -Runtime dotnet -FunctionsVersion 3 -Location '<REGION>'
216216
```
217217

218-
The [New-AzFunctionApp](/powershell/module/az.functions/new-azfunctionapp) cmdlet creates the function app in Azure.
218+
The [New-AzFunctionApp](/powershell/module/az.functions/new-azfunctionapp) cmdlet creates the function app in Azure.
219219

220220
# [Azure PowerShell](#tab/azure-powershell/isolated-process)
221221

222222
```azurepowershell
223223
New-AzFunctionApp -Name <APP_NAME> -ResourceGroupName AzureFunctionsQuickstart-rg -StorageAccount <STORAGE_NAME> -Runtime dotnet-isolated -FunctionsVersion 3 -Location '<REGION>'
224224
```
225225

226-
The [New-AzFunctionApp](/powershell/module/az.functions/new-azfunctionapp) cmdlet creates the function app in Azure.
226+
The [New-AzFunctionApp](/powershell/module/az.functions/new-azfunctionapp) cmdlet creates the function app in Azure.
227227

228228
---
229229

230230
::: zone pivot="programming-runtime-functions-v4"
231231
> [!NOTE]
232232
> This command creates a function app using the 3.x version of the Azure Functions runtime. The `func azure functionapp publish` command that you'll run later updates the app to version 4.x.
233233
::: zone-end
234-
235-
In the previous example, replace `<STORAGE_NAME>` with the name of the account you used in the previous step, and replace `<APP_NAME>` with a globally unique name appropriate to you. The `<APP_NAME>` is also the default DNS domain for the function app.
236-
234+
235+
In the previous example, replace `<STORAGE_NAME>` with the name of the account you used in the previous step, and replace `<APP_NAME>` with a globally unique name appropriate to you. The `<APP_NAME>` is also the default DNS domain for the function app.
236+
237237
This command creates a function app running in your specified language runtime under the [Azure Functions Consumption Plan](consumption-plan.md), which is free for the amount of usage you incur here. The command also provisions an associated Azure Application Insights instance in the same resource group, with which you can monitor your function app and view logs. For more information, see [Monitor Azure Functions](functions-monitoring.md). The instance incurs no costs until you activate it.
238238

239239
[!INCLUDE [functions-publish-project-cli](../../includes/functions-publish-project-cli.md)]
240240

241241
## Invoke the function on Azure
242242

243-
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.
243+
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.
244244

245-
# [In-process](#tab/in-process)
245+
# [In-process](#tab/in-process)
246246

247247
Copy the complete **Invoke URL** shown in the output of the publish command into a browser address bar, appending the query parameter `?name=Functions`. When you navigate to this URL, the browser should display similar output as when you ran the function locally.
248248

@@ -258,7 +258,7 @@ Copy the complete **Invoke URL** shown in the output of the publish command into
258258

259259
## Next steps
260260

261-
# [In-process](#tab/in-process)
261+
# [In-process](#tab/in-process)
262262

263263
> [!div class="nextstepaction"]
264264
> [Connect to Azure Queue Storage](functions-add-output-binding-storage-queue-cli.md?pivots=programming-language-csharp&tabs=in-process)

0 commit comments

Comments
 (0)