-1

Description

I received this strange error while deploying an Azure Function using ARM Templates. I was able to isolate that specific resource as the origin of the failure. I was unable to find information about this error in the Microsoft doc. D o you have any idea of what could be the root cause ?

Error

There were errors in your deployment. Error code: DeploymentFailed.
##[error]At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.
##[error]Details:
##[error]undefined: ValueType 'System.Boolean' cannot be null.
##[error]Check out the troubleshooting guide to see if your issue is addressed: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment?view=azure-devops#troubleshooting
##[error]Task failed while creating or updating the template deployment.

Template

Note that the server farm already exists in another resource group.

{
  // ...
  "variables": {
    // ...
    "serverfarms_ASE_externalid": "[concat('/subscriptions/', variables('varSubscriptionId'), '/resourceGroups/ABC-123-rg/providers/Microsoft.Web/serverfarms/Medium-ASE01-Windows01')]",
    // ...
  },
  "resources": [
    // ...
    {
      "type": "Microsoft.Web/sites",
      "apiVersion": "2019-08-01",
      "name": "[variables('functionApp_name')]",
      "location": "[parameters('infra').region.primaryName]",
      "dependsOn": [
        "[resourceId('Microsoft.Storage/storageAccounts/blobServices', variables('storageAccount_name'), 'default')]",
        "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccount_name'))]"
      ],
      "identity": {
        "type": "SystemAssigned"
      },
      "kind": "functionapp",
      "properties": {
        "serverFarmId": "[variables('serverfarms_ASE_externalid')]",
        "siteConfig": {
          "appSettings": [
            {
              "name": "AzureWebJobsStorage",
              "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccount_name'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
            },
            {
              "name": "AzureWebJobsDashboard",
              "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccount_name'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
            },
            {
              "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
              "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccount_name'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
            },
            {
              "name": "WEBSITE_CONTENTSHARE",
              "value": "[toLower(variables('functionApp_name'))]"
            },
            {
              "name": "FUNCTIONS_EXTENSION_VERSION",
              "value": "~3"
            },
            {
              "name": "WEBSITE_NODE_DEFAULT_VERSION",
              "value": "8.11.1"
            },
            {
              "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
              "value": "[reference(resourceId('Microsoft.Insights/components', variables('appInsights_name')), '2014-04-01').InstrumentationKey]"
            },
            {
              "name": "FUNCTIONS_WORKER_RUNTIME",
              "value": "dotnet"
            },
            {
              "name": "AzureWebJobsSecretStorageType",
              "value": "files"
            }
          ]
        }
      }
    }
    // ...
  ]
}
  • Hi pivielti; you need to go and look at the resource group's deployment records. That will have a detailed record of the attempted deployment, with as much information as is available. You can access this through the azure portal, or via az cli or powershell. – Vince Bowdren Jan 08 '22 at 01:25

1 Answers1

0

##[error]Details: ##[error]undefined: ValueType 'System.Boolean' cannot be null.

This is not a common azure deployment issue. Please check the common azure deployment issue

You can find the exact issue by using find error code

There are three types of errors that are related to a deployment:

  • Validation errors occur before a deployment begins and are caused by syntax errors in your file. Your editor can identify these errors.
  • Preflight validation errors occur when a deployment command is run but resources aren't deployed. These errors are found without starting the deployment. For example, if a parameter value is incorrect, the error is found in preflight validation.
  • Deployment errors occur during the deployment process and can only be found by assessing the deployment's progress.

All types of errors return an error code that you use to troubleshoot the deployment. Validation and preflight errors are shown in the activity log but don't appear in your deployment history. A Bicep file with syntax errors doesn't compile into JSON and isn't shown in the activity log.

To identify syntax errors, you can use Visual Studio Code with the latest Bicep extension or Azure Resource Manager Tools extension.