Azure Monitor Private Link Scope
This page shows how to write Terraform and Azure Resource Manager for Monitor Private Link Scope and write them securely.
azurerm_monitor_private_link_scope (Terraform)
The Private Link Scope in Monitor can be configured in Terraform with the resource name azurerm_monitor_private_link_scope
. The following sections describe 2 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_monitor_private_link_scope" "ampls01" {
name = "ampls01"
resource_group_name = azurerm_resource_group.dev-prolab.name
}
resource "azurerm_monitor_private_link_scoped_service" "ampls01linkedscopeservice" {
resource "azurerm_monitor_private_link_scope" "ampls01" {
name = "ampls01"
resource_group_name = azurerm_resource_group.dev-prolab.name
}
resource "azurerm_monitor_private_link_scoped_service" "ampls01linkedscopeservice" {
Parameters
The following arguments are supported:
name
- (Required) The name of the Azure Monitor Private Link Scope. Changing this forces a new resource to be created.resource_group_name
- (Required) The name of the Resource Group where the Azure Monitor Private Link Scope should exist. Changing this forces a new resource to be created.tags
- (Optional) A mapping of tags which should be assigned to the Azure Monitor Private Link Scope.
In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the Azure Monitor Private Link Scope.
Explanation in Terraform Registry
Manages an Azure Monitor Private Link Scope.
Tips: Best Practices for The Other Azure Monitor Resources
In addition to the azurerm_monitor_log_profile, Azure Monitor has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.
azurerm_monitor_log_profile
Ensure to enable the activity retention log
It is better to enable the activity retention log to ensure that all the information required for an effective investigation is still available.
Microsoft.Insights/privateLinkScopes (Azure Resource Manager)
The privateLinkScopes in Microsoft.Insights can be configured in Azure Resource Manager with the resource name Microsoft.Insights/privateLinkScopes
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
"type": "Microsoft.Insights/privateLinkScopes",
"apiVersion": "2021-09-01",
"name": "[parameters('private_link_scope_name')]",
"location": "global",
"properties": { "accessModeSettings": { "queryAccessMode": "PrivateOnly", "ingestionAccessMode": "PrivateOnly" } }
},
"type": "Microsoft.Insights/privateLinkScopes",
"apiVersion": "2021-09-01",
"name": "[parameters('private_link_scope_name')]",
"location": "global",
"properties": { "accessModeSettings": { "queryAccessMode": "PrivateOnly", "ingestionAccessMode": "PrivateOnly" } }
},
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"private_link_scope_name": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"private_link_scope_name": {
"type": "Microsoft.Insights/privateLinkScopes",
"location": "Global",
"tags": {},
"properties": {
"provisioningState": "Succeeded"
}
"type": "Microsoft.Insights/privateLinkScopes",
"location": "Global",
"tags": {},
"properties": {
"provisioningState": "Succeeded"
}
"type": "Microsoft.Insights/privateLinkScopes",
"location": "Global",
"tags": {},
"properties": {
"provisioningState": "Succeeded"
}
"type": "Microsoft.Insights/privateLinkScopes",
"location": "Global",
"tags": {
"Tag1": "Value1"
},
"properties": {
"type": "Microsoft.Insights/privateLinkScopes",
"location": "Global",
"tags": {},
"properties": {
"provisioningState": "Succeeded"
}
"type": "Microsoft.Insights/privateLinkScopes",
"location": "Global",
"tags": {},
"properties": {
"provisioningState": "Succeeded"
}
Frequently asked questions
What is Azure Monitor Private Link Scope?
Azure Monitor Private Link Scope is a resource for Monitor of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Monitor Private Link Scope?
For Terraform, the konradmaleckipl/Terraform-workshop and cloudstateu/Terraform-Labs source code examples are useful. See the Terraform Example section for further details.
For Azure Resource Manager, the yz4898/att_mvm, jessed/azure_k8s_lab and microsoft/privateAML source code examples are useful. See the Azure Resource Manager Example section for further details.