Professional Documents
Culture Documents
az login
#Create Tags
az resource tag --tags Department=Finance \
--resource-group msftlearn-core-infrastructure-rg \
--name msftlearn-vnet1 \
--resource-type "Microsoft.Network/virtualNetworks"
#To get all the resources that have a particular tag and value, use az resource
list:
az resource list --tag Dept=Finance
#To get resource groups that have a specific tag, use az group list:
az group list --tag Dept=IT
#To view the resources that aren't compliant under this new assignment, get the
policy assignment ID by running the following commands:
az policy assignment list --query "[?displayName=='Audit VMs without managed disks
Assignment'].id"
#To lock a resource, provide the name of the resource, its resource type, and its
resource group name.
az lock create --name LockSite --lock-type CanNotDelete --resource-group
exampleresourcegroup --resource-name examplesite --resource-type
Microsoft.Web/sites
#To lock a resource group, provide the name of the resource group.
az lock create --name LockGroup --lock-type CanNotDelete --resource-group
exampleresourcegroup