3

I am developing a Saas based application which has hybrid DB architecture (Azure SQL Server and Azure Cosmos DB).

To manage SQL Server Tables, Stored procedures, triggers and functions we will create a SQLDB project (.sqlproj). Also we can generate .dacpac and deploy in the sql server.

As like SQL, we will have collections, stored procedures, triggers and functions in Azure CosmosDB.

How to manage CosmosDB collection, procedure, trigger? Is there any project templete available to manage? Suggest a solution to proceed.

Saravana Kumar
  • 3,669
  • 5
  • 15
  • 35

2 Answers2

1

Based on my experience with CosmosDb, I believe there is nothing sort of project templates available for CosmosDb. Because it is not as easy as SQL Db project.

I suggest you will have to store them as json files in local solution version control and version them accordingly.

You could write necessary programming logic to execute these scripts/cosmos DB logic using SQL API for .NET or another platform. This way you are controlling the collections, udf, triggers etc from your code, and you can version your code accordingly.

More references here: https://learn.microsoft.com/en-us/azure/cosmos-db/programming

nithinmohantk
  • 459
  • 4
  • 11
0

Azure CosmosDBs can be managed through ARM templates. You can use these to version your databases/collections/etc. See Microsoft.DocumentDB resource types documentation.

Tobias
  • 4,999
  • 7
  • 34
  • 40