Bird
Raised Fist0
Azurecloud~20 mins

Resource group commands in Azure - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Azure Resource Group Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate
2:00remaining
What is the output of this Azure CLI command?
You run the command az group list --query "[].name" -o json. What will this command output?
Azure
az group list --query "[].name" -o json
A["ResourceGroup1": {}, "ResourceGroup2": {}]
B[{"name": "ResourceGroup1"}, {"name": "ResourceGroup2"}]
C["ResourceGroup1", "ResourceGroup2", "ResourceGroup3"]
DSyntaxError: Invalid query syntax
Attempts:
2 left
💡 Hint
The command lists resource groups and extracts only their names as a list.
❓ Configuration
intermediate
2:00remaining
Which Azure CLI command creates a resource group in the East US region?
Select the correct command to create a resource group named MyGroup in the eastus location.
Aaz group create --name MyGroup --location eastus
Baz create group --name MyGroup --location eastus
Caz group create --resource-group MyGroup --location eastus
Daz group new --name MyGroup --location eastus
Attempts:
2 left
💡 Hint
The correct command uses 'az group create' with '--name' and '--location' parameters.
❓ security
advanced
2:00remaining
What happens if you delete a resource group with active resources?
You run az group delete --name MyGroup --yes on a resource group that contains virtual machines and storage accounts. What is the result?
AThe resource group is deleted but resources are moved to a default group.
BThe resource group and all its resources are deleted permanently.
CThe command fails with an error because resources are active.
DOnly the resource group is deleted; resources remain intact.
Attempts:
2 left
💡 Hint
Deleting a resource group deletes everything inside it.
❓ Architecture
advanced
2:00remaining
Which option correctly describes the best practice for organizing resources in Azure?
You want to organize resources by environment (dev, test, prod) and by application. Which approach is best?
ACreate separate resource groups for each environment and application combination.
BPut all resources in a single resource group regardless of environment or application.
CCreate resource groups only by application, ignoring environment.
DCreate one resource group per subscription and put all resources there.
Attempts:
2 left
💡 Hint
Resource groups help manage and isolate resources logically.
🧠 Conceptual
expert
2:00remaining
What is the effect of running az group update --name MyGroup --set tags.env=production?
You run the command to update a resource group. What happens to the tags of the resource group?
Azure
az group update --name MyGroup --set tags.env=production
AThe tag 'env' is added but existing tags with the same key cause an error.
BAll existing tags are removed and replaced with only 'env=production'.
CThe command fails because '--set' cannot update tags.
DThe tag 'env' is added or updated to 'production' without affecting other tags.
Attempts:
2 left
💡 Hint
The '--set' parameter updates or adds properties without removing others.

Practice

(1/5)
1. What is the main purpose of an Azure resource group?
easy
A. To store data permanently like a database
B. To run virtual machines directly
C. To organize and manage related cloud resources together
D. To provide internet access to resources

Solution

  1. Step 1: Understand resource group role

    Resource groups are containers that hold related Azure resources for easier management.
  2. Step 2: Differentiate from other services

    They do not store data or run services directly but organize resources like VMs, databases, etc.
  3. Final Answer:

    To organize and manage related cloud resources together -> Option C
  4. Quick Check:

    Resource group = container for related resources [OK]
Hint: Resource groups group resources logically for management [OK]
Common Mistakes:
  • Thinking resource groups store data
  • Confusing resource groups with virtual machines
  • Assuming resource groups provide network access
2. Which Azure CLI command correctly creates a resource group named MyGroup in the eastus region?
easy
A. az group create --name MyGroup --location eastus
B. az resource create --group MyGroup --location eastus
C. az group new --name MyGroup --region eastus
D. az create group --name MyGroup --location eastus

Solution

  1. Step 1: Identify correct command syntax

    The correct command to create a resource group is az group create with --name and --location parameters.
  2. Step 2: Check options for errors

    Options B, C, and D use incorrect commands or parameters not recognized by Azure CLI.
  3. Final Answer:

    az group create --name MyGroup --location eastus -> Option A
  4. Quick Check:

    Use az group create to create resource groups [OK]
Hint: Use 'az group create' with --name and --location [OK]
Common Mistakes:
  • Using 'az resource create' instead of 'az group create'
  • Using wrong flags like --region instead of --location
  • Incorrect command order or misspelling
3. What will be the output of the command az group list --query "[].name" -o tsv?
medium
A. A count of how many resource groups exist
B. Detailed JSON information about each resource group
C. An error because the query syntax is wrong
D. A list of resource group names, one per line

Solution

  1. Step 1: Understand the command parts

    az group list lists all resource groups. The --query "[].name" extracts only the names. The -o tsv outputs plain text, one name per line.
  2. Step 2: Interpret output format

    The output will be a simple list of resource group names, each on its own line, without JSON formatting.
  3. Final Answer:

    A list of resource group names, one per line -> Option D
  4. Quick Check:

    Query extracts names; tsv outputs plain list [OK]
Hint: Use --query with -o tsv to get plain lists [OK]
Common Mistakes:
  • Expecting JSON output with -o tsv
  • Misunderstanding query syntax
  • Thinking it returns count instead of names
4. You run az group delete --name MyGroup but get an error saying the resource group does not exist. What is the likely cause?
medium
A. The resource group name is misspelled or does not exist
B. You need to specify the location with --location
C. The delete command requires confirmation flag
D. You must stop all resources inside before deleting

Solution

  1. Step 1: Analyze error message

    The error says the resource group does not exist, so the name is likely wrong or the group was deleted already.
  2. Step 2: Check command requirements

    The delete command does not require location or stopping resources first; it deletes all resources inside automatically.
  3. Final Answer:

    The resource group name is misspelled or does not exist -> Option A
  4. Quick Check:

    Delete fails if group name is wrong [OK]
Hint: Check spelling of resource group name first [OK]
Common Mistakes:
  • Assuming location is needed to delete
  • Thinking resources must be stopped manually
  • Forgetting to confirm deletion (not required)
5. You want to delete a resource group named TestGroup without any confirmation prompts. Which command should you use?
hard
A. az group remove --name TestGroup --yes
B. az group delete --name TestGroup --yes
C. az group delete --name TestGroup --force
D. az group remove --name TestGroup --force

Solution

  1. Step 1: Identify correct delete command

    The command to delete a resource group is az group delete. The --yes flag skips confirmation prompts.
  2. Step 2: Verify flags and commands

    --force is not a valid flag for this command, and az group remove is not a recognized command.
  3. Final Answer:

    az group delete --name TestGroup --yes -> Option B
  4. Quick Check:

    Use --yes to skip confirmation on delete [OK]
Hint: Add --yes to delete without prompt [OK]
Common Mistakes:
  • Using --force instead of --yes
  • Using az group remove instead of az group delete
  • Omitting confirmation flag and expecting no prompt
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard