Azure Log Analytics Solution

This page shows how to write Terraform for Log Analytics Solution and write them securely.

azurerm_log_analytics_solution (Terraform)

The Solution in Log Analytics can be configured in Terraform with the resource name azurerm_log_analytics_solution. The following sections describe 6 examples of how to use the resource and its parameters.

Example Usage from GitHub
resource "azurerm_log_analytics_solution" "activity" {
  solution_name         = "AzureActivity"
  location              = var.location
  resource_group_name   = var.resource_group_name
  workspace_resource_id =
  workspace_name        =
resource "azurerm_log_analytics_solution" "containerinsights" {
  provider = azurerm.Management
  solution_name         = "ContainerInsights"
  location              = azurerm_resource_group.logging.location
  resource_group_name   =
  workspace_resource_id =
resource "azurerm_log_analytics_solution" "lawsolutionupdates" {
  solution_name         = "Updates"
  location              = var.law_location
  resource_group_name   = azurerm_automation_account.aa.resource_group_name
  workspace_resource_id = var.law_id
  workspace_name        = var.law_name
resource "azurerm_log_analytics_solution" "container" {
  solution_name         = "ContainerInsights"
  location              = azurerm_log_analytics_workspace.log_analytics.location
  resource_group_name   = azurerm_log_analytics_workspace.log_analytics.resource_group_name
  workspace_resource_id =
  workspace_name        =
resource "azurerm_log_analytics_solution" "hub_KeyVaultAnalytics" {
  solution_name         = "KeyVaultAnalytics"
  location              = azurerm_resource_group.hub.location
  resource_group_name   =
  workspace_resource_id =
  workspace_name        =
resource "azurerm_log_analytics_solution" "aks-sol" {
  solution_name         = "ContainerInsights"
  location              = azurerm_resource_group.rg.location
  resource_group_name   =
  workspace_name        =
  workspace_resource_id =

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).


Explanation in Terraform Registry

Manages a Log Analytics (formally Operational Insights) Solution.

Azure Resource Manager Example

Azure Resource Manager code does not have the related resource.

Frequently asked questions

What is Azure Log Analytics Solution?

Azure Log Analytics Solution is a resource for Log Analytics of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Log Analytics Solution?

For Terraform, the MarkWarnekeMe/Microsoft, liamfoneill/NotQuiteEnterpriseScale and aultt/Azure-Terraform-LabinaBox source code examples are useful. See the Terraform Example section for further details.


Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.