cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
samwoolerton
Regular Visitor

Authenticating an R or Python script

I was excited to see that Power BI now supports Python scripts, so I put together a quick script to get data from the Zendesk API.

 

With basic auth (username and password) hard-coded, this works in Power BI and pulls the data in. I really need this to work like any other Power BI data source though, and use the Power BI auth credentials/prompts.

 

Is this possible, and if so, how?

 

 

Note that I made a version of this script in both Python and R for testing purposes (I was hoping there'd be more docs for using R script with Power BI, as it has been around for longer). If it's not possible yet in Python but is doable in R, that's also an option.

1 ACCEPTED SOLUTION

Yeah I'm more comfortable with the few people I will work on the report with having access to my credentials than those who I'll share the report with.

 

Thanks for the help all, looks like hard-coding the username and password is the best option for me here

View solution in original post

5 REPLIES 5
zoloturu
Memorable Member
Memorable Member

Hi @samwoolerton,

 

The only approach would be:

1) Create Username and Password parameters. See example - https://www.youtube.com/watch?v=iiNDq2VrZPY

2) Use them in M (PowerQuery) script at the beginning

3) Then Populate them to R/Python script.

 

And then you will be able to open parameters window at any time. 

 

Regards,
Ruslan
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!

 

Hey Ruslan,

Thanks for the update here - Guyinacube videos are great!
 
Downside of this approach is that any user of the Power BI report can still see those parameters (they're not hidden away like credentials are for other data sources).
 
Any way to get around this?
 
Thanks,
Sam

@samwoolerton,

You can directly define parameters(user name and password) in Advanced Editor of your query in Power BI Desktop following the guide in this similar thread, and then create a Power BI report template(.PBIT) .

This way, when each user open the PBIT in Power BI Desktop, they will be prompted to enter username and password.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@samwoolerton@v-yuezhe-msft,

 

On the one hand, approach sounds as an alternative but on the other hand, once you publish a report with such parameters to Power BI Service then your parameters will be opened to everyone who has access to a workspace. 

 

Regards,
Ruslan

Yeah I'm more comfortable with the few people I will work on the report with having access to my credentials than those who I'll share the report with.

 

Thanks for the help all, looks like hard-coding the username and password is the best option for me here

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors