Incredibly slow DACPAC deploy from DevOps to an Azure with deployment pipeline

Viewed 634

Azure DevOps release pipeline takes ages(around 25mins) to deploy the dacpac. I'm pretty sure this can't take this much time. something unusual here. After the research, I corrected some warnings but those are not that important. but now there are no warnings in dacpac project.

  • Db contains around 50 tables with minimal data
  • couple of Stored procedures
  • couple of post-build scripts

Please see the below logs. Expert help much appreciated.

enter image description here enter image description here

1 Answers

Finally found the issue after a long struggle. Posting this answer as this might be helpful for someone. in my case what has happen was that there was post deplyment script which executing line by line insted batch process due to the way it has been written.

SET IDENTITY_INSERT ### 
GO
INSERT [dbo].###
GO
INSERT [dbo].###
GO
INSERT [dbo].###
GO

So removing all the GO statements in the script made things to execute smoothly as it will execute as a batch.

Surprisingly my time reduced 25 mins to 2 mins. So always make sure if you have any SQL scripts to be executed in the pipeline as a post-build. bettor optimized those as much as possible.

Hope this will help someone.

Related