Thanks for posting your question in the Microsoft Q&A forum!
For your query I understand that you are trying to delete the Mutiple Azure service principle, and you are facing an issue with an error.
In your Azure CLI script, you are trying to delete the Mutiple service principals to do that you are using az ad sp list
which allow you delete first 100 service principals.
To delete required multiple service principals, you need to list all Service Principals with display names in your script which has shown in the below.
sp_list=$(az ad sp list --all --query "[?displayName=='app1' || displayName=='app2' || displayName=='app3' || displayName=='app4'].appId" -o tsv)
for sp_id in $sp_list;do
echo "Deleting service principal: $sp_id"
az ad sp delete --id $sp_id
done
echo "All Service Principals deleted"
Replace app1, app2, app3 and app4 with the application name.
If you would like to delete the individual service principals, you can use the below command.
az ad sp delete --id myServicePrincipalID
Replace myServicePrincipalID with the object ID of your service principle.
Hope this helps. Do let us know if you any further queries.
Reference: https://learn.microsoft.com/en-us/cli/azure/ad/sp?view=azure-cli-latest#az-ad-sp-delete
Thanks,
Akhilesh.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.