Skip to content

Commit fe85c91

Browse files
Merge pull request #199056 from omondiatieno/recover-deleted-apps
recover deleted apps
2 parents 7983aa7 + d9dfb6d commit fe85c91

File tree

8 files changed

+116
-7
lines changed

8 files changed

+116
-7
lines changed

articles/active-directory/develop/app-objects-and-service-principals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ A service principal must be created in each tenant where the application is used
7272

7373
### Consequences of modifying and deleting applications
7474

75-
Any changes that you make to your application object are also reflected in its service principal object in the application's home tenant only (the tenant where it was registered). This means that deleting an application object will also delete its home tenant service principal object. However, restoring that application object will not restore its corresponding service principal. For multi-tenant applications, changes to the application object are not reflected in any consumer tenants' service principal objects until the access is removed through the [Application Access Panel](https://myapps.microsoft.com) and granted again.
75+
Any changes that you make to your application object are also reflected in its service principal object in the application's home tenant only (the tenant where it was registered). This means that deleting an application object will also delete its home tenant service principal object. However, restoring that application object through the app registrations UI won't restore its corresponding service principal. For more information on deletion and recovery of applications and their service principal objects, see [delete and recover applications and service principal objects](../manage-apps/recover-deleted-apps-faq.md).
7676

7777
## Example
7878

articles/active-directory/develop/howto-remove-app.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ In the following sections, you learn how to:
3131

3232
## Remove an application authored by you or your organization
3333

34-
Applications that you or your organization have registered are represented by both an application object and service principal object in your tenant. For more information, see [Application Objects and Service Principal Objects](./app-objects-and-service-principals.md).
34+
Applications that you or your organization have registered are represented by both an application object and service principal object in your tenant. For more information, see [Application objects and service principal objects](./app-objects-and-service-principals.md).
3535

3636
> [!NOTE]
3737
> Deleting an application will also delete its service principal object in the application's home directory. For multi-tenant applications, service principal objects in other directories will not be deleted.
@@ -50,7 +50,7 @@ To delete an application, be listed as an owner of the application or have admin
5050

5151
If you are viewing **App registrations** in the context of a tenant, a subset of the applications that appear under the **All apps** tab are from another tenant and were registered into your tenant during the consent process. More specifically, they are represented by only a service principal object in your tenant, with no corresponding application object. For more information on the differences between application and service principal objects, see [Application and service principal objects in Azure AD](./app-objects-and-service-principals.md).
5252

53-
In order to remove an application’s access to your directory (after having granted consent), the company administrator must remove its service principal. The administrator must have Global Admininstrator access, and can remove the application through the Azure portal or use the [Azure AD PowerShell Cmdlets](/previous-versions/azure/jj151815(v=azure.100)) to remove access.
53+
In order to remove an application’s access to your directory (after having granted consent), the company administrator must remove its service principal. The administrator must have Global Administrator access, and can remove the application through the Azure portal or use the [Azure AD PowerShell Cmdlets](/previous-versions/azure/jj151815(v=azure.100)) to remove access.
5454

5555
## Next steps
5656

articles/active-directory/fundamentals/recover-from-deletions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ To restore an application from the Azure portal, select **App registrations** >
133133

134134
[![Screenshot that shows the app registration restore process in the azure portal.](./media/recoverability/deletion-restore-application.png)](./media/recoverability/deletion-restore-application.png#lightbox)
135135

136+
To restore applications using Microsoft Graph, see [Restore deleted item - Microsoft Graph v1.0.](/graph/api/directory-deleteditems-restore?tabs=http)
137+
136138
## Hard deletions
137139

138140
A hard deletion is the permanent removal of an object from your Azure AD tenant. Objects that don't support soft delete are removed in this way. Similarly, soft-deleted objects are hard deleted after a deletion time of 30 days. The only object types that support a soft delete are:
@@ -174,7 +176,7 @@ Ensure you have a process to frequently review items in the soft-delete state an
174176
* Ensure that you have specific roles or users assigned to evaluate and restore items as appropriate.
175177
* Develop and test a continuity management plan. For more information, see [Considerations for your Enterprise Business Continuity Management Plan](/compliance/assurance/assurance-developing-your-ebcm-plan).
176178

177-
For more information on how to avoid unwanted deletions, see the following topics in [Recoverability best practices](recoverability-overview.md):
179+
For more information on how to avoid unwanted deletions, see the following articles in [Recoverability best practices](recoverability-overview.md):
178180

179181
* Business continuity and disaster planning
180182
* Document known good states

articles/active-directory/fundamentals/recoverability-overview.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,14 @@ The Audit log always records a "Delete \<object\>" event when an object in the t
160160

161161
:::image type="content" source="media/recoverability/deletions-audit-log.png" alt-text="Screenshot that shows Audit log detail." lightbox="media/recoverability/deletions-audit-log.png":::
162162

163-
A Delete event for applications, users, and Microsoft 365 Groups is a soft delete. For any other object type, it's a hard delete.
163+
A Delete event for applications, service principals, users, and Microsoft 365 Groups is a soft delete. For any other object type, it's a hard delete.
164164

165165
| Object type | Activity in log| Result |
166166
| - | - | - |
167-
| Application| Delete application| Soft deleted |
168-
| Application| Hard delete application| Hard deleted |
167+
| Application| Delete application and service principal| Soft deleted |
168+
| Application| Hard delete application | Hard deleted |
169+
| Service principal| Delete service principal| Soft deleted |
170+
| Service principal| Hard delete service principal| Hard deleted |
169171
| User| Delete user| Soft deleted |
170172
| User| Hard delete user| Hard deleted |
171173
| Microsoft 365 Groups| Delete group| Soft deleted |
80.2 KB
Loading
229 KB
Loading
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
title: Frequently asked questions about recovering deleted apps
3+
titleSuffix: Azure AD
4+
description: Find answers to frequently asked questions (FAQs) about recovering deleted apps and service principals.
5+
services: active-directory
6+
author: omondiatieno
7+
manager: CelesteDG
8+
ms.service: active-directory
9+
ms.subservice: app-mgmt
10+
ms.workload: identity
11+
ms.topic: reference
12+
ms.date: 05/24/2022
13+
ms.author: jomondi
14+
ms.reviewer: sureshja
15+
ms.collection: M365-identity-device-management
16+
17+
---
18+
19+
# Recover deleted applications in Azure Active Directory FAQs
20+
21+
This page answers frequently asked questions about deleting and restoring deleted application registrations and service principals.
22+
23+
## When I create applications, I'm getting Directory_QuotaExceeded error. How can I avoid this problem?
24+
A non-admin user can create no more than 250 Azure AD resources that include applications and service principals. Both active resources and deleted resources that are available to restore count toward this quota. Even if you delete more applications that you don't need, they'll still add count to the quota. Hence, to free up the quota, you need to [permanently delete](/graph/api/directory-deleteditems-delete?tabs=http) objects in the deleted items container. You can learn more about the service limits through [this link](/azure/azure-resource-manager/management/azure-subscription-service-limits?msclkid=6cb6cc54c68711ec93eb9539fce3cc28#active-directory-limits).
25+
26+
The quota limit set for Azure AD resources is applicable when creating applications or service principals using a delegated flow such as using Azure AD app registrations or Enterprise apps portal. Creating applications using the Microsoft Graph API programmatically using application flow won't have this restriction.
27+
28+
## Where can I find all the deleted applications and service principals?
29+
30+
Soft-deleted application and service principal objects go into the [deleted items](/graph/api/resources/directory?tabs=http) container and remain available to restore for up to 30 days. After 30 days, they're permanently deleted, and this frees up the quota.
31+
You find the deleted applications by using one of the following approaches:
32+
33+
- Using the Azure portal
34+
35+
Recently deleted application objects can be found under the **Deleted applications** tab on the App registrations blade of Azure portal.
36+
37+
:::image type="content" source="media/delete-application-portal/recover-deleted-apps.png" alt-text="Screenshot shows list of deleted items.":::
38+
39+
- Using the Microsoft Graph API
40+
41+
Recently deleted application and service principal objects can be found using the [List deletedItems](/graph/api/directory-deleteditems-list?tabs=http) API.
42+
43+
- Using PowerShell
44+
45+
Recently deleted application and service principal objects can be found using the
46+
[Get-AzureADMSDeletedDirectoryObject](/powershell/module/azuread/get-azureadmsdeleteddirectoryobject?tabs=http) cmdlet.
47+
48+
## How do I restore deleted applications or service principals?
49+
50+
- Using Microsoft Graph API
51+
52+
Deleted objects can be restored using the [Restore deleted item](/graph/api/directory-deleteditems-restore?tabs=http) API.
53+
54+
- Using PowerShell
55+
56+
Deleted objects can be restored using the [Restore-AzureADMSDeletedDirectoryObject](/powershell/module/azuread/restore-azureadmsdeleteddirectoryobject?tabs=http) cmdlet.
57+
58+
## How do I permanently delete soft deleted applications or service principals?
59+
60+
- Using the Microsoft Graph API
61+
62+
Soft deleted objects can be permanently deleted by using the [Permanently delete an item from deleted items](/graph/api/directory-deleteditems-delete?tabs=http) API.
63+
64+
- Using PowerShell
65+
66+
Soft deleted objects can be permanently deleted using the [Remove-AzureADMSDeletedDirectoryObject](/powershell/module/azuread/remove-azureadmsdeleteddirectoryobject?tabs=http) cmdlet.
67+
68+
## Can I configure the interval in which applications and service principals are permanently deleted by Azure AD?
69+
70+
No. You can’t configure the periodicity of hard deletion.
71+
72+
## I restored a deleted application using the App registrations portal experience. I don't see the SAML SSO configurations I made to the app prior to deletion.
73+
74+
The SAML SSO configurations are stored on the service principal object. When you restore an application from the App registrations UI, it recovers the app object but creates a new service principal. Hence, the SAML SSO configurations done earlier to the app are lost when restoring a deleted application using the App registrations UI.
75+
76+
To correct this problem, delete the new service principal the app registrations experience created and restore the original service principal using the [Microsoft Graph API](/graph/api/directory-deleteditems-restore?tabs=http) or the [Microsoft Graph PowerShell cmdlet](/powershell/module/azuread/restore-azureadmsdeleteddirectoryobject?tabs=http).
77+
78+
If you recorded the object ID of the service principal before deleting the application, use the [Restore deleted item](/graph/api/directory-deleteditems-restore?tabs=http) API to recover the service principal. Otherwise, use the [list deleted items](/graph/api/directory-deleteditems-list?tabs=http) API to fetch the deleted service principal and filter the results by the client's application ID (**appId**) property using the following syntax:
79+
80+
`https://graph.microsoft.com/v1.0/directory/deletedItems/microsoft.graph.servicePrincipal?$filter=appId eq '{appId}'`
81+
82+
## Why can’t I recover managed identities?
83+
84+
[Managed identities](../managed-identities-azure-resources/overview.md) are a special type of service principals. Deleted managed identities can’t be recovered currently.
85+
86+
## I can’t see the provisioning data from a recovered service principal. How can I recover it back?
87+
88+
After recovering an SP, you may initially see the error in the following screenshot. This issue will resolve itself between 40 mins and 1 day. If you would like the provisioning job to start immediately, you can hit restart to force the provisioning service to run again. Hitting restart will trigger an initial cycle that can take time for customers with 100 K+ users or group memberships.
89+
90+
:::image type="content" source="media/delete-application-portal/recover-user-provisioning.png" alt-text="Screenshot of recovering user provisioning data.":::
91+
92+
## I recovered my application that was configured for application proxy. I can’t see app proxy configurations after the recovery. How can I recover it back?
93+
94+
App proxy configurations can't be recovered through the portal UI. Use the API to recover app proxy settings. Expect a delay of up to 24 hours as the app proxy data gets synced back.
95+
96+
## I can’t see the policies I set on the service principal object after the recovery. How can I recover them?
97+
98+
Policies can't be recovered currently. When you restore a service principal, you'll have to configure the policies again.
99+
100+
## Next steps
101+
102+
- [Delete a service principal](delete-application-portal.md)
103+
- [Delete an application registration](../develop/howto-restore-app.md)

articles/active-directory/manage-apps/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@
232232
href: application-sign-in-problem-first-party-microsoft.md
233233
- name: Reference
234234
items:
235+
- name: Deletion and recovery FAQ
236+
href: recover-deleted-apps-faq.md
235237
- name: Admin consent workflow FAQ
236238
href: admin-consent-workflow-faq.md
237239
- name: App Management certificates FAQ

0 commit comments

Comments
 (0)