azure - 无法使用 azure key Vault ('New-AzureKeyVault' 无法识别)('keyvault' 不是 azure 命令)

标签 azure azure-keyvault

我正在尝试创建一个 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 - 无法使用 azure key Vault ('New-AzureKeyVault' 无法识别)('keyvault' 不是 azure 命令),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32850304/

相关文章:

azure - 我的域的 DNS 记录未通过 dns-01 质询在 azure-dns 上传播

sql-server - Azure SQL : Create login user only if not exists

azure-resource-manager - 尝试从不同订阅中的 Keyvault 设置 WebApp 证书时,ResourceGroup 部署失败并出现 'LinkedAuthorizationFailed' 错误

azure - AKS 的 key 保管库问题

azure-devops - 自动生成 Key Vault Secrets

ios - Xamarin Forms、MS Azure 崩溃,无法在 iOS 上运行

azure - Azure 模拟器中 MVC 中托管的 SignalR 存在来自 JS 客户端的跨域问题

sql - 将数据从本地 SQL 移动到 SQL Azure

c# - 如何向 Azure C# SecretClient 提供凭据 (DefaultAzureCredential)?它似乎忽略凭据和 RBAC 并抛出 403

azure - 保护资源连接数据/字符串以供 Azure 中的微服务使用