Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SUGGESTION] Use Microsoft Entra ID authentication #43

Open
seesharprun opened this issue Oct 10, 2024 · 0 comments
Open

[SUGGESTION] Use Microsoft Entra ID authentication #43

seesharprun opened this issue Oct 10, 2024 · 0 comments
Assignees
Labels

Comments

@seesharprun
Copy link
Contributor

seesharprun commented Oct 10, 2024

We should use the best practices from the Azure Cosmos DB for NoSQL security guide: https://learn.microsoft.com/azure/cosmos-db/nosql/security

This would require changing the projects to use RBAC and Entra authentication with the following code:

using Azure.Identity;
using Microsoft.Azure.Cosmos;

DefaultAzureCredential credential = new();

using CosmosClient client = new(
    accountEndpoint: config?.CosmosUri, 
    tokenCredential: credential
);

and steps:

  1. Having the maintainers pre-import the Azure.Identity package: dotnet add package Azure.Identity --version 1.*
  2. Somehow setting up RBAC for user's accounts (no idea how you want to handle this)
  3. Instructing users to sign-in to Azure CLI or Visual Studio Code so the DefaultAzureCredential picks up their credential.
  4. Instructing users to only add their endpoint to the environment (no keys) (ex: dotnet user-secrets set "CosmosUri" "<nosql-account-endpoint>")

FYI @markjbrown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants