Home > Blockchain >  Error while deploying an ARM template to Azure
Error while deploying an ARM template to Azure

Time:08-10

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.

CodePudding user response:

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

CodePudding user response:

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.

  • Related