Automatic deployment of Windows Azure. Problem with powershell script

I am using Azure Management Cmdlets version 1.0.

I run the following PowerShell script

New-Deployment -subscriptionId bef7722c-1a13-4c9f-b7f6-fafc0a958b35 -certificate D: \ pcg \ ​​T.cer -serviceName 1ClickDeploymentTest -slot Production -package D: \ pcg

\ CloudTodorTest.cspkg -configuration D: \ pcg \ ​​ServiceConfiguration.cscfg -label lbl1 -StorageServiceName TodorTestStorage

where D: \ pcg \ ​​T.cert is a certificate that is already uploaded to Azure. The package and configuration are local copies of an application that is already running on Azure. I tried to deploy them manually and they work.

After running this script, the following error message appears:

PS C: \ Windows \ SysWOW64 \ WindowsPowerShell \ v1.0> D: \ PSScripts \ dt2.ps1 New deployment: the remote server returned an unexpected response: (400) "Bad request." In D: \ PSScripts \ dt2.ps1: 1 char: 15 + New deployment <<-subscriptionId bef7722c-1a13-4c9f-b7f6-fafc0a958b35 -certificate D: \ pcg \ ​​T.cer -serviceName 1Cli ckDeploymentTest -slot Staging - package D: \ pcg \ ​​CloudTodorTest.cspkg -configuration D: \ pcg \ ​​ServiceConfiguration.cscfg -l abel lbl1 -StorageServiceName TodorTestStorage | Get-OperationStatus -WaitToComplete + CategoryInfo: CloseError: (:) [New Deployment], ProtocolException + FullyQualifiedErrorId: Microsoft.Samples.AzureManagementTools.PowerShell.HostedServices.NewDeploymentCommand

I can run other cmdlets. For example, to check current deployment options.

+4
source share
2 answers

Check the example of the service name and deployment slot and other parameters that you specify - I seem to remember that the service name must be all lowercase because it is used in DNS.

The Azure API is very thin in terms of being sensitive to certain arguments, and if you make a mistake, you will get a “Bad Request” response without further information.

If the problem is with the subscription ID or certificate, you will receive an unauthorized response. I think you got past authorization and are failing because something in the request itself is invalid.

+3
source

Storage accounts must be lowercase. I'm not sure what your problem is (maybe the cmdlets are automatically crossed out), but this is something to try.

0
source

All Articles