Skip to content

Commit f75d764

Browse files
committed
updated bash script example using the az cli command to set cluster manager extended location environment variable
1 parent d9cda78 commit f75d764

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

articles/operator-nexus/howto-use-vm-console-service.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ To help set up the environment for access to Virtual Machines, define these envi
4949
```bash
5050
# CM_HOSTED_RESOURCES_RESOURCE_GROUP: Cluster Manager resource group name
5151
export CM_HOSTED_RESOURCES_RESOURCE_GROUP="my-contoso-console-rg"
52-
# CM_EXTENDED_LOCATION: Cluster Manager Extended Location, can be retrieved but you will need access rights to execute certain Azure CLI commands
53-
export CM_EXTENDED_LOCATION="/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"
5452
5553
# VIRTUAL_MACHINE_NAME: Virtual Machine name you want to access through VM Console service
5654
export VIRTUAL_MACHINE_NAME="my-undercloud-vm"
55+
# CM_EXTENDED_LOCATION: Cluster Manager Extended Location, can be retrieved but you will need access rights to execute certain Azure CLI commands
56+
export CM_EXTENDED_LOCATION=$(az networkcloud virtualmachine show --name ${VIRTUAL_MACHINE_NAME} --resource-group ${VIRTUAL_MACHINE_RG} --query "consoleExtendedLocation" | jq -r '.consoleExtendedLocation.name')
57+
5758
# CONSOLE_PUBLIC_KEY: Public Key matching Private Key to be used when establish `ssh` session, e.g., `ssh -i $HOME/.ssh/id-rsa`
5859
export CONSOLE_PUBLIC_KEY="xxxx-xxxx-xxxxxx-xxxx"
5960
# CONSOLE_EXPIRATION_TIME: Expiration date and time (RFC3339 format) for any `ssh` session with a virtual machine.

0 commit comments

Comments
 (0)