BlogPost

Azure - Manage Azure resources and resource groups by using Azure CLI - Part 2

Azure - Manage Azure resources and resource groups by using Azure CLI - Part 2



This is the second part of using Azure CLI - where we will continue to manage Azure resources and resource groups by using Azure CLI...link to part 1



Task One

Manage Azure resources and resource groups by using Azure CLI

From Administrator: Command Prompt, I typed in the following command (please use the resource group that resides in your Azure subscriptions) and then press Enter:


az group show --name 20533D0101-LabRG



From Administrator: Command Prompt, type the following command and then press Enter:


az resource list --resource-group 20533D0102-LabRG



In the output of the previous command, at Administrator: Command Prompt, note the value of the id property of the 20533D0101-rt. You will use this value in the next command.

From Administrator: Command Prompt, type the following command (replace guid with ID of your Azure subscription) and then press Enter:


az resource move --ids
"/subscriptions/{guid}/resourceGroups/20533D0102-LabRG/providers
/Microsoft.Network/routeTables/20533D0101-rt" --destination-group "20533D0101-LabRG"


Wait for the operation to complete.





From Administrator: Command Prompt, type the following command and then press Enter:


az resource list --resource-group 20533D0101-LabRG


Verify that the route table was moved back to the original resource group.



Task Two

Manage Azure resources and resource groups by using Azure CLI

From Administrator: Command Prompt, type the following command and then press Enter:


az group show --name 20533D0101-LabRG



From Administrator: Command Prompt, type the following command and then press Enter:


az resource list --resource-group 20533D0102-LabRG



In the output of the previous command, at Administrator: Command Prompt, note the value of the id property of the 20533D0101-rt. You will use this value in the next command.

From Administrator: Command Prompt, type the following command (replace guid with ID of your Azure subscription) and then press Enter:


az resource move --ids
"/subscriptions/{guid}/resourceGroups/20533D0102-LabRG/providers/Microsoft.Network
/routeTables/20533D0101-rt" --destination-group "20533D0101-LabRG"




Verify that the route table was moved back to the original resource group.



In the next post we will go through removing resourse groups