Implementing Azure Best Practices using Azure Advisor

If you want to implement Azure best practices for your deployed resources, then Azure Advisor is your personal cloud assistant. In this post we will discuss about implementing Azure best practices using Azure Advisor.

What Azure Advisor does?

  • Based on the telemetry data and the configuration of resources, Advisor analyses them and improve the performance and cost.
  • It gives personalized recommendations and proposed actions for the same.
  • Recommendations are across various categories like cost, performance, security and high-availability.

Best Practices recommended by Azure Advisor Category wise

Cost

When it comes to cost, it is the most important factor which is looked upon by businesses. Advisor recommends optimizing and reducing the overall Azure cost by recognizing resources which are underutilized and idle. The recommendations can be seen on the Advisor dashboard, Cost tab.

Azure Data Factory pipeline optimization

ADF pipelines come with a cost hence Advisor will identify which pipelines are failing and will recommend to either resolve the issues or delete them if they are not needed. This is because even if pipelines are not working still they are billed.

ExpressRoute circuit optimization

If the ExpressRoute circuit is in the ‘Not Provisioned’ state for more than 30 days, Advisor recommends deleting the same.

VM optimization

Advisor monitors the VM for 7 days and then recommends the new VM size if the network utilization is less than 2% and CPU utilization is  less than or equals 5%. Also it looks at the VM usage for the past month and can recommend if cost can be lowered by buying an Azure reservation. It advises on which regions and sizes where the savings will be more by giving estimations.

Virtual Network Gateway optimization

If any VNET gateways are idle for over 3 months, Advisor recommends reconfiguring or deleting the same.

Snapshot optimization

Advisor will identify if any snapshots are stored in Premium Storages and recommend moving them to Standard Storage which will reduce around 60% costing. This is irrespective of the parent disk’s storage type.

Public I.P address optimizations

I.P addresses are usually associated to Azure resources such as VMs or Load Balances. Hence if some I.P addresses are not associated with them Advisor recommends deleting them.

Performance

Advisor identifies performance related issues in your applications. The recommendations can be seen on the Advisor dashboard, Performance tab.

App Service performance

Advisor detect which apps are causing CPU or memory resources threshold limits with rectification steps. It also advises which resources can be put in a specific region for good performance. For e.g. An application and its connected database can be advised to be put under a particular location.

Disks I/O performance

If Advisor detects that a VM is reaching its peak scale, the VM might be vulnerable to I/O throttling so it will recommend the use of Managed Disks to avoid any performance issues. Also Advisor will monitor VM with standard disks and if the transaction volumes are high it will recommend using premium disks.

SQL Azure DB

Based on the usage history, Advisor integrates with SQL DB Advisor for recommending performance changes for your SQL Azure DB.

SQL DW Table Keys

Usually SQL Azure tables have distribution keys. This results unwanted data transfer while running our workloads. It will recommend revisit of all such keys.

Azure MySQL and Azure PostgreSQL performance

  1. Connection constraints – Sometimes the db servers are slow when connections to the server fail due to memory upper limits. Azure Advisor will recommend upgrading these connection limits to increase server memory by scaling up the compute resources have more cores.
  2. Memory constraints – Any background process with a lot of internal workload or a bad query plan can result in a low cache hit ration. This in turn can slow the query performance and an increase in IOPS (Input Output Operations). Advisor notices the servers affected due to this and recommend either fixing the query plan, increasing the storage size or moving to an SKU with more memory. Advisor will also identify servers with high read-intensive workloads and advise for additional read replicas to balance the read workloads.

SQL Data Warehouse tables cache utilization

If the SQL DW has low hit and high cache used percentage, there might be cache eviction which results in lower performance of SQL DW. Hence to increase query performance, Advisor recommends that the SQL Data Warehouse be scaled up to ensure enough cache is allocated for workloads.

SQL Data Warehouse table statistics

Advisor will monitor tables that do not have latest updated table statistics and will recommend creating or updating table statistics. The query optimizer uses revised statistics to derive number of rows in the query resulting in a fast performing query plan.

SQL Data Warehouse replicated tableconversion

There might be certain tables are not replicated that would benefit from conversion. Hence Advisor recommends conversion for the same based on parameters like table size, number of columns, number of partitions and distribution type.

