
CosmosDB PowerShell Module
Module Build Status
| Branch |
GitHub Actions |
Automated Tests |
Code Quality |
| main |
 |
 |
 |
Introduction
This PowerShell module provides cmdlets for accessing Cosmos DB collections via the
Azure Cosmos DB REST API.
It makes it easy to perform CRUD operations on Cosmos DB collections and documents
and related entities while also implementing role-based access control or token-based
authentication.
[!IMPORTANT]
The CosmosDB PowerShell module is not intended to be a replacement for the
Az.CosmosDB. Although
there is some cross-over between the two modules, the CosmosDB PowerShell
module is primarily intended to be used for accessing the documents within
collections using RBAC and token-based authentication. This is functionality that
the Az.CosmosDB module does not currently provide.
The CosmosDB PowerShell module enables management of:
The module uses the Cosmos DB (DocumentDB) REST APIs. For more information on
the Cosmos DB REST APIs, see this link.
User Guide
For full usage documentation — contexts, authentication, working with databases,
collections, documents, stored procedures, and more — see the
User Guide.
Requirements
This module requires the following:
- Windows PowerShell 5.x, PowerShell Core 6.x or PowerShell 7.x
PowerShell Module Dependencies
- Az.Accounts: 5.0.0 and newer.
- Az.Resources: 8.0.0 and newer.
These modules are required if using New-CosmosDbContext -ResourceGroupName $resourceGroup
or *-CosmosDbAccount functions.
Installation
To install the module from PowerShell Gallery, use the PowerShell Cmdlet:
Install-Module -Name CosmosDB
Compatibility and Testing
This PowerShell module is automatically tested and validated to run
on the following systems:
- Windows Server (using Windows PowerShell 5.1):
- Windows Server (using Windows PowerShell 7.x):
- Linux (using PowerShell 7.x):
- macOS (using PowerShell 7.x):
This module is no longer tested on PowerShell Core 6.x as PowerShell 7.x
should be used. It should still work, but will no longer be verified. Issues with
this module that only exist on PowerShell Core 6.x but not PowerShell 7.x will
not be fixed.
This module should function correctly on other systems and configurations
but is not automatically tested with them in every change.
Contributing
If you wish to contribute to this project, please read the Contributing.md
document first. We would be very grateful of any contributions.
Cmdlets
A list of Cmdlets in the CosmosDB PowerShell module can be found by running the
following PowerShell commands:
Import-Module -Name CosmosDB
Get-Command -Module CosmosDB
Help on individual Cmdlets can be found in the built-in Cmdlet help:
Get-Help -Name Get-CosmosDBUser
The details of the cmdlets contained in this module can also be
found in the wiki.
Change Log
For a list of changes to versions, see the CHANGELOG.md file.
Links
评论