Hello,
Welcome to Microsoft Q&A,
If your Azure API Management (APIM) instance is stuck in the “Activating” state for several hours after a restore operation, it's likely in a hung or inconsistent provisioning state. Unfortunately, during this state, the instance cannot be directly managed (including deletion) through the standard Azure Portal, but you will be able to force delete it from the CLI.
az apim delete --name <your-apim-name> --resource-group <your-resource-group>
https://learn.microsoft.com/en-us/cli/azure/apim?view=azure-cli-latest#az-apim-delete
Please Upvote and accept the answer if it helps!!