Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
Johanneszv
Frequent Visitor

Use REST API to update workspace from git

Hi!

What would be a good aproach to update a workspace automatically from a branch in Devops trough a Azure devops pipeline? 

 

Context: 

- We use Azure Devops to version controll our fabric items i.e notebooks, pipelines, lakehouse etc.

- We develop on feature branches and merge into one main branch. Production workspace is synced with main branch.

- The syncing is currently manual, but this is what we want to automate with Azure Devops pipelines and the Fabric API. Say after the PR is merged to main.

 

Currently we are limited by: 

- The REST api for updating the workspace is limited to user only. Calling the REST Api with a Service Prinicple is not supported for this endpoint: https://learn.microsoft.com/en-us/rest/api/fabric/core/git/update-from-git?tabs=HTTP#microsoft-entra...
- Since we want to run this in an Azure Devops authentication with a user is not desirable becasue of MFA and we want to limit access to contribution (or higher) role in production.  

1 ACCEPTED SOLUTION

Hi @Johanneszv ,
 Azure DevOps pipeline runs a PowerShell script to automate the update process. The automation will be triggered upon completion of a pull request (PR) to the branch linked with the workspace.

Here are the steps:

  1. The pipeline will execute a PowerShell script that interacts with Fabric's 'Update From Git' API to apply the changes from the Git repository to the workspace.
  2. Since this pipeline will interact with Fabric’s API and the Git repository,you may need to handle authentication securely. This can be done either by using tokens stored in an Azure Key Vault or by setting up a user account excluded from Multi-Factor Authentication (MFA).

Additionally, 

  • Authentication: The Fabric API currently doesn’t support service principals,you may need to manage tokens securely.
  • Workspace Permissions: Ensure the account used for the automation has admin privileges on the workspace to perform the update operation.

If this post helps, please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
v-pagayam-msft
Community Support
Community Support

Hi @Johanneszv 

Can you please confirm whether you have resolved issue. If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. This will be helpful for other community members who have similar problems to solve it faster. 

If we don’t hear back, we’ll go ahead and close this thread.Should you need further assistance in the future, we encourage you to reach out via the Microsoft Fabric Community Forum and create a new thread. We’ll be happy to help.

Thank you.

Regards,
Pallavi G

v-pagayam-msft
Community Support
Community Support

Hi @Johanneszv ,
We wanted to follow up since we haven't heard back from you regarding our last response. We hope your issue has been resolved.
If our answer resolved your query, please mark it as "Accept as Solution" and select "Yes" if it was helpful.
If you need any further assistance, feel free to reach out.
Thank you for being a valued member of the Microsoft Fabric Community Forum!

Hi @v-pagayam-msft and thanks for following up. 

I cannot accept any answers here as they don't solve my question. The PAT documentation you are linking to is about getting access to DevOps it self and there i can grant access to repoes, feeds etc. What i want, on the other hand, is to call the Fabric API and update the workspace to a given git commit. Please correct me if im wrong.


Hi @Johanneszv ,
 Azure DevOps pipeline runs a PowerShell script to automate the update process. The automation will be triggered upon completion of a pull request (PR) to the branch linked with the workspace.

Here are the steps:

  1. The pipeline will execute a PowerShell script that interacts with Fabric's 'Update From Git' API to apply the changes from the Git repository to the workspace.
  2. Since this pipeline will interact with Fabric’s API and the Git repository,you may need to handle authentication securely. This can be done either by using tokens stored in an Azure Key Vault or by setting up a user account excluded from Multi-Factor Authentication (MFA).

Additionally, 

  • Authentication: The Fabric API currently doesn’t support service principals,you may need to manage tokens securely.
  • Workspace Permissions: Ensure the account used for the automation has admin privileges on the workspace to perform the update operation.

If this post helps, please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

v-pagayam-msft
Community Support
Community Support

Hi @Johanneszv ,

We haven't heard back from you regarding our last response and wanted to check if your issue has been resolved. If our response addressed your query, please mark it as Accept as Solution and click Yes if you found it helpful.If you have any further questions, feel free to reach out.

Thank you for being a part of the Microsoft Fabric Community Forum!

v-pagayam-msft
Community Support
Community Support

Hi @Johanneszv ,
I wanted to follow up and see if you've had a chance to review the previous response provide by me. Please let us know if everything has been sorted. If needed any further assistance, feel free to reach out.

Thank you for being a valued member of the Microsoft Fabric Community Forum!

Regards,
Pallavi.

Johanneszv
Frequent Visitor

Thanks for replaying and your suggestion @v-pagayam-msft

Using a PAT is an interesting path. Do you know what kind of PAT is discussed in the thread you are reffering to? Where can i generate one? I don't see this mentioned in the Fabric documentation.

Hi @Johanneszv ,

Thank you for the repsonse.

Providing the document which assist you in creating PAT token.
personal-access-tokens 

The refrerence thread is about to update a Power BI workspace whenever there is a change in a Git repository ,this would help keep the Power BI workspace synced with the latest changes from the code.

If this post helps, please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thank you for being a part of Microsoft Fabric Community Forum!

v-pagayam-msft
Community Support
Community Support

Hi @Johanneszv ,

Thank you for reaching out to the Microsoft Fabric Community Forum about the issue you are encountering.

Considering the limitations I would suggest you to try using PowerShell script that uses PAT instead Service Principal.
The PAT approach  authentication may be a best option to achieve the desired functionality, as it might allow you to securely authenticate and automate the process without manual intervention.

Providing the reference thread which may assist you in addressing the query:
Solved: Update from Git - Azure Devops Pipeline - Microsoft Fabric Community

If still facing difficulty in resolving the issue, please feel free to reachout.

If this post helps, please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Regards,
Pallavi.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.