Azure / cli

Automate your GitHub workflows using Azure CLI scripts
MIT License
124 stars 52 forks source link

az synapse workspace activate fails for --ids option #67

Closed shannawaz closed 2 years ago

shannawaz commented 2 years ago

zz --version azure-cli 2.31.0

core 2.31.0 telemetry 1.0.6

Describe the bug I am trying to activate Synapse workspace via AZ CLI command using --ids option. What exactly is needed for --ids to work? The command is unable to get the --name option. Its ignores if I provide the option.

--W/O --name option az synapse workspace activate --ids /subscriptions/xxxxxxxxxxxxxxxxx/resourceGroups/rg-mddsha1prodeastus-synapse-ws/providers/Microsoft.Synapse/workspaces/synmddsha1prodeastus --key-identifier https://xxxxxxxxx.vault.azure.net/keys/key-cmk-mddsha1prodeastus

Argument --name cannot be derived from ID /subscriptions/a0b62ca5-4dbf-4ddb-8d97-9d36cea4875c/resourceGroups/rg-mddsha1prodeastus-synapse-ws/providers/Microsoft.Synapse/workspaces/synmddsha1prodeastus,. Please provide a complete resource ID containing all information of 'Resource Id' arguments.

---With --name option

az synapse workspace activate --ids /subscriptions/xxxxxxxxxxxxxxxxx/resourceGroups/rg-mddsha1prodeastus-synapse-ws/providers/Microsoft.Synapse/workspaces/synmddsha1prodeastus --key-identifier https://xxxxxxxxx.vault.azure.net/keys/key-cmk-mddsha1prodeastus --name key-cmk-xxxxxxxx

option '--name' will be ignored due to use of '--ids'.

To Reproduce Create synapse workspace with double encryption/system managed identity and run above command Additional context Add any other context about the problem here.

t-dedah commented 2 years ago

Hi @shannawaz as this issue is more suitable for core azure cli team, we have raised an issue on your behalf. https://github.com/Azure/azure-cli/issues/20814

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 7 days with no activity.

github-actions[bot] commented 2 years ago

This issue is idle because it has been open for 14 days with no activity.

t-dedah commented 2 years ago

Hi @shannawaz , --ids need to send a keyvault resourceid, not workspace resourceid. And if we use --ids, don't need to use --workspace-name and --name.

Source :- https://github.com/Azure/azure-cli/issues/20814#issuecomment-1004552610

shannawaz commented 2 years ago

Thank you, This issue can be closed. Appreciate if the documentation be update for future customers.

Here is current doc

https://docs.microsoft.com/en-us/cli/azure/synapse/workspace?view=azure-cli-latest#az-synapse-workspace-activate

--ids One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

t-dedah commented 2 years ago

Thanks @shannawaz, I am closing this issue now.