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 providing only PowerShell-based CLI examples for scripting and REST API calls, referencing Windows-specific tools and cmdlets (e.g., Set-AzAutomationAccount, Invoke-RestMethod), and omitting equivalent examples for Linux users (such as Azure CLI or curl). There are no bash, Azure CLI, or cross-platform scripting examples, and PowerShell is the only automation language shown for command-line operations.
Recommendations:
- Add Azure CLI (az) examples alongside PowerShell for all command-line operations, including removing managed identities and making REST API calls.
- Provide bash/curl examples for REST API interactions to support Linux/macOS users.
- When referencing scripting, present both PowerShell and bash/Azure CLI options, or clearly indicate cross-platform alternatives.
- Avoid assuming the use of PowerShell for verification steps; show how to verify results using Azure CLI or the portal.
- Explicitly mention that PowerShell examples can be run on Linux/macOS with PowerShell Core, or provide native Linux shell alternatives.
Create pull request
Flagged Code Snippets
$resourceGroup = "resourceGroupName"
$automationAccount = "automationAccountName"
# Sign in to your Azure subscription
$sub = Get-AzSubscription -ErrorAction SilentlyContinue
if(-not($sub))
{
Connect-AzAccount
}
# Removes all UAs, keeps SA
$output = Set-AzAutomationAccount `
-ResourceGroupName $resourceGroup `
-Name $automationAccount `
-AssignSystemIdentity
$output.identity.Type
# Sign in to your Azure subscription
$sub = Get-AzSubscription -ErrorAction SilentlyContinue
if(-not($sub))
{
Connect-AzAccount -Subscription
}
$subscriptionID = "subscriptionID"
$resourceGroup = "resourceGroupName"
$automationAccount = "automationAccountName"
$file = "path\body_remove_ua.json"
# build URI
$URI = "https://management.azure.com/subscriptions/$subscriptionID/resourceGroups/$resourceGroup/providers/Microsoft.Automation/automationAccounts/$automationAccount`?api-version=2020-01-13-preview"
# build body
$body = Get-Content $file
# obtain access token
$azContext = Get-AzContext
$azProfile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile
$profileClient = New-Object -TypeName Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient -ArgumentList ($azProfile)
$token = $profileClient.AcquireAccessToken($azContext.Subscription.TenantId)
$authHeader = @{
'Content-Type'='application/json'
'Authorization'='Bearer ' + $token.AccessToken
}
# Invoke the REST API
Invoke-RestMethod -Uri $URI -Method PATCH -Headers $authHeader -Body $body
# Confirm removal
(Get-AzAutomationAccount `
-ResourceGroupName $resourceGroup `
-Name $automationAccount).Identity.Type
(Get-AzAutomationAccount `
-ResourceGroupName $resourceGroup `
-Name $automationAccount).Identity.Type