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?

Nikolay
  • 77
  • 1
  • 8

1 Answers1

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

  • 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. – Nikolay Aug 29 '19 at 08:50
  • 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 https://learn.microsoft.com/en-us/powershell/azure/servicemanagement/overview?view=azuresmps-4.0.0). That was described by the link mentioned in @test123's answer. – Nikolay Sep 05 '19 at 15:50
  • @Nikolay have you worked on this since Sep '19? Do they provide support now in Jan '21? – Garbem Feb 03 '21 at 11:54
  • As I know they are not going to provide support https://learn.microsoft.com/en-us/azure/virtual-machines/classic-vm-deprecation. – Nikolay Feb 04 '21 at 16:08