question

JosephDurnal-2548 avatar image
0 Votes"
JosephDurnal-2548 asked AmitaMenon-3691 edited

New-AzResourceGroupDeployment moving from File to Uri and lost passed arguments

Working on some template automation and I'll need to move from deploying with local files to deploying with files from cloud storage. I've bolded the stuff that worked and now doesn't.

This works
New-AzResourceGroupDeployment -ResourceGroupName myrg -TemplateParameterFile .\ScalingParameters.json" -TemplateFile .\ScalingTemplate.json -vmInitialNumber 1 -hostpooltoken <System.Security.SecureString> -WhatIf


This doesn't
New-AzResourceGroupDeployment -ResourceGroupName myrg -TemplateParameterUri "https://mysa.blob.core.windows.net/wvdarmtemplates/ScalingParameters.json?sp=<stuff>;" -TemplateUri "https://mysa.blob.core.windows.net/wvdarmtemplates/ScalingTemplate.json?sp=<stuff>;" -vmInitialNumber 1 -hostpooltoken <System.Security.SecureString> -WhatIf

Is passing the additional arguments not supported with URIs of have I done something else wrong?

Thanks,
Joe

azure-virtual-desktop
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am currently investigating and get back to you shortly. Thanks.

1 Vote 1 ·

Hi @JosephDurnal-2548, It looks like it could be because of an issue with your file. Can you please check the following:
1. Your blob file needs to be available as RAW.
2. Also, there should not be authentication issues while opening the blob link.

Please check and let me know so that I can further troubleshoot. Thank you.

1 Vote 1 ·

1 Answer

JosephDurnal-2548 avatar image
0 Votes"
JosephDurnal-2548 answered

Have to read the documentation very carefully.
https://docs.microsoft.com/en-us/powershell/module/az.resources/new-azresourcegroupdeployment?view=azps-4.6.1

-TemplateParameterFile says:
To use the dynamic parameters, type a minus sign (-) to indicate a parameter name and then use the Tab key to cycle through the available parameters.

-TemplateParameterURI doesn't say that so it doesn't seem like it is supported.

I've moved on to -TemplateParamaterObject and adding my values there. Which will create a new set of questions.

(they really need a more general tag for new-azresourcegroupdeployment)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.