Move Azure Function Apps to another Service Plan

It’s not possible to move a Azure Function Apps to another Service Plan in the portal.
You need to do this in Powershell in some simple steps:

Get the Ressource ID from your new Service Plan :

$afa_plan = Get-AzureRmAppServicePlan -ResourceGroupName $RG -Name $App_Name 

Then just use the Set-AzureRMResource cmdlet to apply the updated properties :

$afa_properties = @{'serverFarmId'=$afa_plan.Id}
Set-AzureRmResource -Kind functionapp -ResourceGroupName $RG -ResourceName $AFA_name -Properties $afa_properties -ResourceType "Microsoft.Web/sites"

That’s all !

Create a Azure webapp in a Resource Group different than the one containing the App Service Plan in Powershell

In Powershell when we would like to create a WebApp, you must specify a Service plan :


New-AzureRmWebApp -ResourceGroupName $RG -Name $WEB_Frontend -Location $location_west -AppServicePlan $APP_Service_front

But, if the service plan is in another RG, Azure will create a NEW Service plan in the same RG of the WebApp, this is problematic …

The solution is to specify the service plan ID with :

$APP_Service_front = (Get-AzureRmAppServicePlan -Name $APP_Service_front).Id

And now, the WebApp will be using the new RG and the service plan will stay on the another RG.

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!