https://github.com/agazoth/axcosmosdb
A Powershell module that utilizes Azure CosmosDB
https://github.com/agazoth/axcosmosdb
Last synced: 9 months ago
JSON representation
A Powershell module that utilizes Azure CosmosDB
- Host: GitHub
- URL: https://github.com/agazoth/axcosmosdb
- Owner: Agazoth
- License: mit
- Created: 2017-09-17T17:40:32.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-25T05:57:50.000Z (over 8 years ago)
- Last Synced: 2025-06-21T11:06:57.674Z (about 1 year ago)
- Language: PowerShell
- Size: 325 KB
- Stars: 3
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# AxCosmosDB
This module lets you create, modify and delete CosmosDB databases, Collections and Documents. I created this module, because I'm a stubborn old geezer. I wanted to prove, that Powershell can reach and manipulate the Cosmos without wrapping C#.
The trick was to find a way to substitute the huma readable Id with the inhuman _rid, when building the url and authorization string. The intriguing thing is, that the documentation clearly states, that you should use the human readable id NOT the _rid, but all the examples clearly use the _rid.


Functionality:
Create a CosmosDB, note the URI and the Key and you are good to go.
Converts any hashtable to a JSON document and stores it in a Collection.
#Instructions
```powershell
# One time setup
# Download the repository
# Unblock the zip
# Extract the AxCosmosDB folder to a module path (e.g. $env:USERPROFILE\Documents\WindowsPowerShell\Modules\)
#Simple alternative, if you have PowerShell 5, or the PowerShellGet module:
Install-Module AxCosmosDB
# Import the module.
Import-Module AxCosmosDB
# Get commands in the module
Get-Command -Module AxCosmosDB
# Get help for a command
Get-Help New-CosmosDocument -Full
```
# Caveats
There is some kind of bug in the New-CosmosDocumentQuery. Only a general query returns anything. If additional parameters are added, nothing is returned.