Hello,
We have moved all our Azure resources to a new Azure AD tenant and would like to delete the tenant that is no longer used. When I attempt to delete, it reports that there are Enterprise Applications installed.
When I run the following command
Get-AzureADServicePrincipal
It lists a number of applications and their object ID's, When I attempt to delete them I get the following error:
Remove-AzureADServicePrincipal : Error occurred while executing RemoveServicePrincipal
Code: Authorization_RequestDenied
Message: Insufficient privileges to complete the operation.
RequestId: 4fedb115-b87b-4d6d-a2b5-ac5d88844b50
DateTimeStamp: Mon, 16 Aug 2021 09:37:57 GMT
HttpStatusCode: Forbidden
HttpStatusDescription: Forbidden
HttpResponseStatus: Completed
At line:1 char:1
+ Remove-AzureADServicePrincipal -ObjectId 66ab900e-7605-4c54-bf5f-5630 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Remove-AzureADServicePrincipal], ApiException
+ FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.RemoveServicePrincipal
I do not know what permissions I require because I am a global administrator to Azure AD? The object has a description of ReportingDataFactory. Does anyone know how to delete these? Unfortunately the Azure AD tenant has no subscription present anymore, so its a completely dead tenant.