Configuring Databases from CI/CD
Explore how to automate the configuration of Cosmos DB databases and containers through CI/CD pipelines. Understand how to define databases in JSON, apply updates with C# console apps, and manage triggers, user-defined functions, and stored procedures to keep applications and databases synchronized.
We'll cover the following...
Introduction
When our solution grows, especially in a microservices architecture, it’s hard to maintain the persistence layer in sync with the apps or clients. In the case of multiple deployment environments, maintaining persistence is intractable.
It would be nice to have a solution to apply database changes when applications are deployed with a CI/CD pipeline.
A simple solution is to create a console application that lives in the build agent, takes a Cosmos DB definition file from the app repositories, and applies changes.
A simple file where we define and create the database and its containers is a good place to start.
...