Freaking amazing video man! Just an advice do the ones that are starting on python... I couldn't set the cred.py file, nor install the package, so i just created the variable with username and password. It's not the best practice to do, but it worked properly, so let the future me worry about secury stuff lol.
Thank you. Great content and now I see how to connect Python to a power bi dataset. I wonder if you can query a power bi dataset as if it is a database?
Hey, If i don't own pbi pro, and my co worker is creating the app our team use, can i use his app client id and secret with my user, in my code, in order to fetch data from the api? will i'll be able to create access token?
Wonderful video its work to me, but at the same in my side *Disable Default Security* option not necessary to me just apply ** is enough to me and its work...!, once again thank you so much...
Hello, when I check the reponse to the access token, I see that the scope returned in my access token is 00000002-0000-0000-c000-000000000000, and not the actual scopes defined in the app. Do you have any idea why ? Thanks a lot !!
@@JJPowerBI Thank you for your response. The username and password you used are admin credentials ? I am trying to connect without using a user credentials...
Hey :) Thanks for the detailed video!! When trying to register application I get this error: Error when registering application: ERROR: Request returned Forbidden and graph API request id: {id} Do you know what can be the problem? thanks!
Hi, thank you for perfect and detailed video. Maybe you can help me with one issue. I fail to authenticate using username and password (I get an "The access policy does not allow token issuance." - which should mean that I need to use MFA - company policy that cannot be avoided). When I use Confidential client then i can get a Access token, but it gets refused by the http call (401 error). Any idea how can I perform a MFA authentication and get a functional token, please? Thanks a lot for your answer.
I am trying with MSAL ConfidentialClientApplication, I am getting the token correctly, but the last part is not working for me... Do I need to change the way I build my endpoint? Or How I know which is my endpoint? Hope you could solve my doubt c:
HI Sir, while running response = client.acquire_token_by_username_password(username=username, password=password, scopes= scopes) I am getting below error: 'WsTrust server returned error in RSTR: {'reason': 'Authentication failed', 'code': 'wst:FailedAuthentication'}' any idea how can we resolve this?
enable security defaults is by default in my case still getting error. please help. getting an error 'error': 'invalid_grant', 'error_description': "AADSTS65001: The user or administrator has not consented to use the application.
@@AntrikshSharma Thanks much man. The domain name isn't verified that's why I was not getting an option to grant. I did it by visiting admin.microsoft.com and it's working now.
Hi, I'm on Step 1: Generating Access Token and get this error: ImportError: cannot import name 'username' from 'cred' (C:\Users\talha.farooq\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\cred\__init__.py) I have installed cred module Could you please let me know what am I missing?
Thank you so much! This is a really helpful tutorial. Very good!! ❤
Excelente video, Muchas gracias
thank you for an amazing and detailed video.
Freaking amazing video man! Just an advice do the ones that are starting on python... I couldn't set the cred.py file, nor install the package, so i just created the variable with username and password. It's not the best practice to do, but it worked properly, so let the future me worry about secury stuff lol.
Doesn't let me disable security defaults, a permission related message prompts
That means you probably don't have admin right
Thank you. Great content and now I see how to connect Python to a power bi dataset.
I wonder if you can query a power bi dataset as if it is a database?
I have tried, unfortunately, that's not possible currently. Perhaps one day Microsoft will release such API.
thanks this is helpful. is there a way get query a power bi dataset using this python script?
Is there any additional costs when running requests to API when using pro account?
Currently there is no cost using the API.
Hi!! Can you explain how get the access token with a service principal authentication??
Hi man,
awesome this is.
how can we refresh this access token automatically hereafter?
Nice keep rocking …
We need to buy azure embedded licenses for this ..?
Nope.
can I have the same implementation code with java
Thank you so much the azure kept returning error 401 and what was missing was turning the azure active directory security off
Hey,
Can I use the api without pbi pro?
Unfortunately no. Power BI rest API is mostly used to manage power BI online functions.
Hey,
If i don't own pbi pro, and my co worker is creating the app our team use, can i use his app client id and secret with my user, in my code, in order to fetch data from the api? will i'll be able to create access token?
I am not sure. You can give it a try.
Wonderful video its work to me, but at the same in my side *Disable Default Security* option not necessary to me just apply ** is enough to me and its work...!, once again thank you so much...
Is there any PowerBI rest API, to read data from a visual?
Can you be more specific?
For companies who use Power BI via an Office 365 licence, I assume the setting changes made in Azure would need to come via the IT department?
Hello, when I check the reponse to the access token, I see that the scope returned in my access token is 00000002-0000-0000-c000-000000000000, and not the actual scopes defined in the app.
Do you have any idea why ?
Thanks a lot !!
Hard to tell. But most likely it when you set up the Azure app, one of the option is not set correctly.
@@JJPowerBI Thank you for your response. The username and password you used are admin credentials ? I am trying to connect without using a user credentials...
Hey :)
Thanks for the detailed video!!
When trying to register application I get this error:
Error when registering application: ERROR: Request returned Forbidden and graph API request id: {id}
Do you know what can be the problem?
thanks!
This is has to do with permission issue that that you will need to reach out to your admin to grant you permission.
@@JJPowerBI thanks for the answer !
Hi, thank you for perfect and detailed video.
Maybe you can help me with one issue. I fail to authenticate using username and password (I get an "The access policy does not allow token issuance." - which should mean that I need to use MFA - company policy that cannot be avoided). When I use Confidential client then i can get a Access token, but it gets refused by the http call (401 error).
Any idea how can I perform a MFA authentication and get a functional token, please? Thanks a lot for your answer.
Hello,
I am facing the same problem you mentioned. Could you explain to me how you managed to solve it? I would greatly appreciate your help.
I am trying with MSAL ConfidentialClientApplication, I am getting the token correctly, but the last part is not working for me...
Do I need to change the way I build my endpoint?
Or How I know which is my endpoint?
Hope you could solve my doubt c:
I have the same issue, did you solve it?
hello bro, i dont know what happened, "ValueError: Public Client should not possess credentials"
There is a typo somewhere in your code.
HI Sir, while running response = client.acquire_token_by_username_password(username=username, password=password, scopes= scopes) I am getting below error: 'WsTrust server returned error in RSTR: {'reason': 'Authentication failed', 'code': 'wst:FailedAuthentication'}'
any idea how can we resolve this?
I would probably Google the error.
i am getting 404 error while accessing the data
404 error is usually due to address is not found. Maybe sure your app is set up correctly.
enable security defaults is by default in my case still getting error. please help.
getting an error
'error': 'invalid_grant', 'error_description': "AADSTS65001: The user or administrator has not consented to use the application.
At 5:45 see the option "Grant admin consent for ...." click on that and grant it.
@@AntrikshSharma Thanks much man. The domain name isn't verified that's why I was not getting an option to grant. I did it by visiting admin.microsoft.com and it's working now.
Hi, I'm on Step 1: Generating Access Token and get this error:
ImportError: cannot import name 'username' from 'cred' (C:\Users\talha.farooq\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\cred\__init__.py)
I have installed cred module
Could you please let me know what am I missing?
Create a file called cred.py. Inside cred.py, create two variables "username" and "password".
@@JJPowerBI What are the values of this username and password? are they blank variables or should we send any credentials to it?
--- 7:57 without sharing your username or password, can you show us the 'cred' script? ---11JUN23
Basically just defining two variables. For example,
username = 'xyz'
password = 'abc'