问题
Even after looking at the docs, I couldn't find a way to do this with the AzureRM powershell cmdlets. Does anyone know how to do this?
The old Azure Service Management powershell cmdlets have a Publish-AzureServiceProject, but I believe it is deprecated now.
EDIT: Supplement Answer to yoape's answer below
You can create a new classical cloud service project using something like this:
New-AzureRmResource -ResourceType "Microsoft.ClassicCompute/domainNames" -Location "centralus" -ResourceName "myCloudServiceProjectName" -ResourceGroupName "myResourceGroup"
Where Microsoft.ClassicCompute/domainNames
is the magic sauce one needs to create the desired classic cloud service project.
However, (afaik) you will still need to deploy/publish the classic cloud service via the old cmdlet: Publish-AzureServiceProject
. Using the above cmdlet lets you create the cloud project in the proper resource group though.
回答1:
The classic compute services are basically not supported by the Azure Resource Manager model. This means you cannot use the AzureRM cmdlets for publishing your Cloud Services.
The Publish-AzureServiceProject cmdlet from ASM is not depricated (yet), you can still use it (in fact it is still the only way to publish your Cloud Service from PowerShell). Perhaps you where thinking about the deprecation of the Switch-AzureMode cmdlet?
来源:https://stackoverflow.com/questions/42335487/create-and-publish-azure-classic-cloud-service-project-with-azurerm-powershell