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
⚠️
missing_linux_example
⚠️
windows_tools
⚠️
windows_first
Summary:
The documentation page provides only PowerShell-based examples for disabling a system-assigned managed identity via the REST API, with no equivalent examples for Linux or cross-platform tools (such as Azure CLI or curl). The scripting and authentication steps are tailored to Windows environments and PowerShell users, and there is no mention of Linux-native workflows or tools.
Recommendations:
- Add equivalent Azure CLI examples for authentication and sending the PATCH request, which work cross-platform (Windows, Linux, macOS).
- Provide a curl example for sending the REST API request, including details on how to obtain an access token using Azure CLI (az account get-access-token).
- Explicitly mention that the PowerShell example is Windows-centric and offer alternative instructions for Linux/macOS users.
- Consider reordering or parallelizing the examples so that Windows and Linux instructions are presented together, or at least ensure Linux examples are not omitted.
- Reference relevant documentation for Linux users, such as Azure CLI authentication and REST API invocation.
Create pull request
Flagged Code Snippets
# 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
# Sign in to your Azure subscription
$sub = Get-AzSubscription -ErrorAction SilentlyContinue
if(-not($sub))
{
Connect-AzAccount
}
# If you have multiple subscriptions, set the one to use
# Select-AzSubscription -SubscriptionId "<SUBSCRIPTIONID>"