How to create a Gitlab pipeline to restore a DACPAC to Azure SQL

Richard Duane Wolford Jr 221 Reputation points
2023-01-19T15:00:45.3366667+00:00

I'm trying to create a Gitlab pipeline to restore a dacpac to Azure SQL, yet all of my searches have turned up in vain. Does anyone have any information about how to accomplish this task? I know this is probably a somewhat different kind of question.

Azure SQL Database
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 29,517 Reputation points Microsoft Employee
    2023-01-20T15:01:15.36+00:00

    Hi, @Richard Duane Wolford Jr Thanks for posting your question in the Microsoft Q&A forum.

    I understand you want to create a GitLab pipeline to restore a dacpac to Azure SQL.

    First, you need to establish connectivity between your GitLab runner and Azure SQL. you may need to leverage az CLI to dynamically create/remove firewall rules at runtime if your GitLab runner isn't hosted in a managed vnet with your SQL instance.

    Then you would need to:

    install sqlpackage on the pipeline runner: https://learn.microsoft.com/sql/tools/sqlpackage/sqlpackage-download

    • use the script: option in GitLab to run sqlpackage /Action:Publish

    Hope this will help. Please let us know if any further queries.

    Regards

    Geetha

    If you think your question has been answered, click "Mark as Accept Answer" if just helped click "Vote as helpful". This can be beneficial to other community members reading this forum thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.