c# – SQL Server connection authentication in Azure DevOps pipeline for .NET seeding data .sln
I have a .NET application that seeds data to an Azure SQL database after deployment via Azure DevOps pipelines.
I’m struggling with authentication when using a connection string in Azure DevOps pipeline.
My setup:
-
An Azure SQL database deployment task that already deploy my database authenticated
-
.NET 8 project that seed static data to the database (
dotnet exec Core.Db.dll) -
using an
appSettings.jsonwith connection string:"Databases": { "CareProTech": { "ConnectionString": "Server=sql-server.database.windows.net,1433; Authentication=Active Directory Interactive; Database=sqldb-mydatabase; Encrypt=True; TrustServerCertificate=False;" } },
But authentication here fails because it asks for interactive authentication in the pipeline.
But it is a robot…
What connection string to use in an Azure pipeline, to use ServiceConnection authentication?
Read more here: Source link
