Skip to content

Split Az.Functions Examples #17136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions src/Functions/help/Get-AzFunctionApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ Gets function apps in a subscription.

### Example 1: Get all function apps.
```powershell
PS C:\> Get-AzFunctionApp
Get-AzFunctionApp
```

```output
Name Status OSType Runtime Location AppServicePlan ResourceGroupName SubscriptionId
---- ------ ------ ------- -------- -------------- ----------------- --------------
Functions1-Windows-DoNet Running Windows DotNet Central US CentralUSPlan Functions-West-Europe-Win fe16564a-d943-4bf8-8c28-cf01708c3f8b
Expand All @@ -54,8 +56,10 @@ Functions1-Windows-Java Running Windows Java West Europe Premium1-WE Func

### Example 2: Get function apps by name.
```powershell
PS C:\> Get-AzFunctionApp -ResourceGroupName Functions-West-Europe-Win -Name Functions1-Windows-DoNet
Get-AzFunctionApp -ResourceGroupName Functions-West-Europe-Win -Name Functions1-Windows-DoNet
```

```output
Name Status OSType Runtime Location AppServicePlan ResourceGroupName SubscriptionId
---- ------ ------ ------- -------- -------------- ----------------- --------------
Functions1-Windows-DoNet Running Windows DotNet Central US CentralUSPlan Functions-West-Europe-Win fe16564a-d943-4bf8-8c28-cf01708c3f8b
Expand All @@ -65,8 +69,10 @@ Functions1-Windows-DoNet Running Windows DotNet Central US CentralUSPlan Funct

### Example 3: Get function apps by resource group name.
```powershell
PS C:\> Get-AzFunctionApp -ResourceGroupName Functions-West-Europe-Win
Get-AzFunctionApp -ResourceGroupName Functions-West-Europe-Win
```

```output
Name Status OSType Runtime Location AppServicePlan ResourceGroupName SubscriptionId
---- ------ ------ ------- -------- -------------- ----------------- --------------
Functions1-Windows-DoNet Running Windows DotNet Central US CentralUSPlan Functions-West-Europe-Win fe16564a-d943-4bf8-8c28-cf01708c3f8b
Expand All @@ -76,8 +82,10 @@ Functions1-Windows-DoNet Running Windows DotNet Central US CentralUSPlan Funct

### Example 4: Get function apps for the given subscriptions.
```powershell
PS C:\> Get-AzFunctionApp -SubscriptionId fe16564a-d943-4bf8-8c28-cf01708c3f8b
Get-AzFunctionApp -SubscriptionId fe16564a-d943-4bf8-8c28-cf01708c3f8b
```

```output
Name Status OSType Runtime Location AppServicePlan ResourceGroupName SubscriptionId
---- ------ ------ ------- -------- -------------- ----------------- --------------
Functions1-Windows-DoNet Running Windows DotNet Central US CentralUSPlan Functions-West-Europe-Win fe16564a-d943-4bf8-8c28-cf01708c3f8b
Expand All @@ -87,8 +95,10 @@ Functions1-Windows-DoNet Running Windows DotNet Central US CentralUSPlan Funct

### Example 5: Get function apps by location.
```powershell
PS C:\> Get-AzFunctionApp -Location "Central US"
Get-AzFunctionApp -Location "Central US"
```

```output
Name Status OSType Runtime Location AppServicePlan ResourceGroupName SubscriptionId
---- ------ ------ ------- -------- -------------- ----------------- --------------
Functions1-Windows-DoNet Running Windows DotNet Central US CentralUSPlan Functions-West-Europe-Win fe16564a-d943-4bf8-8c28-cf01708c3f8b
Expand Down
12 changes: 9 additions & 3 deletions src/Functions/help/Get-AzFunctionAppAvailableLocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ Gets the location where a function app for the given os and plan type is availab

### Example 1: Get the locations where Premium is available for Windows. If no parameters are specified, PlanType is set to 'Premium' and OSType is set to 'Windows'.
```powershell
PS C:\> Get-AzFunctionAppAvailableLocation
Get-AzFunctionAppAvailableLocation
```

```output
Name
----
Central US
Expand Down Expand Up @@ -64,8 +66,10 @@ This command gets the locations where Premium is available for Windows.

### Example 2: Get the locations where Premium is available for Linux.
```powershell
PS C:\> Get-AzFunctionAppAvailableLocation -PlanType Premium -OSType Linux
Get-AzFunctionAppAvailableLocation -PlanType Premium -OSType Linux
```

