Forum Discussion
Custom Connector Unable to Refresh
I've created an OAuth custom connector which uses Azure AD to authenticate against our backend service deployed in Azure. It accepts a host URL such that customers who use it are able to use their own deployment of this backend service. My question is two fold:
1. Is there a way to parameterize the connection itself such that customers can enter the details for their own app registration without having to compile a new custom connector to a .mez file? In an ideal scenario they would just publish the .pbix we give them after entering their client id, secret, tenant id, etc. and signing their user in.
2. For now I've hardcoded these details for our own app registration and our CustomConnector.Contents function accepts a host URL for the deployed web service as I mentioned. Try as I might, the data refresh works in PBI desktop but not in the web service. I had read that an on-prem gateway was only necessary for on-prem resources not cloud resources accessed via Web.Contents. Nevertheless, my TestConnection function fails while my test query that does the same thing works fine. Any ideas?
2 Replies
- v-yueyunzh-msftCommunity Support
Hi , Anonymous
For your two questions, here are my thoughts
I think you can try the M query parameter function in Power Query to define these variables that you need customer input, and then create a connection to your Azure AD backend by customizing M query, we can't support this part, you can briefly refer to this official documentation:
Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
As far as I know, for datasets connected to local resources, the difference between data refresh on PBI service is the additional step of the gateway, if the refresh on desktop is successful but the service refresh fails, you need to first view the detailed error information of the gateway log at the corresponding point in time, you can view this document specifically:
Troubleshoot gateways - Power BI | Microsoft Learn
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- AnonymousNot applicable
Hey Aniya,
Thank you for the reply. I'm sort of confused on both of the things you mentioned.
Firstly these parameters are not part of the data fetching i.e. query. I don't want customers to supply arguments to our HTTP endpoint. I simply want them to access the endpoint as is but in order to do so they need to authenticate via OAuth. I basically want to add more fields where the user would see their "Sign In" button in the dialog for the connector. So to clarify this is a connection parameter I want to create, not a usage parameter that is referenced in the query after authenticating. The point would be to prevent users from having to create and compile their own custom connectors.
As for the gateway, I've tried taking a look at it but I can't sign in. My TestConnection function doesn't work despite all it does is call the CustomConnector.Contents function which works fine in my test query. And lastly I'm not even sure why I need it because I'm not even connecting to an on-prem resource like Oracle or MySQL, etc. I'm connecting to a public HTTP endpoint deployed in Azure which is accessible to the authenticated user signed in with our custom connector, i.e. it's a Web.Contents call with a bearer token. I can't really fathom the need for a custom to keep their computer running 24/7 for data refreshes to work just to serve a .mez file in any case. There should be a way to export the .pbix file embedding the .mez file inside of it when you publish.