azure-cli-extensions icon indicating copy to clipboard operation
azure-cli-extensions copied to clipboard

[Serial-Console]: az serial-console connect: Change to use different region for url calls when custom storage account firewalls are enabled

Open rhkodiak opened this issue 3 years ago • 7 comments


This changed introduces the ability when using custom storage accounts with the firewall enabled to use the region (i.e. westcentralUS) when connecting to serial-console. If the VIirtual Machine and custom storage account live in the same region then the user gets a Forbidden message when trying to connect to serial-console. These changes allow the code to find the pairing region and connect to serial-console through that region url.

Screenshot 2022-09-28 101831 .

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

Related command

az serial-console connect

General Guidelines

  • [x] Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • [x] Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
The precondition is to put your code inside this repository and upgrade the version in the pull request but do not modify src/index.json.

rhkodiak avatar Sep 28 '22 15:09 rhkodiak

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

ghost avatar Sep 28 '22 15:09 ghost

Serial-Console

yonzhan avatar Sep 28 '22 22:09 yonzhan

/azp run

wangzelin007 avatar Oct 07 '22 06:10 wangzelin007

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Oct 07 '22 06:10 azure-pipelines[bot]

@yonzhan: @rhkodiak has run the tests successfully locally, is there some environmental disparity that causes the CI checks to fail?

brendank310 avatar Oct 13 '22 14:10 brendank310

@rhkodiak @brendank310

https://dev.azure.com/azclitools/public/_build/results?buildId=8724&view=logs&j=59e8686e-5e74-514d-6cad-f7d66c66b425&t=59602323-6717-504d-f2cc-5c81369f935f&l=1003

According to the error log, it shows that we need use virtual machines == 2022-08-01, But in your recording files virtual Machines version is 2022-03-01,

Latest profile in Azure CLI: https://github.com/Azure/azure-cli/blob/c1c805f5680f27b17412acf6fd53228b50edb8b2/src/azure-cli-core/azure/cli/core/profiles/_shared.py#L153

Your recording file's virtual machines version: https://github.com/Azure/azure-cli-extensions/blob/bb45618e76a71ff8eef0dd06ec01fbde33ce0e32/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VM.yaml#L16

Here are the suggestions:

  1. git pull the latest code from Azure/azure-cli
  2. azdev setup -c
  3. merge the latest code into your branch
  4. rerun all the tests and make sure API version is 2022-08-01

wangzelin007 avatar Oct 14 '22 01:10 wangzelin007

@wangzelin007 @brendank310

Thank you for the help! I applied what you suggested and the tests are passing now. I couldn’t tell from the error logs what the problem was so much appreciated.

The PR is ready for your review and approval.

rhkodiak avatar Oct 14 '22 17:10 rhkodiak

[Release] Update index.json for extension [ serial-console ] : https://dev.azure.com/azclitools/internal/_build/results?buildId=10355&view=results

azclibot avatar Oct 21 '22 02:10 azclibot