Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Azure Advisor Recommendations Setup
📖 Scenario: You are managing an Azure subscription and want to use Azure Advisor to get personalized best practice recommendations. These recommendations help optimize your resources for cost, security, reliability, operational excellence, and performance.
🎯 Goal: Set up a simple Azure Advisor configuration to retrieve and display recommendations for your subscription using Azure CLI commands in a script.
📋 What You'll Learn
Create a variable to hold your Azure subscription ID.
Create a variable to specify the recommendation category to filter.
Write a command to list Azure Advisor recommendations filtered by the category.
Add a command to show details of a specific recommendation.
💡 Why This Matters
🌍 Real World
Azure Advisor helps cloud administrators optimize their Azure resources by providing actionable recommendations.
💼 Career
Knowing how to programmatically access Azure Advisor recommendations is useful for cloud engineers and administrators to automate cost and security optimizations.
Progress0 / 4 steps
1
Set Azure Subscription ID
Create a variable called subscription_id and set it to the exact string "12345678-1234-1234-1234-123456789abc" representing your Azure subscription ID.
Azure
Hint
The subscription ID is a string in quotes. Assign it exactly as given.
2
Set Recommendation Category Filter
Create a variable called recommendation_category and set it to the exact string "Cost" to filter Azure Advisor recommendations by cost category.
Azure
Hint
The category is a string and must match exactly "Cost".
3
List Azure Advisor Recommendations
Write a command string called list_recommendations_cmd that uses az advisor recommendation list with the subscription ID and filters by the recommendation category variable. The command should be exactly: az advisor recommendation list --subscription {subscription_id} --category {recommendation_category} using f-string formatting.
Azure
Hint
Use an f-string to insert variables into the command string exactly as shown.
4
Show Details of a Specific Recommendation
Create a command string called show_recommendation_cmd that uses az advisor recommendation show with the subscription ID and a recommendation ID variable called recommendation_id. Set recommendation_id to the exact string "1234abcd-12ab-34cd-56ef-1234567890ab". The command should be exactly: az advisor recommendation show --subscription {subscription_id} --recommendation-id {recommendation_id} using f-string formatting.
Azure
Hint
Assign the recommendation ID string exactly and use an f-string to build the show command.
Practice
(1/5)
1. What is the main purpose of Azure Advisor?
easy
A. To monitor network traffic in real-time
B. To provide personalized recommendations to optimize your Azure resources
C. To create new Azure resources automatically
D. To manage user access and permissions
Solution
Step 1: Understand Azure Advisor's role
Azure Advisor analyzes your Azure resources and suggests improvements.
Step 2: Compare options with Advisor's function
Only To provide personalized recommendations to optimize your Azure resources matches the purpose of giving personalized recommendations.
Final Answer:
To provide personalized recommendations to optimize your Azure resources -> Option B
Quick Check:
Advisor = personalized recommendations [OK]
Hint: Advisor gives tips to improve, not create or monitor [OK]
Common Mistakes:
Confusing Advisor with monitoring tools
Thinking Advisor manages user permissions
Assuming Advisor creates resources automatically
2. Which Azure CLI command shows Advisor recommendations for your subscription?
easy
A. az advisor recommendation list
B. az vm list
C. az network watcher show
D. az storage account create
Solution
Step 1: Identify command for Advisor recommendations
The command az advisor recommendation list lists Advisor tips.
Step 2: Check other commands' purposes
Other commands manage VMs, network watcher, or storage, unrelated to Advisor.
Final Answer:
az advisor recommendation list -> Option A
Quick Check:
Advisor recommendations = az advisor recommendation list [OK]
Hint: Look for 'advisor' in the command for recommendations [OK]
Common Mistakes:
Using VM or storage commands instead of Advisor
Confusing network watcher with Advisor
Missing 'recommendation' keyword in command
3. You run az advisor recommendation list --category Performance. What will you see?
medium
A. List of all security alerts
B. Network traffic statistics
C. Details of billing invoices
D. Recommendations to improve your resource performance
Solution
Step 1: Understand the command filter
The command filters Advisor recommendations by the Performance category.
Step 2: Match output with options
Only Recommendations to improve your resource performance describes performance improvement tips, matching the command.
Final Answer:
Recommendations to improve your resource performance -> Option D
Quick Check:
Performance category = performance tips [OK]
Hint: Filter by category shows matching recommendations [OK]
Common Mistakes:
Expecting security alerts instead of performance tips
Confusing billing info with Advisor output
Thinking network stats appear in Advisor list
4. You tried to run az advisor recommendation list --category cost but got an error. What is a likely cause?
medium
A. The Azure CLI is not installed
B. Your Azure subscription has no resources
C. You misspelled the category name; it should be 'Cost' with capital C
D. The command requires administrator privileges
Solution
Step 1: Check category name case sensitivity
Azure CLI commands often require exact category names; 'cost' should be 'Cost'.
Step 2: Evaluate other options
Subscription without resources or CLI not installed cause different errors; admin rights not needed.
Final Answer:
You misspelled the category name; it should be 'Cost' with capital C -> Option C
Quick Check:
Category names are case-sensitive [OK]
Hint: Check exact spelling and case of category names [OK]
Common Mistakes:
Ignoring case sensitivity in command options
Assuming admin rights are required
Thinking no resources means no command output error
5. Your company wants to reduce Azure costs and improve security. How can Azure Advisor help you achieve both?
hard
A. By providing cost-saving and security improvement recommendations for your resources
B. By automatically deleting unused resources
C. By increasing the size of all virtual machines
D. By disabling all network traffic temporarily
Solution
Step 1: Identify Advisor's recommendation scope
Azure Advisor gives tips on cost savings and security improvements based on your resource usage.
Step 2: Evaluate other options for feasibility
Advisor does not delete resources, resize VMs automatically, or disable network traffic.
Final Answer:
By providing cost-saving and security improvement recommendations for your resources -> Option A
Quick Check:
Advisor = cost + security tips [OK]
Hint: Advisor suggests actions; it doesn't change resources automatically [OK]
Common Mistakes:
Thinking Advisor deletes or changes resources automatically