简体   繁体   中英

Azure Resource Group Deployment Fails

I have an Azure Resource Group Deployment project in Visual Studio 2019 that validates and deploys fine from Visual Studio, however when I try to deploy it through Azure Release Pipeline with an Azure Resource Group Deployment Task it intermittently fails with the error:

The request content was invalid and could not be deserialized: 'Required property 'type' not found in JSON. Path 'properties.template.resources[6]', line 1, position 3759.'. Task failed while creating or updating the template deployment.

I haven't been able to find any helpful information in my research of the problem. Here is the template:

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "sql_name": {
      "defaultValue": "project-sql",
      "type": "String"
    },
    "name": {
      "defaultValue": "a-data-factory",
      "type": "String"
    },
    "location": {
      "defaultValue": "Central US",
      "type": "String"
    },
    "apiVersion": {
      "defaultValue": "2018-06-01",
      "type": "String"
    },
    "gitAccountName": {
      "type": "String"
    },
    "gitRepositoryName": {
      "type": "String"
    },
    "gitBranchName": {
      "defaultValue": "foo-branch",
      "type": "String"
    },
    "gitRootFolder": {
      "defaultValue": "/",
      "type": "String"
    },
    "gitProjectName": {
      "type": "String"
    },
    "ssisdbname": {
      "type": "String",
      "defaultValue": "SSISDB"
    },
    "factoryName": {
      "type": "string",
      "metadata": "Data Factory Name",
      "defaultValue": "a-data-factory"
    }
  },
  "variables": {
    "factoryId": "[concat('Microsoft.DataFactory/factories/', parameters('factoryName'))]"
  },
  "resources": [
    {
      "type": "Microsoft.Sql/servers",
      "apiVersion": "2015-05-01-preview",
      "name": "[parameters('sql_name')]",
      "location": "northcentralus",
      "kind": "v12.0",
      "properties": {
        "administratorLogin": "theadmin",
        "administratorLoginPassword": "",
        "version": "12.0"
      }
    },
    {
      "type": "Microsoft.Sql/servers/databases",
      "apiVersion": "2017-03-01-preview",
      "name": "[concat(parameters('sql_name'), '/dummyDB')]",
      "location": "northcentralus",
      "dependsOn": [
        "[resourceId('Microsoft.Sql/servers', parameters('sql_name'))]"
      ],
      "sku": {
        "name": "S0",
        "tier": "Standard"
      },
      "kind": "v12.0,user",
      "properties": {
        "collation": "SQL_Latin1_General_CP1_CI_AS",
        "maxSizeBytes": 268435456000,
        "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
        "zoneRedundant": false
      }
    },
    {
      "type": "Microsoft.Sql/servers/databases",
      "apiVersion": "2017-03-01-preview",
      "name": "[concat(parameters('sql_name'), '/dummerDB')]",
      "location": "northcentralus",
      "dependsOn": [
        "[resourceId('Microsoft.Sql/servers', parameters('sql_name'))]"
      ],
      "sku": {
        "name": "S0",
        "tier": "Standard"
      },
      "kind": "v12.0,user",
      "properties": {
        "collation": "SQL_Latin1_General_CP1_CI_AS",
        "maxSizeBytes": 268435456000,
        "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
        "zoneRedundant": false
      }
    },
    {
      "type": "Microsoft.Sql/servers/encryptionProtector",
      "apiVersion": "2015-05-01-preview",
      "name": "[concat(parameters('sql_name'), '/current')]",
      "dependsOn": [
        "[resourceId('Microsoft.Sql/servers', parameters('sql_name'))]"
      ],
      "kind": "servicemanaged",
      "properties": {
        "serverKeyName": "ServiceManaged",
        "serverKeyType": "ServiceManaged"
      }
    },
    {
      "type": "Microsoft.Sql/servers/firewallRules",
      "apiVersion": "2015-05-01-preview",
      "name": "[concat(parameters('sql_name'), '/AllowAllWindowsAzureIps')]",
      "dependsOn": [
        "[resourceId('Microsoft.Sql/servers', parameters('sql_name'))]"
      ],
      "properties": {
        "startIpAddress": "0.0.0.0",
        "endIpAddress": "0.0.0.0"
      }
    },
    {
      "type": "Microsoft.DataFactory/factories",
      "apiVersion": "[parameters('apiVersion')]",
      "name": "[parameters('factoryName')]",
      "location": "[parameters('location')]",
      "identity": {
        "type": "SystemAssigned"
      },
      "resources": [
        {
          "name": "[concat(parameters('factoryName'), '/theIntegrationRuntime1')]",
          "type": "Microsoft.DataFactory/factories/integrationRuntimes",
          "apiVersion": "2018-06-01",
          "properties": {
            "type": "Managed",
            "typeProperties": {
              "computeProperties": {
                "location": "Central US",
                "nodeSize": "Standard_D2_v3",
                "numberOfNodes": 1,
                "maxParallelExecutionsPerNode": 2
              },
              "ssisProperties": {
                "catalogInfo": {
                  "catalogServerEndpoint": "project-sql.database.windows.net",
                  "catalogAdminUserName": "theadmin",
                  "catalogAdminPassword": {
                    "type": "SecureString",
                    "value": ""
                  },
                  "catalogPricingTier": "S0"
                },
                "edition": "Standard",
                "licenseType": "LicenseIncluded"
              }
            }
          },
          "dependsOn": [ "[resourceId('Microsoft.DataFactory/factories', parameters('factoryname'))]" ]
        }
      ],
      "properties": {
        "repoConfiguration": {
          "type": "FactoryVSTSConfiguration",
          "accountName": "[parameters('gitAccountName')]",
          "repositoryName": "[parameters('gitRepositoryName')]",
          "collaborationBranch": "[parameters('gitBranchName')]",
          "rootFolder": "[parameters('gitRootFolder')]",
          "projectName": "[parameters('gitProjectName')]"
        }
      },
      "dependsOn": [ "[resourceId('Microsoft.Sql/servers', parameters('sql_name'))]" ]
    }
  ]
}

The Release Pipeline was pointed to an old build artifact with a malformed template.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM