docs-aspire icon indicating copy to clipboard operation
docs-aspire copied to clipboard

Document Entra ID and new Azure API pattern for Redis, PostgreSQL, and SQLServer

Open eerhardt opened this issue 1 year ago • 0 comments

Describe the issue or suggestion

With supporting Microsoft Entra ID in Redis and PostgreSQL we needed to introduce a new API pattern for working with these resources that can be either locally in a container or as Azure managed resources.

  1. The existing [Publish]AsAzureRedis and [Publish]AsAzurePostgresFlexibleServer methods are marked Obsolete
  2. New AddAzureRedis and AddAzurePostgresFlexibleServer methods are introduced for when you want an Azure resource.
    1. These methods configure Entra ID by default instead of using secrets.
    2. To use them in your app, you need to configure managed identity in your app. See
      1. https://github.com/Azure/Microsoft.Azure.StackExchangeRedis
      2. https://devblogs.microsoft.com/dotnet/using-postgre-sql-with-dotnet-and-entra-id/
    3. To continue using password and access key auth - new WithAccessKeyAuth/WithPasswordAuth methods can be invoked.
  3. To use a non-Azure container locally, a new RunAsContainer method can be called.

For more information:

  • https://github.com/dotnet/aspire/pull/5930
  • https://github.com/dotnet/aspire/pull/5966
  • https://github.com/dotnet/aspire/issues/5998

eerhardt avatar Sep 27 '24 21:09 eerhardt