Azure / azure-cli

Azure Command-Line Interface
MIT License
3.99k stars 2.97k forks source link

[Feature request] add `--output portal` to open the resulting resource created in the portal #26245

Open serbrech opened 1 year ago

serbrech commented 1 year ago

add a --output option to open the resource in the portal.

example:

az group --name my-group -o portal -> open the browser at the resource group url

az deployment create ... -o portal -> open the portal showing the deployment progress

yonzhan commented 1 year ago

Thank you for opening this issue, we will look into it.

jsntcy commented 1 year ago

Similar feature request with https://github.com/Azure/azure-cli/issues/21888

serbrech commented 1 year ago

@jsntcy you're sure you linked the right issue? It seems completely different to me?

jsntcy commented 1 year ago

@jsntcy Yu Chen FTE you're sure you linked the right issue? It seems completely different to me?

Sorry, updated the issue link.

serbrech commented 1 year ago

Yep, that's exactly the same. Our current use case is that we have a resource model that can get pretty large, and the portal page will provide a much clearer visualization.

In general, I feel like making the --output parameter extensible per resource would also be useful.

Currently, it's validated and anything unknown by the root az command will be rejected.

Our resource cli is built as an extension, so we will add a --portal option that will open the browser.

jsntcy commented 1 year ago

This feature request is a framework level change and we'll have a design and discuss it in May. Once the design is finalized, we'll start development work (probably in July).

jsntcy commented 1 year ago

Hi @serbrech, today we discussed this feature inside Azure CLI team and had another alternative solution to meet the requirements of the customer (Customer can easily discover the resource url in Azure Portal in command window). Now we have two solutions below:

Solution 1: Display a message (“You can open the resource in Azure Portal with the url: https://portal.azure.com/#@{tentant_id}/resource/{resource_id}”) in command window after a command is executed successfully; then the customer can copy the url above to the browser to view the resource in Azure Portal easily.

Pros:

Cons:

Solution 2: Add a new format portal for the --output argument for all commands.

Pros:

Cons:

Appreciate you can share your thoughts about the two solutions. (We prefer Solution 1 based on their pros and cons.)