1

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.json with 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?

2
  • 3
    "authentication here fails because it asks for interactive authentication" that's what you asked it for Authentication=Active Directory Interactive Commented Oct 16 at 16:43
  • See learn.microsoft.com/en-us/sql/connect/ado-net/sql/… for more options Commented Oct 16 at 16:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.