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)
In my case most of the contributors use Excel Files as source, is it still possible to use the parameters?
Hi caio-pavesi,
Thanks for reaching out to the Microsoft Fabric Community forum.
Data Source Rules can be defined for the following data sources:
- Azure Analysis Services (AAS)
- Azure Synapse
- SQL Server Analysis Services (SSAS)
- Azure SQL Server
- SQL Server
- OData Feed
- Oracle
- SAP HANA (Import mode only)
- SharePoint
- Teradata
"For other data sources, It is recommended" using parameters to configure settings that may change between deployment stages.
Best practices for lifecycle management in Fabric - Microsoft Fabric | Microsoft Learn
The parameters can be used for configurations such as data source connections, internal Fabric items, queries, filters, and text displayed to users. In Deployment Pipelines, Parameter Rules can be configured to set different values for each deployment stage.
You may find the following documentation helpful:
Create deployment rules for Fabric's ALM - Microsoft Fabric | Microsoft Learn
I hope this helps. Please feel free to reach out if you have any further questions.
Thank you.