Azure / Azure/Azure-Verified-Modules
[Module Proposal]: `avm/ptn/app/cosmos-db-account-container-app`
- Dominant language
- PowerShell
- Stars
- 580
- Forks
- 161
- Avg merge
- 11h 3m
- Merged PRs (30d)
- 15
Description
### Check for previous/existing GitHub issues/module proposals
- [x] I have checked for previous/existing GitHub issues/module proposals.
### Check this module doesn't already exist in the module indexes
- [x] I have checked for that this module doesn't already exist in the module indexes.
### Bicep or Terraform?
Bicep
### Module Classification?
Pattern Module
### Module Name
`avm/ptn/app/cosmos-db-account-container-app`
### Module Details
I'm the content developer for Azure Cosmos DB documentation and I have a series of Azure Cosmos DB for NoSQL, MongoDB RU and Table Quickstarts that are published as Azure Developer CLI templates. Here's a list of the current ones:
| | API | Framework/Language | Documentation
| --- | --- | --- | --- |
| [`azure-samples/cosmos-db-nosql-dotnet-quickstart`](https://github.com/azure-samples/cosmos-db-nosql-dotnet-quickstart) | NoSQL | .NET/C# | [`/azure/cosmos-db/nosql/quickstart-dotnet`](https://learn.microsoft.com/azure/cosmos-db/nosql/quickstart-dotnet) |
| [`azure-samples/cosmos-db-nosql-nodejs-quickstart`](https://github.com/azure-samples/cosmos-db-nosql-nodejs-quickstart) | NoSQL | Node.js/JavaScript/TypeScript | [`/azure/cosmos-db/nosql/quickstart-nodejs`](https://learn.microsoft.com/azure/cosmos-db/nosql/quickstart-nodejs) |
| [`azure-samples/cosmos-db-nosql-python-quickstart`](https://github.com/azure-samples/cosmos-db-nosql-python-quickstart) | NoSQL | Python | [`/azure/cosmos-db/nosql/quickstart-python`](https://learn.microsoft.com/azure/cosmos-db/nosql/quickstart-python) |
| [`azure-samples/cosmos-db-nosql-java-quickstart`](https://github.com/azure-samples/cosmos-db-nosql-java-quickstart) | NoSQL | Java | [`/azure/cosmos-db/nosql/quickstart-java`](https://learn.microsoft.com/azure/cosmos-db/nosql/quickstart-java) |
| [`azure-samples/cosmos-db-nosql-go-quickstart`](https://github.com/azure-samples/cosmos-db-nosql-go-quickstart) | NoSQL | Go | [`/azure/cosmos-db/nosql/quickstart-go`](https://learn.microsoft.com/azure/cosmos-db/nosql/quickstart-go) |
| [`azure-samples/cosmos-db-nosql-rust-quickstart`](https://github.com/azure-samples/cosmos-db-nosql-rust-quickstart) | NoSQL | Rust | |
| [`azure-samples/cosmos-db-mongodb-dotnet-quickstart`](https://github.com/azure-samples/cosmos-db-mongodb-dotnet-quickstart) | MongoDB (RU) | .NET/C# | [`/azure/cosmos-db/mongodb/quickstart-dotnet`](https://learn.microsoft.com/azure/cosmos-db/mongodb/quickstart-dotnet) |
| [`azure-samples/cosmos-db-mongodb-nodejs-quickstart`](https://github.com/azure-samples/cosmos-db-mongodb-nodejs-quickstart) | MongoDB (RU) | Node.js/JavaScript/TypeScript | [`/azure/cosmos-db/mongodb/quickstart-nodejs`](https://learn.microsoft.com/azure/cosmos-db/mongodb/quickstart-nodejs) |
| [`azure-samples/cosmos-db-mongodb-python-quickstart`](https://github.com/azure-samples/cosmos-db-mongodb-python-quickstart) | MongoDB (RU) | Python | [`/azure/cosmos-db/mongodb/quickstart-python`](https://learn.microsoft.com/azure/cosmos-db/mongodb/quickstart-python) |
| [`azure-samples/cosmos-db-table-dotnet-quickstart`](https://github.com/azure-samples/cosmos-db-table-dotnet-quickstart) | Table | .NET/C# | [`/azure/cosmos-db/table/quickstart-dotnet`](https://learn.microsoft.com/azure/cosmos-db/table/quickstart-dotnet) |
| [`azure-samples/cosmos-db-table-nodejs-quickstart`](https://github.com/azure-samples/cosmos-db-table-nodejs-quickstart) | Table | Node.js/JavaScript/TypeScript | [`/azure/cosmos-db/table/quickstart-nodejs`](https://learn.microsoft.com/azure/cosmos-db/table/quickstart-nodejs) |
| [`azure-samples/cosmos-db-table-python-quickstart`](https://github.com/azure-samples/cosmos-db-table-python-quickstart) | Table | Python | [`/azure/cosmos-db/table/quickstart-python`](https://learn.microsoft.com/azure/cosmos-db/table/quickstart-python) |
| [`azure-samples/cosmos-db-table-java-quickstart`](https://github.com/azure-samples/cosmos-db-table-java-quickstart) | Table | Java | [`/azure/cosmos-db/table/quickstart-java`](https://learn.microsoft.com/azure/cosmos-db/table/quickstart-java) |
| [`azure-samples/cosmos-db-table-go-quickstart`](https://github.com/azure-samples/cosmos-db-table-go-quickstart) | Table | Go | [`/azure/cosmos-db/table/quickstart-go`](https://learn.microsoft.com/azure/cosmos-db/table/quickstart-go) |
Today, I need to maintain an Azure Bicep infrastructure definition that defines a solution that hosts an Azure Container Registry, Azure Container App, and Azure Cosmos DB account and duplicate it across all of these AZD templates. For some APIs, like MongoDB (RU), I also need to maintain an Azure Key Vault instance to store the ROPC credentials. For others, like NoSQL and Table, Microsoft Entra authentication is configured end-to-end.
The problem today is that anytime I discover an efficiency, I'm disuaded from updating all of the templates because of the sheer complexity. I'm also onboarding at least two more APIs (Apache Gremlin and Apache Cassandra) across five languages to this sample set.
I want to define a pattern that has the following components:
- An Azure Container Apps environment and instance to host our n-tier web application
- An Azure Container Registry to host container images from the web application
- An Azure Cosmos DB account
- An user-assigned managed identity
- If using Entra authentication, the correct roles to correct directly to the account
- If not using Entra authentication, a key vault with the correct credentials for the host to access the ROPC as a secret
I'm prepared to build and own this myself. I can also recruit someone from the product group as a co-owner.
My goal is to make the pattern flexible enough that someone can use it for their own best-practices deployment no matter how many tiers their web application has definied.
I already have a pilot pattern template that I'm working on locally.
> [!NOTE]
> This pattern is distinct from the other similar pattern I proposed: `document-db-cluster-container-app`. This pattern is for the Azure Cosmos DB NoSQL, Table, Apache Gremlin, MongoDB (RU), Apache Cassandra APIs.
- Related to #2076
### Do you want to be the owner of this module?
Yes
### Module Owner's GitHub Username (handle)
seesharprun
### (Optional) Secondary Module Owner's GitHub Username (handle)
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the pilot pattern template mentioned in the issue and compare it with the related proposal in #2076. Done means defining the proposed Azure Container Apps, Container Registry, Cosmos DB, managed identity, and authentication-dependent Key Vault components for the listed Cosmos DB APIs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100