Share via

Stuck with not working automation account

jan pawel 0 Reputation points
2026-04-24T23:09:08.0666667+00:00

After failing deployment I have deleted the resource group alongside with the automation account (unwise thing to do). Later I've tried to redeem myself and restore that automation account following the instruction (via creating new resource group with same name and then the "restore automation account" button). Account was restored but my deployment still fails with

"{\r\n  \"code\": \"BadRequest\",\r\n  \"message\": \"Only one account is allowed for your subscription per Region. If Deleted recently, please restore the same account\"\r\n}"

the target is that said original restored automation account. Not sure if that's a bug or there are some extra steps not mentioned here https://learn.microsoft.com/en-gb/azure/automation/delete-account?wt.mc_id=knowledgesearch_inproduct_copilot-in-azure&tabs=azure-portal#restore-a-deleted-automation-account

Azure Automation
Azure Automation

An Azure service that is used to automate, configure, and install updates across hybrid environments.


1 answer

Sort by: Most helpful
  1. Jerald Felix 11,550 Reputation points Volunteer Moderator
    2026-04-25T05:37:28.2966667+00:00

    Hello jan pawel,

    Greetings!

    Thanks for raising this question in Q&A forum.

    Don't worry you're not alone in this situation and it's actually a very understandable mistake! Here's what's happening: Azure soft-deletes Automation accounts for up to 14 days after you delete them. During this time, the service still counts that deleted account against your regional quota of one Automation account per subscription per region. So even though you restored the account, the deployment is still seeing a conflict — likely because there is either a ghost of the old deleted account still lingering in the system, or the restored account hasn't fully propagated yet in the backend.

    Here's how to get yourself unstuck step by step:

    Step 1: Check for Lingering Soft-Deleted Accounts

    First, let's see exactly what's sitting in your subscription. Open the Azure Portal → Automation Accounts, click Filters at the top, and enable "Show deleted". This will reveal any soft-deleted accounts that are still counting against your quota alongside your restored one.

    You can also check via PowerShell for a clearer picture:

    Get-AzAutomationAccount -SubscriptionId <your-sub-id>
    Get-AzAutomationDeletedAccount -SubscriptionId <your-sub-id>
    

    Step 2: Remove Any Extra or Duplicate Soft-Deleted Account

    If you see more than one account in that region (either live or in deleted state), remove the unwanted one using PowerShell:

    Remove-AzAutomationDeletedAccount `
      -Name <AccountName> `
      -ResourceGroupName <ResourceGroupName> `
      -Force
    

    Wait a few minutes after running this to allow the quota to update on the backend.

    Step 3: Confirm Your Restored Account Is Fully Active

    Go to the Azure Portal → Automation Accounts and open your restored account. Make sure its status shows as "Active" not "Restoring" or any transitional state. Sometimes the restore completes visually in the portal before it's fully live in the backend.

    Step 4: Try Restoring via PowerShell if Portal Restore Seems Incomplete

    If you're not fully confident the portal restore worked properly, try running the restore command via PowerShell as it is often more reliable:

    Restore-AzAutomationDeletedAccount `
      -Name <YourAccountName> `
      -ResourceGroupName <YourResourceGroupName> `
      -Location <YourRegion>
    

    Step 5: Wait a Few Minutes Then Re-Run Your Deployment

    After cleaning up duplicates and confirming only one active Automation account exists in that region, wait about 5 minutes for quota propagation, then re-run your failed deployment. Point it to the restored account and the "Only one account is allowed" error should no longer appear.

    Step 6: If the Error Still Persists, Escalate to Azure Support

    If after all these steps the same error continues, this may be a backend propagation bug that needs the Azure Automation product team to manually clear the quota state. Open an Azure Support Request and include your Subscription ID, region, the correlation ID from the failed deployment error, and a screenshot of the Automation Accounts blade with "Show deleted" enabled.

    If this answer helps you kindly accept the answer which will help others who have similar questions.

    Best Regards,

    Jerald Felix.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.