```output
Name
----
Central US
Expand Down Expand Up @@ -99,8 +103,10 @@ This command gets the locations where Premium is available for Linux.

### Example 3: Get the locations where Consumption is available for Windows.
```powershell
PS C:\> Get-AzFunctionAppAvailableLocation -PlanType Consumption -OSType Windows
Get-AzFunctionAppAvailableLocation -PlanType Consumption -OSType Windows
```

```output
Name
----
Central US
Expand Down
16 changes: 12 additions & 4 deletions src/Functions/help/Get-AzFunctionAppPlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ Get function apps plans in a subscription.

### Example 1: Get all function app plans.
```powershell
PS C:\> Get-AzFunctionAppPlan
Get-AzFunctionAppPlan
```

```output
Name WorkerType SkuTier SkuName Location ResourceGroupName SubscriptionId
---- ---------- ------- ------- -------- ----------------- --------------
Func99-West-Europe-Linux-Premium Linux ElasticPremium EP1 West Europe Func99-West-Europe-Linux-Premium fe16564a-d943-4bf8-8c28-cf01708c3f8b
Expand All @@ -59,8 +61,10 @@ This command gets all function app plans.

### Example 2: Get function app plans by resource group name.
```powershell
PS C:\> Get-AzFunctionAppPlan -ResourceGroupName "West Europe"
Get-AzFunctionAppPlan -ResourceGroupName "West Europe"
```

```output
Name WorkerType SkuTier SkuName Location ResourceGroupName SubscriptionId
---- ---------- ------- ------- -------- ----------------- --------------
Func99-West-Europe-Linux-Premium Linux ElasticPremium EP1 West Europe Func99-West-Europe-Linux-Premium fe16564a-d943-4bf8-8c28-cf01708c3f8b
Expand All @@ -72,8 +76,10 @@ This command gets function app plans by resource group name.

### Example 3: Get function app plans for the given subscriptions.
```powershell
PS C:\> Get-AzFunctionAppPlan -SubscriptionId fe16564a-d943-4bf8-8c28-cf01708c3f8z
Get-AzFunctionAppPlan -SubscriptionId fe16564a-d943-4bf8-8c28-cf01708c3f8z
```

```output
Name WorkerType SkuTier SkuName Location ResourceGroupName SubscriptionId
---- ---------- ------- ------- -------- ----------------- --------------
Func99-West-Europe-Windows-Premium Windows ElasticPremium EP1 West Europe Func99-West-Europe-Win-Premium fe16564a-d943-4bf8-8c28-cf01708c3f8z
Expand All @@ -83,8 +89,10 @@ This command gets function app plans for the given subscriptions.

### Example 4: Get function app plans by location.
```powershell
PS C:\> Get-AzFunctionAppPlan -Location "Central US"
Get-AzFunctionAppPlan -Location "Central US"
```

```output
Name WorkerType SkuTier SkuName Location ResourceGroupName SubscriptionId
---- ---------- ------- ------- -------- ----------------- --------------
Func99-West-Europe-Windows-Premium Windows ElasticPremium EP1 Central US Func99-West-Europe-Win-Premium 3r16564a-d943-4bf8-8c28-cf01708c3f8b
Expand Down
2 changes: 1 addition & 1 deletion src/Functions/help/Get-AzFunctionAppSetting.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Gets app settings for a function app.

### Example 1: Get the app settings of a function app.
```powershell
PS C:\> Get-AzFunctionAppSetting -Name MyAppName -ResourceGroupName MyResourceGroupName
Get-AzFunctionAppSetting -Name MyAppName -ResourceGroupName MyResourceGroupName
```

This command gets the app settings of a function app.
Expand Down
31 changes: 15 additions & 16 deletions src/Functions/help/New-AzFunctionApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,33 @@ Creates a function app.

### Example 1: Create a consumption PowerShell function app in Central US.
```powershell
PS C:\> New-AzFunctionApp -Name MyUniqueFunctionAppName `
-ResourceGroupName MyResourceGroupName `
-Location centralUS `
-StorageAccount MyStorageAccountName `
-Runtime PowerShell
New-AzFunctionApp -Name MyUniqueFunctionAppName `
-ResourceGroupName MyResourceGroupName `
-Location centralUS `
-StorageAccount MyStorageAccountName `
-Runtime PowerShell
```

This command creates a consumption PowerShell function app in Central US.

