Skip main navigation

Azure Resource Manager: How to identify and log errors

This article will help you to identify, understand, and troubleshoot errors within the Azure Resource Manager platform.

As with any other platform or software, you may experience issues or come across errors.

Let’s explore logging, troubleshooting and diagnostics.

Activity Logs

The activity log is a platform log in Azure that provides insight into subscription-level events. This includes information such as when a resource is modified or when a virtual machine is started.

Activity logs are important for troubleshooting Azure deployments because they allow you to determine the following:

  • What operations were taken on the resources in your subscription?
  • Who initiated the operation (although operations initiated by a back-end service do not return a user as the caller).
  • When the operation occurred.
  • The status of the operation.
  • The values of other properties that might help you research the operation.

The logs contain all the write operations (but not the read operations that were performed on resources) and are retained for 90 days.

The logs can be accessed through the Azure portal, Azure CLI or PowerShell, and with REST API.

Azure Resource Manager troubleshooting template

In Microsoft Azure, there are two kinds of errors:

  • Validation errors result from scenarios that can be predetermined to cause a problem, including syntax errors in a template or trying to deploy resources that would exceed a subscription quota.
  • Deployment errors result from conditions that occur during the deployment process, such as trying to access a resource that is being deployed in parallel.

These errors appear in the activity log and return an error code that can be used to troubleshoot the deployment. Validation errors do not appear in the deployment history because the deployment did not start.

Common error codes and their descriptions can be found here.

Configuring diagnostic settings

Microsoft Azure Diagnostics allows you to collect diagnostic data on a deployed app and transfer it to an Azure Storage account or services such as Application Insights. This data can help debug and troubleshoot, measure performance, and monitor resource usage, traffic analysis and capacity planning and auditing.

You can use Azure Resource Manager templates to configure the diagnostic settings on a resource upon creation of that resource to start streaming logs and metrics to event hubs and archiving them in a storage account, or to send them to log analytics when a resource is created.

The method for enabling diagnostic logs with an Azure Resource Manager template depends on the resource type:

To enable diagnostic logs:

  1. Create a template as a JSON file that describes how to create the resource and enable diagnostics.
  2. Deploy the template by using any deployment method.

DIAGNOSTIC GRAPHIC

Additional information

  • You can click a recommendation to learn additional information about it.
  • You can also learn about actions that you can perform to take advantage of an opportunity or resolve an issue.
  • Azure Advisor offers recommendations with inline actions or documentation links.
  • Clicking an inline action takes you through a guided user journey to implement it.
  • Clicking a documentation link will take you to the documentation that describes how you can manually implement the action.

Azure Advisor updates recommendations on an hourly basis. If you don’t intend to take immediate action on a recommendation, you can snooze it for a set time period or dismiss it.

This article is from the free online

Microsoft Future Ready: DevOps Development, Implementation and Azure Automation

Created by
FutureLearn - Learning For Life

Our purpose is to transform access to education.

We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.

We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.

Learn more about how FutureLearn is transforming access to education