Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.98k forks source link

Azure Pipelines: In Cloud Shell, running a pipeline with the --open option doesn't spawn a new browser tab #18321

Open DennisLee-DennisLee opened 3 years ago

DennisLee-DennisLee commented 3 years ago

Describe the bug When you enter the command az pipelines run --id <id_number> --open, a browser tab is supposed to open. The spawned tab will contain the new pipeline run's results page. The browser tab does open when I enter the command from my local Git Bash installation, but it doesn't open when I enter the command in a Cloud Shell (Bash) environment.

I wrote an article where I had to use this command, but because of this issue, I had to create a workaround by outputting the URL that the page opens, and telling the user to open that URL if the new tab doesn't appear.

To Reproduce

  1. Go to https://docs.microsoft.com/azure/devops/pipelines/scripts/cli/pipeline-variable-group-secret-nonsecret-variables (a sample article that I authored on Microsoft Docs),
  2. Follow the instructions in the Sample script section by:
    • Saving and pushing the YAML file to your remote GitHub repository.
    • Filling in the placeholders in the Azure CLI code (there are 7 of them).
    • Saving or uploading the Azure CLI code to a file in Cloud Shell (Bash).
    • Entering bash <scriptname>.sh in Cloud Shell to run the script.

You'll eventually see output similar to the following, but a new browser tab with the pipeline results does not spawn:

Go to the pipeline run's web page to view the output results for the 1st run.
If the web page doesn't automatically appear, go to:
    https://dev.azure.com/v-dele/74a24d9d-c15a-4749-84f1-82b0ce81d3d7/_build/results?buildId=207
Press Enter to change the value of one of the variable group's nonsecret variables, then run again:

Expected behavior A new browser tab automatically opens that shows the results of the new pipeline run.

Environment summary

Additional context If there are other Azure CLI commands that spawn a browser tab, they may also be hindered by this issue.

Cc: @dbradish-microsoft

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @narula0781, @ashishonce, @romil07.

Issue Details
**Describe the bug** When you enter the command `az pipelines run --id --open`, a browser tab is supposed to open. The spawned tab will contain the new pipeline run's results page. The browser tab does open when I enter the command from my local Git Bash installation, but it doesn't open when I enter the command in a Cloud Shell (Bash) environment. I wrote an article where I had to use this command, but because of this issue, I had to create a workaround by outputting the URL that the page opens, and telling the user to open that URL if the new tab doesn't appear. **To Reproduce** 1. Go to (a sample article that I authored on Microsoft Docs), 2. Follow the instructions in the **Sample script** section by: - Saving and pushing the YAML file to your remote GitHub repository. - Filling in the placeholders in the Azure CLI code (there are 7 of them). - Saving or uploading the Azure CLI code to a file in Cloud Shell (Bash). - Entering `bash .sh` in Cloud Shell to run the script. You'll eventually see output similar to the following, but a new browser tab with the pipeline results does not spawn: ```console Go to the pipeline run's web page to view the output results for the 1st run. If the web page doesn't automatically appear, go to: https://dev.azure.com/v-dele/74a24d9d-c15a-4749-84f1-82b0ce81d3d7/_build/results?buildId=207 Press Enter to change the value of one of the variable group's nonsecret variables, then run again: ``` **Expected behavior** A new browser tab automatically opens that shows the results of the new pipeline run. **Environment summary** - An Azure DevOps personal access token - An Azure DevOps account or organization (in https://dev.azure.com) - Your own GitHub repository (to save the pipeline scripts) - Cloud Shell (https://shell.azure.com) using the Bash option **Additional context** If there are other Azure CLI commands that spawn a browser tab, they may also be hindered by this issue. Cc: @dbradish-microsoft
Author: DennisLee-DennisLee
Assignees: -
Labels: `DevOps`, `Pipelines`, `Service Attention`, `needs-triage`
Milestone: -
yonzhan commented 3 years ago

route to service team

jiasli commented 3 years ago

We use the Python library webbrowser to open web browser from Azure CLI. Cloud Shell runs on a docker-based Ubuntu so it doesn't have corresponding GUI component. Currently there is no way to launch browser from Cloud Shell.

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @maertendMSFT.

Issue Details
**Describe the bug** When you enter the command `az pipelines run --id --open`, a browser tab is supposed to open. The spawned tab will contain the new pipeline run's results page. The browser tab does open when I enter the command from my local Git Bash installation, but it doesn't open when I enter the command in a Cloud Shell (Bash) environment. I wrote an article where I had to use this command, but because of this issue, I had to create a workaround by outputting the URL that the page opens, and telling the user to open that URL if the new tab doesn't appear. **To Reproduce** 1. Go to (a sample article that I authored on Microsoft Docs), 2. Follow the instructions in the **Sample script** section by: - Saving and pushing the YAML file to your remote GitHub repository. - Filling in the placeholders in the Azure CLI code (there are 7 of them). - Saving or uploading the Azure CLI code to a file in Cloud Shell (Bash). - Entering `bash .sh` in Cloud Shell to run the script. You'll eventually see output similar to the following, but a new browser tab with the pipeline results does not spawn: ```console Go to the pipeline run's web page to view the output results for the 1st run. If the web page doesn't automatically appear, go to: https://dev.azure.com/v-dele/74a24d9d-c15a-4749-84f1-82b0ce81d3d7/_build/results?buildId=207 Press Enter to change the value of one of the variable group's nonsecret variables, then run again: ``` **Expected behavior** A new browser tab automatically opens that shows the results of the new pipeline run. **Environment summary** - An Azure DevOps personal access token - An Azure DevOps account or organization (in https://dev.azure.com) - Your own GitHub repository (to save the pipeline scripts) - Cloud Shell (https://shell.azure.com) using the Bash option **Additional context** If there are other Azure CLI commands that spawn a browser tab, they may also be hindered by this issue. Cc: @dbradish-microsoft
Author: DennisLee-DennisLee
Assignees: jiasli
Labels: `Cloud Shell`, `DevOps`, `Pipelines`, `Service Attention`
Milestone: -