This worked for me!!!
$IPADDRESS=az vm list-ip-addresses --resource-group "learn-2cd37bff-96d3-425a-a823-b77b3f8d70d8" --name my-vm --query "[].virtualMachine.network.publicIpAddresses[*].ipAddress" --output tsv
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello , i had created the vitual VMs before , i want to create a bash variable in this command :
IPADDRESS="$(az vm list-ip-addresses --resource-group "[learn-create-subscription]" --name my-vm --query "[].virtualMachine.network.publicIpAddresses[*].ipAddress" --output tsv)"
i receipted an error :
'IPADDRESS=$(az vm list-ip-addresses --resource-group [learn-create-subscription] --name my-vm --query [].virtualMachine.network.publicIpAddresses[*].ipAddress --output tsv)' is misspelled or not recognized by the system.
how can i fix this, it may be wrong a syntax right ? This question is related to the following Learning Module
This worked for me!!!
$IPADDRESS=az vm list-ip-addresses --resource-group "learn-2cd37bff-96d3-425a-a823-b77b3f8d70d8" --name my-vm --query "[].virtualMachine.network.publicIpAddresses[*].ipAddress" --output tsv
It may be common but verify you're in bash and not in powershll
Hi 197CT31523 - TRẦN NGUYỄN MINH THÀNH - K25T-IT1,
Thank you for reaching out to Q&A forum. Based on the query provided, it's evident that you are encountering difficulties related to azure cloud shell.
IPADDRESS="$(az vm list-ip-addresses --resource-group "learn-316a3089-2d07-40d4-90a5-9076280d0c6b" --name my-vm --query "[].virtualMachine.network.publicIpAddresses[*].ipAddress" --output tsv)"
We've made several attempts from our side and managed to complete the exercise successfully each time. Below is a screenshot for your reference:
Continue the learning process, if you are still running into issues, kindly attach the screenshots for reference and please let us know in the comments. We are happy to assist you.
If the information is helpful, please Accept Answer & Upvote so that it would be helpful to other community members.
Thank You.
The commands mentioned above weren't working in my Azure portal and tried several times.