Azure / Azure/azure-powershell

Introduce Site Config configuration, especially for Pre-Warmed Instances and Always Ready settings (minimumElasticInstanceCount)

Open
#19,165 5 comments 0 reactions 1 assignee Assigned to @apawast View on GitHub
act-observability-squad bug Functions P2 Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

### Description

Customers that want to configure the Always Ready and Pre-Warmed Instances settings of their Premium function apps using this PowerShell module have to currently configure it using the Get-AzResource and Set-AzResource approach as currently [documented here](https://docs.microsoft.com/en-us/azure/azure-functions/functions-premium-plan?tabs=azure-powershell#always-ready-instances).

It would be cleaner for customers to be able to get and set this minimumElasticInstanceCount and PreWarmedInstanceCount site config settings using this Az.Functions module instead. It looks like minimumElasticInstanceCount was introduced as part of the 2020-12-01 rest spec version and is also in the [2022-03-01 version](https://github.com/Azure/azure-rest-api-specs/blob/cf3574813e15bb33b3cb610f44edfcbebd8b1b23/specification/web/resource-manager/Microsoft.Web/stable/2022-03-01/CommonDefinitions.json#L3478). This Az.Functions module is currently using the [2019-08-01](https://github.com/Azure/azure-rest-api-specs/tree/main/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01) spec version. So for Always Ready (minimumElasticInstanceCount) and Pre-Warmed Instances (PreWarmedInstanceCount) to work the rest spec version used by this Az.Functions module would need to be updated, with a likely introduction of a breaking change.

Expected something like the following.

Always Ready:
```powershell
PS> $appconfig = Get-AzFunctionAppConfig -ResourceGroupName -Name
PS> $appconfig.MinimumElasticInstanceCount =
PS> $appconfig | Set-AzFunctionAppConfig -Force
```
Pre-Warmed Instances:
```powershell
PS> $appconfig = Get-AzFunctionAppConfig -ResourceGroupName -Name
PS> $appconfig.PreWarmedInstanceCount =
PS> $appconfig | Set-AzFunctionAppConfig -Force
```

Or an alternative approach using Get-AzFunctionApp and Set-AzFunctionApp if it makes more sense so not to introduce a new command.

### Issue script & Debug output

```PowerShell
N/A
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 5.1.22000.653
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22000.653
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```

### Module versions

```PowerShell
4.0.3 Az.Functions
```

### Error output

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.