Skip to content

[CosmosDB] az cosmosdb update: Add support for Microsoft Fabric workspace resource IDs in --network-acl-bypass-resource-ids#32797

Open
dgao97 wants to merge 3 commits intoAzure:devfrom
dgao97:users/danielgao/fabricBypass
Open

[CosmosDB] az cosmosdb update: Add support for Microsoft Fabric workspace resource IDs in --network-acl-bypass-resource-ids#32797
dgao97 wants to merge 3 commits intoAzure:devfrom
dgao97:users/danielgao/fabricBypass

Conversation

@dgao97
Copy link

@dgao97 dgao97 commented Feb 13, 2026

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-ids parameter for az 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:

  • Added is_valid_network_acl_bypass_resource_id() function in _validators.py that validates both standard Azure resource IDs and Fabric resource IDs
  • Updated cli_cosmosdb_update() in custom.py to use the new validation function

Testing Guide

# Update a CosmosDB account with a Fabric workspace resource ID for network ACL bypass
az cosmosdb update -n myaccount -g mygroup --capabilities EnableFabricNetworkAclBypass --network-acl-bypass AzureServices --network-acl-bypass-resource-ids /tenants/72f988bf-86f1-41af-91ab-2d7cd011db47/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Fabric/providers/Microsoft.Fabric/workspaces/3e83f2c3-5a1e-45c3-95f3-53f3a1794e6f

# Standard Azure resource IDs continue to work
az cosmosdb update -n myaccount -g mygroup --network-acl-bypass AzureServices --network-acl-bypass-resource-ids /subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Synapse/workspaces/wsName

History Notes

[CosmosDB] az cosmosdb update: Add support for Microsoft Fabric workspace resource IDs in --network-acl-bypass-resource-ids


This checklist is used to make sure that common guidelines for a pull request are followed.

@dgao97 dgao97 requested a review from calvinhzy as a code owner February 13, 2026 18:33
Copilot AI review requested due to automatic review settings February 13, 2026 18:33
@azure-client-tools-bot-prd
Copy link

Validation for Azure CLI Full Test Starting...

Thanks for your contribution!

@azure-client-tools-bot-prd
Copy link

Validation for Breaking Change Starting...

Thanks for your contribution!

@yonzhan
Copy link
Collaborator

yonzhan commented Feb 13, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot CosmosDB az cosmosdb labels Feb 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for Microsoft Fabric workspace resource IDs in the --network-acl-bypass-resource-ids parameter for the az cosmosdb update command. The change extends the existing validation to accept not only standard Azure resource IDs (starting with /subscriptions/) but also Fabric-specific resource IDs that begin with /tenants/ and follow a specific format.

Changes:

  • Added a new validation function is_valid_network_acl_bypass_resource_id() with a helper _is_valid_guid() to validate both standard Azure and Fabric resource ID formats
  • Updated cli_cosmosdb_update() to use the new validator instead of the generic is_valid_resource_id() function
  • Added integration test test_cosmosdb_network_acl_bypass() to verify the new functionality

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/azure-cli/azure/cli/command_modules/cosmosdb/_validators.py Adds new validation functions for network ACL bypass resource IDs with support for Fabric workspace format
src/azure-cli/azure/cli/command_modules/cosmosdb/custom.py Updates the update command to use the new Fabric-aware validator
src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_commands.py Adds integration test covering both standard Azure and Fabric resource ID formats
src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/recordings/test_cosmosdb_network_acl_bypass.yaml Test recording file for the new test case

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yonzhan yonzhan assigned calvinhzy and unassigned evelyn-ys Feb 13, 2026
@yonzhan yonzhan removed the request for review from evelyn-ys February 13, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot CosmosDB az cosmosdb customer-reported Issues that are reported by GitHub users external to the Azure organization. Synapse

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants