Closes #909 Remove defaultazurecredential fallback path#910
Merged
shirasassoon merged 5 commits intomicrosoft:mainfrom Mar 31, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the DefaultAzureCredential fallback in FabricWorkspace so API authentication requires an explicit token_credential (except when running in Fabric runtime), and updates tests/changelog to match this breaking change.
Changes:
- Enforce explicit
token_credentialinFabricWorkspace.__init__(noDefaultAzureCredentialfallback outside Fabric runtime). - Update unit tests to pass
DummyTokenCredentialwhen constructingFabricWorkspace. - Add an unreleased breaking-change entry describing the auth change.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/fabric_cicd/fabric_workspace.py |
Removes default credential fallback, raises InputError when credential is missing outside Fabric runtime, and adjusts typing/docstring. |
tests/test_publish.py |
Passes DummyTokenCredential into FabricWorkspace instances used by publish/unpublish tests. |
tests/test_fabric_workspace.py |
Updates workspace factory and specific tests to pass DummyTokenCredential. |
tests/test_response_collection.py |
Supplies DummyTokenCredential for workspace creation in response-collection tests. |
tests/test_subfolders.py |
Supplies DummyTokenCredential for workspace creation in subfolder tests. |
.changes/unreleased/breaking-20260329-150739.yaml |
Adds changelog entry documenting the breaking authentication change. |
Comments suppressed due to low confidence (1)
src/fabric_cicd/fabric_workspace.py:56
- The docstring now implies/illustrates that
FabricWorkspacecan be created without atoken_credential(see the “Basic usage” examples below), but__init__will raise anInputErroroutside Fabric runtime whentoken_credentialis omitted. Update the examples and/or argument description to reflect thattoken_credentialis required outside Fabric runtime (and only auto-generated when running in Fabric).
Args:
workspace_id: The ID of the workspace to interact with. Either `workspace_id` or `workspace_name` must be provided. Considers only `workspace_id` if both are specified.
workspace_name: The name of the workspace to interact with. Either `workspace_id` or `workspace_name` must be provided. Considers only `workspace_id` if both are specified.
repository_directory: Local directory path of the repository where items are to be deployed from.
item_type_in_scope: Item types that should be deployed for a given workspace. If omitted, defaults to all available item types.
environment: The environment to be used for parameterization.
token_credential: The token credential to use for API requests (e.g., AzureCliCredential, ClientSecretCredential).
kwargs: Additional keyword arguments.
Examples:
Basic usage
>>> from fabric_cicd import FabricWorkspace
>>> workspace = FabricWorkspace(
ayeshurun
approved these changes
Mar 31, 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.
This pull request introduces a breaking change to the authentication mechanism in
FabricWorkspace: the default credential fallback has been removed, and an explicittoken_credentialmust now be provided for API requests. The codebase and tests have been updated accordingly to enforce this requirement and provide clearer error messaging.Breaking change to authentication:
DefaultAzureCredentialas a fallback;FabricWorkspacenow requires an explicittoken_credentialto be passed for authentication. Attempting to instantiate without a credential (outside Fabric runtime) raises anInputErrorwith a clear message. [1] [2]Documentation and interface improvements:
fabric_workspace.pyto clarify the requirement for an explicittoken_credentialand provide usage examples.Test suite updates:
FabricWorkspacenow explicitly provide aDummyTokenCredentialto comply with the new requirement, ensuring tests remain valid and pass. This affects multiple test files, includingtest_publish.py,test_fabric_workspace.py,test_response_collection.py, andtest_subfolders.py. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27]Type annotation improvement:
token_credentialparameter type inFabricWorkspace.__init__to be explicitlyOptional[TokenCredential]for better type clarity.