0
votes

Hi is there a powershell script for moving a web app to an another app service plan who is not in the same resourcegroup. Or can we create a web app where the app service plan is not in the same resource group.

New-AzWebApp -ResourceGroupName $WebAppResourceGroup -Name $testWebAppName -location $location `
    -AppServicePlan $appServicePlan01

This script create a new webapp and a new app service plan even there is one exist with the same name. so in case when a want to move the problem resiste the same i cant move it to an existing app service plan.

Set-AzWebApp -Name $WebAppName -ResourceGroupName $WebAppResourceGroup `
    -AppServicePlan $appServicePlan02

is there a powershell cmdlet for doing this or do I move the webapp trough the portal.

Thanks

1

1 Answers

0
votes

The region in which your app runs is the region of the App Service plan it's in. However, you cannot change an App Service plan's region. If you want to run your app in a different region, one alternative is app cloning. Cloning makes a copy of your app in a new or existing App Service plan in any region.

It can be accomplished by using the Azure Resource Manager version of the PowerShell cmdlet to create a new app with the -SourceWebApp option.

https://docs.microsoft.com/en-us/azure/app-service/app-service-web-app-cloning#cloning-an-existing-app