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

Joseph Durnal 321 Reputation points
2020-09-10T22:46:31.373+00:00

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
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,451 questions
{count} votes

Accepted answer
  1. Joseph Durnal 321 Reputation points
    2020-09-14T12:43:02.287+00:00

    Have to read the documentation very carefully.
    https://learn.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)

    0 comments No comments

0 additional answers

Sort by: Most helpful