In Microsoft Entra, an Application (or App Registration) serves as a blueprint for your application. It describes how the service issues tokens to the application, the resources it might need to access and the actions it can perform. This object exists only in the tenant where the application was initially registered (the home tenant). For the application to establish an identity and be used within a specific tenant, a Service Principal object is created, which local instance of the Application within that tenant.
Previously, to remove an application’s access to resources in your tenant, you needed to remove the permissions and role assignments associated with the Service Principal in your tenant, or just delete the Service Principal. Now, you can actually “Disable” the application and hence Service Principal from its source to prevent it from accessing resources, similar to how you can with User objects in Microsoft Entra. This means that all the existing configuration settings, permissions and metadata are preserved.
In this article I will walk you through how to disable / deactivate an Application in Microsoft Entra and what that experience looks like.
Prerequisites
To successfully disable an application in Microsoft Entra, you must first have one of the following Microsoft Entra roles:
- Cloud Application Administrator
- Application Administrator
You must also provide consent to the following Microsoft Graph API permissions (which requires Global Administrator):
- Application.ReadWrite.All
Lastly, to use the PowerShell examples in this article, you must have the Microsoft.Graph.Authentication PowerShell module installed, which works best with PowerShell v7.
Disabling an Application
Disabling an Application isn’t yet supported using the Microsoft Entra Admin Center. As such, you need to use the Graph API directly to disable an application. Below is an example of how to use Microsoft Graph PowerShell to disable an application
#Connect to Microsoft Graph with the required permissions
Connect-MgGraph -Scopes "Application.ReadWrite.All"
#Define the name of the application to be disabled
$appName = "DansScriptApp"
#filter to obtain the ID of the application with displayName 'DansScriptApp'
$uri = "/beta/applications/?`$filter=displayName eq '$appName'"
$app = Invoke-MgGraphRequest -Uri $uri | Select -Expand Value
#Define the URI of th e application to be disabled and create the body to set isDisabled to true
$uri2 = "/beta/applications/$($app.Id)"
$body = @{
"isDisabled" = $true
}
#Send the PATCH request to disable the application
Invoke-MgGraphRequest -Uri $uri2 -Method PATCH -Body $body Once the commands have been successfully run, you will see the application show as disabled from within the Microsoft Entra Admin Center.
As the app is disabled, if you then attempt to authenticate to Microsoft Entra with that application, you will be blocked. Here I have attempted to connect to Microsoft Graph PowerShell in the delegated context:
Is disabling an application more secure?
You might want to consider disabling an application if the application becomes risky or if you believe the application is being misused. Once the application is disabled, Refresh Tokens are immediately invalidated for said application and can no longer be used to request new Access Tokens to access resources. That being said, if an Access Token has been issued and then the application is disabled, that Access Token can still be used to access resources for up to 60 minutes before it expires. Users will also be unable to sign in to the application, as you saw from this article, and the application will be unable to access protected resources itself.

