{"id":13458660,"url":"https://github.com/Azure-Samples/todo-csharp-cosmos-sql","last_synced_at":"2025-03-24T15:31:48.722Z","repository":{"id":44680676,"uuid":"446558288","full_name":"Azure-Samples/todo-csharp-cosmos-sql","owner":"Azure-Samples","description":"A blueprint for getting a React web app with a C# API and a MongoDB database on Azure. The blueprint includes sample application code (a ToDo web app) which can be removed and replaced with your own application code. Add your own source code and leverage the Infrastructure as Code assets (written in Bicep) to get up and running quickly.","archived":false,"fork":false,"pushed_at":"2025-03-21T18:52:55.000Z","size":2210,"stargazers_count":74,"open_issues_count":0,"forks_count":34,"subscribers_count":73,"default_branch":"main","last_synced_at":"2025-03-21T19:45:37.323Z","etag":null,"topics":["azd-templates","azure"],"latest_commit_sha":null,"homepage":"","language":"Bicep","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Azure-Samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-10T19:37:39.000Z","updated_at":"2025-03-19T23:31:04.000Z","dependencies_parsed_at":"2023-09-27T22:21:19.158Z","dependency_job_id":"91456b40-68d6-45e9-87d9-03825eb84435","html_url":"https://github.com/Azure-Samples/todo-csharp-cosmos-sql","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Ftodo-csharp-cosmos-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Ftodo-csharp-cosmos-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Ftodo-csharp-cosmos-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Ftodo-csharp-cosmos-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure-Samples","download_url":"https://codeload.github.com/Azure-Samples/todo-csharp-cosmos-sql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245298125,"owners_count":20592546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azd-templates","azure"],"created_at":"2024-07-31T09:00:54.967Z","updated_at":"2025-03-24T15:31:43.701Z","avatar_url":"https://github.com/Azure-Samples.png","language":"Bicep","funding_links":[],"categories":["3. Templates"],"sub_categories":["3.1 Microsoft"],"readme":"---\npage_type: sample\nlanguages:\n- azdeveloper\n- aspx-csharp\n- csharp\n- bicep\n- typescript\n- html\nproducts:\n- azure\n- azure-cosmos-db\n- azure-app-service\n- azure-monitor\n- azure-pipelines\n- aspnet-core\nurlFragment: todo-csharp-cosmos-sql\nname: React Web App with C# API and Cosmos DB for NoSQL on Azure\ndescription: A complete ToDo app with C# API and Azure Cosmos DB (NoSQL) for storage. Uses Azure Developer CLI (azd) to build, deploy, and monitor\n---\n\u003c!-- YAML front-matter schema: https://review.learn.microsoft.com/en-us/help/contribute/samples/process/onboarding?branch=main#supported-metadata-fields-for-readmemd --\u003e\n\n# React Web App with C# API and Cosmos DB for NoSQL on Azure\n\n[![Open in GitHub Codespaces](https://img.shields.io/static/v1?style=for-the-badge\u0026label=GitHub+Codespaces\u0026message=Open\u0026color=brightgreen\u0026logo=github)](https://codespaces.new/azure-samples/todo-csharp-cosmos-sql)\n[![Open in Dev Container](https://img.shields.io/static/v1?style=for-the-badge\u0026label=Dev+Containers\u0026message=Open\u0026color=blue\u0026logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/azure-samples/todo-csharp-cosmos-sql)\n\nA blueprint for getting a React web app with a C# API and a MongoDB database running on Azure. The blueprint includes sample application code (a ToDo web app) which can be removed and replaced with your own application code. Add your own source code and leverage the Infrastructure as Code assets (written in Bicep) to get up and running quickly.\n\nLet's jump in and get this up and running in Azure. When you are finished, you will have a fully functional web app deployed to the cloud. In later steps, you'll see how to setup a pipeline and monitor the application.\n\n![\"Screenshot of deployed ToDo app\"](assets/web.png)\n\n\u003csup\u003eScreenshot of the deployed ToDo app\u003c/sup\u003e\n\n### Prerequisites\n\u003e This template will create infrastructure and deploy code to Azure. If you don't have an Azure Subscription, you can sign up for a [free account here](https://azure.microsoft.com/free/). Make sure you have contributor role to the Azure subscription.\n\n\nThe following prerequisites are required to use this application. Please ensure that you have them all installed locally.\n\n- [Azure Developer CLI](https://aka.ms/azd-install)\n- [.NET SDK 8.0](https://dotnet.microsoft.com/download/dotnet/8.0) - for the API backend\n- [Node.js with npm (18.17.1+)](https://nodejs.org/) - for the Web frontend\n\n### Quickstart\nTo learn how to get started with any template, follow the steps in [this quickstart](https://learn.microsoft.com/azure/developer/azure-developer-cli/get-started?tabs=localinstall\u0026pivots=programming-language-csharp) with this template (`Azure-Samples/todo-csharp-cosmos-sql`).\n\nThis quickstart will show you how to authenticate on Azure, initialize using a template, provision infrastructure and deploy code on Azure via the following commands:\n\n```bash\n# Log in to azd. Only required once per-install.\nazd auth login\n\n# First-time project setup. Initialize a project in the current directory, using this template.\nazd init --template Azure-Samples/todo-csharp-cosmos-sql\n\n# Provision and deploy to Azure\nazd up\n```\n\n### Application Architecture\n\nThis application utilizes the following Azure resources:\n\n- [**Azure App Services**](https://docs.microsoft.com/azure/app-service/) to host the Web frontend and API backend\n- [**Azure Cosmos DB for NoSQL**](https://docs.microsoft.com/learn/modules/intro-to-azure-cosmos-db-core-api/) for storage\n- [**Azure Monitor**](https://docs.microsoft.com/azure/azure-monitor/) for monitoring and logging\n- [**Azure Key Vault**](https://docs.microsoft.com/azure/key-vault/) for securing secrets\n\nHere's a high level architecture diagram that illustrates these components. Notice that these are all contained within a single [resource group](https://docs.microsoft.com/azure/azure-resource-manager/management/manage-resource-groups-portal), that will be created for you when you create the resources.\n\n![\"Application architecture diagram\"](assets/resources.png)\n\n### Cost of provisioning and deploying this template\nThis template provisions resources to an Azure subscription that you will select upon provisioning them. Refer to the [Pricing calculator for Microsoft Azure](https://azure.microsoft.com/pricing/calculator/) to estimate the cost you might incur when this template is running on Azure and, if needed, update the included Azure resource definitions found in `infra/main.bicep` to suit your needs.\n\n### Application Code\n\nThis template is structured to follow the [Azure Developer CLI](https://aka.ms/azure-dev/overview). You can learn more about `azd` architecture in [the official documentation](https://learn.microsoft.com/azure/developer/azure-developer-cli/make-azd-compatible?pivots=azd-create#understand-the-azd-architecture).\n\n### Next Steps\n\nAt this point, you have a complete application deployed on Azure. But there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.\n\n\u003e Note: Needs to manually install [setup-azd extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd) for Azure DevOps (azdo).\n\n- [`azd pipeline config`](https://learn.microsoft.com/azure/developer/azure-developer-cli/configure-devops-pipeline?tabs=GitHub) - to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch.\n\n- [`azd monitor`](https://learn.microsoft.com/azure/developer/azure-developer-cli/monitor-your-app) - to monitor the application and quickly navigate to the various Application Insights dashboards (e.g. overview, live metrics, logs)\n\n- [Run and Debug Locally](https://learn.microsoft.com/azure/developer/azure-developer-cli/debug?pivots=ide-vs-code) - using Visual Studio Code and the Azure Developer CLI extension\n\n- [`azd down`](https://learn.microsoft.com/azure/developer/azure-developer-cli/reference#azd-down) - to delete all the Azure resources created with this template\n\n- [Enable optional features, like APIM](./OPTIONAL_FEATURES.md) - for enhanced backend API protection and observability\n\n### Additional `azd` commands\n\nThe Azure Developer CLI includes many other commands to help with your Azure development experience. You can view these commands at the terminal by running `azd help`. You can also view the full list of commands on our [Azure Developer CLI command](https://aka.ms/azure-dev/ref) page.\n\n\n## Security\n\n### Roles\n\nThis template creates a [managed identity](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview) for your app inside your Azure Active Directory tenant, and it is used to authenticate your app with Azure and other services that support Azure AD authentication like Key Vault via access policies. You will see principalId referenced in the infrastructure as code files, that refers to the id of the currently logged in Azure Developer CLI user, which will be granted access policies and permissions to run the application locally. To view your managed identity in the Azure Portal, follow these [steps](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/how-to-view-managed-identity-service-principal-portal).\n\n### Key Vault\n\nThis template uses [Azure Key Vault](https://docs.microsoft.com/azure/key-vault/general/overview) to securely store your Cosmos DB connection string for the provisioned Cosmos DB account. Key Vault is a cloud service for securely storing and accessing secrets (API keys, passwords, certificates, cryptographic keys) and makes it simple to give other Azure services access to them. As you continue developing your solution, you may add as many secrets to your Key Vault as you require.\n\n## Reporting Issues and Feedback\n\nIf you have any feature requests, issues, or areas for improvement, please [file an issue](https://aka.ms/azure-dev/issues). To keep up-to-date, ask questions, or share suggestions, join our [GitHub Discussions](https://aka.ms/azure-dev/discussions). You may also contact us via AzDevTeam@microsoft.com.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAzure-Samples%2Ftodo-csharp-cosmos-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAzure-Samples%2Ftodo-csharp-cosmos-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAzure-Samples%2Ftodo-csharp-cosmos-sql/lists"}