Share via

MFA login error attempting az cli command after successful MFA login

robertmglynn 1 Reputation point
2026-06-05T20:26:24.4933333+00:00

I'm attempting to run:

az containerapp update --name some-container-app-name --resource-group some-resource-group --yaml some-yaml-config.yaml

and when submitting that command the response is:

(RequestDisallowedByAzure) Resource 'some-resource-name' was disallowed by Azure: You are receiving this error because you tried to create, update or delete Azure resources without authenticating through MFA. User accounts must be authenticated through MFA to manage your resources. To resolve this error, go to https://aka.ms/MFAforAzure.

Here are the steps I take:

az login -> get login page in browser -> choose account -> enter password -> get MFA prompt in browser -> enter MFA code from prompt into Authenticator app -> success message in browser -> az cli prompts me to choose tenant -> hit enter for default -> attempt cli command above -> get error.

I have the issue before and after updating to most recent az cli version. I have quadrouple-checked the tenant, container name, resource group values are all correct. My account has owner role for the container app I'm trying to update.

I can perform other commands successfully, such as az group list . This makes me believe this is a policy permission issue or something else that's not an actual MFA error. However, I am stuck as to where to go to find the real cause of the issue. I have read the page at the URI in the error message, but it is not helpful in my case.

Microsoft Security | Microsoft Entra | Microsoft Entra ID

1 answer

Sort by: Most helpful
  1. AI answer

    2026-06-05T20:26:42.85+00:00

    The error is caused by a Conditional Access / Azure Policy requirement that the specific create/update/delete operation be performed with an MFA-authenticated token that satisfies the policy, even though an MFA challenge was completed at sign-in.

    For Azure CLI, this scenario is explicitly called out: when a policy enforces MFA for certain resource operations, Azure CLI can return errors like:

    Resource was disallowed by policy. Reasons: MFA is required.

    In enforcement mode, each denied create/update/delete is logged as a deny event, and the client (Azure CLI) shows this message when the token used for the operation does not meet the MFA requirement.

    To resolve:

    1. Ensure the tenant’s Conditional Access policy enforces MFA at sign-in rather than only as a per-resource requirement. This allows the CLI session token obtained at az login to satisfy the policy for subsequent resource operations.
    2. If enforcing MFA at sign-in is not possible, use the --claims-challenge flow so the CLI can obtain a token that meets the policy for the specific operation:
         az logout
         az login \
           --tenant "<tenant-id>" \
           --scope "https://management.core.windows.net//.default" \
           --claims-challenge "<claims-challenge-token>"
      
      The claims challenge token is provided in the error details when using Azure CLI 2.76.0 or later.
    3. If the organization is enforcing MFA via Azure Policy (MFA self-enforcement), review the deny events in the activity log to confirm that the policy is blocking the az containerapp update operation. Adjust the policy or ensure that the sign-in token is MFA-compliant for that operation.

    Because az group list is a read-only operation, it is not blocked by the MFA-enforcement policy, while az containerapp update is a write operation and therefore subject to the MFA requirement.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.