Hi Joshua
I understand you're facing an issue where you're unable to delete a PostgreSQL flexible server after a failed creation attempt. That sounds really frustrating! Here's what I suggest you can try:
- Check Resource State: First, ensure that the server is genuinely in a "bad state." Sometimes, the resource might not appear immediately in the portal, and it might help to refresh or check the Azure CLI for the actual status.
- Use Azure CLI with Force Flag: You can attempt to delete the server using the Azure CLI with the
--yes
flag to bypass any confirmation prompts. The command should look like this:az postgres flexible-server delete --resource-group <resource-group> --name <server-name> --yes
- Try Deleting Resource Group: If you don't mind losing other resources in that group, and the above methods fail, consider deleting the entire resource group:
az group delete --name <resource-group> --yes --no-wait
- Check Dependencies: Ensure there are no dependent resources (like DNS resources) preventing deletion. Disabling or removing those dependencies can sometimes resolve the issue.
I hope one of these suggestions helps you resolve the issue! If you have any further questions or need more clarification on any steps, feel free to ask!