Azure Log Analytics Linked Service
This page shows how to write Terraform and Azure Resource Manager for Log Analytics Linked Service and write them securely.
azurerm_log_analytics_linked_service (Terraform)
The Linked Service in Log Analytics can be configured in Terraform with the resource name azurerm_log_analytics_linked_service
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_log_analytics_linked_service" "automation" {
provider = azurerm.default
resource_group_name = var.rg_name
workspace_name = azurerm_log_analytics_workspace.monitor.name
resource_id = var.automation_account_id
resource "azurerm_log_analytics_linked_service" "loganalyticslink" {
resource_group_name = "hrwrg"
workspace_name = azurerm_log_analytics_workspace.loganalytics.name
resource_id = azurerm_automation_account.autoaccount.id
resource "azurerm_log_analytics_linked_service" "this" {
linked_service_name = var.linked_service_name
resource_group_name = var.resource_group_name
resource_id = var.resource_id
tags = var.tags
workspace_name = var.workspace_name
resource "azurerm_log_analytics_linked_service" "AutomationAccount1_lawslink" {
resource_group_name = azurerm_resource_group.monitoring.name
workspace_id = module.loganalytics.id
read_access_id = azurerm_automation_account.AutomationAccount1.id
}
resource "azurerm_log_analytics_linked_service" "law-link" {
resource_group_name = azurerm_resource_group.tf-automation.name
workspace_id = azurerm_log_analytics_workspace.law-updates.id
read_access_id = azurerm_automation_account.aa-arc.id
resource "azurerm_log_analytics_linked_service" "this" {
linked_service_name = var.linked_service_name
resource_group_name = var.resource_group_name
resource_id = var.resource_id
tags = var.tags
workspace_name = var.workspace_name
resource "azurerm_log_analytics_linked_service" "law_link" {
resource_group_name = var.resource_group_name
workspace_id = var.law_id
read_access_id = azurerm_automation_account.aa.id
}
resource "azurerm_log_analytics_linked_service" "la_monitor_log01_link_aut" {
resource_group_name = azurerm_resource_group.rg_monitor.name
workspace_id = azurerm_log_analytics_workspace.la_monitor_log01.id
read_access_id = azurerm_automation_account.automation01.id
resource "azurerm_log_analytics_linked_service" "la_monitor_log01_link_aut" {
resource_group_name = azurerm_resource_group.rg_monitor.name
workspace_id = azurerm_log_analytics_workspace.la_monitor_log01.id
read_access_id = azurerm_automation_account.automation01.id
resource "azurerm_log_analytics_linked_service" "la_monitor_log01_link_aut" {
resource_group_name = azurerm_resource_group.rg_monitor.name
workspace_id = azurerm_log_analytics_workspace.la_monitor_log01.id
read_access_id = azurerm_automation_account.automation01.id
Parameters
-
id
optional computed - string -
linked_service_name
optional computed - string -
name
optional computed - string -
read_access_id
optional computed - string -
resource_group_name
required - string -
resource_id
optional computed - string -
tags
optional - map from string to string -
workspace_id
optional computed - string -
workspace_name
optional computed - string -
write_access_id
optional - string -
timeouts
single block
Explanation in Terraform Registry
Manages a Log Analytics Linked Service.
Microsoft.OperationalInsights/workspaces/linkedServices (Azure Resource Manager)
The workspaces/linkedServices in Microsoft.OperationalInsights can be configured in Azure Resource Manager with the resource name Microsoft.OperationalInsights/workspaces/linkedServices
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"logAnalyticsWorkspaceName": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"logAnalyticsWorkspaceName": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"rgLocation": {
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"omsWorkspaceName": {
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"omsWorkspaceName": {
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"omsWorkspaceName": {
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"omsWorkspaceName": {
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"omsWorkspaceName": {
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"omsWorkspaceName": {
Frequently asked questions
What is Azure Log Analytics Linked Service?
Azure Log Analytics Linked Service 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 Linked Service?
For Terraform, the bytemech/tf_lz, Xergy/AzMIMDeploy and kevinhead/azurerm source code examples are useful. See the Terraform Example section for further details.
For Azure Resource Manager, the sbkuehn/AzureOperations, mspnp/samples and sbkuehn/logAnalytics source code examples are useful. See the Azure Resource Manager Example section for further details.