If you have recently installed Azure PowerShell module on one of the machines and then trying to login using Select-AzureRMProfile, you are likely to receive below error:
Save-AzureRMProfile : The term ‘Save-AzureRMProfile’ 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 againAt line:3 char:2+ Save-AzureRMProfile -Path “C:\$SubscriptionName.json”+ ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Save-AzureRMProfile:String) , CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
I checked the list of cmdlets and it was gone. I checked the docs, and it does include a listing for Save-AzureRmProfile.
This is a case of the PowerShell AzureRM module getting ahead of the docs and one more botched up documentation for Azure PowerShell. After spending some time, I found that the cmdlets had been replaced with the new noun of AzureRmContext.
To use them, first login to Azure manually using Login-AzureRmAccount. Then, use the new Save-AzureRmContext to save your information to a file.
# Setup – First login manually using login-azurermaccount # Now save your context locally $path = "C:\Azure\PS\ProfileContext.json’ Save-AzureRmContext -Path $path -Force
Once that’s done, from then on you can use the Import-AzureRmContext to automate the login.
$path = C:\Azure\PS\ProfileContext.json’ Import-AzureRmContext -Path $path
There are other undocumented changes too. We will discover that in later posts.