Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hello,
I am trying to connect GitHub private repository with Power BI desktop. When I try to pass the Web API key, then I am getting below error.
That API Key is generated from GitHub personal access tokens
Using same key I can generate JSON file from Postman, it's working fine.
Can any one help me on this to connect GitHub private repository with Power BI desktop
Thanks in advance
Solved! Go to Solution.
Hi @LDevi2017
You can try the following solutions.
1.Connect Power BI to Private GitHub Repo — Smoother Consulting
Put your useraccount of the github to the username, then put the API key to the password.
2.You can try the following code.
let
apiUrl = "my_api_url",
token="my_api_key",
options = [Headers=[#"Authorization"="Bearer " & token ]],
result = Json.Document(Web.Contents(apiUrl , options))
in
#"result"
You can also refer to the following link.
Solved: A web API key can only be specified when a web API... - Microsoft Fabric Community
rest - A web API key can only be specified when a web API key name is provided - Stack Overflow
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @LDevi2017 ,
Thanks for your quick reply, you can try to refresh the datasource,
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This might be a bit late, but you can connect as follows (for example to retrieve repos in an org - I tend to use RelativePath as that allows for looping through different orgs too and doesn't cause the dynamic data source issues):
let
Source = Json.Document(Web.Contents("https://api.github.com/", [
RelativePath = "orgs/<org>/repos"]))
in Source
You don't need to add the header in as suggested below.
However, if your PAT does not work:
- Use Git Bash to generate a token instead by logging in via git bash into Github using command: gh auth login and follow the prompts to authenticate via Git Bash with Github. Once logged in into Github use command gh auth token. This will generate a token starting with gho_ or similar.
- For authentication in PowerBI, use Basic authentication. your username is your github username and your password is the token you generated above. Set the Privacy level as applicable, e.g. to Organizational if you're connecting to an Organisation.
Providing you have the right levels of access in Github (read:repos, etc), you can now see all public, private and internal info. It also means you don't have your token pasted as a string in your power query.
I tend to use this method and that seems to work fine.
I have connected using web option and selected basic user name as API Key
But after entered into power query result as below
Actually JSON file need to load from this link. Can we able to convert this to table.
Can I get any help
Hi @LDevi2017
You can try the following solutions.
1.Connect Power BI to Private GitHub Repo — Smoother Consulting
Put your useraccount of the github to the username, then put the API key to the password.
2.You can try the following code.
let
apiUrl = "my_api_url",
token="my_api_key",
options = [Headers=[#"Authorization"="Bearer " & token ]],
result = Json.Document(Web.Contents(apiUrl , options))
in
#"result"
You can also refer to the following link.
Solved: A web API key can only be specified when a web API... - Microsoft Fabric Community
rest - A web API key can only be specified when a web API key name is provided - Stack Overflow
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for your reply.
When I try to connect with Power BI desktop, till the repo it's reading.
i.e https://api.github.com/repos/owner/repo
But it's not reading till joson file and I can see blank result.
Can you suggest me where I can check it exactly.
Hi @LDevi2017 ,
Thanks for your quick reply, you can try to refresh the datasource,
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Yolo Zhu,
I got the result on power query on yesterday once and again it shows blank result.
Can you suggest me what would be the reason and how can we solve.
Thanks,
Lakshmi
Hi Yolo Zhu,
Thank you very much. It's working perfectly.
Thanks,
Lakshmi
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
23 | |
11 | |
10 | |
10 | |
9 |