Set-AzWebApp

Synopsis

Updates an existing Azure Web App with new configuration settings, connection strings, or deployment slots.

Syntax

Set-AzWebApp
   -ResourceGroupName <String>
   -Name <String>
   [-AppServicePlan <String>]
   [-Location <String>]
   [-AppSettings <Hashtable>]
   [-ConnectionStrings <Hashtable>]
   [-HttpsOnly <Boolean>]
   [-AssignIdentity <String[]>]
   [-Force] []

Parameters

NameTypeRequiredDescription
-ResourceGroupNameStringYesName of the resource group containing the web app.
-NameStringYesName of the web app to update.
-AppServicePlanStringNoExisting App Service plan to associate.
-LocationStringNoAzure region (e.g., EastUS).
-AppSettingsHashtableNoKey‑value pairs of app settings.
-ConnectionStringsHashtableNoConnection string definitions.
-HttpsOnlyBooleanNoForce HTTPS traffic only.
-AssignIdentityString[]NoManaged identities to assign.
-ForceSwitchParameterNoSuppress confirmation prompts.

Examples

Example 1: Update app settings

Set-AzWebApp -ResourceGroupName "MyRG" -Name "myWebApp" `
  -AppSettings @{ "Environment" = "Prod"; "LogLevel" = "Warning" }

Example 2: Enable HTTPS only and assign a system‑assigned identity

Set-AzWebApp -ResourceGroupName "MyRG" -Name "myWebApp" `
  -HttpsOnly $true -AssignIdentity @()

Related Links