Hi @Puttisate
Thank you for reaching out to Microsoft Q&A
There's a Quota limit of 250 Service Principal + Applications in Entra. Your Microsoft Entra Directory has reached these limits, please delete the unwanted service principals and delete them from the Deleted applications list too. Refer the commands below:
# Sign in with admin-consented scopes
Connect-MgGraph -Scopes "Application.ReadWrite.All ServicePrincipal.ReadWrite.All Directory.ReadWrite.All"
Delete Service principal:
# Sign in with admin-consented scopes
Connect-MgGraph -Scopes "Application.ReadWrite.All ServicePrincipal.ReadWrite.All Directory.ReadWrite.All"
Delete Applications
# By objectId
Remove-MgApplication -ApplicationId "<app-object-id>"
# By appId
$app = Get-MgApplication -Filter "appId eq '<app-id-guid>'"; if ($app) { Remove-MgApplication -ApplicationId $app.Id }
Purge delete the deleted Service principals and Applications
# List deleted items
Get-MgDirectoryDeletedItem -All
# Purge specific deleted object
Remove-MgDirectoryDeletedItem -DirectoryObjectId "<deleted-item-id>"
# Purge only deleted Applications
Get-MgDirectoryDeletedItem -All | Where-Object { $_.'@odata.type' -eq '#microsoft.graph.application' } |
ForEach-Object { Remove-MgDirectoryDeletedItem -DirectoryObjectId $_.Id -ErrorAction Continue }
# Purge only deleted Service Principals
Get-MgDirectoryDeletedItem -All | Where-Object { $_.'@odata.type' -eq '#microsoft.graph.servicePrincipal' } |
ForEach-Object { Remove-MgDirectoryDeletedItem -DirectoryObjectId $_.Id -ErrorAction Continue }
Get the Owners or users added to Service Principal or applications to review:
# SP owners
Get-MgServicePrincipalOwner -ServicePrincipalId "<sp-object-id>" -All
# App owners
Get-MgApplicationOwner -ApplicationId "<app-object-id>" -All
You can also delete the unwanted applications manually from Azure Portal - Microsoft Entra