<?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 Issue while creating data source under Data Gateway using powershell in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Issue-while-creating-data-source-under-Data-Gateway-using/m-p/3103824#M41459</link>
    <description>&lt;P&gt;I am using powershell for .pbix to deployment in workspaces. As part of that i need to create SQL datasource under gateway for further use. I am using powerbI rest API with service principle :&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/create-datasource" target="_blank" rel="nofollow noopener noreferrer"&gt;https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/create-datasource&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is link for sample we can use in powershell:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Power-BI-REST-API-via-Powershell-Create-Datasource/m-p/511934" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.powerbi.com/t5/Developer/Power-BI-REST-API-via-Powershell-Create-Datasource/m-p/511934&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I hope someone can help me here. Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;API I am seding request:&lt;/STRONG&gt;&lt;BR /&gt;POST &lt;A href="https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Request message Body:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
"connectionDetails": "{\"server\":\"MyServer\",\"database\":\"MyDatabase\"}",
"datasourceName": "Test_dateasource",
"dataSourceType": "Sql",
"credentialDetails": {
"credentialType": "Basic",
"encryptedConnection": "Encrypted",
"encryptionAlgorithm": "RSA-OAEP",
"privacyLevel": "Organizational",
"credentials": "W3....=="
}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Response from API:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "error": {
    "code": "DM_GWPipeline_UnknownError",
    "pbi.error": {
      "code": "DM_GWPipeline_UnknownError",
      "parameters": {},
      "details": [
        {
          "code": "DM_ErrorDetailNameCode_UnderlyingErrorMessage",
          "detail": {
            "type": 1,
            "value": "The parameter is incorrect.\r\n"
          }
        },
        {
          "code": "DM_ErrorDetailNameCode_UnderlyingHResult",
          "detail": {
            "type": 1,
            "value": "-2146893785"
          }
        }
      ],
      "exceptionCulprit": 1
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2023 14:30:13 GMT</pubDate>
    <dc:creator>riyajshaikh09</dc:creator>
    <dc:date>2023-02-28T14:30:13Z</dc:date>
    <item>
      <title>Issue while creating data source under Data Gateway using powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Issue-while-creating-data-source-under-Data-Gateway-using/m-p/3103824#M41459</link>
      <description>&lt;P&gt;I am using powershell for .pbix to deployment in workspaces. As part of that i need to create SQL datasource under gateway for further use. I am using powerbI rest API with service principle :&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/create-datasource" target="_blank" rel="nofollow noopener noreferrer"&gt;https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/create-datasource&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is link for sample we can use in powershell:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Power-BI-REST-API-via-Powershell-Create-Datasource/m-p/511934" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.powerbi.com/t5/Developer/Power-BI-REST-API-via-Powershell-Create-Datasource/m-p/511934&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I hope someone can help me here. Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;API I am seding request:&lt;/STRONG&gt;&lt;BR /&gt;POST &lt;A href="https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Request message Body:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
"connectionDetails": "{\"server\":\"MyServer\",\"database\":\"MyDatabase\"}",
"datasourceName": "Test_dateasource",
"dataSourceType": "Sql",
"credentialDetails": {
"credentialType": "Basic",
"encryptedConnection": "Encrypted",
"encryptionAlgorithm": "RSA-OAEP",
"privacyLevel": "Organizational",
"credentials": "W3....=="
}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Response from API:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "error": {
    "code": "DM_GWPipeline_UnknownError",
    "pbi.error": {
      "code": "DM_GWPipeline_UnknownError",
      "parameters": {},
      "details": [
        {
          "code": "DM_ErrorDetailNameCode_UnderlyingErrorMessage",
          "detail": {
            "type": 1,
            "value": "The parameter is incorrect.\r\n"
          }
        },
        {
          "code": "DM_ErrorDetailNameCode_UnderlyingHResult",
          "detail": {
            "type": 1,
            "value": "-2146893785"
          }
        }
      ],
      "exceptionCulprit": 1
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 14:30:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Issue-while-creating-data-source-under-Data-Gateway-using/m-p/3103824#M41459</guid>
      <dc:creator>riyajshaikh09</dc:creator>
      <dc:date>2023-02-28T14:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while creating data source under Data Gateway using powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Issue-while-creating-data-source-under-Data-Gateway-using/m-p/3112886#M41561</link>
      <description>&lt;P&gt;Assuming you have a Pro license you can consider raising a Pro ticket at &lt;A href="https://powerbi.microsoft.com/en-us/support/pro/" target="_blank"&gt;https://powerbi.microsoft.com/en-us/support/pro/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 02:34:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Issue-while-creating-data-source-under-Data-Gateway-using/m-p/3112886#M41561</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-03-06T02:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while creating data source under Data Gateway using powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Issue-while-creating-data-source-under-Data-Gateway-using/m-p/3127663#M41703</link>
      <description>&lt;P&gt;I've got the same problem.&amp;nbsp;&lt;BR /&gt;Just gonna keep an eye here, in case you figure it out.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 10:41:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Issue-while-creating-data-source-under-Data-Gateway-using/m-p/3127663#M41703</guid>
      <dc:creator>PierreHusted</dc:creator>
      <dc:date>2023-03-13T10:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while creating data source under Data Gateway using powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Issue-while-creating-data-source-under-Data-Gateway-using/m-p/3130871#M41717</link>
      <description>&lt;P&gt;I am able to solve this problem, In my case credential encryption was not correct. using owershell i was not able to encrypt credentials correctly.&lt;BR /&gt;To solve this i used C# code from below sample to encrypt credentials. So I created C# console application and use that .exe to encrypt credentials.&lt;BR /&gt;&lt;A href="https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/.NET%20Core/EncryptCredentials" target="_blank"&gt;https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/.NET%20Core/EncryptCredentials&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 13:36:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Issue-while-creating-data-source-under-Data-Gateway-using/m-p/3130871#M41717</guid>
      <dc:creator>riyajshaikh09</dc:creator>
      <dc:date>2023-03-14T13:36:51Z</dc:date>
    </item>
  </channel>
</rss>

