Since October 1, 2025, Microsoft has been rolling out MFA enforcement, gradually across tenants, for create, update and delete requests that user accounts send to Azure Resource Manager through Azure CLI, Azure PowerShell, the Azure SDKs, REST or IaC tools. Scripts that sign in with a user's password can't complete MFA, so their changes fail. Here is how to find them and move them to workload identities.
| When | What Microsoft says |
|---|---|
| October 1, 2025 | Phase 2 enforcement gradually begins for create, update and delete operations through Azure CLI, Azure PowerShell, the Azure mobile app, IaC tools, REST API (control plane) endpoints and the Azure SDKs. Read operations don't require MFA. |
| Up to July 1, 2026 | Tenants with complex environments or technical barriers could postpone phase 2 up to this date, which a Global Administrator set at aka.ms/postponePhase2MFA. Postponing phase 1 also postponed phase 2 to the same date; a later one could be chosen. |
| After enforcement begins | A Global Administrator can submit a request to Microsoft Help and Support to lift enforcement temporarily. |
July 1, 2026 has passed, and Microsoft says there's no way to opt out. To check a tenant, a Global Administrator opens aka.ms/postponePhase2MFA in the Azure portal; its Multifactor authentication (Phase 2) page shows a banner once enforcement has begun.
https://management.azure.com is in scope, whatever the client. Microsoft Graph APIs generally aren't.A job that signs in with a user's password uses the OAuth 2.0 Resource Owner Password Credentials (ROPC) grant, which sends the password straight to Microsoft Entra ID with no step where anyone can complete MFA. Microsoft says ROPC is incompatible with MFA and ROPC-based APIs throw exceptions once MFA applies. Expect one of two failures:
AADSTS50076; Azure PowerShell reports UsernamePasswordCredential authentication failed: Response status code does not indicate success: 400 (BadRequest).RequestDisallowedByPolicy error (Resource was disallowed by policy) saying users must authenticate with multi-factor authentication. Older versions (Azure CLI 2.75.0 or earlier, Azure PowerShell 14.2.0 or earlier) can show other errors instead, such as Interactive authentication is needed or SharedTokenCacheCredential authentication unavailable.Look for az login --username … --password …, Connect-AzAccount -Credential with a user account, MSAL.NET AcquireTokenByUsernamePassword (public client API deprecated as of 4.74.0), Azure.Identity UsernamePasswordCredential (deprecated as of 1.14.0-beta.2), and DefaultAzureCredential or EnvironmentCredential with AZURE_USERNAME and AZURE_PASSWORD set. Service accounts synced from Active Directory are user identities too.
Azure CLI 2.76.0 or later and Azure PowerShell 14.3.0 (Az.Accounts 5.2.0) or later, which Microsoft recommends, add a sign-in command with the claims challenge to the RequestDisallowedByPolicy error (az login … --claims-challenge or Connect-AzAccount … -ClaimsChallenge), so a person can sign in again interactively with MFA. An unattended job can't.
singleFactorAuthentication usually means no MFA was required; Microsoft lists exceptions, such as attempts where MFA was required but primary authentication failed. Scheduled sign-ins from a server IP point to a job.| Client | App ID |
|---|---|
| Azure CLI | 04b07795-8ddb-461a-bbee-02f9e1bf7b46 |
| Azure PowerShell | 1950a258-227b-4e31-a9cf-717495945fc2 |
| Azure mobile app | 0c1307d4-29d6-4389-a11c-5cbe7f65d7fa |
| IaC tools | Microsoft points to the Azure CLI and Azure PowerShell IDs |
| REST API, Azure SDKs | None listed: look for your own app registrations with ROPC sign-ins |
With sign-in logs in Log Analytics, this query lists the last 30 days' candidates:
union SigninLogs, AADNonInteractiveUserSignInLogs
| where TimeGenerated > ago(30d)
| where AppId in ("04b07795-8ddb-461a-bbee-02f9e1bf7b46", "1950a258-227b-4e31-a9cf-717495945fc2")
or AuthenticationProtocol == "ropc"
| summarize SignIns = count(), LastSeen = max(TimeGenerated)
by UserPrincipalName, AppDisplayName, AuthenticationProtocol, AuthenticationRequirement, IPAddress
| order by SignIns desc
Assigned in audit mode, the built-in Azure Policy definition Users must authenticate with multi-factor authentication to create or update resources and its counterpart for deletes log each change by a user without MFA as an Activity Log event. Also search code, scheduled tasks and pipeline variables for UsernamePasswordCredential, AcquireTokenByUsernamePassword, AZURE_PASSWORD, grant_type=password, and Connect-AzAccount -Credential or az login -u without the service principal switch.
| Where the job runs | Use |
|---|---|
| Azure VM, App Service, Azure Functions | Managed identity, system- or user-assigned |
| GitHub Actions | A federated credential for the repository on an app registration or user-assigned managed identity |
| Azure Pipelines | An Azure Resource Manager service connection with workload identity federation |
| Kubernetes, Google Cloud, AWS, other OIDC platforms | Workload identity federation |
| On-premises servers, everything else | A service principal with a certificate |
This follows Microsoft's ROPC guidance: a managed identity on Azure, federation when another OAuth 2.0-compliant identity provider such as GitHub issues the tokens, otherwise a certificate, which Microsoft prefers to client secrets. Give each identity an Azure role at the smallest scope the job needs, then remove the old account's roles and stored password.
# Before: a user account and its password (ROPC)
$cred = [pscredential]::new($userName, $securePassword)
Connect-AzAccount -Credential $cred -Tenant $tenantId
# After, option A: on an Azure VM, App Service or Azure Functions, the managed identity
Connect-AzAccount -Identity # system-assigned
# Connect-AzAccount -Identity -AccountId $uamiClientId # user-assigned
# After, option B: anywhere else, a service principal with a certificate in the local store
Connect-AzAccount -ServicePrincipal -ApplicationId $appId -Tenant $tenantId `
-CertificateThumbprint $thumbprint
# Unchanged
New-AzResourceGroup -Name 'rg-nightly' -Location 'westeurope'
For a .pfx file instead of the certificate store, use -CertificatePath. In Azure CLI, the PEM file must hold the private key with the certificate appended:
# Before
az login --username "$AZ_USER" --password "$AZ_PASS"
# After
az login --identity
az login --service-principal --username "$APP_ID" --certificate /path/to/cert.pem --tenant "$TENANT_ID"
// Before: ROPC. UsernamePasswordCredential is marked [Obsolete] and fails once MFA applies.
var credential = new UsernamePasswordCredential(userName, password, tenantId, clientId);
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Resources;
// After: only the credential changes. Pick the one for where the code runs.
TokenCredential credential =
new ManagedIdentityCredential(ManagedIdentityId.SystemAssigned); // on Azure
// new ManagedIdentityCredential(ManagedIdentityId.FromUserAssignedClientId(uamiClientId));
// new ClientCertificateCredential(tenantId, clientId, "/etc/app/cert.pfx"); // outside Azure
// new WorkloadIdentityCredential(); // Kubernetes
var arm = new ArmClient(credential);
SubscriptionResource subscription = await arm.GetDefaultSubscriptionAsync();
await subscription.GetResourceGroups().CreateOrUpdateAsync(
WaitUntil.Completed, "rg-nightly", new ResourceGroupData(AzureLocation.WestEurope));
Without options, WorkloadIdentityCredential reads AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_FEDERATED_TOKEN_FILE. With DefaultAzureCredential or EnvironmentCredential, you may need no code change: replace AZURE_USERNAME and AZURE_PASSWORD with AZURE_TENANT_ID, AZURE_CLIENT_ID (the new app's ID) and AZURE_CLIENT_CERTIFICATE_PATH (a PFX or PEM file with the private key). Switching to a managed identity through DefaultAzureCredential? Remove the old AZURE_CLIENT_ID, or it is read as a user-assigned identity's client ID. MSAL.NET code moves to a confidential client with WithCertificate and AcquireTokenForClient.
In GitHub Actions, give an app registration or user-assigned managed identity a federated credential for the repository and store the client, tenant and subscription IDs as secrets:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write # lets the job fetch an OIDC token
steps:
- uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
enable-AzPSSession: true # also signs in Azure PowerShell
- run: az group create --name rg-nightly --location westeurope
In Azure DevOps, Microsoft recommends Azure Resource Manager service connections with workload identity federation. A secret-based connection that Azure DevOps created and only one project uses can be switched with Convert under Project settings → Service connections, and reverted within seven days. .NET code in a pipeline can use the connection through AzurePipelinesCredential.