Scenario: You are running IaC solution to create Azure Resources using VS 2017 community version using ARM templates. When you try to deploy the Deploy-AzureResourceGroup.ps1 script it fails with error

———————————————————————————————————————————

Get-AzureRmEnvironment : The term ‘Get-AzureRmEnvironment’ 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.

———————————————————————————————————————————

Solution:

Make sure you have following-

>>AzureRM module is installed. If not, install it using the below command

Install-Module -Name AzureRM -AllowClobber

>> If it is installed then check the version

Get-InstalledModule -Name AzureRM -AllVersions

>>Make sure VS 2017 is connected to your Azure account

>>Install PowerShell tools if not installed, use this link to download and install PowerShell tools for Visual studio. Then start VS 2017 ‘as an administrator’ and run the ARM template to deploy to Azure.

This should resolve the error.