0

我正在尝试创建一个 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?

编辑:

这些应该包含在 0.9.5 的 Azure CLI 中,但 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
4

1 回答 1

3

如果首先发出以下命令,显然 Azure PowerShell 将起作用:

Switch-AzureMode -Name AzureResourceManager

我很困惑,因为文档说它已经过时并且在 10 月 1 日之后可能无法工作(距撰写本文还有两天)。 https://github.com/Azure/azure-powershell/wiki/Deprecation-of-Switch-AzureMode-in-Azure-PowerShell

仍然不知道为什么 Azure CLI 不起作用,但至少它可以在某个地方工作。

于 2015-09-30T04:08:59.760 回答