Skip to main content
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Jarrinf
New Contributor II

Configure connection for deploy DACPAC using Releases in Azure DevOps

I need to configure the release pipeline for deploy to a SQL Server (preview) in Fabric database.

 

I already deploy the DACPAC by publishing from my Dababase Project using Visual Studio Code, works perfect, but I want to deploy from Azure DevOps and I cannot find the way for configure the credentials.

 

Does anybody know how to do it?.

1 ACCEPTED SOLUTION
v-kpoloju-msft
Honored Contributor II

Hi @Jarrinf,

Thank you for reaching out to the Microsoft Fabric Community Forum. Also, thanks to @nielsvdc,  for his inputs on this thread.

itโ€™s a great work getting your DACPAC deployment running from Visual Studio Code. When moving this to Azure DevOps, the main step you are missing is how to authenticate the release pipeline with your SQL Server (preview) in Fabric.

You can do this by using an Azure AD Service Principal. First, Register a Microsoft Entra app and create a service principal - Microsoft identity platform | Micros... in Azure AD and assign it permissions like SQL DB Contributor or admin access to your Fabric SQL endpoint. Then, in Azure DevOps, Service connections - Azure Pipelines | Microsoft Learn (Project Settings โ†’ Service connections โ†’ New connection โ†’ Azure Resource Manager โ†’ Service principal).

Once thatโ€™s configured, add the Azure SQL DACPAC deployment task in your release pipeline and choose that service connection under authentication. This securely allows your pipeline to connect to the Fabric SQL database and deploy the DACPAC automatically.
https://learn.microsoft.com/en-gb/azure/devops/pipelines/tasks/reference/sql-azure-dacpac-deployment... 

If the Fabric SQL (preview) target isnโ€™t yet fully supported by the built-in task, you can instead use a PowerShell step running SqlPackage.exe with an Azure AD access token.
https://learn.microsoft.com/en-gb/sql/tools/sqlpackage/sqlpackage-pipelines?view=sql-server-ver17 

Also, refer these links: 
1. https://learn.microsoft.com/en-us/fabric/database/sql/overview 
2. https://learn.microsoft.com/en-gb/azure/devops/pipelines/library/service-endpoints?view=azure-devops 

Hope this helps get your automated deployment working smoothly. Let us know if you have any doubts regarding this. We will be happy to help.

Thank you for using the Microsoft Fabric Community Forum.

View solution in original post

3 REPLIES 3
nielsvdc
Contributor

Hi @Jarrinf, I assume you are using a service principal for deployment. Have you created the service principal as a user in the database? And have you assigned the service principal contributor permissions to database or, as an alternative, the workspace?

 

Hope this helps. If so, please give a Kudos ๐Ÿ‘ and mark as Accepted Solution โœ”๏ธ.

 

v-kpoloju-msft
Honored Contributor II

Hi @Jarrinf,

Thank you for reaching out to the Microsoft Fabric Community Forum. Also, thanks to @nielsvdc,  for his inputs on this thread.

itโ€™s a great work getting your DACPAC deployment running from Visual Studio Code. When moving this to Azure DevOps, the main step you are missing is how to authenticate the release pipeline with your SQL Server (preview) in Fabric.

You can do this by using an Azure AD Service Principal. First, Register a Microsoft Entra app and create a service principal - Microsoft identity platform | Micros... in Azure AD and assign it permissions like SQL DB Contributor or admin access to your Fabric SQL endpoint. Then, in Azure DevOps, Service connections - Azure Pipelines | Microsoft Learn (Project Settings โ†’ Service connections โ†’ New connection โ†’ Azure Resource Manager โ†’ Service principal).

Once thatโ€™s configured, add the Azure SQL DACPAC deployment task in your release pipeline and choose that service connection under authentication. This securely allows your pipeline to connect to the Fabric SQL database and deploy the DACPAC automatically.
https://learn.microsoft.com/en-gb/azure/devops/pipelines/tasks/reference/sql-azure-dacpac-deployment... 

If the Fabric SQL (preview) target isnโ€™t yet fully supported by the built-in task, you can instead use a PowerShell step running SqlPackage.exe with an Azure AD access token.
https://learn.microsoft.com/en-gb/sql/tools/sqlpackage/sqlpackage-pipelines?view=sql-server-ver17 

Also, refer these links: 
1. https://learn.microsoft.com/en-us/fabric/database/sql/overview 
2. https://learn.microsoft.com/en-gb/azure/devops/pipelines/library/service-endpoints?view=azure-devops 

Hope this helps get your automated deployment working smoothly. Let us know if you have any doubts regarding this. We will be happy to help.

Thank you for using the Microsoft Fabric Community Forum.

KevinChant
Contributor III

You are in luck, I have a post that covers exactly how to do it along with a sample GitHub repository that you can import into Azure DevOps and use:

https://www.kevinrchant.com/2024/12/12/two-ways-to-perform-ci-cd-for-sql-databases-in-fabric-using-y... 

Helpful resources

Announcements
Top Solution Authors
Top Kudoed Authors
Users online (11,584)