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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply

Develop a custom connector MEZ file with AUTH or No Auth setup

We are developing a custom connector to read a JSON file from a local location and send it to Power BI. But we are facing an issue with creating a MEZ file. Below I have added the code for the pq file, the same code runs as a blank query in Power BI.  How to set up a mez file for the below code with or without authentication? The Mez file fails if "None" is set at authentication. Create a auth setup or no auth to directly load the data we see via blank query. 

Mohanasudharsan_0-1684499891768.png

 

Attached is the result of the blank query for the same m query.

Mohanasudharsan_1-1684500295315.png

 

 

section PQExtension1;
filePath = "C:\\Users\\ADMIN\\Documents\\navigation2.json";
[DataSource.Kind="PQExtension1", Publish="PQExtension1.Publish"]
shared PQExtension1.Contents = (optional message as text) =>
let
// Read the JSON file
jsonData = Json.Document(File.Contents(filePath)),

// Extract the cube values
cube = jsonData[cube],

// Extract the dimension values
dimension = jsonData[dimension],

// Convert dimension values to a table
dimensionTable = Table.FromColumns(Record.FieldValues(dimension), Record.FieldNames(dimension)),

// Expand the cube values
cubeTable = Table.FromList(cube, Splitter.SplitByNothing(), null, null, ExtraValues.Error),

// Create a new column for each dimension
finalTable = Table.AddColumn(cubeTable, "Dimensions", each dimensionTable)
in
finalTable;

// Data Source Kind description
PQExtension1 = [
Authentication = [
Key = [],
UsernamePassword = [],
Windows = [],
Implicit = [],
None = []
],
Label = Extension.LoadString("DataSourceLabel")
];

// Data Source UI publishing description
PQExtension1.Publish = [
Beta = true,
Category = "Other",
ButtonText = { Extension.LoadString("ButtonTitle"), Extension.LoadString("ButtonHelp") },
LearnMoreUrl = "https://powerbi.microsoft.com/",
SourceImage = PQExtension1.Icons,
SourceTypeImage = PQExtension1.Icons
];

PQExtension1.Icons = [
Icon16 = { Extension.Contents("PQExtension116.png"), Extension.Contents("PQExtension120.png"), Extension.Contents("PQExtension124.png"), Extension.Contents("PQExtension132.png") },
Icon32 = { Extension.Contents("PQExtension132.png"), Extension.Contents("PQExtension140.png"), Extension.Contents("PQExtension148.png"), Extension.Contents("PQExtension164.png") }
];

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @Mohanasudharsan ,

To use a non-certified custom connector:

  1. Put the connector .pq, .pqx, .m, or .mez file in your local [Documents]\Power BI Desktop\Custom Connectors folder. If the folder doesn't exist, create it.

  2. To adjust the data extension security settings, in Power BI Desktop, select File > Options and settings > Options > Security.

  3. Under Data Extensions, select (Not Recommended) Allow any extension to load without validation or warning.

  4. Select OK, and then restart Power BI Desktop.

vyanjiangmsft_2-1684919672432.png

Reference: Connector extensibility in Power BI - Power BI | Microsoft Learn

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best regards,

Community Support Team_yanjiang

View solution in original post

1 REPLY 1
v-yanjiang-msft
Community Support
Community Support

Hi @Mohanasudharsan ,

To use a non-certified custom connector:

  1. Put the connector .pq, .pqx, .m, or .mez file in your local [Documents]\Power BI Desktop\Custom Connectors folder. If the folder doesn't exist, create it.

  2. To adjust the data extension security settings, in Power BI Desktop, select File > Options and settings > Options > Security.

  3. Under Data Extensions, select (Not Recommended) Allow any extension to load without validation or warning.

  4. Select OK, and then restart Power BI Desktop.

vyanjiangmsft_2-1684919672432.png

Reference: Connector extensibility in Power BI - Power BI | Microsoft Learn

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best regards,

Community Support Team_yanjiang

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors