The Set-AzAppServicePlan cmdlet sets an Azure App Service plan.
Use -AsyncScalingEnabled $true to allow asynchronous scaling when there are insufficient workers to scale synchronously, or -AsyncScalingEnabled $false to disable it.
This setting requires a dedicated App Service plan.
Omit the parameter to preserve the existing setting, including when passing a plan through the pipeline.
The cmdlet waits for the operation to complete; use -AsJob for background execution.
For Managed Instance plans, this cmdlet also configures managed identities, installation scripts, storage mounts, registry adapters, plan-level virtual network integration, and Remote Desktop Protocol (RDP) access.
Settings omitted from the command are preserved.
Collection parameters replace the entire corresponding collection; pass an empty array to remove all entries.
To add or remove a single entry, retrieve the existing plan and pass the updated collection.
This command sets the PerSiteScaling option to true on the App Service plan named ContosoASP
that belongs to the resource group named Default-Web-WestUS.
Example 2
Sets an Azure App Service plan. (autogenerated)
Set-AzAppServicePlan -Name 'ContosoASP' -ResourceGroupName 'Default-Web-WestUS' -Tier Free -WorkerSize Small
Example 3: Change an App Service plan to a memory-optimized Isolated v4 SKU
This command replaces the user-assigned identity list, selects that identity for plan integrations, and disables RDP.
The system-assigned identity and other settings are preserved because their parameters were not specified.
Example 5: Remove one installation script without removing other scripts
This command removes the setup script and retains the other scripts in their existing order.
If setup was the last script, passing the empty array clears the script collection.
To add a script, pass the existing collection together with the new script object.
Example 6: Clear Managed Instance configuration using pipeline input
This command removes all scripts, mounts, registry adapters, virtual network integration, and managed identities from the plan.
The default identity is also cleared.
Other properties, including whether the plan is a Managed Instance plan, are preserved.
Example 7: Enable asynchronous scaling while increasing the worker count
This command enables asynchronous scaling on an existing dedicated App Service plan and requests ten workers.
If there are insufficient workers to scale synchronously, the service scales asynchronously and the cmdlet waits for completion.
Parameters
-AcquirePolicyToken
Acquire an Azure Policy token automatically for this resource operation.
Enable or disable the plan's system-assigned managed identity.
Omit this parameter to preserve the current system-assigned identity.
User-assigned identities are preserved unless -UserAssignedIdentityId is also specified.
Enable or disable asynchronous scaling for a dedicated App Service plan.
Set to true to allow an asynchronous operation when there are insufficient workers to scale synchronously, or false to allow only synchronous scaling.
Omit this parameter to preserve the current setting.
This parameter can also override the setting on a plan passed through the pipeline and is independent of -AsJob.
The identity used by default for plan integrations.
Specify [system] for the system-assigned identity or the resource ID of a user-assigned identity associated with the plan.
Pass an empty string to clear the default, including when removing the identity previously selected as the default.
Omit the parameter to preserve the current default.
The complete installation script collection for the Managed Instance plan.
Each object specifies Name and a Source containing SourceUri and Type, such as RemoteAzureBlob or PlatformStorage.
Pass an empty array to remove all scripts; omit the parameter to preserve existing scripts.
Enable or disable Remote Desktop Protocol (RDP) access to the Managed Instance plan.
Pass false to disable access; omit the parameter to preserve the current setting.
Use Get-AzAppServicePlanRdpCredential to retrieve credentials when RDP is enabled.
The complete registry adapter collection for the Managed Instance plan.
Each object specifies RegistryKey, Type, and KeyVaultSecretReference.SecretUri.
Supported types include Binary, String, Expand_String, Multi_String, DWord, and QWord.
Pass an empty array to remove all adapters; omit the parameter to preserve existing adapters.
The complete storage mount collection for the Managed Instance plan.
Each object specifies Name, Type, and DestinationPath.
AzureFiles and FileShare mounts also require Source and can reference credentials with CredentialsKeyVaultReference.SecretUri.
LocalStorage mounts do not require a source.
Pass an empty array to remove all mounts; omit the parameter to preserve existing mounts.
The App Service plan tier.
Use IsolatedV4 for I1V4 through I6V4 plans and IsolatedMV4 for I1MV4 through I5MV4 memory-optimized plans in an App Service Environment.
The complete list of user-assigned managed identity resource IDs to associate with the plan.
Pass an empty array to remove all user-assigned identities; omit the parameter to preserve the current list.
The system-assigned identity is preserved unless -AssignIdentity is also specified.
The full resource ID of an existing subnet configured for App Service integration, including delegation to Microsoft.Web/serverFarms.
Pass an empty string to disconnect the plan from its subnet; omit the parameter to preserve the current integration.
The size of the workers to allocate.
For IsolatedV4, Small through ExtraExtraExtraLarge select I1V4 through I6V4.
For IsolatedMV4, Small through ExtraExtraLarge select I1MV4 through I5MV4.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.