Forum Discussion
Automate the deployment pipelines programmatically(CICD)
Hi Fabuser_123 this is a very big as ask 😅! I abstracted from your description these two requests ...
#1. How to automate a feature deployment using Fabric deployment pipelines (on git merge, trigger deployment stage dev>prod)
#2. How to set up the deployment rules to change environemnt specific variables between dev and prod
If this is correct, let's tackle one at a time because the techniques and process are different, just contributing to the same goal.
#1.
I'm going to assume you are using MSFT DevOps, in my blog some time ago, i published something similiar, I recorded a video
showing how to Automating workspace updates using Fabric's 'Update From Git' REST API here's the link https://www.techtacofriday.com/automating-workspace-updates-using-fabric-api/ this is very close of what you're trying to achieve, you can take the code that pushes changed to the source and add a new process to trigger the deployment pipeline stage using API calls using these steps:
Step #1. first you need to identify your deployment pipeline via Deployment Pipelines - Get Deployment Pipeline - REST API (Core) | Microsoft Learn
Step 2. Then get the ID of your pipeline and get its stages via Deployment Pipelines - List Deployment Pipeline Stages - REST API (Core) | Microsoft Learn
Step 3. Get the stage ID that correspond to dev>prod and deploy the state via Deployment Pipelines - Deploy Stage Content - REST API (Core) | Microsoft Learn
#2.
For this one, there are basically two methods, using variable libraries, I also recently published a video on my blog on this topic Deployment Pipelines in Fabric: The Right Way to Handle Lakehouse Shortcuts and the second is DEPLOYMENT RULES, and I also have a video for you on this topic here Demystifying Fabric Deployment Pipelines
Plenty of information to digest, right? I hope you find it useful, THERE'S A LOT OF MATERIAL AND TECHNIQUES IN THIS RESOURCES! The good thing is that is all on my blog and created by me, so, if you have a specific question on any of the videos or code, subscribe and give me a ping! If you find this information useful, WOULD YOU MIND GIVE ME A KUDOS?! I appreciate and if this solve your problem, mark this as a solution for other people looking for the same info.