Azure (Resource Manager deployments)

Azure ResourceNotFound: the resource was not found

Azure ResourceNotFound means Resource Manager could not find a resource it needed. Check the name, resource group and subscription, dependencies and references.

By EpiFive Editorial TeamSources checked How we check our guides

What the error means

ResourceNotFound is one of two Azure Resource Manager codes, together with NotFound, that mean a resource cannot be found. Microsoft's article says the cause is that Resource Manager needs to retrieve the properties for a resource but can't find the resource in your subscription. The message names the resource type, the resource and the resource group, for example a storage account that "was not found" under a given resource group.

You see it most often when deploying an ARM template or Bicep file, but also during management tasks. Microsoft's example is adding tags to a resource that doesn't exist. In deployments, the common errors table says ResourceNotFound means your deployment references a resource that can't be resolved, and asks you to verify that your use of the reference function includes the parameters required for your scenario.

The resource may genuinely be missing, or it may exist somewhere other than where Resource Manager looked: a different resource group or subscription, or not yet created because the template deployed it in parallel with something that needed it.

Common causes

  • A wrong resource name, resource group name or subscription, including running commands in the wrong subscription context.
  • A template that deploys a resource at the same time as a resource that needs it, without a dependency.
  • A reference or listKeys call for a resource in another resource group or subscription without the full resource ID.
  • Reading a managed identity's values before the resource that carries the identity is deployed.
  • A resource that was just deleted and still briefly appears in the portal.

How to fix it

1. Check the name, resource group and subscription

For a management task, check the resource name, resource group name and subscription. In PowerShell or Azure CLI, make sure you are working in the subscription that contains the resource, and switch if needed:

az account set --subscription "<subscription name or ID>"
Set-AzContext -Subscription "<subscription name or ID>"

If you cannot verify the values, find the resource in the Azure portal and compare its name, resource group and subscription.

2. Add the missing dependency in the template

Resource Manager deploys resources in parallel where it can. Microsoft's example is a web app that fails because its App Service plan does not exist yet. In Bicep, refer to the plan by its symbolic name, for example serverFarmId: servicePlan.id, to create an implicit dependency. In JSON, add the plan to dependsOn. Avoid unnecessary dependencies, which slow deployments and can create circular dependencies. To see the order, open the resource group's deployment history in the portal and select Related events.

3. Reference resources in other groups correctly

For a resource in another resource group, use the existing keyword with scope: resourceGroup(rgname) in Bicep, or the resourceId function with the resource group name in JSON. For reference or listKeys on a resource in another group, provide the full resource ID.

4. Get managed identity values from the resource

Pass the name of the resource that the identity is applied to, not the identity, and use 'Full' in the reference function, as in Microsoft's pattern:

"[reference(resourceId('Microsoft.Compute/virtualMachines', variables('vmName')), '2022-03-01', 'Full').identity.principalId]"

5. Refresh after deleting a resource

If you just deleted the resource, refresh the portal; it should disappear from the list.

If nothing works

Microsoft says that if a deleted resource continues to be shown as available for more than a few minutes, contact support. For deployments, as a general step, check the resource group's deployment operations to see exactly which resource failed and which resource it was looking for.

What we checked

Two Microsoft Learn pages were read. The resource not found article shows the NotFound and ResourceNotFound messages, the cause, and solutions for checking properties, setting dependencies, referencing external resources, managed identities, functions and recently deleted resources. "Troubleshoot common Azure deployment errors" lists ResourceNotFound with the reference function mitigation. The error was not reproduced for this page.

Last checked: 2026-11-21.

Official sources

Questions people ask

What causes Azure ResourceNotFound?

Resource Manager needs the properties of a resource but cannot find it in your subscription. Typical reasons are a wrong name, resource group or subscription, a missing dependency in a template, or a reference function without the parameters for a resource in another group.

What is the difference between NotFound and ResourceNotFound?

Microsoft documents both codes for a resource that cannot be found. Its common errors table links NotFound to deploying a dependent resource in parallel with its parent, and ResourceNotFound to a reference that cannot be resolved.

I deleted a resource and now get a not found error. Is that a problem?

Usually not. Microsoft says a deleted resource can show in the portal for a short time; refresh the portal. If it still shows as available for more than a few minutes, contact support.

Not your code?

Search the error code library, or report a code we don't cover. Spotted something out of date on this page? Report a correction.