I was trying out the public preview of the Azure Key Vault service that has been released recently. While following the steps as mentioned in their blog, came across the below error when trying the ‘New-AzureKeyVault’ command.
Please install Azure Powershell module version 0.8.13 or newer.
I did have the latest powershell for azure installed, but still this error is thrown.
Exploring the powershell scripts for key vault, below is where the error is thrown from ‘Common.ps1’. The script looks for the AzureResourceManager, which got introduced in poweshell version 0.8.0 and lets you manage resources in a completely different way.
1 2 3 4 5 6 7 8 9 10
When you use the Azure PowerShell cmdlets, the Azure module is imported into the session by default. To remove the Azure module from the session and import the AzureResourceManager and AzureProfile modules, use the Switch-AzureMode cmdlet.
This is what is exactly causing the issue, we need to switch to use the azure resource manager. Running the below command and trying the ‘New-AzureKeyVault’ command works like a charm