You can authorize your applications to connect to Cosmos DB using master keys or resource tokens. Depending on the level of control that is needed, your application may need to use one or even both of these approaches.
In this episode, Chris Anderson (@crandycodes) comes on to show us how to request and make use of resource tokens in Cosmos DB. Along the way, he also shows us some other interesting features in Azure App Service such as EasyAuth and Run-From-Zip deployment.
- [01:23] – Cosmos DB Token provider code
- [04:20] – Future proofing with .NET Standard
- [06:50] – Exploring the token provider implementation
- [10:44] – Cosmos DB keys versus resource tokens
- [12:02] – Demo Acquiring token
- [14:53] – Deploying using run-from-zip
- [21:50] – Setting up EasyAuth
Take a look at the links below that point to code samples, documentation and the official announcements for the features:
- Token Provider sample on GitHub
- Securing access to Azure Cosmos DB data
- Run-From-Zip announcement on GitHub
- Authentication and authorization in Azure App Service
- Create a Free Account (Azure)