Create Pull Request
| Date | Scan | Status | Result |
|---|---|---|---|
| 2026-01-14 00:00 | #250 | in_progress |
Biased
|
| 2026-01-13 00:00 | #246 | completed |
Biased
|
| 2026-01-11 00:00 | #240 | completed |
Biased
|
| 2026-01-10 00:00 | #237 | completed |
Biased
|
| 2026-01-09 00:34 | #234 | completed |
Biased
|
| 2026-01-08 00:53 | #231 | completed |
Biased
|
| 2026-01-06 18:15 | #225 | cancelled |
Clean
|
| 2025-08-17 00:01 | #83 | cancelled |
Clean
|
| 2025-07-13 21:37 | #48 | completed |
Clean
|
| 2025-07-12 23:44 | #41 | cancelled |
Biased
|
| 2025-07-09 13:09 | #3 | cancelled |
Clean
|
| 2025-07-08 04:23 | #2 | cancelled |
Biased
|
# The URL of the DCR template file, change {HDIClusterType} to your cluster type.
# The valid types are: hadoop, hbase, interactivehive, kafka, llap, spark
$dcrTemplatejsonUrl = "https://hdiconfigactions.blob.core.windows.net/azuremonitoriningagent/DCR/{HDIClusterType}_dcr_template.json"
$dcrJsonContent = Invoke-RestMethod -Uri $dcrTemplatejsonUrl
# Get details of your Log Analytics workspace, if your workspace is in another subscription, you need to change context to the subscription
$workspaceResourceGroupName = "{yourWorkspaceResourceGroup}"
$workspaceName = {yourWorkspaceName}
$workspace = Get-AzOperationalInsightsWorkspace -ResourceGroupName $workspaceResourceGroupName -Name $workspaceName
# Customize the DCR content
$dcrJsonContent.properties.destinations.logAnalytics[0].workspaceResourceId = $workspace.ResourceId
$dcrJsonContent.properties.destinations.logAnalytics[0].workspaceId = $workspace.CustomerId
$dcrJsonContent.location = $workspace.Location
# Create the DCR using the customized JSON (DCR needs to be in the same location as Log Analytics workspace).
# If your HDInsight cluster is in another subscription, you need to change context to your cluster’s subscription
$dcrName = " {yourDcrName} "
$resourceGroupName = " {YourDcrResourceGroup} "
$dcrStr = $dcrJsonContent | ConvertTo-Json -Depth 10
$dcr = New-AzDataCollectionRule -Name $dcrName -ResourceGroupName $resourceGroupName -JsonString $dcrStr
# Associate DCR to HDInsight cluster
$hdinsightClusterResourceId = "/subscriptions/{subscription}/resourceGroups/{resourceGroup}/providers/Microsoft.HDInsight/clusters/{clusterName}"
$dcrAssociationName = "{yourDcrAssociation}"
New-AzDataCollectionRuleAssociation -AssociationName $dcrAssociationName -ResourceUri $hdinsightClusterResourceId -DataCollectionRuleId $dcr.Id
Disable-AzHDInsightAzureMonitorAgent -ResourceGroupName $resourceGroup -ClusterName $cluster
# Associate DCR to HDInsight cluster
$hdinsightClusterResourceId = "{YourHDInsightClusterResourceId}"
$dcrAssociationName = "{yourDcrAssociation}"
$dcrId = $dcr | jq -r '.id'
az monitor data-collection rule association create --association-name $dcrAssociationName --resource $hdinsightClusterResourceId --data-collection-rule-id $dcrId
# Enter user information
$resourceGroup = "<your-resource-group>"
$cluster = "<your-cluster>"
$LAW = "<your-Log-Analytics-workspace>"
# End of user input
# obtain workspace id for defined Log Analytics workspace
$WorkspaceId = (Get-AzOperationalInsightsWorkspace -ResourceGroupName $resourceGroup -Name $LAW).CustomerId
# obtain primary key for defined Log Analytics workspace
$PrimaryKey = (Get-AzOperationalInsightsWorkspace -ResourceGroupName $resourceGroup -Name $LAW | Get-AzOperationalInsightsWorkspaceSharedKeys).PrimarySharedKey
# Enables monitoring and relevant logs will be sent to the specified workspace.
Enable-AzHDInsightAzureMonitorAgent -ResourceGroupName $resourceGroup -ClusterName $cluster -WorkspaceId $WorkspaceId -PrimaryKey $PrimaryKey
# Gets the status of monitoring installation on the cluster.
Get-AzHDInsightAzureMonitorAgent -ResourceGroupName $resourceGroup -ClusterName $cluster
# The URL of the DCR template file, change {HDIClusterType} to your cluster type.
# The valid types are: hadoop, hbase, interactivehive, kafka, llap, spark
$dcrTemplatejsonUrl = "https://hdiconfigactions.blob.core.windows.net/azuremonitoriningagent/DCR/{HDIClusterType}_dcr_template.json?api-version=2020-08-01"
# Download dcr template to local
$dcrTemplateLocalFile = "dcrTemplateFileName.json"
azcopy copy $dcrTemplatejsonUrl $dcrTemplateLocalFile
# Set subscription
az account set --subscription "{yourSubscription}"
# Get details of your Log Analytics workspace
$workspaceResourceGroupName = "{yourWorkspaceResourceGroup}"
$workspaceName = "{yourWorkspaceName}"
$workspace = az monitor log-analytics workspace show --resource-group $workspaceResourceGroupName --workspace-name $workspaceName
# Customize the DCR content. Below script depends on jq, you need to install it if it’s not available in your environment.
$workspaceResourceId = $workspace | jq -r '.id'
$workspaceId = $workspace | jq -r '.customerId'
$location = $workspace | jq -r '.location'
# Read the JSON file
$templateJsonData=cat $dcrTemplateLocalFile
# Update the JSON fields using jq
$templateJsonData=echo $templateJsonData | jq --arg workspaceResourceId $workspaceResourceId '.properties.destinations.logAnalytics[0].workspaceResourceId = $workspaceResourceId'
$templateJsonData=echo $templateJsonData | jq --arg workspaceId $workspaceId '.properties.destinations.logAnalytics[0].workspaceId = $workspaceId'
$templateJsonData=echo $templateJsonData | jq --arg location $location '.location = $location'
# Save the updated JSON back to the file
echo $templateJsonData > $dcrTemplateLocalFile
# Print the updated JSON
cat $dcrTemplateLocalFile
# Create the DCR using the customized JSON (DCR needs to be in the same location as Log Analytics workspace)
# If your HDInsight cluster is in another subscription, you need to set subscription to your cluster’s subscription
$dcrName = "{yourDcrName}"
$resourceGroupName = "{YourDcrResourceGroup}" # Suggest to put DCR in the same resource group as your HDInsight cluster
$dcr = az monitor data-collection rule create --name $dcrName --location $location --resource-group $resourceGroupName --rule-file $dcrTemplateLocalFile