Skip to content

Commit e79dff1

Browse files
authored
Added mfa error messages to troubleshooting (#5403)
1 parent 5687ba1 commit e79dff1

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

docs-ref-conceptual/Latest-version/use-azure-cli-successfully-troubleshooting.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,80 @@ examples:
124124
> If you can get an article example to execute in Bash, but it doesn't execute in PowerShell, review
125125
> your use of single and double quotes, and escape characters.
126126
127+
## Troubleshooting multifactor authentication (MFA)
128+
129+
### Interactive login failures
130+
131+
If you encounter errors when running Azure CLI commands that create, modify, or delete resources,
132+
the issue might be caused by a Microsoft Entra ID Conditional Access policy that requires
133+
multifactor authentication (MFA).
134+
135+
These errors typically occur when MFA is required by policy but isn't enforced during login.
136+
137+
#### Resource was disallowed by policy
138+
139+
You might see one of the following errors when using:
140+
141+
- Azure CLI version 2.75.0 or earlier
142+
143+
```Output
144+
Due to a configuration change made by your administrator, or because you moved to a new location,
145+
you must enroll in multi-factor authentication. Interactive authentication is needed.
146+
```
147+
148+
Or:
149+
150+
```Output
151+
Resource was disallowed by policy. Reasons: MFA is required. See error details for policy resource
152+
IDs. RequestDisallowedByPolicy Message: Resource policy resource IDs was disallowed by policy.
153+
Reasons: MFA is required.
154+
```
155+
156+
Or:
157+
158+
```Output
159+
Unauthorized. RequestDisallowedByPolicy. Resource was disallowed by policy. Reasons: MFA is
160+
required. See error details for policy resource IDs. MFA is required. Users must authenticate with
161+
multi-factor authentication to create or update resources.
162+
```
163+
164+
Upgrade to the following versions or later to receive more informative error messages and policy
165+
details:
166+
167+
- Azure CLI version 2.76.0 or later
168+
169+
The following error occurs in Azure CLI 2.76.0+, where MFA is required by Conditional Access for
170+
specific operations.
171+
172+
```Output
173+
Run the command below to authenticate interactively; additional arguments may be added as needed:
174+
az logout
175+
az login --tenant "aaaabbbb-0000-cccc-1111-dddd2222eeee" --scope "https://management.core.windows.net//.default" --claims-challenge "<claims-challenge-token>"
176+
177+
(RequestDisallowedByPolicy) Resource was disallowed by policy. Policy identifiers. Users must use
178+
MFA for Create/Update operations. Users must authenticate with multi-factor authentication to create
179+
or update resources. Users must use MFA for Create operation. Users must authenticate with
180+
multi-factor authentication to create or update resources. Users must use MFA for Create/Update
181+
operations. Users must authenticate with multi-factor authentication to create or update resources.
182+
Users must use MFA for Create operation. Users must authenticate with multi-factor authentication to
183+
create or update resources.
184+
```
185+
186+
#### Resolution options
187+
188+
- Ask your Azure administrator to enforce MFA at sign-in. This allows your session to meet
189+
Conditional Access requirements without additional steps.
190+
- If MFA enforcement at sign-in isn't possible, use the `--claims-challenge` parameter to
191+
authenticate interactively:
192+
193+
```azurecli
194+
az logout
195+
az login --tenant "aaaabbbb-0000-cccc-1111-dddd2222eeee" --scope "https://management.core.windows.net//.default" --claims-challenge "<claims-challenge-token>"
196+
```
197+
198+
For more information, see
199+
[Planning for mandatory multifactor authentication for Azure and other admin portals][19]
200+
127201
## Error: Invalid value or doesn't exist
128202

129203
These errors often occur when trying to use variable values that contain an incorrect format. The
@@ -287,3 +361,4 @@ If you experience a product issue with Azure CLI not listed in this article,
287361
[16]: #work-behind-a-proxy
288362
[17]: https://github.com/Azure/azure-cli/issues/new/choose
289363
[18]: https://github.com/kennethreitz/requests
364+
[19]: /entra/identity/authentication/concept-mandatory-multifactor-authentication

0 commit comments

Comments
 (0)