为什么我不能使用PowerShell创建CosmosDB? [英] Why I cannot create CosmosDB with PowerShell?

查看:86
本文介绍了为什么我不能使用PowerShell创建CosmosDB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#创建数据库
New-AzureRmResource -ResourceType"Microsoft.DocumentDb/databaseAccounts"; `
                    -ApiVersion"2015-04-08"; `
                    -ResourceGroupName $ resourceGroupName`
                    -Location $位置`
                    -Name $ DBName`
                    -PropertyObject $ DBProperties

# Create the database
New-AzureRmResource -ResourceType "Microsoft.DocumentDb/databaseAccounts" `
                    -ApiVersion "2015-04-08" `
                    -ResourceGroupName $resourceGroupName `
                    -Location $Location `
                    -Name $DBName `
                    -PropertyObject $DBProperties

错误:

New-AzureRmResource:MissingSubscriptionRegistration:未注册该订阅以使用名称空间"Microsoft.DocumentDB".有关如何注册的信息,请参见https://aka.ms/rps-not-found
订阅.
在C:\ Toyota \ ARM \ From Scratch \ Create_FP_IoT.ps1:116 char:1
+ New-AzureRmResource -ResourceType" Microsoft.DocumentDb/databaseAccou ...

New-AzureRmResource : MissingSubscriptionRegistration : The subscription is not registered to use namespace 'Microsoft.DocumentDB'. See https://aka.ms/rps-not-found for how to register 
subscriptions.
At C:\Toyota\ARM\From Scratch\Create_FP_IoT.ps1:116 char:1
+ New-AzureRmResource -ResourceType "Microsoft.DocumentDb/databaseAccou ...

尝试注册,但也失败:


Kenny_I

推荐答案

您好@Kenny_I,如果可以,请尝试使用Azure门户而不是PowerShell创建cosmos数据库.有效.

Hi @Kenny_I, Could you please try creating the cosmos db using the Azure portal instead of PowerShell, if that works.

使用Azure门户创建CosmosDB的参考链接:https://docs.microsoft.com/zh-cn/azure/cosmos-db/create-sql-api-dotnet

Reference link for creating CosmosDB using Azure portal : https://docs.microsoft.com/en-us/azure/cosmos-db/create-sql-api-dotnet

如有任何疑问,请通知我们.

Please let us know in case of any concerns.


这篇关于为什么我不能使用PowerShell创建CosmosDB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