简体   繁体   中英

Create Collection in CosmosDb via Powershell

Is there a way to create cosmosDb collections via Azure Templates or via Powershell?

All i have got so far are examples with the Azure CLI, but those do not fit my requirements.

I would also like to avoid Rest Calls, since this seams like a lot of overhead compared to the a possible Powershell solution.

Based on the information provided here , you can only perform account related operations with PowerShell. It is not possible to manage data inside an account using PowerShell as of today.

The following table includes links to sample Azure PowerShell scripts for Azure Cosmos DB. At this time you can only manage the Azure Cosmos DB accountlayer via PowerShell; other resources such as databases and collections cannot be managed via PowerShell .

Also looking at the Azure Feedback site here , it is still unplanned but someone has started a project on Github for this. Do take a look at that project here: https://github.com/secabstraction/PoshDocs .

You can use the Cosmos DB PowerShell module available on the PowerShell Gallery . You can find the documentation and examples of how to use it on GitHub in the project repository .

您可以尝试从powershell调用REST API,以在此处实现您的目标SEE REST API Dcumentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM