Azure Cosmos DB
Cosmos DB is a document store. There are no SQL migrations and no transactions: migrations are Python, and each operation stands on its own. MongoDB is the other document engine.
type
cosmosdb
Driver
azure-cosmos
DDL
No transactions
Migrations
Python only
Install
pip install "dblift[cosmosdb]"Connection URL
https://account.documents.azure.com:443/There is no SQL URL here. Give account_endpoint (or url) plus a database, and authenticate with an account key or a managed identity. The aliases cosmos and nosql also select this engine.
dblift.yaml
database:
type: cosmosdb
account_endpoint: "https://account.documents.azure.com:443/"
database_name: "app"
container_name: "orders"
use_managed_identity: trueEngine settings
KeyDefaultEffect
account_endpoint—Required unless url is given. The Cosmos DB account endpoint.account_key—Required unless use_managed_identity is true. password is accepted as a synonym.database_name—Required unless database is given.container_name—Default container for operations.use_managed_identityfalseAuthenticate with an Azure managed identity instead of a key.Behaviour notes
SQL migrations are not supported.
Write Python migrations; a .sql file has nothing to run against.
No transactions, and no transactional DDL.
A migration that fails half-way leaves completed operations in place. Rehearse, and keep each migration small.
Cloud account authentication is required.
A key or a managed identity — there is no anonymous local mode.
Configuration is validated up front.
A missing endpoint, database or credential fails before anything connects.