1

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?

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for the link on stackoverflow, I wonder how could I have missed it. Now, I also have doubts that it is possible. But the error message 'The deployment request is missing the package link.' I am receiving still gives me a little hope. Maybe I should clarify with azure support team.
According to a response I have received from MS support, creation of PaaS Cloud Services (classic) is not supported by AZ module at the moment. As an alternative, they suggest to use New-AzureDeployment and Set-AzureDemployment cmdlets (see details of ASM powershell module learn.microsoft.com/en-us/powershell/azure/servicemanagement/…). That was described by the link mentioned in @test123's answer.
@Nikolay have you worked on this since Sep '19? Do they provide support now in Jan '21?
As I know they are not going to provide support learn.microsoft.com/en-us/azure/virtual-machines/….

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.