skip to Main Content

I’m deploying an App Service Plan using an ARM Template. The template worked yesterday. After the deployment, I deleted the resource. Then, today, I’m trying to redeploy the same resource with the same ARM template and I’m getting the following error:

{
  "code": "InvalidTemplateDeployment",
  "details": [
    {
      "message": "Object reference not set to an instance of an object."
    }
  ],
  "message": "The template deployment 'Microsoft.Template-20220809104848' is not valid according to the validation procedure. The tracking id is 'ae29e10d-8e67-4131-988c-236d65af0f89'. See inner errors for details."
}

I’ve searched a lot trying to understand what this message "Object reference not set to an instance of an object" means, but I couldn’t find anything. I tryed to download the same template from the deployment log, the one that worked yesterday, and use it again, but I still got this error.

This is the template I’m using:

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "metadata": {
    "_generator": {
      "name": "bicep",
      "version": "0.9.1.41621",
      "templateHash": "8638675738336979076"
    }
  },
  "resources": [
    {
      "type": "Microsoft.Web/serverfarms",
      "apiVersion": "2020-12-01",
      "name": "dfp-testing",
      "location": "centralus",
      "sku": {
        "name": "F1",
        "capacity": 1
      }
    }
  ]
}

So, I’m lost. I really don’t know what is happening here.

Thanks for your help.

3

Answers


  1. I can’t tell you why it happens. But it seems a problem with the location.
    Deploying the template in West Europe for example works. Maybe there is a temporary issue in this region

    Login or Signup to reply.
  2. It seems that the ARM-Template you’re providing is invalid in term of including all the required elements/attributes. Please refer to Create App Service app using an ARM template and make sure you have a complete template. For example: properties could be required.

    Login or Signup to reply.
  3. Add an empty properties field to your server farms resource and it should fix things. Looks like they added it as a required field recently. Hope this helps!

    {
          "type": "Microsoft.Web/serverfarms",
          "apiVersion": "2020-12-01",
          "name": "dfp-testing",
          "location": "centralus",
          "sku": {
            "name": "F1",
            "capacity": 1
          },
          "properties": {}
        }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search