无法使用 azure key vault(无法识别 'New-AzureKeyVault')('keyvault' 不是 azure 命令)
Can't use azure key vault ('New-AzureKeyVault' is not recognized) ('keyvault' is not an azure command)
我正在尝试创建 Azure Key Vault,但门户(旧的和新的)还没有这个选项,最新的文档说要使用命令行,但这似乎不起作用要么。
来自 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'.
来自 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
如何使用 Key Vault?
编辑:
这些应该包含在 Azure CLI 0.9.5 中,但 0.9.9 没有:
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
显然,如果先发出以下命令,Azure PowerShell 就会工作:
Switch-AzureMode -Name AzureResourceManager
我很困惑,因为文档说它已经过时并且在 10 月 1 日之后可能无法工作(距离撰写本文还有两天)。
https://github.com/Azure/azure-powershell/wiki/Deprecation-of-Switch-AzureMode-in-Azure-PowerShell
仍然不知道为什么 Azure CLI 不起作用,但至少它在某个地方起作用。
我正在尝试创建 Azure Key Vault,但门户(旧的和新的)还没有这个选项,最新的文档说要使用命令行,但这似乎不起作用要么。
来自 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'.
来自 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
如何使用 Key Vault?
编辑:
这些应该包含在 Azure CLI 0.9.5 中,但 0.9.9 没有: 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
显然,如果先发出以下命令,Azure PowerShell 就会工作:
Switch-AzureMode -Name AzureResourceManager
我很困惑,因为文档说它已经过时并且在 10 月 1 日之后可能无法工作(距离撰写本文还有两天)。 https://github.com/Azure/azure-powershell/wiki/Deprecation-of-Switch-AzureMode-in-Azure-PowerShell
仍然不知道为什么 Azure CLI 不起作用,但至少它在某个地方起作用。