- 09 Dec 2024
- 2 Minutes to read
- Print
- DarkLight
Setting Up Azure Log Analytics Integration
- Updated on 09 Dec 2024
- 2 Minutes to read
- Print
- DarkLight
Users with v8 installations can integrate with Azure Log Analytics for external logging capabilities and storage and organizing logs for Azure Containerization.
Azure Log Analytics allows Azure users to run queries on information gathered via the Azure Monitor tool. These tools can be used to Log and monitor Decisions Studio from outside the environment. Logging can be accomplished via Environment Variables or Logging Settings.
Prerequisites
- An active Azure account with an established Resource Group
- A v8 Decisions environment
- Installation of the AzureServices Module
Configuration
- Login to Azure Portal.
- From the Azure Portal, under Azure Services, select Create a resource.
In the Search services and marketplace box, search for and locate Log Analytics Workspace, then click Create > Log Analytics Workspace.
From the Create Log Analytics workspace, under Project details, select the desired Resource group. Then, under Instance details, provide a Name, and select the same Region as the Resource Group.
Click Review + Create.
Navigate to the newly created Log Analytics Workspace; then, under Settings, click Agents management.
From the Agents management screen, copy both the Workspace ID and the Primary key into a Text Editor.
Environment Variables Method
From the Local File System of the Decisions v.8 installation, press the Windows key, or select the Search icon on the bottom toolbar, then locate and open the Edit system environment variables Control Panel.
From the System Properties window, click the Environment Variables... button.
From the Environment Variables window, under System Variables, click New...
In the resulting New System Variable window, in the Variable name box, provide the name "DECISIONS_LOG_AZURE_WORKSPACE_ID"; paste the previously copied Workspace ID in the Variable value box. Then, click OK.
Repeat the process with the variable name "DECISIONS_LOG_AZURE_AUTHENTICATION_ID " and the Primary Key in the Variable Value box.
If desired, provide the Variable "DECISIONS_LOG_SERILOG_DEBUG" with the Value "True". Serilog.txt is a file that records any errors that occur with Azure Logging. By adding "DECISIONS_LOG_SERILOG_DEBUG" to the Local File System's list of environment variables and setting it to "true", it will create the file within the /Logs directory.From the Environment Variables window, click OK. Then, click OK from the System Properties window to save and close the window.
Proceed to Running Logs.
Logging Settings Method
From Decisions Studio, navigate to System > Settings > Logging Settings, then open Azure Log Analytics.
From the Azure Log Analytics window, select the desired Levels. Then, under SETTINGS, provide the respective Workspace Id and Authentication Id.
Under Log Name, provide the desired value formatted as "[Log Name]_CL"; Then, click OK.Log Name DefaultIf a Log Name is not provided, the default value in Azure will be DecisionsWeb_CL.Proceed to Running Logs.
Running Logs
Restart the Decisions service to ensure that Decisions knows the Azure Log settings.
Navigate back to the Portal for the Log Analytics workspace; under the General category on the left-hand side of the screen, select Logs.
Close out of the Queries window and create a New Query in the Query Editor, input the Log Name (either the custom one defined in Logging Settings or "DecisionsWeb_CL"), then click Run.
Verify that the expected Logs display.
Filtering LogsIf desired, the resulting Logs may be filtered using Kusto Query Language (KQL).