Smack Jack
Smack Jack

Reputation: 267

Can't use azure key vault ('New-AzureKeyVault' is not recognized) ('keyvault' is not an azure command)

I am trying to create an Azure Key Vault, but the portal (old and new) don't yet have the option, and the latest docs say to use the command line, but that doesn't seem to work either.

Unknown command when running from Azure CLI:

C:\WINDOWS\system32>azure keyvault create --vault-name 'abc' --resource-group 'abc' --location 'West US'
error:   'keyvault' is not an azure command. See 'azure help'.

Unknown command when running from Azure PowerShell:

PS C:\> New-AzureKeyVault -VaultName  -EnabledForDeployment -ResourceGroupName abc -Location "West US" -Sku "Premium"
New-AzureKeyVault : The term 'New-AzureKeyVault' 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-AzureKeyVault -VaultName  -EnabledForDeployment -ResourceGroupName ...
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (New-AzureKeyVault:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

How do you use Key Vault?

Edit:

These were supposedly included with 0.9.5 of Azure CLI, but 0.9.9 doesn't have it: http://blogs.technet.com/b/kv/archive/2015/06/24/keyvaulthasshipped.aspx

C:\WINDOWS\system32>azure help
info:    Executing command help
info:             _    _____   _ ___ ___
info:            /_\  |_  / | | | _ \ __|
info:      _ ___/ _ \__/ /| |_| |   / _|___ _ _
info:    (___  /_/ \_\/___|\___/|_|_\___| _____)
info:       (_______ _ _)         _ ______ _)_ _
info:              (______________ _ )   (___ _ _)
info:
info:    Microsoft Azure: Microsoft's Cloud Platform
info:
info:    Tool version 0.9.9

Upvotes: 0

Views: 2316

Answers (1)

Smack Jack
Smack Jack

Reputation: 267

Apparently the Azure PowerShell will work if the following command is issued first:

Switch-AzureMode -Name AzureResourceManager

I was confused because the documentation says it is obsoleted and may not work after October 1st (which is two days from this writing). https://github.com/Azure/azure-powershell/wiki/Deprecation-of-Switch-AzureMode-in-Azure-PowerShell

Still don't know why the Azure CLI doesn't work, but at least it works somewhere.

Upvotes: 3

Related Questions