Enable resource logging in Azure Traffic Manager
This article describes how to enable collection of diagnostic resource logs and access log data for a Traffic Manager profile.
Azure Traffic Manager resource logs can provide insight into the behavior of the Traffic Manager profile resource. For example, you can use the profile's log data to determine why individual probes have timed out against an endpoint.
Enable resource logging
This article has been updated to use the new Azure PowerShell Az module. You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. For Az module installation instructions, see Install Azure PowerShell.
You can run the commands that follow in the Azure Cloud Shell, or by running PowerShell from your computer. The Azure Cloud Shell is a free interactive shell. It has common Azure tools preinstalled and configured to use with your account.
If you run PowerShell from your computer, you need the Azure PowerShell module, 1.0.0 or later. You can run
Get-Module -ListAvailable Az to find the installed version. If you need to install or upgrade, see Install Azure PowerShell module. If you are running PowerShell locally, you also need to run
Login-AzAccount to sign in to Azure.
Retrieve the Traffic Manager profile:
To enable resource logging, you need the ID of a Traffic Manager profile. Retrieve the Traffic Manager profile that you want to enable resource logging for with Get-AzTrafficManagerProfile. The output includes the Traffic Manager profile's ID information.
Get-AzTrafficManagerProfile -Name <TrafficManagerprofilename> -ResourceGroupName <resourcegroupname>
Enable resource logging for the Traffic Manager profile:
Enable resource logging for the Traffic Manager profile using the ID obtained in the previous step with Set-AzDiagnosticSetting. The following command stores verbose logs for the Traffic Manager profile to a specified Azure Storage account.
Set-AzDiagnosticSetting -ResourceId <TrafficManagerprofileResourceId> -StorageAccountId <storageAccountId> -Enabled $true
Verify diagnostic settings:
Verify diagnostic settings for the Traffic Manager profile using Get-AzDiagnosticSetting. The following command displays the categories that are logged for a resource.
Get-AzDiagnosticSetting -ResourceId <TrafficManagerprofileResourceId>
Ensure that all log categories associated with the Traffic Manager profile resource display as enabled. Also, verify that the storage account is correctly set.
Access log files
Sign in to the Azure portal.
Navigate to your Azure Storage account in the portal.
On the Overview page of your Azure storage account, under Services select Blobs.
For Containers, select insights-logs-probehealthstatusevents, and navigate down to the PT1H.json file and click Download to download and save a copy of this log file.
Traffic Manager log schema
All resource logs available through Azure Monitor share a common top-level schema, with flexibility for each service to emit unique properties for their own events. For top-level resource logs schema, see Supported services, schemas, and categories for Azure Resource Logs.
The following table includes logs schema specific to the Azure Traffic Manager profile resource.
|Field Name||Field Type||Definition||Example|
|EndpointName||String||The name of the Traffic Manager endpoint whose health status is being recorded.||myPrimaryEndpoint|
|Status||String||The health status of the Traffic Manager endpoint that was probed. The status can either be Up or Down.||Up|
- Learn more about Traffic Manager Monitoring