gpt4 book ai didi

Azure Keyvault CLI 错误 : The subscription is not registered to use namespace 'Microsoft.KeyVault'

转载 作者:行者123 更新时间:2023-12-01 18:27:43 27 4
gpt4 key购买 nike

创建新的 KeyVault 时出现以下错误

The subscription is not registered to use namespace 'Microsoft.KeyVault'

对于所有其他产品,解决方案是使用 GUI 在同一区域/帐户中部署类似的资源,但 KeyVault 在门户中尚不可用。 (经典或预览)

我按照说明访问 create a KeyVault are here 。如果这很重要的话,我只是碰巧使用 OSX,但 NPM 适用于所有平台。

Chris$ sudo npm install azure-cli -g
Chris$ echo '. <(azure --completion)' >> .zshrc
Chris$ echo 'source ~/azure.completion.sh' >> ~/.bash_profile


Chris$ azure login -u <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ed8e859f849ead85889f88c38e8280" rel="noreferrer noopener nofollow">[email protected]</a>
Chris$ azure telemetry --enable
Chris$ azure config mode arm
Chris$ azure location list
Chris$ azure group create 'agent77keysRM' 'centralus'
Chris$ azure account list
Chris$ azure account set "AccountDisplayName"


Chris$ azure keyvault create --vault-name "agent77keys" --resource-group 'agent77keysRM' --location 'centralus'
info: Executing command keyvault create
+ Checking pre-condition
+ Creating vault agent77keys
error: The subscription is not registered to use namespace 'Microsoft.KeyVault'.
error: Error information has been recorded to /Users/Chris/.azure/azure.err
error: keyvault create command failed

出于隐私原因,我不会在这里转储 azure.err,但关键信息是:

   'x-ms-client-request-id': 'b9991d6f-bd8c-4e62-b887-cac9b90d0281',
'accept-language': 'en-US',
'Content-Type': 'application/json; charset=utf-8',
'user-agent': 'WindowsAzureXplatCLI/0.10.2'
...
'x-ms-failure-cause': 'gateway',
'x-ms-request-id': 'fcb04d40-306f-40bd-b8df-f1b42b283010',
'x-ms-correlation-request-id': 'fcb04d40-306f-40bd-b8df-f1b42b283010',
'x-ms-routing-request-id': 'EASTUS:20160806T013209Z:fcb04d40-306f-40bd-b8df-f1b42b283010',

看起来注册修复了它,如果有人想看到它告诉您未创建 HSM key ,这里是输出...简单修复,只需添加 SKU

info:    Executing command keyvault create
+ Checking pre-condition
+ Creating vault xxxxx
info: Created vault xxxxx
data: id "/subscriptions/xxxx/resourceGroups/xxxx/providers/Microsoft.KeyVault/vaults/xxxxxxs"
data: name "xxxx"
data: type "Microsoft.KeyVault/vaults"
data: location "centralus"
data: properties sku family "A"
data: properties sku name "Standard"
data: properties tenantId "xxxx"
data: properties accessPolicies 0 tenantId "xxxx
data: properties accessPolicies 0 objectId "xxxx
data: properties accessPolicies 0 permissions keys 0 "get"
data: properties accessPolicies 0 permissions keys 1 "create"
data: properties accessPolicies 0 permissions keys 2 "delete"
data: properties accessPolicies 0 permissions keys 3 "list"
data: properties accessPolicies 0 permissions keys 4 "update"
data: properties accessPolicies 0 permissions keys 5 "import"
data: properties accessPolicies 0 permissions keys 6 "backup"
data: properties accessPolicies 0 permissions keys 7 "restore"
data: properties accessPolicies 0 permissions secrets 0 "all"
data: properties enabledForDeployment false
data: properties vaultUri "https://xxxxx.vault.azure.net"
warn: This vault does not support HSM-protected keys. Please refer to http://go.microsoft.com/fwlink/?linkid=512521 for the vault service tiers.
warn: When creating a vault, specify the --sku parameter to select a service tier that supports HSM-protected keys.
info: keyvault create command OK

最佳答案

请查看此线程以了解为什么会出现此错误:The subscription is not registered to use namespace 'Microsoft.DataFactory error .

要解决此问题,您需要向 Microsoft.KeyVault 资源提供程序注册您的订阅。您可以使用以下命令执行相同的操作:

azure provider register --namespace "Microsoft.KeyVault"

使用 Azure 资源管理器

Register-AzureRmResourceProvider -ProviderNamespace 'Microsoft.KeyVault'

关于Azure Keyvault CLI 错误 : The subscription is not registered to use namespace 'Microsoft.KeyVault' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38799788/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com