Purging an Azure APIM Soft Deletion
In order to redeploy an Azure API Manager with the same name you may run across the issue of the previously deleted resource being in a "soft delete" state. to get around this you need to purge the old APIM instance using PowerShell/Azure CLI.
az rest --method delete -u https://management.azure.com/subscriptions/<SUB ID>/providers/Microsoft.ApiManagement/locations/<LOCATION>/deletedservices/<SERVICE NAME>?api-version=2022-08-01
Make sure to edit the URL so that you hit the correct resource, you need to add your Subscription ID, Resource Location and Service Name.
Note: Service name refers to the name given to the resource at deployment with in your Arm template or Bicep file.