Unable to create a service connection.

Puttisate 20 Reputation points
2025-12-23T02:52:06.0466667+00:00

Hi there,

I'm trying to create a new Docker registry, but I'm getting the error shown in the image. What can I do?sc

Azure DevOps
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Siddhesh Desai 740 Reputation points Microsoft External Staff Moderator
    2025-12-23T08:25:53.88+00:00

    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

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.