azureazure-web-rolesazure-deployment-slotsaz

Is it possible to publish cloud service package using AZ powershell script?


I want to find out is it possible to deploy classic cloud service package (Microsoft.ClassicCompute) to Azure deployment slot with AZ powershell.

There is a classic service inside a resource group already created in Azure. A package that is going to be deployed is uploaded to a separate Storage Profile blob.

Currently, the webroles are deployed using REST API. An appropriate path to a package in the blob is specified in element of a post request and this works fine.

I am trying to do the same thing using AZ powershell, particulary, by calling New-AzResource cmdlet with '-PropertyObject' parameter specified like that:

@{
    deploymentLabel = 'XXX';
    configuration = '<?xml version=\"1.0\" encoding=\"utf-8\"?> ....  ';
    packageUrl = '{valid_url_to_package}';
    ....
}

but an error returns:

The request content was invalid and could not be deserialized: 'Could not find member 'packageUrl' on object of type 'DeploymentSlotProperties'. Path 'properties.packageUrl'

If to remove 'packageUrl' property from the object and execute the cmdlet again an another error is shown up:

The deployment request is missing the package link.

Unfortunately, I cannot find any any information about format of '-PropertyObject' parameter. Or maybe there is a better way to deploy a package via AZ?


Solution

  • According to my research, Azure PowerShell Az module is used to manage Azure ARM resource. But Azure Cloud service is Classic resource. So we cannot deploy azure cloud service with az module. For more details, please refer to the document and issue. If you want to know to deploy Azure cloud service with PowerShell, please refer to https://github.com/MicrosoftDocs/azure-cloud-services-files/tree/master/Scripts/cloud-services-continuous-delivery