Set-AzWebApp

Learn the syntax and usage of the Set-AzWebApp PowerShell command with examples.

Set-AzWebApp

Set-AzWebApp is an Azure PowerShell cmdlet that can help you modify your Azure Web App.

Syntax:

The syntax of the Set-AzWebApp Azure PowerShell cmdlet is as follows.

Set-AzWebApp
 [-ResourceGroupName] <String>
   [-Name] <String>
[-AppServicePlan] <String>]

Example:

You can consider the below example. Here, we will change the App Service Plan for the Azure Web App named “TSINFOSite” from “TSINFOASP12” to “TSINFOASPNEW” with the resource group name “Demo123“.

Execute the below Azure PowerShell cmdlet

PS C:\WINDOWS\system32> Set-AzWebApp -ResourceGroupName "Demo123" -Name "TSINFOSite" -AppServicePlan "TSINFOASPNEW"

Once you execute the above Azure PowerShell cmdlet, you will get the output like the one below.

GitRemoteName               : 
GitRemoteUri                : 
GitRemoteUsername           : 
GitRemotePassword           : 
AzureStorageAccounts        : 
AzureStoragePath            : {}
State                       : Running
HostNames                   : {tsinfosite.azurewebsites.net}
RepositorySiteName          : TSINFOSite
UsageState                  : Normal
Enabled                     : True
EnabledHostNames            : {tsinfosite.azurewebsites.net, 
                              tsinfosite.scm.azurewebsites.net}
AvailabilityState           : Normal
HostNameSslStates           : {tsinfosite.azurewebsites.net, 
                              tsinfosite.scm.azurewebsites.net}
ServerFarmId                : /subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/reso
                              urceGroups/Demo123/providers/Microsoft.Web/serverfarms/T
                              SINFOASPNEW
Reserved                    : False
IsXenon                     : False
HyperV                      : 
LastModifiedTimeUtc         : 6/25/2021 4:12:49 AM
SiteConfig                  : Microsoft.Azure.Management.WebSites.Models.SiteConfig
TrafficManagerHostNames     : 
ScmSiteAlsoStopped          : False
TargetSwapSlot              : 
HostingEnvironmentProfile   : 
ClientAffinityEnabled       : True
ClientCertEnabled           : False
ClientCertMode              : 
ClientCertExclusionPaths    : 
HostNamesDisabled           : False
CustomDomainVerificationId  : 
OutboundIpAddresses         : 52.170.7.25,52.168.75.147,52.179.5.98,52.179.1.81,52.179
                              .4.232
PossibleOutboundIpAddresses : 52.170.7.25,52.168.75.147,52.179.5.98,52.179.1.81,52.179
                              .4.232,52.179.2.103,52.170.87.19
ContainerSize               : 0
DailyMemoryTimeQuota        : 0
SuspendedTill               : 
MaxNumberOfWorkers          : 
CloningInfo                 : 
ResourceGroup               : Demo123
IsDefaultContainer          : 
DefaultHostName             : tsinfosite.azurewebsites.net
SlotSwapStatus              : 
HttpsOnly                   : False
RedundancyMode              : 
InProgressOperationId       : 
Identity                    : 
Id                          : /subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/reso
                              urceGroups/Demo123/providers/Microsoft.Web/sites/TSINFOS
                              ite
Name                        : TSINFOSite
Kind                        : app
Location                    : East US
Type                        : Microsoft.Web/sites
Tags                        : 

You can see that here

Set-AzWebApp

Similarly, you can use the Get-AzWebApp PowerShell command to get the details of the web applications.

Conclusion

We discussed the syntax and usage of the Set-AzWebApp PowerShell command with examples. Thanks for reading this article !!!