<?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 trigger an on-demand run to a pipeline from a API in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4250673#M5993</link>
    <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="353745" data-lia-user-login="tackytechtom" class="lia-mention lia-mention-user"&gt;tackytechtom&lt;/a&gt; mentioned, you are not able to run this specific API with Service Principals. Instead of creating a token with&amp;nbsp;&lt;A href="https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token" target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token&lt;/A&gt; in Postman, you should use PowerShell or Azure Cloud Shell and connect to PowerBI/Fabric with&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Connect-PowerBIServiceAccount&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;With that same Shell, run the following command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Invoke-PowerBIRestMethod -Method post -Url&amp;nbsp;https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items/{itemId}/jobs/instances?jobType={jobType}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 21 Oct 2024 11:17:51 GMT</pubDate>
    <dc:creator>FabianSchut</dc:creator>
    <dc:date>2024-10-21T11:17:51Z</dc:date>
    <item>
      <title>How to trigger an on-demand run to a pipeline from a API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4248175#M5970</link>
      <description>&lt;P&gt;Hello experts, I've been reading documentation about how to trigger a pipeline run by using a Fabric REST API, but i find myself in a loophole. I'm confident i can find the soultion in this forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've created an app registration and given Item.ReadWrite.All and Workspace.ReadWrite.All permissions. Also generated the secret client value. But, when i try to generate the token through a get&amp;nbsp;&lt;A href="https://login.microsoftonline.com/{tenant" target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/{tenant_&lt;/A&gt;id}/oauth2/v2.0/token in Postman, with scope "&lt;A href="https://analysis.windows.net/powerbi/api/.default&amp;quot;" target="_blank"&gt;https://analysis.windows.net/powerbi/api/.default"&lt;/A&gt;&amp;nbsp;a token is generated and when i try to run the pipeline through&amp;nbsp;the API URL i get an error message: "&lt;SPAN&gt;PrincipalTypeNotSupported&lt;/SPAN&gt;&lt;SPAN&gt;". I use a&amp;nbsp;jobType=Pipeline&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Ultimately, what i want to achieve is to trigger on demand a pipeline run through the REST API.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 12:24:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4248175#M5970</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-18T12:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger an on-demand run to a pipeline from a API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4248639#M5978</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might be the scope that is making up something here. Can you try it with "&lt;SPAN&gt;&lt;A href="https://api.fabric.microsoft.com&amp;quot;?" target="_blank"&gt;https://api.fabric.microsoft.com"?&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here are two blog articles that might be helping you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.tackytech.blog/how-to-call-fabric-rest-apis-from-fabric-data-pipelines/" target="_blank"&gt;https://www.tackytech.blog/how-to-call-fabric-rest-apis-from-fabric-data-pipelines/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.tackytech.blog/how-to-call-power-bi-rest-apis-from-fabric-data-pipelines/" target="_blank"&gt;https://www.tackytech.blog/how-to-call-power-bi-rest-apis-from-fabric-data-pipelines/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Let me know, how it goes!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 16:42:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4248639#M5978</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2024-10-18T16:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger an on-demand run to a pipeline from a API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4249213#M5981</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="353745" data-lia-user-login="tackytechtom" class="lia-mention lia-mention-user"&gt;tackytechtom&lt;/a&gt;&amp;nbsp;! I can retrieve the token from the scope "&lt;A href="https://api.fabric.microsoft.com&amp;quot;," target="_blank" rel="noopener"&gt;https://api.fabric.microsoft.com",&lt;/A&gt;&amp;nbsp;but when i try to execute the post statement in Postman i get the same error &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;PrincipalTypeNotSupported&lt;/SPAN&gt;&lt;SPAN&gt;".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There where a few things that i was missing that those two blogs helped me, like adding the connection from the app registration in Fabric, so i could replicate your example in the blog post. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But what i want to do is to be able to trigger a pipeline from a web (in this case, a localhost). Is this possible? Microsoft has some documentation about this (&lt;A href="https://learn.microsoft.com/en-us/rest/api/fabric/core/job-scheduler/run-on-demand-item-job?tabs=HTTP" target="_blank" rel="noopener"&gt;Job Scheduler - Run On Demand Item Job - REST API (Core) | Microsoft Learn&lt;/A&gt;) but i can't seem to replicate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Oct 2024 17:33:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4249213#M5981</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-19T17:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger an on-demand run to a pipeline from a API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4249267#M5982</link>
      <description>&lt;P&gt;Hm interesting...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I actually got the same error when I wrote those articles. If you take a look here and scroll down right above the third bullet, I am mentioning that matter as well.&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/how-to-call-fabric-rest-apis-from-fabric-data-pipelines/#set-up-a-new-connection" target="_blank" rel="noopener"&gt;https://www.tackytech.blog/how-to-call-fabric-rest-apis-from-fabric-data-pipelines/#set-up-a-new-connection&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With that said the article is from last year and things change ridiculously quickly so this information might already be outdated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the documentation you linked to, it does say though that the call is not (yet) supported with service principals. I'd suggest you fetch a token with your Entra ID user and see whether this works. Though I would not recommend this for production use, you can at least see whether your approach works at all like fetching the correct token and using the correct API syntax etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know this is not a proper solution, but maybe it is still of some help...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good Luck!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank" rel="noopener"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank" rel="noopener"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Oct 2024 18:39:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4249267#M5982</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2024-10-19T18:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger an on-demand run to a pipeline from a API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4250196#M5990</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much tackytechtom&amp;nbsp;for your thoughtful reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you tell me if your problem is solved? If yes, please accept it as solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Nono Chen&lt;/P&gt;
