<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to enter SQL server credentials via API? in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/How-to-enter-SQL-server-credentials-via-API/m-p/2683456#M37736</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/420414"&gt;@robzib&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first step is to add the gateway connection information. But,&amp;nbsp;&lt;SPAN&gt;to encrypt credentials, see&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/configure-credentials" data-linktype="absolute-path" target="_blank"&gt;Configure credentials programmatically&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;for Power BI and review the EncryptCredentials&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/.NET%20Core/EncryptCredentials" data-linktype="external" target="_blank"&gt;.NET Core&lt;/A&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/Java/EncryptCredentials" data-linktype="external" target="_blank"&gt;Java&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/Python/Encrypt%20credentials" data-linktype="external" target="_blank"&gt;Python&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;examples.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;POST https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/create-datasource" target="_blank"&gt;Gateways - Create Datasource - REST API (Power BI Power BI REST APIs) | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Part 2, get the newly added datasource from the result of step 1.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/datasources&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/get-datasources-in-group#sql-example" target="_blank"&gt;Datasets - Get Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Part 3, get the connection information from part 2 and use&amp;nbsp;Update Datasources In Group.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/datasources&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/get-datasources-in-group#sql-example" target="_blank"&gt;Datasets - Get Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Aug 2022 07:07:49 GMT</pubDate>
    <dc:creator>v-chenwuz-msft</dc:creator>
    <dc:date>2022-08-05T07:07:49Z</dc:date>
    <item>
      <title>How to enter SQL server credentials via API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-enter-SQL-server-credentials-via-API/m-p/2675734#M37680</link>
      <description>&lt;P&gt;I have workspace1 with one report and one dataset that's targeting db1. I managed to create workspace2 with api, moved single report and dataset from workspace1 to workspace2 and I've also updated data source to target db2 with UpdateDatasourcesInGroup endpoint. They are both on the same server.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to enter server credentials without me going to PowerBI and manually entering it? I see that it used to be possible via connection string property but it's now obsolete.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: Just to be clear I need to set username and password to my SQL instance&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 06:44:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-enter-SQL-server-credentials-via-API/m-p/2675734#M37680</guid>
      <dc:creator>robzib</dc:creator>
      <dc:date>2022-08-03T06:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to enter SQL server credentials via API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-enter-SQL-server-credentials-via-API/m-p/2683456#M37736</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/420414"&gt;@robzib&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first step is to add the gateway connection information. But,&amp;nbsp;&lt;SPAN&gt;to encrypt credentials, see&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/configure-credentials" data-linktype="absolute-path" target="_blank"&gt;Configure credentials programmatically&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;for Power BI and review the EncryptCredentials&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/.NET%20Core/EncryptCredentials" data-linktype="external" target="_blank"&gt;.NET Core&lt;/A&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/Java/EncryptCredentials" data-linktype="external" target="_blank"&gt;Java&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/Python/Encrypt%20credentials" data-linktype="external" target="_blank"&gt;Python&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;examples.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;POST https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/create-datasource" target="_blank"&gt;Gateways - Create Datasource - REST API (Power BI Power BI REST APIs) | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Part 2, get the newly added datasource from the result of step 1.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/datasources&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/get-datasources-in-group#sql-example" target="_blank"&gt;Datasets - Get Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Part 3, get the connection information from part 2 and use&amp;nbsp;Update Datasources In Group.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/datasources&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/get-datasources-in-group#sql-example" target="_blank"&gt;Datasets - Get Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 07:07:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-enter-SQL-server-credentials-via-API/m-p/2683456#M37736</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-08-05T07:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to enter SQL server credentials via API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-enter-SQL-server-credentials-via-API/m-p/2709785#M37970</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/320777"&gt;@v-chenwuz-msft&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for your reply. I forgot to mention that my databases are in Azure. From what I understand, gateways are used when we have on-premise databases, or can we use them as well with Azure?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 12:12:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-enter-SQL-server-credentials-via-API/m-p/2709785#M37970</guid>
      <dc:creator>robzib</dc:creator>
      <dc:date>2022-08-18T12:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to enter SQL server credentials via API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-enter-SQL-server-credentials-via-API/m-p/2711324#M37987</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/420414"&gt;@robzib&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, you can use them with Azure's Vnet gateway and do not need to install the gateway on the Azure VM.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/data-integration/vnet/data-gateway-architecture" target="_blank"&gt;Virtual network (VNet) data gateway architecture | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/data-integration/vnet/use-data-gateways-sources-power-bi" target="_blank"&gt;Use virtual network (VNet) data gateway and data sources in Power BI | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are using Azure SQL database, then you don't need a gateway. Please refer to the following post for the same issue.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Gateway-for-Azure-SQL-Server/m-p/2423201" target="_blank"&gt;Solved: Re: Gateway for Azure SQL Server - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 02:25:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-enter-SQL-server-credentials-via-API/m-p/2711324#M37987</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-08-19T02:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to enter SQL server credentials via API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-enter-SQL-server-credentials-via-API/m-p/2717937#M38090</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/320777" target="_blank" rel="noopener"&gt;@v-chenwuz-msft&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;so I've decided to test gateways and see if I can make them work with the help of your links, and I'm stuck at Add data source step. I think the issue is connection details because I'm getting Bad request every time. Parameters that I'm sending are:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Data Source Type: "SQL"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Connection details: "{"server":"dell0\\dbi","database":"dbi6452"}"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Credential type: "Basic credentials"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm trying to do that from EncryptCredentials.sln example you attached. Google returned a couple of threads with same issues and I can't find a working example. I'm also not sure in what format should connection details be, this is copy and paste from app.powerbi when I do it via GUI over there.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, gateway needs to be installed with service principal account or else I can't see it with Rest API, but I managed to get some instructions online about that so that part works now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help is appreciated.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 17:29:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-enter-SQL-server-credentials-via-API/m-p/2717937#M38090</guid>
      <dc:creator>robzib</dc:creator>
      <dc:date>2022-08-22T17:29:58Z</dc:date>
    </item>
  </channel>
</rss>

