Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
319 views
in Technique[技术] by (71.8m points)

Add existing SQL code to Azure DevOps Git and automate further deployment to production

I have an existing Azure SQL Server with Development, Testing and Production DB's. I need to copy SQL code to Azure DevOps Git Repo and automate further process (check files and deploy to Prod). Or in other words, to implement a version control that should allow to create a forks, change SQL db objects definition and control all changes. Are there any best practices to do so? Newbi to Azure DevOps Git...

question from:https://stackoverflow.com/questions/65940695/add-existing-sql-code-to-azure-devops-git-and-automate-further-deployment-to-pro

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is how we follow CICD for Azure SQL database in our project:

  1. Branches We have 4 environments: Dev,test,UAT,Prod So we have the below branching strategy hierarchy : a) Features branches : For diff developments b) Test : When we want to deploy our code to Test Env, we raise a PR from Feature branch to Test c) UAT : raise Pull request from Test to UAT d) Master: For Prod

We have created Azure SQL database project for maintaining our SQL code objects.

For actual CICD :

  1. Build Pipeline

Use Visual studio build task to build the SQL solution and publish the DACPAC artifacts in Build location

enter image description here

  1. Release Pipeline :

Use Azure SQL database deployment task to publish the DACPAC to the Env server:

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
...