&lt;P&gt;If this &lt;STRONG&gt;&lt;EM&gt;post&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;helps, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 06:57:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4250196#M5990</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-21T06:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger an on-demand run to a pipeline from a API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4250520#M5991</link>
      <description>&lt;P&gt;I tried to change it as you suggest but haven't been able to trigger the pipeline. I'm trying to do so as the documentation I linked in my previous response, using the same format, but it turns out the same error&amp;nbsp;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;PrincipalTypeNotSupported&lt;/SPAN&gt;&lt;SPAN&gt;".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Although I can retrieve the name of the pipeline i want to trigger, but what i can't seem to be able to do is to actually trigger it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If there's more information about this issue, I'll be grateful&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 09:43:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4250520#M5991</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-21T09:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger an on-demand run to a pipeline from a API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4250673#M5993</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="353745" data-lia-user-login="tackytechtom" class="lia-mention lia-mention-user"&gt;tackytechtom&lt;/a&gt; mentioned, you are not able to run this specific API with Service Principals. Instead of creating a token with&amp;nbsp;&lt;A href="https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token" target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token&lt;/A&gt; in Postman, you should use PowerShell or Azure Cloud Shell and connect to PowerBI/Fabric with&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Connect-PowerBIServiceAccount&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;With that same Shell, run the following command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Invoke-PowerBIRestMethod -Method post -Url&amp;nbsp;https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items/{itemId}/jobs/instances?jobType={jobType}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Oct 2024 11:17:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4250673#M5993</guid>
      <dc:creator>FabianSchut</dc:creator>
      <dc:date>2024-10-21T11:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger an on-demand run to a pipeline from a API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4250850#M5994</link>
      <description>&lt;P&gt;Thanks, can i get a little bit more context on how to use Powershell with Fabric? Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 13:21:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4250850#M5994</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-21T13:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger an on-demand run to a pipeline from a API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4250902#M5995</link>
      <description>&lt;P&gt;Does this resource work for you: &lt;A href="https://learn.microsoft.com/en-us/azure/cloud-shell/get-started/classic?tabs=powershell" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/cloud-shell/get-started/classic?tabs=powershell&lt;/A&gt;? You can run the commands that I have given in the previous post after you've set up the Azure Cloud Shell with PowerShell as your choice of shell environment. With the first command, you should login with a user that has access to the pipeline you want to trigger. The second command should be a bit adjusted with your id's.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 13:53:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4250902#M5995</guid>
      <dc:creator>FabianSchut</dc:creator>
      <dc:date>2024-10-21T13:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger an on-demand run to a pipeline from a API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4268981#M6214</link>
      <description>&lt;P&gt;Sorry i missed out. Due to some restrictions I can't use the Shell method. Alternatively, I managed to trigger the pipeline by invoking&amp;nbsp;&lt;SPAN&gt;&lt;SPAN class=""&gt;powerBIAccessToken in the developer console while signed in the Fabric platform. This token did work, while the Principal type did not.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Is there a way to achieve this by using a post or get method?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Thanks&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 10:36:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4268981#M6214</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-04T10:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger an on-demand run to a pipeline from a API</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4269428#M6226</link>
      <description>&lt;P&gt;You may achieve this by using "grant_type = password" in the API post request, instead of using "grant_type = client_credentials". You should give your username and password in the request, and is therefore not recommended at all. Furthermore, if you have MFA enabled, this will not work. But if you are aware of the risks and have no other option, you could try this.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 16:24:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-trigger-an-on-demand-run-to-a-pipeline-from-a-API/m-p/4269428#M6226</guid>
      <dc:creator>FabianSchut</dc:creator>
      <dc:date>2024-11-04T16:24:26Z</dc:date>
    </item>
  </channel>
</rss>

