az-resource
Manage Azure resources generically across all types
TLDR
SYNOPSIS
az resource subcommand [options]
DESCRIPTION
az resource is a subcommand of the Azure CLI that manages Azure resources generically across all resource types. It provides a unified interface for operations that apply to any resource, regardless of the specific service.Resources in Azure are identifiable entities like virtual machines, storage accounts, or databases. Each has a unique resource ID following the pattern /subscriptions/{sub}/resourceGroups/{rg}/providers/{provider}/{type}/{name}.This command is useful for scripting cross-resource operations, bulk management, and working with resource types that may not have dedicated CLI command groups.
PARAMETERS
list
List resources with optional filters.show
Display resource details.create
Create a resource from properties.delete
Remove a resource.update
Update a resource by PUT request.patch
Update a resource by PATCH request.move
Move resources between groups or subscriptions.tag
Tag a resource.invoke-action
Invoke an action on a resource.wait
Wait until a condition on a resource is met (provisioning, deletion, etc.).--ids ids
One or more resource IDs.--resource-group rg
Resource group name.--resource-type type
Resource type (e.g., Microsoft.Compute/virtualMachines).--name name
Resource name.--namespace namespace
Provider namespace.--api-version version
API version for the resource type.--set property=value
Update a property on the resource (e.g., properties.someProperty=value).--add list property=value
Add an object to a list of objects (e.g., --add tags.newKey=value).--remove property/index
Remove a property or an element from a list.--tags tags
Space-separated tags (key=value).--query-string query
Filter resources with OData query.
CAVEATS
Some resources cannot be moved between resource groups or subscriptions. Deleting a resource may leave orphaned dependent resources. API version compatibility varies by resource type. Generic commands may lack service-specific validations available in dedicated command groups. Resource moves may take extended time and have service-specific limitations.
HISTORY
The generic resource commands have been part of the Azure CLI since Azure CLI 2.0 launched in 2017. They provide ARM (Azure Resource Manager) API access for any resource type. As Azure has grown, dedicated command groups for services have expanded, but the generic resource commands remain valuable for automation, bulk operations, and accessing new resource types before dedicated commands exist.
SEE ALSO
az(1), az-group(1), az-deployment(1), az-provider(1), az-tag(1)
