2

Is it possible to connect to Azure cosmos DB using MSI the same way as it is possible for Azure SQL?

That's how it works for Azure SQL Server

using (var connection = new SqlConnection(connectionString))
{
    connection.AccessToken = await new AzureServiceTokenProvider().GetAccessTokenAsync("https://database.windows.net/");
    await connection.OpenAsync(cancellationToken);

    //...
}

I'm not able to find anythig like this for Cosmos DB. While MSI support for it seems to be enabled

VinSmile
  • 756
  • 6
  • 10

1 Answers1