This page contains Windows bias

About This Page

This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.

Bias Analysis

Bias Types:
⚠️ powershell_heavy
⚠️ windows_first
⚠️ windows_tools
Summary:
The documentation demonstrates a moderate Windows bias. The PowerShell approach is described in detail and appears before the Azure CLI approach, with extensive use of PowerShell cmdlets and scripts. There are multiple references to PowerShell and Windows-specific tools (such as references to the 'Set up the Azure Monitor agent on Windows client devices' documentation). The CLI approach is provided, but it is positioned after the PowerShell approach, and some instructions (such as using 'azcopy' and 'jq') assume familiarity with Linux tooling but are less detailed than the PowerShell section. There are no explicit Linux shell or Bash examples for direct agent management, and the documentation does not mention Linux-specific considerations, even though HDInsight clusters are often Linux-based.
Recommendations:
  • Reorder the instructions so that Azure CLI examples appear before or alongside PowerShell examples, reflecting the cross-platform nature of HDInsight clusters.
  • Add explicit Bash/Linux shell examples for common operations, especially for agent management and DCR association, to better support Linux users.
  • Avoid referencing Windows-specific documentation (such as 'Set up the Azure Monitor agent on Windows client devices') unless there is a Linux equivalent or a clear note about Linux applicability.
  • Clarify that both PowerShell and CLI approaches are fully supported on Linux-based HDInsight clusters, and note any differences or prerequisites for Linux environments.
  • Where possible, provide parity in detail and troubleshooting steps for both PowerShell and CLI/Bash workflows.
GitHub Create pull request

Scan History

Date Scan ID Status Bias Status
2025-08-17 00:01 #83 in_progress ✅ Clean
2025-07-13 21:37 #48 completed ✅ Clean
2025-07-12 23:44 #41 in_progress ❌ Biased
2025-07-09 13:09 #3 cancelled ✅ Clean
2025-07-08 04:23 #2 cancelled ❌ Biased

Flagged Code Snippets

# 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