Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Tanito1
Regular Visitor

Power BI Service Custom Connector with Native Queries

Hello experts,

I have installed a custom connector on an on-premises gateway. Within the connector, I am using Value.NativeQuery (with query folding enabled).
However, when setting up the connection in the Power BI service, I get an error. The gateway log contains the following message: Microsoft.PowerBI.DataMovement.Pipeline.Diagnostics.MashupDataAccessPermissionException: The evaluation requires a permission that has not been provided. Data source kind: ‘...’. Data source path: ‘...’. Permission kind: ‘NativeQuery’.
Do you know what else I need to set up so that I can use the connector?

The custom connector works in Power BI Desktop, so native queries can be executed in principle.

Do you have any idea what I'm doing wrong?

Thank you very much.

1 ACCEPTED SOLUTION
Harsh_Insights
Frequent Visitor

Hi @Tanito1 

 

 

1. Ensure the custom connector supports native query approval
In your connector’s pq or m code, the Value.NativeQuery call triggers a permission check. In Desktop, you click “Run” when it asks to approve a native query. In the service, you must define that the connector can handle it without UI approval. This is done by:

  • Specifying SupportsNativeQuery = true in the connector metadata.
  • Implementing the OnNativeQuery handler if required by your connector design.

If your connector is not coded to explicitly declare native query capability, the service will block it.

 

2. Configure the gateway data source permissions
In the Power BI Service:

  • Go to Manage gateways → Your gateway → Add or edit the data source.
  • Make sure the data source kind matches the custom connector’s declared kind exactly.
  • Re-enter credentials and save.

If the connector requires native query execution, you must reauthenticate it here. The service then stores the equivalent of the “approve native query” setting that Desktop uses locally.

 

3. Test the same source without native query
To confirm that the issue is indeed native query permission, try calling the same source using Table.SelectRows or other folding-friendly queries without Value.NativeQuery. If it works, then the only missing piece is the native query permission setting.

 

4. Deploy the connector to the gateway correctly
Custom connectors must be placed in the correct folder on the gateway server:

C:\Users\<GatewayServiceAccount>\Documents\Power BI Desktop\Custom Connectors

The gateway service account must have permission to read the .mez file.
After placing the file, restart the gateway service.

 

5. Sign-in match between Desktop and Service
Sometimes the native query permission in Desktop is tied to your local credentials. Make sure the credentials configured in the Service for the gateway match the exact authentication type and user account you tested with in Desktop.

 

View solution in original post

1 REPLY 1
Harsh_Insights
Frequent Visitor

Hi @Tanito1 

 

 

1. Ensure the custom connector supports native query approval
In your connector’s pq or m code, the Value.NativeQuery call triggers a permission check. In Desktop, you click “Run” when it asks to approve a native query. In the service, you must define that the connector can handle it without UI approval. This is done by:

  • Specifying SupportsNativeQuery = true in the connector metadata.
  • Implementing the OnNativeQuery handler if required by your connector design.

If your connector is not coded to explicitly declare native query capability, the service will block it.

 

2. Configure the gateway data source permissions
In the Power BI Service:

  • Go to Manage gateways → Your gateway → Add or edit the data source.
  • Make sure the data source kind matches the custom connector’s declared kind exactly.
  • Re-enter credentials and save.

If the connector requires native query execution, you must reauthenticate it here. The service then stores the equivalent of the “approve native query” setting that Desktop uses locally.

 

3. Test the same source without native query
To confirm that the issue is indeed native query permission, try calling the same source using Table.SelectRows or other folding-friendly queries without Value.NativeQuery. If it works, then the only missing piece is the native query permission setting.

 

4. Deploy the connector to the gateway correctly
Custom connectors must be placed in the correct folder on the gateway server:

C:\Users\<GatewayServiceAccount>\Documents\Power BI Desktop\Custom Connectors

The gateway service account must have permission to read the .mez file.
After placing the file, restart the gateway service.

 

5. Sign-in match between Desktop and Service
Sometimes the native query permission in Desktop is tied to your local credentials. Make sure the credentials configured in the Service for the gateway match the exact authentication type and user account you tested with in Desktop.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (2,851)