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
⚠️
missing_linux_example
⚠️
windows_tools
Summary:
The documentation page demonstrates a strong Windows bias by exclusively providing PowerShell-based instructions and code samples, referencing Windows-specific tools (such as .msi installers and Windows Management Framework), and omitting any Linux or cross-platform command-line examples. Steps for certificate creation, service principal setup, Key Vault access, and even installation of required libraries are all described using Windows-centric tools and workflows, with no mention of Linux equivalents or Bash/CLI alternatives.
Recommendations:
- Provide equivalent Bash/Azure CLI examples for all PowerShell commands, including certificate creation, service principal setup, and Key Vault access.
- Include instructions for installing necessary libraries (e.g., Azure CLI, Python SDK) on Linux nodes, not just PowerShell on Windows.
- Mention and demonstrate cross-platform tools and workflows where possible, such as using OpenSSL for certificate generation or az CLI for resource management.
- Explicitly state which steps are platform-specific and offer parallel guidance for both Windows and Linux environments.
- Add a section or callouts for Linux users, referencing relevant documentation or scripts for common Linux distributions.
Create pull request
Flagged Code Snippets
$now = [System.DateTime]::Parse("2020-02-10")
# Set this to the expiration date of the certificate
$expirationDate = [System.DateTime]::Parse("2021-02-10")
# Point the script at the cer file you created $cerCertificateFilePath = 'c:\temp\batchcertificate.cer'
$cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$cer.Import($cerCertificateFilePath)
# Load the certificate into memory
$credValue = [System.Convert]::ToBase64String($cer.GetRawCertData())
# Create a new AAD application that uses this certificate
$newADApplication = New-AzureRmADApplication -DisplayName "Batch Key Vault Access" -HomePage "https://batch.mydomain.com" -IdentifierUris "https://batch.mydomain.com" -certValue $credValue -StartDate $now -EndDate $expirationDate
# Create new AAD service principal that uses this application
$newAzureAdPrincipal = New-AzureRmADServicePrincipal -ApplicationId $newADApplication.ApplicationId
Set-AzureRmKeyVaultAccessPolicy -VaultName 'BatchVault' -ServicePrincipalName '"https://batch.mydomain.com' -PermissionsToSecrets 'Get'
Add-AzureRmAccount -ServicePrincipal -CertificateThumbprint -ApplicationId
$adminPassword=Get-AzureKeyVaultSecret -VaultName BatchVault -Name batchAdminPass
$psModuleCheck=Get-Module -ListAvailable -Name Azure -Refresh
if($psModuleCheck.count -eq 0) {
$psInstallerPath = Join-Path $downloadPath "azure-powershell.3.4.0.msi" Start-Process msiexec.exe -ArgumentList /i, $psInstallerPath, /quiet -wait
}