Connection String to Grant Web App running .NET code access to PostgreSQL Flexible Server via Managed Identity

84017655 1 Reputation point
2024-06-11T13:04:40.8433333+00:00

Hi,

I need to deploy a webApp running .NET Code and Azure Database for PostgreSQL flexible server.

Our policy is to grant webApps/functionApps access to SQL Server/MySql Server/PostgreSQL Server via Managed Identity.

While, I can see connection strings in Azure Portal for sql Server that I have used to grant connect web App and SQL Server via Managed Identity but there is no connection string for Azure Database for PostgreSQL flexible server in this regard.

Connection String - PostgreSQL flexible server.jpg

We cannot hardcode login credentials in connection String mentioned on Azure Portal as shown below: Server=postgreserverweu-prod.postgres.database.azure.com;Database=postgres;Port=5432;User Id=maiaAdmin;Password={your_password};Ssl Mode=Require;

I cannot find any documentation on Microsoft Learn in this regard except this where a VM is being granted access to PostgreSQL server via Managed Identity:

https://learn.microsoft.com/en-us/azure/postgresql/single-server/how-to-connect-with-managed-identity

Kindly confirm whether Azure supports Connection String to Grant Web App running .NET code access to PostgreSQL Flexible Server via Managed Identity. If yes, kindly share connection String ASAP.

Microsoft Identity Manager
Microsoft Identity Manager
A family of Microsoft products that manage a user's digital identity using identity synchronization, certificate management, and user provisioning.
642 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,558 questions
Azure Database for PostgreSQL
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,244 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. GeethaThatipatri-MSFT 28,852 Reputation points Microsoft Employee
    2024-06-26T15:32:10.8433333+00:00

    @84017655 Thanks for the update, on your additional question.

    Yes, you can create your databases as a nested resource when you're creating your server, or as an external

    resource myserver 'Microsoft.DBforPostgreSQL/flexibleServers@2023-06-01-preview' = {

     location: 'mylocation'

      name: servername

      resource database 'databases' = {

        name: 'mydb'

      }

    }

     or as an external resource with parent == your server, as documented here:

     Microsoft.DBforPostgreSQL/flexibleServers/databases - Bicep, ARM template & Terraform AzAPI reference | Microsoft Learn

    Please let me know if you need any additional information.

    Regrads

    Geetha

    0 comments No comments