If you want to delete an Azure AD tenant which contains an Azure DevOps Enterprise application record you will first have to remove this Enterprise application record. Removing the Azure DevOps Enterprise record will not succeed from the user interface because the delete button is greyed out. To remove the record follow these steps:
After the Azure DevOps Enterprise record is removed you can delete the Azure AD tenant.
- Create a new Global Admin account in the directory you are trying to delete. Make sure you copy the temporary password.
- Start Windows PowerShell commandline and run:
Install-Module -Name AzureAD
. - Once done run
Connect-AzureAD
. You will be prompted to login, login with the user you created and you will be asked to change your password. - Run
Remove-AzureADServicePrincipal -ObjectId [Object ID]
to remove the Enterprise application record. - Remove the Global Admin account you created.
After the Azure DevOps Enterprise record is removed you can delete the Azure AD tenant.
Thanks! it worked well.
ReplyDelete