question

SundeepKumar-5930 avatar image
0 Votes"
SundeepKumar-5930 asked olgaoos commented

New-AzResourceGroupDeployment not working

I am trying to run the following command in cloud powershell:


$location = 'UK West'
$rgName = 'az104-07-rg0'
New-AzResourceGroup -Name $rgName -Location $location

Above succeeds

Followed by:

New-AzResourceGroupDeployment -ResourceGroupName az104-07-rg0
-TemplateFile az104-07-vm-template.json -TemplateParameterFile az104-07-vm-parameters.json
-AsJob

Which does nothing except give me the following output on screen. I have uploaded the Template and parameters file. Any ideas why this is happening:


PS /home/sundeep> New-AzResourceGroupDeployment >> -ResourceGroupName $rgName

-TemplateFile $HOME/az104-07-vm-template.json >> -TemplateParameterFile $HOME/az104-07-vm-parameters.json
-AsJob

Id Name PSJobTypeName State HasMoreData Location Command


16 Long Running O… AzureLongRunni… Running True localhost New-AzResourceGroupDeplo…

azure-virtual-machines
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.

olgaoos avatar image
0 Votes"
olgaoos answered

Hello @SundeepKumar-5930,

Welcome to the MS Q&A.
I have suspicious how exactly you pass the TemplateFile parameter to specify the template and the TemplateParameterFile parameter to specify a file that contains parameters and parameter values.

I searched for the lab with the same name and noticed what author first uploads file and next providing the path where these files store:

100313-image.png

100288-image.png

Please try to complete the same lab again by following the exact steps in the lab scenario.


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Sincerely,
Olga O


image.png (15.2 KiB)
image.png (43.8 KiB)
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.

SundeepKumar-5930 avatar image
0 Votes"
SundeepKumar-5930 answered olgaoos commented

Hi Olga - thanks for the quick reply.

I am running the lab exactly as it shows. I upload the correct Template and Parametre file to the home directory. After running the resource group deployment I get this output in shell:

100372-deployment-issue.png



deployment-issue.png (223.4 KiB)
· 1
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.

In this case, I think deployment is going as expecting.

First, what you can do is play with the output type to, for example: --output json
Second, I looked in the template code itself and it seems deploying a VM. Do you see this VM in the Azure Portal?

Thanks,
Olga

0 Votes 0 ·