-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[CosmosDB] az cosmosdb update: Add support for Microsoft Fabric workspace resource IDs in --network-acl-bypass-resource-ids
#32761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
Thank you for your contribution @dgao97! We will review the pull request and get back to you soon. |
|
@microsoft-github-policy-service agree company="Microsoft" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds support in az cosmosdb update for validating Microsoft Fabric workspace resource IDs passed via --network-acl-bypass-resource-ids, alongside existing standard ARM /subscriptions/... resource IDs.
Changes:
- Introduces
is_valid_network_acl_bypass_resource_id()to validate both standard ARM resource IDs and Fabric/tenants/...resource IDs. - Updates
cli_cosmosdb_update()to use the new validator for--network-acl-bypass-resource-ids. - Adds a scenario test + recording covering both standard and Fabric resource ID update flows.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/cosmosdb/custom.py | Switches --network-acl-bypass-resource-ids validation to the new validator supporting Fabric IDs. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/_validators.py | Adds Fabric-aware resource ID validation helper used by cosmosdb update. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_commands.py | Adds live scenario test verifying standard + Fabric resource ID behavior. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/recordings/test_cosmosdb_network_acl_bypass.yaml | Recording for the new scenario test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def _is_valid_guid(value): | ||
| """Check if a string is a valid GUID.""" | ||
| import uuid | ||
| try: | ||
| uuid.UUID(value) | ||
| return True | ||
| except ValueError: | ||
| return False |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_is_valid_guid currently uses uuid.UUID(value) which accepts non-canonical GUID representations (e.g. urn:uuid:<guid>, {<guid>}, or 32-hex-without-dashes). Because the Fabric resource ID regex captures (.+), these non-ARM forms would be treated as valid IDs even though they are not valid path segments in an ARM resource ID. Consider tightening validation to require the canonical 36-char hex-with-dashes form (e.g. validate with a GUID regex, or compare str(uuid.UUID(value)) == value.lower()), and/or tighten the capture groups in the Fabric regex to a GUID pattern.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
az cosmosdb update: Add support for Microsoft Fabric workspace resource IDs in --network-acl-bypass-resource-ids
az cosmosdb update: Add support for Microsoft Fabric workspace resource IDs in --network-acl-bypass-resource-idsaz cosmosdb update: Add support for Microsoft Fabric workspace resource IDs in --network-acl-bypass-resource-ids
Related command
az cosmosdb update -n {acc} -g {rg} --network-acl-bypass AzureServices --network-acl-bypass-resource-ids /tenants/{tenantId}/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Fabric/providers/Microsoft.Fabric/workspaces/{workspaceGuid}
Description
This PR adds support for Microsoft Fabric workspace resource IDs in the
--network-acl-bypass-resource-idsparameter foraz cosmosdb update.Previously, only standard Azure resource IDs (starting with
/subscriptions/) were accepted. This change extends validation to also accept Fabric resource IDs in the format:/tenants/{tenantId}/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Fabric/providers/Microsoft.Fabric/workspaces/{workspaceGuid}Changes:
is_valid_network_acl_bypass_resource_id()function in_validators.pythat validates both standard Azure resource IDs and Fabric resource IDscli_cosmosdb_update()incustom.pyto use the new validation functionTesting Guide
History Notes
[CosmosDB]
az cosmosdb update: Add support for Microsoft Fabric workspace resource IDs in--network-acl-bypass-resource-idsThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.