Fix SPN support for refresh_semantic_model and takeover_item_ownership - #1286
Draft
m-kovalsky with Copilot wants to merge 3 commits into
Draft
Fix SPN support for refresh_semantic_model and takeover_item_ownership#1286m-kovalsky with Copilot wants to merge 3 commits into
m-kovalsky with Copilot wants to merge 3 commits into
Conversation
- Replace fabric.refresh_dataset() with direct Power BI REST API call via _base_api(client="fabric_sp") so SPN authentication is properly used - Replace fabric.get_refresh_execution_details() with direct REST API calls for status polling and error extraction - Update cancel_dataset_refresh to use _base_api(client="fabric_sp") and replace fabric.list_refresh_requests() with direct REST API call - Add client="fabric_sp" to get_semantic_model_refresh_history _base_api call - Add "Service Principal Authentication is supported" docstring to refresh_semantic_model, cancel_dataset_refresh, get_semantic_model_refresh_history, and takeover_item_ownership - Note in visualize parameter that XMLA trace requires interactive user context
… add comment for notifyOption
Copilot
AI
changed the title
[WIP] Fix issue refreshing direct lake semantic model
Fix SPN support for refresh_semantic_model and takeover_item_ownership
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When running in a Fabric pipeline via Service Principal,
refresh_semantic_modelfailed because it relied onsempy.fabric.refresh_dataset()/get_refresh_execution_details()— sempy functions that don't route through the SPN token provider set byservice_principal_authentication.Changes
refresh_semantic_model: Replacesfabric.refresh_dataset()andfabric.get_refresh_execution_details()with direct calls to the Power BI Enhanced Refresh REST API via_base_api(client="fabric_sp"). Error extraction likewise uses the REST API instead of sempy.cancel_dataset_refresh: Replacesfabric.list_refresh_requests()with a direct REST API call; addsclient="fabric_sp"to the delete request.get_semantic_model_refresh_history: Addsclient="fabric_sp"to the existing_base_apicall.takeover_item_ownership: Already usedclient="fabric_sp"correctly; docstring updated.visualize=Truepath (XMLA trace) is noted as requiring interactive user context.Usage