Azure/Azure-Lighthouse-samples

Error when deploying deploy-azure-mgmt-services/rgWithAzureMgmt

shidwalden opened this issue · 7 comments

Trying to deploy rgWithAzureMgmt, I get the following error:
400 Client Error: Bad Request for url: https://management.azure.com/subscriptions/...

I am deploying from azcli using:
az deployment create --subscription --name ASCDeployment2 --template-file .\rgWithAzureMgmt.json --location eastus --verbose

I have tried it specifying --parameters using either one of the two files as well...

Let me know if I can provide more information!

Thanks,
Dave

It appears your cmdlet is incorrect.
Using azcli, the syntax is:

az deployment create --name --location --template-file <path to template file. Ie., you should not have --subscription as part of the cmdlet.

Can you retry and let me know that solves the issue?

I have tried it both ways, and it does not. Using subscription has no impact on this at all.

az deployment create --name MSPTestDeployment --location eastus --template-file .\rgWithAzureMgmt.json
Please provide string value for 'workspaceName' (? for help): msptest
Please provide string value for 'workspaceLocation' (? for help): eastus
Please provide string value for 'automationAccountName' (? for help): shiautotest
Please provide string value for 'automationLocation' (? for help): eastus
Please provide string value for 'rgName' (? for help): msp-rg
Please provide string value for 'rgLocation' (? for help): eastus
400 Client Error: Bad Request for url: https://management.azure.com/subscriptions/subscriptionidremoved/providers/Microsoft.Resources/deployments/MSPTestDeployment?api-version=2018-05-01

I am not able to reproduce the error here, using both latest version of Az modules for both PowerShell and AzureCLI. Can you check that you have the latest version installer, or perhaps try to deploy from CloudShell directly (which should be updated).

Hello!
Apologies for the delay - just got time to pick this up again.
even after uploading the files, and running this from Cloud Shell I am getting the same error.

Using a PowerShell cloud shell (tried it last week with Bash, too)
I am doing this:
Uploaded the files

PS Azure:\> ls
clouddrive  mspDashboard.json  omsWorkspace.json  rgWithAzureMgmt.json

Files are there, set subscription
az account set -s <subscriptionid of test subscription/tenant>

Create deployment:

PS Azure:\> az deployment create --name MSPTestDeployment --location eastus --template-file rgWithAzureMgmt.json
Please provide string value for 'workspaceName' (? for help): MSPTestUFPCLOUD
Please provide string value for 'workspaceLocation' (? for help): eastus
Please provide string value for 'automationAccountName' (? for help): MSPTestUFPAuto
Please provide string value for 'automationLocation' (? for help): eastus
Please provide string value for 'rgName' (? for help): msp-rg
Please provide string value for 'rgLocation' (? for help): eastus

AND - Get error:

400 Client Error: Bad Request for url: https://management.azure.com/subscriptions/subscriptionidremoved/providers/Microsoft.Resources/deployments/MSPTestDeployment?api-version=2018-05-01
Azure:/
PS Azure:\>

Not sure what i'm doing wrong? Any advice?
I did a git clone about 10 minutes before I ran this, so I should have the latest version of the code
I truly appreciate any help you can provide here

OK... Getting a little further. I decided to use --template-uri and point it to the raw JSON on github, and it did not immediately error. I'll give this a shot and report back

...and that did it. I am an idiot.
Closing ticket