- Article
- 9 minutes to read
An important part of any Analysis Services solution is monitoring how your servers are performing. Azure Analysis services is integrated with Azure Monitor. With Azure Monitor resource logs, you can monitor and send logs to Azure Storage, stream them to Azure Event Hubs, and export them to Azure Monitor logs.
Note
We recommend that you use the Azure Az PowerShell module to interact with Azure. See Install Azure PowerShell to get started. To learn how to migrate to the Az PowerShell module, see Migrate Azure PowerShell from AzureRM to Az.
What's logged?
You can select Engine, Service, and Metrics categories.
Engine
Selecting Engine logs all xEvents. You cannot select individual events.
XEvent categories | Event name |
---|---|
Security Audit | Audit Login |
Security Audit | Audit Logout |
Security Audit | Audit Server Starts And Stops |
Progress Reports | Progress Report Begin |
Progress Reports | Progress Report End |
Progress Reports | Progress Report Current |
Queries | Query Begin |
Queries | Query End |
Commands | Command Begin |
Commands | Command End |
Errors & Warnings | Error |
Discover | Discover End |
Notification | Notification |
Session | Session Initialize |
Locks | Deadlock |
Query Processing | VertiPaq SE Query Begin |
Query Processing | VertiPaq SE Query End |
Query Processing | VertiPaq SE Query Cache Match |
Query Processing | Direct Query Begin |
Query Processing | Direct Query End |
Service
Operation name | Occurs when |
---|---|
ResumeServer | Resume a server |
SuspendServer | Pause a server |
DeleteServer | Delete a server |
RestartServer | User restarts a server through SSMS or PowerShell |
GetServerLogFiles | User exports server log through PowerShell |
ExportModel | User exports a model in the portal by using Open in Visual Studio |
All metrics
The Metrics category logs the same Server metrics to the AzureMetrics table. If you're using query scale-out and need to separate metrics for each read replica, use the AzureDiagnostics table instead, where OperationName is equal to LogMetric.
Setup diagnostics logging
Azure portal
In Azure portal > server, click Diagnostic settings in the left navigation, and then click Turn on diagnostics.
(Video) Monitoring in Azure Analysis Services (Part 1 of 3)In Diagnostic settings, specify the following options:
Name. Enter a name for the logs to create.
Archive to a storage account. To use this option, you need an existing storage account to connect to. See Create a storage account. Follow the instructions to create a Resource Manager, general-purpose account, then select your storage account by returning to this page in the portal. It may take a few minutes for newly created storage accounts to appear in the drop-down menu.
Stream to an event hub. To use this option, you need an existing Event Hub namespace and event hub to connect to. To learn more, see Create an Event Hubs namespace and an event hub using the Azure portal. Then return to this page in the portal to select the Event Hub namespace and policy name.
Send to Azure Monitor (Log Analytics workspace). To use this option, either use an existing workspace or create a new workspace resource in the portal. For more information on viewing your logs, see View logs in Log Analytics workspace in this article.
Engine. Select this option to log xEvents. If you're archiving to a storage account, you can select the retention period for the resource logs. Logs are autodeleted after the retention period expires.
Service. Select this option to log service level events. If you are archiving to a storage account, you can select the retention period for the resource logs. Logs are autodeleted after the retention period expires.
Metrics. Select this option to store verbose data in Metrics. If you are archiving to a storage account, you can select the retention period for the resource logs. Logs are autodeleted after the retention period expires.
Click Save.
If you receive an error that says "Failed to update diagnostics for <workspace name>. The subscription <subscription id> is not registered to use microsoft.insights." follow the Troubleshoot Azure Diagnostics instructions to register the account, then retry this procedure.
If you want to change how your resource logs are saved at any point in the future, you can return to this page to modify settings.
PowerShell
Here are the basic commands to get you going. If you want step-by-step help on setting up logging to a storage account by using PowerShell, see the tutorial later in this article.
To enable metrics and resource logging by using PowerShell, use the following commands:
To enable storage of resource logs in a storage account, use this command:
Set-AzDiagnosticSetting -ResourceId [your resource id] -StorageAccountId [your storage account id] -Enabled $true
The storage account ID is the resource ID for the storage account where you want to send the logs.
To enable streaming of resource logs to an event hub, use this command:
Set-AzDiagnosticSetting -ResourceId [your resource id] -ServiceBusRuleId [your service bus rule id] -Enabled $true
The Azure Service Bus rule ID is a string with this format:
{service bus resource ID}/authorizationrules/{key name}
To enable sending resource logs to a Log Analytics workspace, use this command:
Set-AzDiagnosticSetting -ResourceId [your resource id] -WorkspaceId [resource id of the log analytics workspace] -Enabled $true
You can obtain the resource ID of your Log Analytics workspace by using the following command:
(Get-AzOperationalInsightsWorkspace).ResourceId
You can combine these parameters to enable multiple output options.
REST API
Learn how to change diagnostics settings by using the Azure Monitor REST API.
Resource Manager template
Learn how to enable diagnostics settings at resource creation by using a Resource Manager template.
Manage your logs
Logs are typically available within a couple hours of setting up logging. It's up to you to manage your logs in your storage account:
- Use standard Azure access control methods to secure your logs by restricting who can access them.
- Delete logs that you no longer want to keep in your storage account.
- Be sure to set a retention period for so old logs are deleted from your storage account.
View logs in Log Analytics workspace
Metrics and server events are integrated with xEvents in your Log Analytics workspace resource for side-by-side analysis. Log Analytics workspace can also be configured to receive events from other Azure services providing a holistic view of diagnostic logging data across your architecture.
To view your diagnostic data, in Log Analytics workspace, open Logs from the left menu.
In the query builder, expand LogManagement > AzureDiagnostics. AzureDiagnostics includes Engine and Service events. Notice a query is created on-the-fly. The EventClass_s field contains xEvent names, which may look familiar if you've used xEvents for on-premises logging. Click EventClass_s or one of the event names and Log Analytics workspace continues constructing a query. Be sure to save your queries to reuse later.
Example queries
Example 1
The following query returns durations for each query end/refresh end event for a model database and server. If scaled out, the results are broken out by replica because the replica number is included in ServerName_s. Grouping by RootActivityId_g reduces the row count retrieved from the Azure Diagnostics REST API and helps stay within the limits as described in Log Analytics Rate limits.
let window = AzureDiagnostics | where ResourceProvider == "MICROSOFT.ANALYSISSERVICES" and Resource =~ "MyServerName" and DatabaseName_s =~ "MyDatabaseName" ;window| where OperationName has "QueryEnd" or (OperationName has "CommandEnd" and EventSubclass_s == 38)| where extract(@"([^,]*)", 1,Duration_s, typeof(long)) > 0| extend DurationMs=extract(@"([^,]*)", 1,Duration_s, typeof(long))| project StartTime_t,EndTime_t,ServerName_s,OperationName,RootActivityId_g,TextData_s,DatabaseName_s,ApplicationName_s,Duration_s,EffectiveUsername_s,User_s,EventSubclass_s,DurationMs| order by StartTime_t asc
Example 2
The following query returns memory and QPU consumption for a server. If scaled out, the results are broken out by replica because the replica number is included in ServerName_s.
let window = AzureDiagnostics | where ResourceProvider == "MICROSOFT.ANALYSISSERVICES" and Resource =~ "MyServerName";window| where OperationName == "LogMetric" | where name_s == "memory_metric" or name_s == "qpu_metric"| project ServerName_s, TimeGenerated, name_s, value_s| summarize avg(todecimal(value_s)) by ServerName_s, name_s, bin(TimeGenerated, 1m)| order by TimeGenerated asc
Example 3
The following query returns the Rows read/sec Analysis Services engine performance counters for a server.
let window = AzureDiagnostics | where ResourceProvider == "MICROSOFT.ANALYSISSERVICES" and Resource =~ "MyServerName";window| where OperationName == "LogMetric" | where parse_json(tostring(parse_json(perfobject_s).counters))[0].name == "Rows read/sec" | extend Value = tostring(parse_json(tostring(parse_json(perfobject_s).counters))[0].value) | project ServerName_s, TimeGenerated, Value| summarize avg(todecimal(Value)) by ServerName_s, bin(TimeGenerated, 1m)| order by TimeGenerated asc
There are hundreds of queries you can use. To learn more about queries, see Get started with Azure Monitor log queries.
Turn on logging by using PowerShell
In this quick tutorial, you create a storage account in the same subscription and resource group as your Analysis Service server. You then use Set-AzDiagnosticSetting to turn on diagnostics logging, sending output to the new storage account.
Prerequisites
To complete this tutorial, you must have the following resources:
- An existing Azure Analysis Services server. For instructions on creating a server resource, see Create a server in Azure portal, or Create an Azure Analysis Services server by using PowerShell.
Connect to your subscriptions
Start an Azure PowerShell session and sign in to your Azure account with the following command:
Connect-AzAccount
In the pop-up browser window, enter your Azure account user name and password. Azure PowerShell gets all the subscriptions that are associated with this account and by default, uses the first one.
If you have multiple subscriptions, you might have to specify a specific one that was used to create your Azure Key Vault. Type the following to see the subscriptions for your account:
Get-AzSubscription
Then, to specify the subscription that's associated with the Azure Analysis Services account you are logging, type:
Set-AzContext -SubscriptionId <subscription ID>
Note
If you have multiple subscriptions associated with your account, it is important to specify the subscription.
Create a new storage account for your logs
You can use an existing storage account for your logs, provided it's in the same subscription as your server. For this tutorial, you create a new storage account dedicated to Analysis Services logs. To make it easy, you're storing the storage account details in a variable named sa.
You also use the same resource group as the one that contains your Analysis Services server. Substitute values for awsales_resgroup
, awsaleslogs
, and West Central US
with your own values:
$sa = New-AzStorageAccount -ResourceGroupName awsales_resgroup `-Name awsaleslogs -Type Standard_LRS -Location 'West Central US'
Identify the server account for your logs
Set the account name to a variable named account, where ResourceName is the name of the account.
$account = Get-AzResource -ResourceGroupName awsales_resgroup `-ResourceName awsales -ResourceType "Microsoft.AnalysisServices/servers"
Enable logging
To enable logging, use the Set-AzDiagnosticSetting cmdlet together with the variables for the new storage account, server account, and the category. Run the following command, setting the -Enabled flag to $true:
Set-AzDiagnosticSetting -ResourceId $account.ResourceId -StorageAccountId $sa.Id -Enabled $true -Categories Engine
The output should look something like this example:
StorageAccountId : /subscriptions/a23279b5-xxxx-xxxx-xxxx-47b7c6d423ea/resourceGroups/awsales_resgroup/providers/Microsoft.Storage/storageAccounts/awsaleslogsServiceBusRuleId :EventHubAuthorizationRuleId :Metrics TimeGrain : PT1M Enabled : False RetentionPolicy Enabled : False Days : 0Logs Category : Engine Enabled : True RetentionPolicy Enabled : False Days : 0 Category : Service Enabled : False RetentionPolicy Enabled : False Days : 0WorkspaceId :Id : /subscriptions/a23279b5-xxxx-xxxx-xxxx-47b7c6d423ea/resourcegroups/awsales_resgroup/providers/microsoft.analysisservices/servers/awsales/providers/microsoft.insights/diagnosticSettings/serviceName : serviceType :Location :Tags :
This output confirms that logging is now enabled for the server, saving information to the storage account.
You can also set retention policy for your logs so older logs are automatically deleted. For example, set retention policy using -RetentionEnabled flag to $true, and set -RetentionInDays parameter to 90. Logs older than 90 days are automatically deleted.
Set-AzDiagnosticSetting -ResourceId $account.ResourceId` -StorageAccountId $sa.Id -Enabled $true -Categories Engine` -RetentionEnabled $true -RetentionInDays 90
Next steps
Learn more about Azure Monitor resource logging.
See Set-AzDiagnosticSetting in PowerShell help.
FAQs
What is Azure Diagnostic Logging? ›
Diagnostic logs provide insights on the operations that were performed within a resource. With Microsoft Azure's diagnostic logs, you can export basic usage metrics from content delivery network (CDN) endpoints to a variety of sources.
What are the two kinds of diagnostics logging available for an Azure app service? ›To enable application logging for Windows apps in the Azure portal, navigate to your app and select App Service logs. Select On for either Application Logging (Filesystem) or Application Logging (Blob), or both.
How do I query Azure diagnostic logs? ›To view your diagnostic data, in Log Analytics workspace, open Logs from the left menu. In the query builder, expand LogManagement > AzureDiagnostics. AzureDiagnostics includes Engine and Service events.
How do I Monitor Azure Analysis Services? ›Use Azure diagnostic logs to monitor and log Azure Analysis Services server performance. You can send logs to Azure Storage, stream them to Azure Event Hubs, and export them to Azure Monitor logs. Tracks engine process events.
What is the difference between activity logs and diagnostic logs? ›Diagnostic Logs capture activity to the data access plane while the Activity log is a subscription-level log for the control plane. Resource-level diagnostic logs provide insight into operations that were performed within that resource itself, for example, getting a secret from a Key Vault.
Where are Azure diagnostic logs stored? ›The diagnostics logs are saved in a blob container named $logs in your storage account. You can view the log data using a storage explorer like the Microsoft Azure Storage Explorer, or programmatically using the storage client library or PowerShell.
What is diagnostic logging? ›Diagnostic logging is a troubleshooting mode the support team might ask you to enable when they are investigating an issue. While diagnostic logging is enabled, the Deep Security Manager records additional information which can be useful for diagnosing problems.
What is the difference between activity logs and diagnostic logs in Azure? ›Of important note, the Activity Log is different from Diagnostic Logs. Activity Logs provide data about the operations on a resource from the outside (the “control plane”). Diagnostics Logs are emitted by a resource and provide information about the operation of that resource (the “data plane”).
Which types of event logs can be collected for Azure Diagnostics? ›You can collect events from standard logs, such as System and Application, and any custom logs created by applications you need to monitor. The legacy Log Analytics agent will be deprecated by August 2024. Migrate to Azure Monitor agent before August 2024 to continue ingesting data.
What are different types of logs in Azure? ›Log category | Log type |
---|---|
Virtual machines and cloud services | Windows Event Log service and Linux Syslog |
Azure Storage Analytics | Storage logging, provides metrics data for a storage account |
Network security group (NSG) flow logs | JSON format, shows outbound and inbound flows on a per-rule basis |
What language is used in Log Analytics? ›
With Log Analytics, you can write queries using its custom query language called Kusto.
What language does Azure Log Analytics use? ›Azure Monitor Logs is based on Azure Data Explorer, and log queries are written by using the same Kusto Query Language (KQL). This rich language is designed to be easy to read and author, so you should be able to start writing queries with some basic guidance.
How do I pull data from Azure Analysis Services? ›- In Excel, on the Data ribbon, click Get Data > From Database > From Analysis Services.
- In Select Database and Table, select the database and model or perspective, and then click Finish.
Azure Analysis Services is a fully managed platform as a service (PaaS) that provides enterprise-grade data models in the cloud. Use advanced mashup and modeling features to combine data from multiple data sources, define metrics, and secure your data in a single, trusted tabular semantic data model.
How do I enable diagnostic settings in Azure? ›- In the Azure portal, navigate to your data factory and select Diagnostics on the left navigation pane to see the diagnostics settings. ...
- Give your setting a name, select Send to Log Analytics, and then select a workspace from Log Analytics workspace. ...
- Select Save.
Availability Logs: track system performance, uptime, and availability. Resource Logs: provide information about connectivity issues and capacity limits. Threat Logs: contain information about system, file, or application traffic that matches a predefined security profile within a firewall.
How do I enable SQL diagnostic logs in Azure? ›Go to Azure SQL database resource. Select Diagnostics settings. Select Turn on diagnostics if no previous settings exist, or select Edit setting to edit a previous setting.
How does logging work in Azure? ›Log Analytics is a tool in the Azure portal. Use it to edit and run log queries and interactively analyze their results. You can then use those queries to support other features in Azure Monitor, such as log query alerts and workbooks.
How do I collect Azure logs? ›- In the Azure portal, select Log Analytics workspaces > your workspace > Settings.
- Select Custom logs.
- By default, all configuration changes are automatically pushed to all agents.
- Circular logging. Use circular logging if all you want is restart recovery, using the log to roll back transactions that were in progress when the system stopped. ...
- Linear logging. ...
- Active log. ...
- Inactive log. ...
- Secondary log files.
What is the difference between logging and monitoring? ›
Logging is a method of tracking and storing data to ensure application availability and to assess the impact of state transformations on performance. Monitoring is a diagnostic tool used for alerting DevOps to system-related issues by analyzing metrics.
How does a diagnostic tool work? ›The basic idea of using a diagnostic scan tool is to get the diagnostic trouble codes your vehicle automatically records when it detects a problem. This is the exact same process that mechanics use when you take it into a garage, just with much fancier, more capable equipment.
What is Diagnostic log and Trace? ›The Diagnostic, Log and Tracing (DLT) provides a log and trace interface in ECUs. The standardized protocol for logging inside ECU is specified in the AUTOSAR 4.0 DLT, and GENIVI has an open source project dlt-daemon that follows those standards.
How do I collect ODC logs? ›Navigate to %localappdata%\elevateddiagnostics to get the logs collected by the ODC tool.
How do I find diagnostic tools? ›When you start debugging in Visual Studio by selecting Debug > Start Debugging, or pressing F5, the Diagnostic Tools window appears by default. To open it manually, select Debug > Windows > Show Diagnostic Tools. The Diagnostic Tools window shows information about events, process memory, and CPU usage.
What is difference between syslog and audit log? ›Syslog and the audit subsystem have different purposes - syslog is a general logging daemon available for any application or the system to use for any reason. The audit daemon's job is to track specific activities or events to determine who did what and when.
Which storage is best suited for sharing of diagnostic logs in Azure? ›Log and metrics reference for monitoring data from Azure Blob Storage. Azure Monitor can read the logs for Azure services that write diagnostics to Azure Table Storage or IIS logs written to Azure Blob Storage.
Which logs should be monitored? ›- 1 – Infrastructure Devices. These are those devices that are the “information superhighway” of your infrastructure. ...
- 2 – Security Devices. ...
- 3 – Server Logs. ...
- 4 – Web Servers. ...
- 5 – Authentication Servers. ...
- 6 – Hypervisors. ...
- 7 – Containers. ...
- 8 – SAN Infrastructure.
Azure storage types include objects, managed files and managed disks. Customers should understand their often-specific uses before implementation. Each storage type has different pricing tiers -- usually based on performance and availability -- to make each one accessible to companies of every size and type.
What is the difference between logs and metrics? ›While logs are about a specific event, metrics are a measurement at a point in time for the system. This unit of measure can have the value, timestamp, and identifier of what that value applies to (like a source or a tag).
What is the difference between Azure Monitor logs and Log Analytics? ›
Azure Monitor builds on top of Azure Log Analytics, the platform service that gathers log and metrics data from all your resources. The easiest way to think about Azure Monitor vs Log Analytics is that Azure Monitor is the marketing name, whereas Azure Log Analytics is the technology that powers it.
What is basic logs in Azure? ›Basic Logs tables reduce the cost of ingesting high-volume verbose logs and let you query the data they store using a limited set of log queries. This article explains how to query data from Basic Logs tables. For more information, see Set a table's log data plan.
How do you write Azure logs? ›Go to the Log Analytics workspaces menu in the Azure portal and select Tables (preview). The tables in the workspace will appear. Select Create > New custom log (DCR based). Specify a name for the table.
How does Azure Log Analytics work? ›Log Analytics is a tool in the Azure portal to edit and run log queries from data collected by Azure Monitor logs and interactively analyze their results. You can use Log Analytics queries to retrieve records that match particular criteria, identify trends, analyze patterns, and provide various insights into your data.
What are the tools you used for log analysis? ›- Sematext Logs.
- SolarWinds Loggly.
- Splunk.
- Logentries (now Rapid7 InsightOps)
- logz.io.
- Sumo Logic.
- SolarWinds Log & Event Manager (now Security Event Manager)
- ManageEngine EventLog Analyzer.
Log360, a unified SIEM solution with integrated DLP and CASB capabilities, is designed to process, audit, and monitor Azure logs to ensure the security of your Azure environment.
What is the equivalent of Azure Log Analytics in AWS? ›Log Analytics is pretty similar to Cloud trail in AWS. Log Analytics is a monitoring solution by Azure. It monitors both cloud and on-premise environment. It gives the check on performance and availability.
What is the use of diagnostic settings in Azure? ›Each Azure resource requires its own diagnostic setting, which defines the following criteria: Sources: The type of metric and log data to send to the destinations defined in the setting. The available types vary by resource type. Destinations: One or more destinations to send to.
What is the purpose of diagnostic services? ›Diagnostic Services facilitates the provision of timely, cost-effective, and high quality diagnostic care in safe and secure environments. It includes the clinical services of Pathology and Laboratory Medicine, Radiology, and Nuclear Medicine .
What is the main purpose of diagnostic tools? ›Diagnostic equipment, methods, or systems are used for discovering what is wrong with people who are ill or with things that do not work properly.
What is the function of diagnostic services? ›
Diagnostic Services means services provided for the purpose of determining the nature and cause of a condition, ill- ness, or injury.
What is the difference between metrics and logs in Azure? ›Azure Monitor Metrics can only store numeric data in a particular structure, whereas Azure Monitor Logs can store a variety of data types that have their own structures. You can also perform complex analysis on Azure Monitor Logs data by using log queries, which can't be used for analysis of Azure Monitor Metrics data.
What are the 3 types of logs available through the event viewer? ›- Application log – events logged by applications. ...
- System log – events logged by the operating system. ...
- Security log – events related to security, including login attempts or file deletion.