This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
The UpdateFromGit API requires "workspaceHead" and "remoteCommitHash" in the body. It's easy to figure out the remoteCommitHash from the git log which is the last commit of the repository. But it is tricky for the workspaceHead. My company's Git Integration setup have one Git repository and multiple workspaces from PBI mapped to respective folders within the same repo, so each workspace's head is different. I can see the workspace head value displayed in the PBI service UI when I access each workspace. We need a programmatic way for us to get that value for different workspaces, as we are trying to automate the process (through scripting) which pulls down the committed changes inside the Git repo and sync to the Power BI service. Or better yet, if this API can be enhanced - since we are already providing the workspace ID in the API call, it should automatically figure out the workspaceHead for that id behind the scene, so we don't have to figure it out with coding and provide it in the body.
curl --location 'https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/git/updateFromGit' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer token' \
--data '{
"workspaceHead": "4a480a507fc051a009fd52a412a6be3c9909b603",
"remoteCommitHash": "e75bd9ba6db14fabc2d25895e4e83fe8c9bfb260",
"conflictResolution": {
"conflictResolutionType": "Workspace",
"conflictResolutionPolicy": "PreferRemote"
},
"options": {
"allowOverrideItems": true
}
}'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.