azurepowershellcscfg

download Azure Service Configuration (.cscfg) through Powershell cmdlet Get-AzureRMDeployment


I am trying to download service configuration (.cscfg) from a Cloud service using the below command powershell command. but unfortunately getting an error.

Get-AzureRmDeployment -Name "xxxx"
Get-AzureRmDeployment : Deployment 'xxxx' could not be found.

I have selected the correct subscription passed the corrected deployment name but still getting this error.

I tried to get all the deployments on this subscription using the below command, the command returned nothing, not even an erro.

Get-AzureRmDeployment

Earlier I used Get-AzureDeployment on the classic subscription to get .cscfg, and it used to work perfectly fine on RM the above commands are not working.

Can somebody help me figuring out on how to get the service configuration, using powershell...?

snipet of the command.

PS C:\WINDOWS\system32> Get-AzureRmDeployment -Name "xxxx"
Get-AzureRmDeployment : Deployment 'xxxx' could not be found.
At line:1 char:1
+ Get-AzureRmDeployment -Name "xxxx"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzureRmDeployment], CloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureDeploymentCmdlet

Solution

  • The Cloud Service is deployed as classic(ASM), you could not get the deployment via Get-AzureRMDeployment.

    If you want to get Configuration (.cscfg) via ARM powershell, you could use Get-AzureRmResource to get it.

    $slot = Get-AzureRmResource -ResourceGroupName <ResourceGroupName> -ResourceType Microsoft.ClassicCompute/domainNames/slots -ResourceName "xxxxx" -ApiVersion 2016-04-01
    $slot.Properties.configuration