Check the Impact Before You Disable a System-assigned Managed Identity

Today I had to review some Terraform code. The change was to disable the System-assigned Managed Identity on one Azure App Service.
My question was this. If we disable it, will the system still work the same? Will it still be functional? We enabled the System-assigned Managed Identity before, so we wanted this Azure App Service to have permission to do something with other Azure resources.
What I want to know now is this. Is this enabled System-assigned Managed Identity used anywhere? Is it assigned to anything?
We can check this in the Azure Portal.

If you see a list, it means the identity is used or assigned somewhere.

If you see no list, it means the identity is not used or assigned anywhere.

You can also check with the Azure CLI.
# Retrieve the managed identity principal ID of the specified Azure Web App
principal_id=$(az webapp show --resource-group "rg-demo" --name "app-demo" --query "identity.principalId" -o tsv)
# List all role assignments associated with the managed identity
az role assignment list --all --assignee "$principal_id" --query "[].{Role:roleDefinitionName, Scope:scope}" -o table
If you see a list, it means the identity is used or assigned somewhere.

If you see no list, it means the identity is not used or assigned anywhere.

One last thing. Before you disable a System-assigned Managed Identity, don’t forget to check where it is used. If you skip this, the system may stop working after you disable it.
Thank you!
P.S. The Azure CLI example checks an Azure App Service. If you want to check another type of Azure resource, use the “show” command for that resource type.