Forum Discussion
Deployment pipelines, data source credentials from contributor not carried on after deployment
- 2 months ago
Hi caio-pavesi,
1. Create a dedicated Service Account (easier) or Service Principal (more robust)
A shared service account (e.g. [email protected]) that has access to all data sources (SharePoint, SQL, etc.)
Give it at least Contributor role in both DEV and PROD workspaces
2. Take ownership of semantic models with that account
After each deployment, the service account should Take Ownership of the semantic model in PROD:
Semantic Model → Settings → Take Ownership
This makes the service account the owner, so its credentials are used for refresh.
3. Set credentials once under that account
Since the service account always has source access, you configure credentials once and they persist reliably.
4. Automate with Deployment Pipeline Rules
In your Deployment Pipeline, configure Parameter Rules and Data Source Rules:
Pipeline → Deployment Rules → Data source rules
This lets you remap the data source connection string from DEV to PROD automatically on deploy (e.g. DEV SharePoint site → PROD SharePoint site), so credentials don't need to be re-entered manually.For refresh schedules:
Use the Power BI REST API or Fabric REST API to programmatically restore refresh schedules post-deployment. You can wrap this in a Power Automate flow triggered by a deployment pipeline event:
Deployment completes → triggers a Flow
Flow calls POST /datasets/{datasetId}/refreshSchedule to restore the schedule
Flow calls POST /datasets/{datasetId}/Default.TakeOverInGroup to reassign ownership to the service account
https://learn.microsoft.com/en-us/fabric/cicd/deployment-pipelines/create-rules
https://learn.microsoft.com/en-us/fabric/enterprise/powerbi/service-premium-service-principal
https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/take-over-in-group
https://learn.microsoft.com/en-us/rest/api/power-bi/pipelines/deploy-all
https://learn.microsoft.com/en-us/rest/api/power-bi/pipelines/selective-deploy
Hope this helps! Don't forget to accept as solution ✅ and thumbs up 👍 in order to keep helping others 🙂
Best regards,
Oussama (Data Consultant - Expert Fabric & Power BI)
oussamahaimoud not sure if this is possible per my company policies but I'm going to give it a shot, for now Thank you for the help!