Set Azure Cosmos DB query page size to -1 (MaxItemCount)

If your Azure Cosmos DB containers are using the query page size of 100 Azure Advisor will identify them and recommend using a page size of -1 resulting in faster scans.

Azure Cosmos DB account region addition based on traffic

Azure Cosmos DB accounts might have traffic from a region that is not currently configured. Advisor will identify and recommend adding that region. Hence requests coming from that region will have improved latency for and will have availability in case of region failures.

Cache size scalingfor improving cache and application performance

Cache instances perform best when not running under high memory pressure, high server load, or high network bandwidth. Advisor will identify Cache instances in running under high server load, network bandwidth or memory pressure. These might experience data loss, unavailable or unresponsive. So it recommends scaling to a different size or SKU with greater capacity or applying best practices to reduce server load, network bandwidth.

Security

Advisor identifies performance related issues in our applications by integrating with Azure Security Center. The recommendations can be seen on the Advisor dashboard and Security tab.

It can detects security issues and recommend.

For more information see
https://docs.microsoft.com/en-us/azure/security-center/security-center-recommendations

High Availability

Advisor helps in ensuring and improving business continuity for critical applications. The recommendations can be seen on the Advisor dashboard, High Availability tab.

Upgrade Azure Cosmos DB .NET SDK to latest Nuget version

If any Azure Cosmos DB accounts are using old versions of the .NET SDK,Advisor will find and advice upgrading them to the latest version from Nuget.

Upgrade Azure Cosmos DB Spark Connector to latest Maven version

If any Azure Cosmos DB accounts are using old versions of the Cosmos DB Spark connector, Advisorwill find and advice upgrading them to the latest version from Maven.

Upgrade your Azure Cosmos DB Java SDK to the latest version from Maven

If Azure Cosmos DB accounts are using old versions of the Java SDK, Advisor willfind and advice upgrading them to the latest version from Maven.

VM replication

There might be some virtual machines that do not have replication enabled on another region hence might be prone to those regional outages. Hence Advisor will identify VMs that do not have replication enabled and recommend enabling replication so that in the event of an outage the VMs can be quickly brought up and running.

VM fault tolerance

Advisor identifies VMs that are not included in an availability set and advises moving them into an availability set. Two or more VMs should be grouped in an availability set. This ensures that at least one VM is available during any maintenance event.

Use Managed Disks to improve data reliability

Disks that share storage accounts are vulnerable to single storage scale unit failures during outages. Advisor will advisesuch availability sets to be migrated to Azure Managed Disks so that the VMs are isolated sufficiently to prevent single point of failure.

How to work with Azure Advisor

Azure Advisor runs in the background automatically to find resources recently and can take up to a day to provide recommendations on those resources

Sign in to the Azure portal with your subscription credentials, so you can see the Azure Portal Dashboard as below

Azure Portal
Image source: https://docs.microsoft.com/


Click All services -> Service menu pane -> Monitoring and Management -> Advisor. The Advisor dashboard is displayed.

Azure Advisor Menu
Image source: https://docs.microsoft.com/

Now you will be able to see recommendations in the categories High AvailabilitySecurityPerformance and Cost as well as the cost savings.

Azure Advisor Dashoboard
Image source: https://docs.microsoft.com/

Get recommendations

Perform above steps from 1 – 3. Then click any of the categories as in above image. Click the recommendation and review the steps given. Click on the Recommended Action to implement the same.

Filter recommendations

Perform above steps 1 and 2. Now you can filter recommendations by the subscriptions, recommendation status or resource type.

Download recommendations

You can also download the recommendations by clicking on Download as CSV or Download as PDF on the action bar

Azure Advisor Download Recommendations
Image source: https://docs.microsoft.com/

Summary

As you saw in this post, if you are a part of a DevOps team for your project and have been assigned with the task of making your Azure infrastructure cost effective, efficient and highly available, then Azure Advisor is a very indispensable tool.

Hope you enjoyed reading this article of implementing best practices using Azure Advisor. Do remember to share this to anyone who might find it helpful.

Hitesh Boricha

I have a little over a decade experience in the IT industry. Having worked in various roles in this industry, I am passionate about technology.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.