Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
AmiraBedh
Most Valuable Professional
Most Valuable Professional

Parametrize a connection for pipeline deployments

I am using 2 parameters to connect to my SQL Server database :

  • Database
  • Server

Each param contains a list of databases names and servers links to 3 different stages : DEV, TST and PROD:

 

Here is an example :

 img.png

 

so in the 1st step I create the query and then in the source step :

 

= OleDb.DataSource("provider=SQLNCLI11.1;initial catalog="&Database&";data source=

"&Server&";trust server certificate=True", [Query=qry])

 

I am using a deployment pipeline with rules on the semantic model to switch from a stage to another.

The problem that in each stage we have a specific user and password when connecting to the database.

I found my self connecting to DEV and publish to the DEV workspace and then I need to go back to Power Query and when I change the parameters to make them point to the TST I get an error saying that the current user doesnt' have access to the database.

Here is how we are configuring our data source connection :

 

AmiraBedh_0-1722531549345.png

 

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
1 ACCEPTED SOLUTION
AmiraBedh
Most Valuable Professional
Most Valuable Professional

I found it in the documentation :

Tutorial: Connect to on-premises data in SQL Server - Power BI | Microsoft Learn

 

If authentication fails, make sure you selected the correct authentication method and used an account with database access. In test environments, you might use Database authentication with an explicit username and password. In production environments, you typically use Windows authentication. For more assistance, see Troubleshoot refresh scenarios, or contact your database administrator.


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@AmiraBedh , Based on what I got

Once you migrate and edit the parameter, it should ask for credentials. If not, you can go to the data source settings and update the credentials there

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
AmiraBedh
Most Valuable Professional
Most Valuable Professional

This is what I get in the credentials :

image.png


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
AmiraBedh
Most Valuable Professional
Most Valuable Professional

I found it in the documentation :

Tutorial: Connect to on-premises data in SQL Server - Power BI | Microsoft Learn

 

If authentication fails, make sure you selected the correct authentication method and used an account with database access. In test environments, you might use Database authentication with an explicit username and password. In production environments, you typically use Windows authentication. For more assistance, see Troubleshoot refresh scenarios, or contact your database administrator.


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.