3

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.

3 Answers 3

5

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.

Sign up to request clarification or add additional context in comments.

Comments

3

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.

Comments

1

You can try calling the REST API from powershell to achieve your goal SEE REST API Dcumentation here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.