Skip to content

{AzureCosmosDB} fixes Azure/azure-cli#24156#24200

Merged
evelyn-ys merged 6 commits into
Azure:devfrom
navba-MSFT:patch-12
Oct 18, 2022
Merged

{AzureCosmosDB} fixes Azure/azure-cli#24156#24200
evelyn-ys merged 6 commits into
Azure:devfrom
navba-MSFT:patch-12

Conversation

@navba-MSFT
Copy link
Copy Markdown
Contributor

@navba-MSFT navba-MSFT commented Oct 14, 2022

fixes #24156

It's possible to input resource id without leading '/' in URI, and this cause Cosmos DB Analytical Store to be unable to identify the mentioned resources and by-pass on network acl checking. Without the leading '/' in resource URI, CLI execution won't report any errors or indicate it's actually an invalid format. Cosmos DB can still store the invalid URI at last, but no help to allow querying from Synapse.

To Reproduce
az cosmosdb update --name MyCosmosDBDatabaseAccount--resource-group MyResourceGroup--network-acl-bypass AzureServices --network-acl-bypass-resource-ids "subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Synapse/workspaces/wsName"

This PR validates the input values of --network-acl-bypass-resource-ids, to ensure customer configuring their resource correctly.

Related command

Description

Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


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

fixes Azure#24156

It's possible to input resource id without leading '/' in URI, and this cause Cosmos DB Analytical Store to be unable to identify the mentioned resources and by-pass on network acl checking.
Without the leading '/' in resource URI, CLI execution won't report any errors or indicate it's actually an invalid format.
Cosmos DB can still store the invalid URI at last, but no help to allow querying from Synapse.

To Reproduce
az cosmosdb update --name MyCosmosDBDatabaseAccount--resource-group MyResourceGroup--network-acl-bypass AzureServices --network-acl-bypass-resource-ids "subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Synapse/workspaces/wsName"

This PR validates the input values of --network-acl-bypass-resource-ids, to ensure customer configuring their resource correctly.
@ghost ghost added CosmosDB az cosmosdb Auto-Assign Auto assign by bot labels Oct 14, 2022
@ghost ghost requested a review from yonzhan October 14, 2022 04:51
@ghost ghost assigned evelyn-ys Oct 14, 2022
@ghost ghost added this to the Oct 2022 (2022-11-01) milestone Oct 14, 2022
@ghost ghost requested a review from jsntcy October 14, 2022 04:52
@ghost ghost assigned jsntcy Oct 14, 2022
@ghost ghost added the Synapse label Oct 14, 2022
@yonzhan yonzhan removed the Synapse label Oct 14, 2022
@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Oct 14, 2022

CosmosDB

@navba-MSFT navba-MSFT changed the title {azure CosmosDB} fixes Azure/azure-cli#24156 {AzureCosmosDB} fixes Azure/azure-cli#24156 Oct 14, 2022
@wangzelin007
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

Comment thread src/azure-cli/azure/cli/command_modules/cosmosdb/custom.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/cosmosdb/custom.py Outdated
@evelyn-ys evelyn-ys merged commit dd18d07 into Azure:dev Oct 18, 2022
avgale pushed a commit to avgale/azure-cli that referenced this pull request Aug 24, 2023
* {azure CosmosDB} fixes Azure#24156

fixes Azure#24156

It's possible to input resource id without leading '/' in URI, and this cause Cosmos DB Analytical Store to be unable to identify the mentioned resources and by-pass on network acl checking.
Without the leading '/' in resource URI, CLI execution won't report any errors or indicate it's actually an invalid format.
Cosmos DB can still store the invalid URI at last, but no help to allow querying from Synapse.

To Reproduce
az cosmosdb update --name MyCosmosDBDatabaseAccount--resource-group MyResourceGroup--network-acl-bypass AzureServices --network-acl-bypass-resource-ids "subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Synapse/workspaces/wsName"

This PR validates the input values of --network-acl-bypass-resource-ids, to ensure customer configuring their resource correctly.

* Update custom.py

* Update custom.py

* Update src/azure-cli/azure/cli/command_modules/cosmosdb/custom.py

Co-authored-by: Yishi Wang <yishiwang@microsoft.com>

* Update custom.py

* Update custom.py

Co-authored-by: Yishi Wang <yishiwang@microsoft.com>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cosmos DB --network-acl-bypass-resource-ids need to be validated further

5 participants