I am trying to figure out the proper Azure sql db connection string to use, when using MSIs
I am now authenticating to sql via Managed Service Indentities (MSIs), and do not have "username and password"
The connection string type is ADO.NET
Prior to using MSI, my connection string was in the below format:
Server=tcp:sqlserver.azurenet,1433;Initial Catalog=testdb;Persist Security Info=False;User ID={your_username};Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication="Active Directory Password";
Am i simply removing the User ID={your_username};Password={your_password}??
Thank you
When connecting to Azure SQL using MSI, the connection authentication method is token. Therefore you cannot use a regular connection string you have indicated above. There is a C# example available in the MSI tutorial ( see below) https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/tutorial-windows-vm-access-sql although I have not tried it on my own. Thanks, Mirek