Resolve not found errors for Azure resources

This article describes the errors you may encounter when a resource can't be found during deployment.


When your template includes the name of a resource that can't be resolved, you receive an error similar to:

Message=Cannot find ServerFarm with name exampleplan.

If you attempt to use the reference or listKeys functions with a resource that cannot be resolved, you receive the following error:

Message=The Resource 'Microsoft.Storage/storageAccounts/{storage name}' under resource
group {resource group name} was not found.


Resource Manager needs to retrieve the properties for a resource, but can't identify the resource in your subscription.

Solution 1 - set dependencies

If you're trying to deploy the missing resource in the template, check whether you need to add a dependency. Resource Manager optimizes deployment by creating resources in parallel, when possible. If one resource must be deployed after another resource, you need to use the dependsOn element in your template. For example, when deploying a web app, the App Service plan must exist. If you haven't specified that the web app depends on the App Service plan, Resource Manager creates both resources at the same time. You get an error stating that the App Service plan resource can't be found, because it doesn't exist yet when attempting to set a property on the web app. You prevent this error by setting the dependency in the web app.

  "apiVersion": "2015-08-01",
  "type": "Microsoft.Web/sites",
  "dependsOn": [

But, you want to avoid setting dependencies that are not needed. When you have unnecessary dependencies, you prolong the duration of the deployment by preventing resources that are not dependent on each other from being deployed in parallel. In addition, you may create circular dependencies that block the deployment. The reference function creates an implicit dependency on the referenced resource, when that resource is deployed in the same template. Therefore, you may have more dependencies than the dependencies specified in the dependsOn property. The resourceId function does not create an implicit dependency or validate that the resource exists.

When you encounter dependency problems, you need to gain insight into the order of resource deployment. To view the order of deployment operations:

  1. Select the deployment history for your resource group.

    select deployment history

  2. Select a deployment from the history, and select Events.

    select deployment events

  3. Examine the sequence of events for each resource. Pay attention to the status of each operation. For example, the following image shows three storage accounts that deployed in parallel. Notice that the three storage accounts are started at the same time.

    parallel deployment

    The next image shows three storage accounts that are not deployed in parallel. The second storage account depends on the first storage account, and the third storage account depends on the second storage account. The first storage account is started, accepted, and completed before the next is started.

    sequential deployment

Solution 2 - get resource from different resource group

When the resource exists in a different resource group than the one being deployed to, use the resourceId function to get the fully qualified name of the resource.

"properties": {
    "name": "[parameters('siteName')]",
    "serverFarmId": "[resourceId('plangroup', 'Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"

Solution 3 - check reference function

Look for an expression that includes the reference function. The values you provide vary based on whether the resource is in the same template, resource group, and subscription. Double check that you are providing the required parameter values for your scenario. If the resource is in a different resource group, provide the full resource ID. For example, to reference a storage account in another resource group, use:

"[reference(resourceId('exampleResourceGroup', 'Microsoft.Storage/storageAccounts', 'myStorage'), '2017-06-01')]"