Question:
I need to run below command in my PowerShell :
1 2 3 4 5 6 |
New-AzResourceGroupDeployment -Name Myrg1010 -ResourceGroupName ADFcslResourceGroup -TemplateFile C:\ADFARM.json -TemplateParameterFile C:\ADFARM-Parameters.json |
Before running this command I have connected to my Azure subscribtion
1 2 |
Connect-AzAccount |
But I have below error :
1 2 3 4 5 6 7 8 9 10 11 12 |
New-AzResourceGroupDeployment : The term 'New-AzResourceGroupDeployment' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + New-AzResourceGroupDeployment -Name MyARMDeployment -ResourceGroupNam ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (New- AzResourceGroupDeployment:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException |
I found this article but this is not my case because my powershell version is 5.1.2
1 2 3 4 5 6 7 8 |
Directory: C:\Program Files\WindowsPowerShell\Modules ModuleType Version Name ExportedCommands ---------- ------- ---- ---------------- Script 5.1.2 Azure {Get- AzureAutomationCertificate, Get-AzureAutomationConnection, New-AzureAuto... |
Could you please tell me what should I do?
Answer:
You need to install the Azure Powershell module:
You can look for just the one for this command:
1 2 |
Install-Module -Name Az.Resources -AllowClobber -Scope CurrentUser |
Or all of them:
1 2 |
Install-Module -Name Az -AllowClobber -Scope CurrentUser |
See here for details