Skip to content

Commit 67eea89

Browse files
committed
Refreshed, reflowed, converted to link refs
1 parent 41e6e16 commit 67eea89

File tree

1 file changed

+45
-14
lines changed

1 file changed

+45
-14
lines changed
Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,91 @@
11
---
22
title: Service principal cleanup and troubleshooting using Azure CLI | Microsoft Docs
33
description: Learn how to cleanup and troubleshoot service principals.
4-
ms.date: 09/19/2024
54
ms.service: azure-cli
65
ms.custom: devx-track-azurecli
76
keywords: azure service principal, create service principal azure, create service principal azure cli
87
---
98

109
# Cleanup & troubleshoot service principals
1110

12-
Congratulations! You learned how to create, retrieve, and work with service principals! Now that you have completed the tutorial, it's time to clean up the created service principal resources.
11+
You learned how to create, retrieve, and work with service principals. Now that you have completed
12+
the tutorial, it's time to clean up the created service principal resources.
1313

1414
## Cleanup service principal resources
1515

16-
The safest way to remove all resources used in this tutorial is to use [az group delete](/cli/azure/group#az-group-delete). The `--no-wait` parameter keeps the CLI from blocking while the deletion takes place.
16+
The safest way to remove all resources used in this tutorial is to use [az group delete][08]. The
17+
`--no-wait` parameter keeps the CLI from blocking while the deletion takes place.
1718

1819
```azurecli-interactive
1920
az group delete --name myResourceGroup --no-wait
2021
```
2122

22-
If you prefer, delete individual service principals with the [az ad sp delete](/cli/azure/ad/sp#az-ad-sp-delete) command.
23+
If you prefer, delete individual service principals with the [az ad sp delete][07] command.
2324

2425
```azurecli-interactive
2526
az ad sp delete --id myServicePrincipalID
2627
```
2728

2829
## Troubleshoot service principals
2930

30-
Although you have completed the tutorial, you may still have questions regarding service principals that can be answered in this section.
31+
Although you have completed the tutorial, you may still have questions regarding service principals
32+
that can be answered in this section.
3133

3234
### Insufficient privileges
3335

34-
If your account doesn't have permission to create a service principal, `az ad sp create-for-rbac` returns an error message containing "Insufficient privileges to complete the operation." Contact your Microsoft Entra administrator to obtain `User Access Administrator` or `Role Based Access Control Administrator` permissions.
36+
If your account doesn't have permission to create a service principal, `az ad sp create-for-rbac`
37+
returns an error message containing "Insufficient privileges to complete the operation." Contact
38+
your Microsoft Entra administrator to obtain `User Access Administrator` or
39+
`Role Based Access Control Administrator` permissions.
3540

3641
### Invalid tenant
3742

38-
If you have specified an invalid subscription ID, you see the error message "The request didn't have a subscription or a valid tenant level resource provider." If using variables, use the Bash `echo` command to see the value being passed to the reference command. Use [az account set](/cli/azure/account#az-account-set) to change your subscription or learn [How to manage Azure subscriptions with the Azure CLI](./manage-azure-subscriptions-azure-cli.md).
43+
If you have specified an invalid subscription ID, you see the error message "The request didn't have
44+
a subscription or a valid tenant level resource provider." If using variables, use the Bash `echo`
45+
command to see the value being passed to the reference command. Use [az account set][06] to change
46+
your subscription or learn [How to manage Azure subscriptions with the Azure CLI][02].
3947

4048
### Resource group not found
4149

42-
If you have specified an invalid resource group name, you see the error message "Resource group 'name' couldn't be found." If using variables, use the Bash `echo` command to see the value being passed to both the subscription and reference commands. Use [az group list](/cli/azure/group#az-group-list) to see the resource groups for the current subscription, or learn [How to manage Azure resource groups with the Azure CLI](./manage-azure-groups-azure-cli.md).
50+
If you have specified an invalid resource group name, you see the error message "Resource group
51+
'name' couldn't be found." If using variables, use the Bash `echo` command to see the value being
52+
passed to both the subscription and reference commands. Use [az group list][09] to see the resource
53+
groups for the current subscription, or learn
54+
[How to manage Azure resource groups with the Azure CLI][01].
4355

4456
### Authorization to perform action
4557

46-
If your account doesn't have permission to assign a role, you see an error message that your account "does not have authorization to perform action 'Microsoft.Authorization/roleAssignments/write'." Contact your Microsoft Entra administrator to manage roles.
58+
If your account doesn't have permission to assign a role, you see an error message that your account
59+
"does not have authorization to perform action 'Microsoft.Authorization/roleAssignments/write'."
60+
Contact your Microsoft Entra administrator to manage roles.
4761

4862
### Interactive authentication is needed
4963

50-
When signing in with password authentication, error message "...Interactive authentication is needed..." occurs if your organization requires multifactor authentication. Switch to certificate-based authentication, or consider using [managed identities](/azure/active-directory/managed-identities-azure-resources/overview).
64+
When signing in with password authentication, error message "...Interactive authentication is
65+
needed..." occurs if your organization requires multifactor authentication. Switch to
66+
certificate-based authentication, or consider using [managed identities][05].
5167

5268
### Compliant device required
5369

54-
If you try to create a service principal using a device that is not compliant with your organizations access policies, you will receive message "...Conditional Access policy requires a compliant device...". Switch to a computer that meets your organization's access policies.
70+
If you try to create a service principal using a device that is not compliant with your
71+
organizations access policies, you will receive message "...Conditional Access policy requires a
72+
compliant device...". Switch to a computer that meets your organization's access policies.
5573

5674
## See also
5775

58-
* [Application and service principal objects in Microsoft Entra ID](/azure/active-directory/develop/app-objects-and-service-principals)
59-
* [Create a service principal using the Azure portal](/azure/active-directory/develop/howto-create-service-principal-portal)
60-
* [Create an Azure service principal with Azure PowerShell](/powershell/azure/create-azure-service-principal-azureps)
76+
- [Application and service principal objects in Microsoft Entra ID][03]
77+
- [Create a service principal using the Azure portal][04]
78+
- [Create an Azure service principal with Azure PowerShell][10]
79+
80+
<!-- link references -->
81+
82+
[01]: ./manage-azure-groups-azure-cli.md
83+
[02]: ./manage-azure-subscriptions-azure-cli.md
84+
[03]: /azure/active-directory/develop/app-objects-and-service-principals
85+
[04]: /azure/active-directory/develop/howto-create-service-principal-portal
86+
[05]: /azure/active-directory/managed-identities-azure-resources/overview
87+
[06]: /cli/azure/account#az-account-set
88+
[07]: /cli/azure/ad/sp#az-ad-sp-delete
89+
[08]: /cli/azure/group#az-group-delete
90+
[09]: /cli/azure/group#az-group-list
91+
[10]: /powershell/azure/create-azure-service-principal-azureps

0 commit comments

Comments
 (0)