<?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: Get workspace components git status through API call in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4855406#M13026</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/686932"&gt;@amaaiia&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have used the below code and im able to get the result with Service Principal.&lt;/P&gt;
&lt;P&gt;function GetSecureTokenForServicePrincipal() {&lt;BR /&gt;$secureServicePrincipalSecret = ConvertTo-SecureString -String $client_secret -AsPlainText -Force&lt;BR /&gt;$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $client_id, $secureServicePrincipalSecret&lt;/P&gt;
&lt;P&gt;#Login to Azure using service principal&lt;BR /&gt;Connect-AzAccount -ServicePrincipal -TenantId $tenant_id -Subscription 'xxx-yyyy' -Credential $credential | Out-Null&lt;/P&gt;
&lt;P&gt;# Get authentication&lt;BR /&gt;$secureFabricToken = (Get-AzAccessToken -AsSecureString -ResourceUrl $global:resourceUrl).Token&lt;BR /&gt;&lt;BR /&gt;return $secureFabricToken&lt;BR /&gt;}&lt;BR /&gt;function ConvertSecureStringToPlainText($secureString) {&lt;BR /&gt;$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($secureString)&lt;BR /&gt;try {&lt;BR /&gt;$plainText = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr)&lt;BR /&gt;} finally {&lt;BR /&gt;[System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr)&lt;BR /&gt;}&lt;BR /&gt;return $plainText&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;$secureFabricToken = GetSecureTokenForServicePrincipal&lt;BR /&gt;$fabricToken = ConvertSecureStringToPlainText($secureFabricToken)&lt;/P&gt;
&lt;P&gt;$global:baseUrl = "&lt;A href="https://api.fabric.microsoft.com/v1" target="_blank" rel="noopener"&gt;https://api.fabric.microsoft.com/v1&lt;/A&gt;"&lt;BR /&gt;$global:resourceUrl = "&lt;A href="https://api.fabric.microsoft.com" target="_blank" rel="noopener"&gt;https://api.fabric.microsoft.com&lt;/A&gt;"&lt;/P&gt;
&lt;P&gt;$global:fabricHeaders = @{&lt;BR /&gt;'Content-Type' = "application/json"&lt;BR /&gt;'Authorization' = "Bearer $fabricToken"&lt;BR /&gt;}&lt;BR /&gt;$gitStatusUrl = "{0}/workspaces/{1}/git/status" -f $global:baseUrl, $workspace.Id&lt;BR /&gt;$gitStatusResponse = Invoke-RestMethod -Headers $global:fabricHeaders -Uri $gitStatusUrl -Method GET&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt;&amp;nbsp;Service Principal is not supported for warehouse git sync. other items are getting sync from git to workspace except warehouse.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sri&lt;/P&gt;</description>
    <pubDate>Wed, 22 Oct 2025 05:34:36 GMT</pubDate>
    <dc:creator>Srisakthi</dc:creator>
    <dc:date>2025-10-22T05:34:36Z</dc:date>
    <item>
      <title>Get workspace components git status through API call</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4835052#M12505</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm trying to get workspace components git status calling &lt;SPAN&gt;GET &lt;A href="https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/git/status" target="_blank" rel="noopener"&gt;https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/git/status&amp;nbsp;(&lt;/A&gt;&lt;A href="https://learn.microsoft.com/es-es/rest/api/fabric/core/git/get-status" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/es-es/rest/api/fabric/core/git/get-status).&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;I use de "Try it" tab in the official page, and using my user token, it works. However, I need it to do with service principal authentication. Doc says Workspace.GitUpdate.All is enough:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/es-es/rest/api/fabric/core/git/get-status)" target="_blank" rel="noopener"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="amaaiia_0-1758786737190.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1299931i337161AB55C99004/image-size/medium?v=v2&amp;amp;px=400" role="button" title="amaaiia_0-1758786737190.png" alt="amaaiia_0-1758786737190.png" /&gt;&lt;/span&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&lt;BR /&gt;I've added this API permission to my registered APP.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;However, I call the API and I get a 400 bad request error:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/es-es/rest/api/fabric/core/git/get-status)" target="_blank" rel="noopener"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="amaaiia_1-1758786905434.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1299932i1763CCE2D6644614/image-size/medium?v=v2&amp;amp;px=400" role="button" title="amaaiia_1-1758786905434.png" alt="amaaiia_1-1758786905434.png" /&gt;&lt;/span&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P data-unlink="true"&gt;If I change the token and I set my personal account token, it works. The issue is happening when I put registered APP token.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;I get the token with:&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;{ "method": "POST", "headers": { "Content-Type": "application/x-www-form-urlencoded" }, "body": "grant_type=client_credentials&amp;amp;client_id=&amp;lt;client_id&amp;gt;&amp;amp;client_secret=&amp;lt;client_secret&amp;gt;&amp;amp;scope= &lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;https://analysis.windows.net/powerbi/api/.default&lt;SPAN&gt; " }&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;I've used this token also for other API calls such us:&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;A href="https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/{element_type" target="_blank" rel="noopener"&gt;https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/{element_type}&lt;/A&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;And it works, so I gess the token is correct for the scope of Fabric. I don't know why I'm getting a 400 bad request response.&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV&gt;&amp;nbsp;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/SPAN&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;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 25 Sep 2025 08:03:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4835052#M12505</guid>
      <dc:creator>amaaiia</dc:creator>
      <dc:date>2025-09-25T08:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get workspace components git status through API call</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4835912#M12524</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/686932"&gt;@amaaiia&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does the sersvicce principal have contributor or higher on the workspaces? These permissions are different from the delegated permissions in my experience.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2025 04:02:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4835912#M12524</guid>
      <dc:creator>tayloramy</dc:creator>
      <dc:date>2025-09-26T04:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get workspace components git status through API call</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4837955#M12590</link>
      <description>&lt;P&gt;Contributor role on the workspace&lt;/P&gt;</description>
      <pubDate>Mon, 29 Sep 2025 13:22:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4837955#M12590</guid>
      <dc:creator>amaaiia</dc:creator>
      <dc:date>2025-09-29T13:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Get workspace components git status through API call</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4838067#M12595</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/686932"&gt;@amaaiia&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you show me the exact POST request that you're sending? A 400 error usually means that your request is incorrect. Microsoft's APIs are particularly picky when it comes to the parameters and body.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Sep 2025 14:44:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4838067#M12595</guid>
      <dc:creator>tayloramy</dc:creator>
      <dc:date>2025-09-29T14:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Get workspace components git status through API call</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4838099#M12597</link>
      <description>&lt;P&gt;The POST request should be ok because if I change the Bearer token with a token of my personal account, I get 200 OK:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="amaaiia_4-1759158246332.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1300622i9C7061F0F43E2B9B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="amaaiia_4-1759158246332.png" alt="amaaiia_4-1759158246332.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I use service principal token, then I get 400:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="amaaiia_3-1759158193676.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1300621i9517C0A08B183AAB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="amaaiia_3-1759158193676.png" alt="amaaiia_3-1759158193676.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the POST request is the same.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Sep 2025 15:04:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4838099#M12597</guid>
      <dc:creator>amaaiia</dc:creator>
      <dc:date>2025-09-29T15:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Get workspace components git status through API call</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4838132#M12598</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/686932"&gt;@amaaiia&lt;/a&gt;&amp;nbsp;Thanks for the info, so something is up with the service principal.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How are you generating the bearer token?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can toy also confirm what delegated permissions the service principal has?&amp;nbsp;&lt;BR /&gt;Here's my function for generating the bearer token using the MSAL library&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def get_access_token():
    app = ConfidentialClientApplication(
        CLIENT_ID,
        authority=AUTHORITY,
        client_credential=CLIENT_SECRET,
    )
    result = app.acquire_token_for_client(scopes=SCOPE)
    
    if 'access_token' in result:
        return result['access_token']
    else:
        error = result.get('error', 'No error information')
        error_description = result.get('error_description', 'No description')
        raise Exception(f"Could not obtain access token. Error: {error}. Description: {error_description}")&lt;/LI-CODE&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Sep 2025 15:20:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4838132#M12598</guid>
      <dc:creator>tayloramy</dc:creator>
      <dc:date>2025-09-29T15:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get workspace components git status through API call</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4838986#M12620</link>
      <description>&lt;P&gt;I get the token with:&amp;nbsp;&lt;A href="https://login.microsoftonline.com/" target="_blank"&gt;https://login.microsoftonline.com/&lt;/A&gt;&amp;lt;tenant_id&amp;gt;/oauth2/v2.0/token&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;{ "method": "POST", "headers": { "Content-Type": "application/x-www-form-urlencoded" }, "body": "grant_type=client_credentials&amp;amp;client_id=&amp;lt;client_id&amp;gt;&amp;amp;client_secret=&amp;lt;client_secret&amp;gt;&amp;amp;scope=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://analysis.windows.net/powerbi/api/.default" target="_blank" rel="noopener"&gt;https://analysis.windows.net/powerbi/api/.default&lt;/A&gt;&amp;nbsp;" }&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And it works because I'm using it for other Fabric API calls such us:&amp;nbsp;&lt;A href="https://api.fabric.microsoft.com/v1/workspaces/%7BworkspaceId%7D/%7Belement_type" target="_blank" rel="noopener nofollow noreferrer"&gt;https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/{element_type}&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;These are API permissions, doc says GitUpdate is enough:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="amaaiia_0-1759233244584.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1300785i79BA50764B0EED93/image-size/medium?v=v2&amp;amp;px=400" role="button" title="amaaiia_0-1759233244584.png" alt="amaaiia_0-1759233244584.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 11:55:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4838986#M12620</guid>
      <dc:creator>amaaiia</dc:creator>
      <dc:date>2025-09-30T11:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get workspace components git status through API call</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4839268#M12632</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/686932"&gt;@amaaiia&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like you're doing everything right. I'd recommend opening a ticket with Microsoft at this point.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 16:36:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4839268#M12632</guid>
      <dc:creator>tayloramy</dc:creator>
      <dc:date>2025-09-30T16:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get workspace components git status through API call</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4839796#M12653</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/686932"&gt;@amaaiia&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;I hope you were successfully able to raise the support ticket.&lt;BR /&gt;If you have any issues, please let us know.&lt;BR /&gt;Thank You&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Oct 2025 10:33:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4839796#M12653</guid>
      <dc:creator>v-sdhruv</dc:creator>
      <dc:date>2025-10-01T10:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Get workspace components git status through API call</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4852444#M12953</link>
      <description>&lt;P&gt;I recommend testing this outside of your pipeline with something like Postman. Is this for CI/CD deployments?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Oct 2025 05:22:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4852444#M12953</guid>
      <dc:creator>KevinChant</dc:creator>
      <dc:date>2025-10-17T05:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get workspace components git status through API call</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4855406#M13026</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/686932"&gt;@amaaiia&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have used the below code and im able to get the result with Service Principal.&lt;/P&gt;
&lt;P&gt;function GetSecureTokenForServicePrincipal() {&lt;BR /&gt;$secureServicePrincipalSecret = ConvertTo-SecureString -String $client_secret -AsPlainText -Force&lt;BR /&gt;$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $client_id, $secureServicePrincipalSecret&lt;/P&gt;
&lt;P&gt;#Login to Azure using service principal&lt;BR /&gt;Connect-AzAccount -ServicePrincipal -TenantId $tenant_id -Subscription 'xxx-yyyy' -Credential $credential | Out-Null&lt;/P&gt;
&lt;P&gt;# Get authentication&lt;BR /&gt;$secureFabricToken = (Get-AzAccessToken -AsSecureString -ResourceUrl $global:resourceUrl).Token&lt;BR /&gt;&lt;BR /&gt;return $secureFabricToken&lt;BR /&gt;}&lt;BR /&gt;function ConvertSecureStringToPlainText($secureString) {&lt;BR /&gt;$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($secureString)&lt;BR /&gt;try {&lt;BR /&gt;$plainText = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr)&lt;BR /&gt;} finally {&lt;BR /&gt;[System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr)&lt;BR /&gt;}&lt;BR /&gt;return $plainText&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;$secureFabricToken = GetSecureTokenForServicePrincipal&lt;BR /&gt;$fabricToken = ConvertSecureStringToPlainText($secureFabricToken)&lt;/P&gt;
&lt;P&gt;$global:baseUrl = "&lt;A href="https://api.fabric.microsoft.com/v1" target="_blank" rel="noopener"&gt;https://api.fabric.microsoft.com/v1&lt;/A&gt;"&lt;BR /&gt;$global:resourceUrl = "&lt;A href="https://api.fabric.microsoft.com" target="_blank" rel="noopener"&gt;https://api.fabric.microsoft.com&lt;/A&gt;"&lt;/P&gt;
&lt;P&gt;$global:fabricHeaders = @{&lt;BR /&gt;'Content-Type' = "application/json"&lt;BR /&gt;'Authorization' = "Bearer $fabricToken"&lt;BR /&gt;}&lt;BR /&gt;$gitStatusUrl = "{0}/workspaces/{1}/git/status" -f $global:baseUrl, $workspace.Id&lt;BR /&gt;$gitStatusResponse = Invoke-RestMethod -Headers $global:fabricHeaders -Uri $gitStatusUrl -Method GET&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt;&amp;nbsp;Service Principal is not supported for warehouse git sync. other items are getting sync from git to workspace except warehouse.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sri&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2025 05:34:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Get-workspace-components-git-status-through-API-call/m-p/4855406#M13026</guid>
      <dc:creator>Srisakthi</dc:creator>
      <dc:date>2025-10-22T05:34:36Z</dc:date>
    </item>
  </channel>
</rss>

