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:
⚠️
windows_first
⚠️
powershell_heavy
Summary:
The documentation provides both Bash (Linux) and PowerShell (Windows) examples for all major steps, but consistently lists PowerShell/Windows examples after Bash/Linux ones. However, there is a slight bias in the 'Prerequisites' section, where 'Invoke-WebRequest' (PowerShell) is mentioned before 'Curl' (Bash), and the general pattern of referencing Windows-specific tools (like PowerShell) is present. The documentation does not omit Linux examples, but does sometimes give more detailed context or explanation for PowerShell commands.
Recommendations:
- Ensure that Linux/Bash tools (curl, jq) are mentioned before or alongside Windows/PowerShell tools in all sections, including prerequisites.
- Provide equal depth of explanation and context for both Bash and PowerShell examples.
- Where possible, use cross-platform tools (like curl) as the primary example, with OS-specific alternatives clearly secondary.
- Explicitly state that all examples are available for both Linux and Windows, and avoid implying a default preference for Windows tools.
- Consider adding a table at the start summarizing equivalent commands for both platforms to reinforce parity.
Create pull request
Flagged Code Snippets
$reqParams = @{"user.name"="admin";"execute"="DROP TABLE log4jLogs;CREATE EXTERNAL TABLE log4jLogs(t1 string, t2 string, t3 string, t4 string, t5 string, t6 string, t7 string) ROW FORMAT DELIMITED BY ' ' STORED AS TEXTFILE LOCATION '/example/data/;SELECT t4 AS sev,COUNT(*) AS count FROM log4jLogs WHERE t4 = '[ERROR]' GROUP BY t4;";"statusdir"="/example/rest"}
$resp = Invoke-WebRequest -Uri "https://$clusterName.azurehdinsight.net/templeton/v1/hive" `
-Credential $creds `
-Body $reqParams `
-Method POST `
-UseBasicParsing
$jobID = (ConvertFrom-Json $resp.Content).id
$jobID
$creds = Get-Credential -UserName "admin" -Message "Enter the HDInsight login"
# Identify properly cased cluster name
$resp = Invoke-WebRequest -Uri "https://CLUSTERNAME.azurehdinsight.net/api/v1/clusters" `
-Credential $creds -UseBasicParsing
$clusterName = (ConvertFrom-Json $resp.Content).items.Clusters.cluster_name;
# Show cluster name
$clusterName
$resp = Invoke-WebRequest -Uri "https://$clusterName.azurehdinsight.net/templeton/v1/status" `
-Credential $creds `
-UseBasicParsing
$resp.Content
$resp = Invoke-WebRequest -Uri "https://$clusterName.azurehdinsight.net/templeton/v1/version/hive" `
-Credential $creds `
-UseBasicParsing
$resp.Content
$reqParams=@{"user.name"="admin"}
$resp = Invoke-WebRequest -Uri "https://$clusterName.azurehdinsight.net/templeton/v1/jobs/$jobID" `
-Credential $creds `
-Body $reqParams `
-UseBasicParsing
# ConvertFrom-JSON can't handle duplicate names with different case
# So change one to prevent the error
$fixDup=$resp.Content.Replace("jobID","job_ID")
(ConvertFrom-Json $fixDup).status.state