2
votes

I can successfully create a new Azure Web App with this command (provided the resource group and app service plan exist, of course):

New-AzureWebApp `
  -Name site-name `
  -ResourceGroupName resource-group-name `
  -Location 'North Central US' `
  -AppServicePlan app-service-plan-name

But when I try to add a slot with a similar command it fails:

New-AzureWebApp `
  -Name site-name `
  -ResourceGroupName resource-group-name `
  -Location 'North Central US' `
  -AppServicePlan app-service-plan-name `
  -SlotName dev # <--------------------------- this line is added

with the error:

New-AzureWebApp : MismatchingResourceName: The provided resource name 'site-name' 
did not match the name in the Url 'site-name/dev'.

At line:1 char:1
+ New-AzureWebApp -SlotName "dev" -Name "site-name" -Location "North  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : CloseError: (:) [New-AzureWebApp], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.WebApp.Cmdlets.NewAzureWebAppCmdlet

What's going on here? Am I not going about making slots the right way?

Note: I'm using Azure Powershell in AzureResourceManager mode.

This AzureServiceManagement mode command does work so I'm not entirely lost:

New-AzureWebsite -Name "site-name" -Slot "dev" -Location "North Central US"

But why can't I get the former command to work?

1
I have the same problem with the .net Azure.Management libraries. I'm sure it's a bug, so I filed it: github.com/Azure/azure-sdk-for-net/issues/1088Sam7

1 Answers

0
votes

What is your App Service plan mode? I hope this is already been taken care, and you should be in either Standard or Premium plan.

This seems to be a issue with the latest release of Azure modules. Will have to wait till the issue is fixed. Probably you might need to raise a Azure Support ticket to bump up the priority.