<?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: Creating SQL DB via REST API in SQL database</title>
    <link>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315607#M71</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="107418" data-lia-user-login="mikegoatly" class="lia-mention lia-mention-user"&gt;mikegoatly&lt;/a&gt;&amp;nbsp;- Sorry to hear things aren't going smoothly. Either scope will work - we just haven't converted this script to use the Fabric scope yet.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you able to see your other databases in the workspace when you look in $databases?&lt;/P&gt;</description>
    <pubDate>Thu, 05 Dec 2024 16:56:54 GMT</pubDate>
    <dc:creator>dlevy</dc:creator>
    <dc:date>2024-12-05T16:56:54Z</dc:date>
    <item>
      <title>Creating SQL DB via REST API</title>
      <link>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315517#M70</link>
      <description>&lt;P&gt;Hi folks - this documentation suggests that creating a SQL Database in Fabric should be possible using the items REST API:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/fabric/database/sql/deploy-rest-api" target="_blank" rel="noopener"&gt;Deploy a SQL database via REST API - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to use the suggested REST endpoint to create a database, I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
    "requestId": "a1bd0f7b-045d-4e3b-a54a-d9682ad3fe66",
    "errorCode": "UnknownError",
    "message": "An unexpected error occurred while processing the request"
}&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;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;(Note that I had to change the auth scope from&amp;nbsp;&lt;A href="https://analysis.windows.net/powerbi/api" target="_blank" rel="noopener"&gt;https://analysis.windows.net/powerbi/api&lt;/A&gt;&amp;nbsp;to&amp;nbsp;&lt;A href="https://api.fabric.microsoft.com" target="_blank" rel="noopener"&gt;https://api.fabric.microsoft.com&lt;/A&gt;)&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Checking the Fabric Portal, the database doesn't show up there. F&lt;SPAN&gt;or a short while after making this call if I try again using the same database name in the request, I get:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
    "requestId": "2700f348-ec09-495c-98c8-f21a2235463e",
    "errorCode": "ItemDisplayNameAlreadyInUse",
    "message": "Requested 'ApiSqlDb' is already in use"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;So it would seem that the API is kind of doing&amp;nbsp;&lt;EM&gt;something&lt;/EM&gt;, just not getting all the way through to completion&lt;EM&gt;.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Answers to the obvious questions:&lt;/P&gt;&lt;P&gt;1. Have I tried different workspaces: yes&lt;/P&gt;&lt;P&gt;2. Is the SQL Database feature enabled for me in the admin portal: yes&lt;/P&gt;&lt;P&gt;3. Can I create a SQL Database in the workspace through the UI: yes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone managed to get SQL Databases programatically created using this REST call?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 15:49:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315517#M70</guid>
      <dc:creator>mikegoatly</dc:creator>
      <dc:date>2024-12-05T15:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SQL DB via REST API</title>
      <link>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315607#M71</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="107418" data-lia-user-login="mikegoatly" class="lia-mention lia-mention-user"&gt;mikegoatly&lt;/a&gt;&amp;nbsp;- Sorry to hear things aren't going smoothly. Either scope will work - we just haven't converted this script to use the Fabric scope yet.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you able to see your other databases in the workspace when you look in $databases?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 16:56:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315607#M71</guid>
      <dc:creator>dlevy</dc:creator>
      <dc:date>2024-12-05T16:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SQL DB via REST API</title>
      <link>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315618#M72</link>
      <description>&lt;P&gt;Heh, that was an obvious question I didn't check &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The call to&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/" target="_blank"&gt;https://api.fabric.microsoft.com/v1/workspaces/&amp;lt;workspaceid&amp;gt;/items?type=SQLDatabase&lt;/A&gt;&amp;nbsp;does return databases created in the workspace:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
    "value": [
        {
            "id": "REMOVED",
            "type": "SQLDatabase",
            "displayName": "TestDb",
            "description": "",
            "workspaceId": "REMOVED"
        }
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I assume that's what you mean by $databases?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 17:02:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315618#M72</guid>
      <dc:creator>mikegoatly</dc:creator>
      <dc:date>2024-12-05T17:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SQL DB via REST API</title>
      <link>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315626#M73</link>
      <description>&lt;P&gt;That works too! I usually just drop $databases from line 26 into the immediate window in ISE to see what I've got in the workspace - usually to make sure I'm in the right one.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is TestDb the one you are creating via API or the one you did via the GUI? Removed means redacted, right...or is that API returning that?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 17:07:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315626#M73</guid>
      <dc:creator>dlevy</dc:creator>
      <dc:date>2024-12-05T17:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SQL DB via REST API</title>
      <link>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315647#M74</link>
      <description>&lt;P&gt;Got it - I'm using Postman to exercise the APIs. I did try the script at one point to see if there was something I was doing wrong, but got the same error from that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, REMOVED is REDACTED in this instance and the database returned there is one that I manually created in the Fabric UI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I check the GET API after using the POST to try to create a new database, it doesn't show up there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 17:23:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315647#M74</guid>
      <dc:creator>mikegoatly</dc:creator>
      <dc:date>2024-12-05T17:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SQL DB via REST API</title>
      <link>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315666#M75</link>
      <description>&lt;P&gt;For Postman you have to be careful with the bearer token. You can use the F12 developer tools in Edge to find the bearer token while logged into the Fabric portal or just grab it using that powershell snippet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The powershell script was actually written because people were struggling to get all the tumblers to align with Postman. If the powershell script is not working then we are probably going to need to get a support case opened to have someone dig into the logs and see where it is short circuiting.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 17:59:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315666#M75</guid>
      <dc:creator>dlevy</dc:creator>
      <dc:date>2024-12-05T17:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SQL DB via REST API</title>
      <link>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315783#M78</link>
      <description>&lt;P&gt;I'm pretty sure I've got auth working. I have a collection set up where I can test out various Fabric APIs; the bearer token is kept as an environment variable so I can update it easily. (I use the Azure CLI to get new ones with&amp;nbsp;&lt;STRONG&gt;az account get-access-token --query accessToken -o tsv --resource &lt;A href="https://api.fabric.microsoft.com" target="_blank"&gt;https://api.fabric.microsoft.com&lt;/A&gt; | Set-Clipboard&lt;/STRONG&gt; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's the best way to raise the support case for the Fabric team?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 20:21:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315783#M78</guid>
      <dc:creator>mikegoatly</dc:creator>
      <dc:date>2024-12-05T20:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SQL DB via REST API</title>
      <link>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315880#M81</link>
      <description>&lt;P&gt;Yeah, if you're able to list the databases in the workspace then the token is good. Assuming you are using the token here is for the same ID that works fine to create databases in the portal then it should work. If the api call runs successfully and the database is not visible in the workspace within 5 minutes then something is wrong - 5 minutes is an enternity and then some here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the link that shows&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket" target="_blank"&gt;How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 22:15:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4315880#M81</guid>
      <dc:creator>dlevy</dc:creator>
      <dc:date>2024-12-05T22:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SQL DB via REST API</title>
      <link>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4369682#M162</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="107418" data-lia-user-login="mikegoatly" class="lia-mention lia-mention-user"&gt;mikegoatly&lt;/a&gt;&amp;nbsp; - We published an update to the REST API example this week. Please give it a shot and let me know how it works for you. Here is the link:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/fabric/database/sql/deploy-rest-api" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/fabric/database/sql/deploy-rest-api&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 18:41:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/SQL-database/Creating-SQL-DB-via-REST-API/m-p/4369682#M162</guid>
      <dc:creator>dlevy</dc:creator>
      <dc:date>2025-01-17T18:41:09Z</dc:date>
    </item>
  </channel>
</rss>

