Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
this is my custom connector:
// GitHub Connector for Power BI (Standard GitHub OAuth)
[Version = "1.0.0"]
section GitHub;
client_id = "Ov23liq0YCxxxxxxxF4lEFP";
client_secret = "78c93c2a275e97c4b21xxxxxxx2195a279e94";
[DataSource.Kind="GitHub", Publish="GitHub.Publish"]
shared GitHub.Contents = (relativePath as text, optional folderPath as text) =>
let
baseUrl = "https://api.github.com/repos/xxx/",
url = baseUrl & relativePath & "/contents/" & folderPath,
source = Json.Document(Web.Contents(url, [
Headers = [
#"Authorization" = "Bearer " & Extension.CurrentCredential()[access_token],
#"User-Agent" = "PowerQuery"
]
]))
in
source;
GitHub = [
Authentication = [
OAuth = [
StartLogin = (resourceUrl, state, display) =>
let
authorizeUrl = "https://github.com/login/oauth/authorize?" &
"client_id=" & client_id &
"&redirect_uri=https://oauth.powerbi.com/views/oauthredirect.html" &
"&scope=repo" &
"&state=" & state
in
[
LoginUri = authorizeUrl,
CallbackUri = "https://oauth.powerbi.com/views/oauthredirect.html",
WindowHeight = 720,
WindowWidth = 1024,
Context = null
],
FinishLogin = (context, callbackUri, state) =>
let
parts = Uri.Parts(callbackUri)[Query],
code = parts[code],
access_token_response = Json.Document(Web.Contents("https://github.com/login/oauth/access_token", [
Content = Text.ToBinary("client_id=" & client_id & "&client_secret=" & client_secret & "&code=" & code),
Headers = [
#"Content-Type" = "application/x-www-form-urlencoded",
Accept = "application/json"
]
])),
access_token = access_token_response[access_token]
in
[
access_token = access_token
],
Refresh = (resourceUrl, refresh_token) => error "GitHub does not support refresh tokens.",
TestConnection = (access_token_record) => {"https://api.github.com/user"},
AccessToken = (access_token_record) => "Bearer " & access_token_record[access_token]
]
]
];
GitHub.Publish = [
Beta = true,
Category = "Other",
ButtonText = { Extension.LoadString("ButtonTitle"), Extension.LoadString("ButtonHelp") },
LearnMoreUrl = "https://powerbi.microsoft.com/",
SourceImage = GitHub.Icons,
SourceTypeImage = GitHub.Icons
];
GitHub.Icons = [
Icon16 = { Extension.Contents("GitHub16.png"), Extension.Contents("GitHub20.png"), Extension.Contents("GitHub24.png"), Extension.Contents("GitHub32.png") },
Icon32 = { Extension.Contents("GitHub32.png"), Extension.Contents("GitHub40.png"), Extension.Contents("GitHub48.png"), Extension.Contents("GitHub64.png") }
];
in service i got:
It means i have to have on promises gateway always?
It is just web contents inside connector it should work withour gateway?
Best,
Jacek
Solved! Go to Solution.
It means i have to have on promises gateway always?
not just that, but your .mez must be installed on ALL gateway cluster members, and must be readable by the gateway service account.
Hi @jaryszek ,
When you launch the On-premises data gateway from Start Menu, there’s a section where your custom connectors .mez files are listed. This tab shows whether the gateway has successfully detected them. The page refers to the Connectors tab in the On-premises data gateway app.
If this post helps, please give us Kudos and consider marking it Accept as solution to assist other members in finding it more easily.
Thank you for being a part of Microsoft Fabric Community Forum!
Thanks and Regards.
Chaithra
It means i have to have on promises gateway always?
not just that, but your .mez must be installed on ALL gateway cluster members, and must be readable by the gateway service account.
thanks,
what does it mean ALL gateway cluister members?
and second - how to set up this: must be readable by the gateway service account?
Best Wishes
Your .mez file must be placed in a folder. That folder must be specified in the gateway management app.
If your connector does not appear in the table on this page (after a short delay) then that means the gateway service can't access it.
ALL gateway cluster members means that you should never run a gateway on a single VM. If that VM goes dark then your gateway goes dark. Use multiple VMs for business continuity.
thanks!
To clarify "Your .mez file must be placed in a folder. That folder must be specified in the gateway management app."
So even if i will have custom connector which has function inside which allow to skip gateway like SharePoint.Files still it will required to put mez file into gateway?
Best,
Jacek
unfortunately yes. Doesn't matter if the data source is on-prem or not.
Thanks!
"If your connector does not appear in the table on this page (after a short delay) then that means the gateway service can't access it."
What page? I added cutom connector to windows gateway...