Forum Discussion
How to connect to git lfs file on github?
- Anonymous1 year ago
Hi jaryszek,
Thank you for reaching out to the Microsoft Fabric Forum Community.
If the issue still persists, I’d recommend raising a support ticket with Microsoft. The support team can look into the backend and provide more in-depth assistance tailored to your environment.
https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket
If this solution helped, please consider marking the response as accepted and giving it a thumbs-up so others can benefit as well.Best regards,
Prasanna Kumar
ok so i managed to add new funtion (it has to have the same parameters like in the first one - this is a huge Microsoft bug like always!!!: https://www.youtube.com/watch?v=U9lqXCiGa08 )
[DataSource.Kind="GitHub", Publish="GitHub.Publish"]
shared GitHub.LfsDownloadUrl = (relativePath as text, optional folderPath as text, optional branchName as text) =>
let
sizeNumber = Number.FromText(folderPath),
body = Json.FromValue([
operation = "download",
transfer = {"basic"},
objects = {
[ oid = relativePath, size = sizeNumber ]
}
]),
UrlLfs = "MyCompany" & "/" & branchName & ".git/info/lfs/objects/batch",
result = Json.Document(Web.Contents("https://github.com", [
RelativePath = UrlLfs,
Content = body,
Headers = [
#"Authorization" = "Bearer " & Extension.CurrentCredential()[access_token],
#"Content-Type" = "application/vnd.git-lfs+json",
Accept = "application/vnd.git-lfs+json",
#"User-Agent" = "PowerQuery"
]
])),
url = result[objects]{0}[actions][download][href]
in
url;
and this work, i got fully downaloded link in power querY:
The issue is that i need to add credentials for this file always...why this is not using my GitHub credentials?
Best,
Jacek