diff --git a/sql-odbc/docs/test/power_bi_manual_test_plan.xlsx b/sql-odbc/docs/test/power_bi_manual_test_plan.xlsx new file mode 100644 index 0000000000..a1948253cb Binary files /dev/null and b/sql-odbc/docs/test/power_bi_manual_test_plan.xlsx differ diff --git a/sql-odbc/docs/user/img/pbi_service_cluster_setting.png b/sql-odbc/docs/user/img/pbi_service_cluster_setting.png index 210f4c37ba..8c6f46f5b8 100644 Binary files a/sql-odbc/docs/user/img/pbi_service_cluster_setting.png and b/sql-odbc/docs/user/img/pbi_service_cluster_setting.png differ diff --git a/sql-odbc/docs/user/power_bi_support.md b/sql-odbc/docs/user/power_bi_support.md index 9247cd0fd1..e155561518 100644 --- a/sql-odbc/docs/user/power_bi_support.md +++ b/sql-odbc/docs/user/power_bi_support.md @@ -5,6 +5,7 @@ * [Open Distro for Elasticsearch](https://opendistro.github.io/for-elasticsearch-docs/docs/install/) * [Open Distro for Elasticsearch SQL ODBC driver](https://opendistro.github.io/for-elasticsearch-docs/docs/sql/odbc/) * [OdfeSqlOdbcPBIConnector.mez](../../src/PowerBIConnector/bin/Release/) +* Optional: [odfesqlodbc_import.pbids](../../src/PowerBIConnector/PBIDSExamples) to help with repeated connections to the same server ## Setup * Copy `OdfeSqlOdbcPBIConnector.mez` file in the `\Documents\Power BI Desktop\Custom Connectors\` folder. This will let Power BI access custom connector. @@ -51,6 +52,38 @@ +## Using .PBIDS Files + +More info: https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-data-sources#using-pbids-files-to-get-data + +Example PBIDS file for Open Distro for Elasticsearch: (available here: [odfesqlodbc_import.pbids](../../src/PowerBIConnector/PBIDSExamples/odfesqlodbc_import.pbids)) +```json +{ + "version": "0.1", + "connections": [ + { + "details": { + "protocol": "odfesqlodbc", + "address": { + "server": "localhost:9200" + } + }, + "mode": "Import" + } + ] +} +``` + +The only part you should change is the `server` attribute, to point to the location of your ODFE server. +* For AWS connections, this will be the full path of your ODFE instance (ex: `https://aws-odfe-instance.us-west-1.com`). +* Otherwise, this will be the `host:port` combination for your instance (ex: `localhost:9200`). + +Save this as a `.pbids` file. Double-click on it to open up your connection in Power BI Desktop. +It will take you straight to the **Navigator** window for selecting the tables from the ODFE server. +* If this is the first time you are connecting to this instance, you will be prompted for your credentials. + + + ## Troubleshooting * If you get an following error, please install [Open Distro For Elasticsearch SQL ODBC Driver](https://opendistro.github.io/for-elasticsearch-docs/docs/sql/odbc/). diff --git a/sql-odbc/src/PowerBIConnector/OdfeSqlOdbcPBIConnector.pq b/sql-odbc/src/PowerBIConnector/OdfeSqlOdbcPBIConnector.pq index b8612f4bc2..e5659bf21f 100644 --- a/sql-odbc/src/PowerBIConnector/OdfeSqlOdbcPBIConnector.pq +++ b/sql-odbc/src/PowerBIConnector/OdfeSqlOdbcPBIConnector.pq @@ -151,7 +151,7 @@ OnOdbcError = (errorRecord as record) => if IsDriverNotInstalled then error Error.Record("", "The Open Distro For Elasticsearch SQL ODBC driver is not installed. Please install the driver") else if IsHostUnreachable then - error Error.Record("", "Couldn't reach server. Please double-check the server and auth. " & ConnectionServer) + error Error.Record("", "Couldn't reach server. Please double-check the server and auth. [" & ConnectionServer & "]") else error errorRecord; @@ -179,6 +179,19 @@ OdfeSqlOdbcPBIConnector = [ ] ], + // PBIDS Handler + DSRHandlers = [ + #"odfesqlodbc" = [ + GetDSR = (server, schema, object, optional options) => [ protocol = "odfesqlodbc", address = [ server = server ] ], + GetFormula = (dsr, optional options) => () => + let + db = OdfeSqlOdbcPBIConnector.Contents(dsr[address][server]) + in + db, + GetFriendlyName = (dsr) => "ODFE SQL ODBC" + ] + ], + // Enable Encryption SupportsEncryption = true, diff --git a/sql-odbc/src/PowerBIConnector/PBIDSExamples/odfesqlodbc_import.pbids b/sql-odbc/src/PowerBIConnector/PBIDSExamples/odfesqlodbc_import.pbids new file mode 100644 index 0000000000..f567a76409 --- /dev/null +++ b/sql-odbc/src/PowerBIConnector/PBIDSExamples/odfesqlodbc_import.pbids @@ -0,0 +1,14 @@ +{ + "version": "0.1", + "connections": [ + { + "details": { + "protocol": "odfesqlodbc", + "address": { + "server": "localhost:9200" + } + }, + "mode": "Import" + } + ] +} \ No newline at end of file diff --git a/sql-odbc/src/PowerBIConnector/bin/Release/OdfeSqlOdbcPBIConnector.mez b/sql-odbc/src/PowerBIConnector/bin/Release/OdfeSqlOdbcPBIConnector.mez index f7e2295ee7..8354aeb7d4 100644 Binary files a/sql-odbc/src/PowerBIConnector/bin/Release/OdfeSqlOdbcPBIConnector.mez and b/sql-odbc/src/PowerBIConnector/bin/Release/OdfeSqlOdbcPBIConnector.mez differ