### Example 2: Create a PowerShell function app which will be hosted in a service plan.
```powershell
PS C:\> New-AzFunctionApp -Name MyUniqueFunctionAppName `
-ResourceGroupName MyResourceGroupName `
-PlanName MyPlanName `
-StorageAccount MyStorageAccountName `
-Runtime PowerShell
New-AzFunctionApp -Name MyUniqueFunctionAppName `
-ResourceGroupName MyResourceGroupName `
-PlanName MyPlanName `
-StorageAccount MyStorageAccountName `
-Runtime PowerShell
```

This command creates a PowerShell function app which will be hosted in a service plan.

### Example 3: Create a function app using a using a private ACR image.
```powershell
PS C:\> New-AzFunctionApp -Name MyUniqueFunctionAppName `
-ResourceGroupName MyResourceGroupName `
-PlanName MyPlanName `
-StorageAccount MyStorageAccountName `
-DockerImageName myacr.azurecr.io/myimage:tag

New-AzFunctionApp -Name MyUniqueFunctionAppName `
-ResourceGroupName MyResourceGroupName `
-PlanName MyPlanName `
-StorageAccount MyStorageAccountName `
-DockerImageName myacr.azurecr.io/myimage:tag
```

This command creates a function app using a using a private ACR image.
Expand Down
15 changes: 7 additions & 8 deletions src/Functions/help/New-AzFunctionAppPlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ Creates a function app service plan.

### Example 1: Create a Windows premium app plan in West Europe with burst out capability up to 10 instances.
```powershell
PS C:\> New-AzFunctionAppPlan -ResourceGroupName MyResourceGroupName `
-Name MyPremiumPlan `
-Location WestEurope `
-MinimumWorkerCount 1 `
-MaximumWorkerCount 10 `
-Sku EP1 `
-WorkerType Windows

New-AzFunctionAppPlan -ResourceGroupName MyResourceGroupName `
-Name MyPremiumPlan `
-Location WestEurope `
-MinimumWorkerCount 1 `
-MaximumWorkerCount 10 `
-Sku EP1 `
-WorkerType Windows
```

This command creates a Windows premium app plan in West Europe with burst out capability up to 10 instances.
Expand Down
4 changes: 2 additions & 2 deletions src/Functions/help/Remove-AzFunctionApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ Deletes a function app.

### Example 1: Get a function app by name and delete it.
```powershell
PS C:\> Get-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName | Remove-AzFunctionApp -Force
Get-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName | Remove-AzFunctionApp -Force
```

This command gets a function app by name and delete it.

### Example 2: Delete a function app by name.
```powershell
PS C:\> Remove-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName -Force
Remove-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName -Force
```

This command deletes a function app by name.
Expand Down
4 changes: 2 additions & 2 deletions src/Functions/help/Remove-AzFunctionAppPlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ Deletes a function app plan.

### Example 1: Get a function app plan by name and delete it.
```powershell
PS C:\> Get-AzFunctionAppPlan -Name MyAppName -ResourceGroupName MyResourceGroupName | Remove-AzFunctionAppPlan -Force
Get-AzFunctionAppPlan -Name MyAppName -ResourceGroupName MyResourceGroupName | Remove-AzFunctionAppPlan -Force
```

This command gets a function app plan by name and deletes it.

### Example 2: Delete a function app plan by name.
```powershell
PS C:\> Remove-AzFunctionAppPlan -Name MyAppName -ResourceGroupName MyResourceGroupName -Force
Remove-AzFunctionAppPlan -Name MyAppName -ResourceGroupName MyResourceGroupName -Force
```

This command deletes a function app plan by name.
Expand Down
2 changes: 1 addition & 1 deletion src/Functions/help/Remove-AzFunctionAppSetting.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Removes app settings from a function app.

### Example 1: Remove app settings in a function app.
```powershell
PS C:\> Remove-AzFunctionAppSetting -Name MyAppName -ResourceGroupName MyResourceGroupName -AppSettingName "MyAppSetting1", "MyAppSetting2"
Remove-AzFunctionAppSetting -Name MyAppName -ResourceGroupName MyResourceGroupName -AppSettingName "MyAppSetting1", "MyAppSetting2"
```

This command removes app settings in a function app.
Expand Down
4 changes: 2 additions & 2 deletions src/Functions/help/Restart-AzFunctionApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ Restarts a function app.

### Example 1: Get a function app by name and restart it.
```powershell
PS C:\> Get-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName | Restart-AzFunctionApp -Force
Get-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName | Restart-AzFunctionApp -Force
```

This command gets a function app by name and restarts it.

### Example 2: Restart a function app by name.
```powershell
PS C:\> Restart-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName -Force
Restart-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName -Force
```

This command restarts a function app by name.
Expand Down
4 changes: 2 additions & 2 deletions src/Functions/help/Start-AzFunctionApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ Starts a function app.

### Example 1: Get a function app by name and start it.
```powershell
PS C:\> Get-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName | Start-AzFunctionApp
Get-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName | Start-AzFunctionApp
```

This command gets a function app by name and starts it.

### Example 2: Start a function app by name.
```powershell
PS C:\> Start-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName
Start-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName
```

This command starts a function app by name.
Expand Down
4 changes: 2 additions & 2 deletions src/Functions/help/Stop-AzFunctionApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ Stops a function app.

### Example 1: Get a function app by name and stop it.
```powershell
PS C:\> Get-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName | Stop-AzFunctionApp -Force
Get-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName | Stop-AzFunctionApp -Force
```

This command gets a function app by name and stops it.

### Example 2: Stop a function app by name.
```powershell
PS C:\> Stop-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName -Force
Stop-AzFunctionApp -Name MyAppName -ResourceGroupName MyResourceGroupName -Force
```

This command stops a function app by name.
Expand Down
8 changes: 4 additions & 4 deletions src/Functions/help/Update-AzFunctionApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,28 @@ Updates a function app.

### Example 1: Update function app hosting plan.
```powershell
PS C:\> Update-AzFunctionApp -Name MyUniqueFunctionAppName -ResourceGroupName MyResourceGroupName -PlanName NewPlanName -Force
Update-AzFunctionApp -Name MyUniqueFunctionAppName -ResourceGroupName MyResourceGroupName -PlanName NewPlanName -Force
```

This command updates function app hosting plan.

### Example 2: Set a SystemAssigned managed identity for a function app.
```powershell
PS C:\> Update-AzFunctionApp -Name MyUniqueFunctionAppName -ResourceGroupName MyResourceGroupName -IdentityType SystemAssigned -Force
Update-AzFunctionApp -Name MyUniqueFunctionAppName -ResourceGroupName MyResourceGroupName -IdentityType SystemAssigned -Force
```

This command sets a SystemAssigned managed identity for a function app.

### Example 3: Update function app Application Insights.
```powershell
PS C:\> Update-AzFunctionApp -Name MyUniqueFunctionAppName -ResourceGroupName MyResourceGroupName -ApplicationInsightsName ApplicationInsightsProjectName -Force
Update-AzFunctionApp -Name MyUniqueFunctionAppName -ResourceGroupName MyResourceGroupName -ApplicationInsightsName ApplicationInsightsProjectName -Force
```

This command updates function app Application Insights.

### Example 3: Remove managed identity from a function app.
```powershell
PS C:\> Update-AzFunctionApp -Name MyUniqueFunctionAppName -ResourceGroupName MyResourceGroupName -IdentityType None -Force
Update-AzFunctionApp -Name MyUniqueFunctionAppName -ResourceGroupName MyResourceGroupName -IdentityType None -Force
```

This command removes a managed identity from a function app.
Expand Down
11 changes: 5 additions & 6 deletions src/Functions/help/Update-AzFunctionAppPlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ Updates a function app service plan.

### Example 1: Update an app service plan to EP2 sku with twenty maximum workers.
```powershell
PS C:\> Update-AzFunctionAppPlan -ResourceGroupName MyResourceGroupName `
-Name MyPremiumPlan `
-MaximumWorkerCount 20 `
-Sku EP2 `
-Force

Update-AzFunctionAppPlan -ResourceGroupName MyResourceGroupName `
-Name MyPremiumPlan `
-MaximumWorkerCount 20 `
-Sku EP2 `
-Force
```

This command updates an app service plan to EP2 sku with twenty maximum workers.
Expand Down
2 changes: 1 addition & 1 deletion src/Functions/help/Update-AzFunctionAppSetting.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Adds or updates app settings in a function app.

### Example 1: Add a new app setting in a function app.
```powershell
PS C:\> Update-AzFunctionAppSetting -Name MyAppName -ResourceGroupName MyResourceGroupName -AppSetting @{"Name1" = "Value1"}
Update-AzFunctionAppSetting -Name MyAppName -ResourceGroupName MyResourceGroupName -AppSetting @{"Name1" = "Value1"}
```

This command adds a new app setting in a function app.
Expand Down