Microsoft.ApplicationInsights.AzureWebSites冲突

问题描述 投票:0回答:1

我从一只手臂上部署两个天蓝色功能时收到此消息Microsoft.ApplicationInsights.AzureWebSites冲突

手臂是:

{
    "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
    "contentVersion": "1.0.0.1",
    "parameters": {
      "environment": {
        "type": "string",
        "defaultValue": "dev",
        "allowedValues": [
          "dev",
          "qa",
          "st",
          "rc",
          "prod"
        ],
        "metadata": {
          "description": "environment to deploy component"
        }
      },
      "storageAccountType": {
        "type": "string",
        "defaultValue": "Standard_LRS",
        "allowedValues": [
          "Standard_LRS",
          "Standard_GRS",
          "Standard_ZRS",
          "Premium_LRS"
        ],
        "metadata": {
          "description": "Storage Account type and replication"
        }
      },
      "storageAccountAccessTier": {
        "type": "string",
        "defaultValue": "Hot",
        "allowedValues": [
          "Cool",
          "Hot"
        ],
        "metadata": {
          "description": "Storage account access tier"
        }
      },
      "applicationInsightsKey": {
        "type": "string",
        "metadata": {
          "description": "Application insights key to by used by deployed components"
        }
      },
      "exchangeRatesSyncCronSchedule": {
        "type": "string",
        "metadata": {
          "description": "A cron for Timer Trigger of Azure function"
        }
      },
      "createSlots": {
        "type": "bool",
        "metadata": {
          "description": "If create slots for API and for Azure functions"
        }
      }
    },
    "variables": {
      "resourceGroupName": "[resourceGroup().name]",
      "baseName": "exchangeRates",
      "resourceGroupLocation": "[resourceGroup().location]",
      "storageName": "[substring(concat('exchangeratetasks', uniqueString(resourceGroup().id)), 0, 22)]",
      "functionAppNameProvider": "[concat(parameters('environment'),'-', variables('baseName'), 'provider', '-', uniqueString(resourceGroup().id))]",
      "functionAppNameSync": "[concat(parameters('environment'),'-', variables('baseName'), 'sync', '-', uniqueString(resourceGroup().id))]",
      "functionAppHostingPlanNameProvider": "[concat(variables('baseName'), 'Provider','ProcessingPlan')]",
      "functionAppHostingPlanNameSync": "[concat(variables('baseName'), 'Sync','ProcessingPlan')]",
      "storageTableName": "[concat(parameters('environment'),'ExchangeRate')]",
      "storageAccountId": "[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',variables('resourceGroupName'),'/providers/','Microsoft.Storage/storageAccounts/', variables('storageName'))]",
      "shouldCreateSlots": "[bool(parameters('createSlots'))]"
    },
    "resources": [
      {
        "name": "[variables('storageName')]",
        "comments": "Storage account for exchange rate.",
        "type": "Microsoft.Storage/storageAccounts",
        "sku": {
          "name": "[parameters('storageAccountType')]"
        },
        "kind": "StorageV2",
        "apiVersion": "2018-07-01",
        "location": "[variables('resourceGroupLocation')]",
        "tags": {},
        "scale": null,
        "properties": {
          "networkAcls": {
            "bypass": "AzureServices",
            "virtualNetworkRules": [],
            "ipRules": [],
            "defaultAction": "Allow"
          },
          "supportsHttpsTrafficOnly": true,
          "encryption": {
            "services": {
              "file": {
                "enabled": true
              },
              "blob": {
                "enabled": true
              }
            },
            "keySource": "Microsoft.Storage"
          },
          "accessTier": "[parameters('storageAccountAccessTier')]"
        },
        "dependsOn": []
      },
      {
        "type": "Microsoft.Web/serverfarms",
        "comments": "Dynamic consumption plan for function app",
        "apiVersion": "2015-04-01",
        "name": "[variables('functionAppHostingPlanNameProvider')]",
        "location": "[variables('resourceGroupLocation')]",
        "properties": {
          "name": "[variables('functionAppHostingPlanNameProvider')]",
          "computeMode": "Dynamic",
          "sku": "Dynamic"
        }
      },
      {
        "apiVersion": "2015-08-01",
        "type": "Microsoft.Web/sites",
        "name": "[variables('functionAppNameProvider')]",
        "location": "[variables('resourceGroupLocation')]",
        "kind": "functionapp",
        "resources": [
          {
            "apiVersion": "2016-08-01",
            "name": "staging",
            "dependsOn": [
              "[resourceId('Microsoft.Web/sites', variables('functionAppNameProvider'))]"
            ],
            "type": "slots",
            "location": "[resourceGroup().location]",
            "properties": {},
            "condition": "[variables('shouldCreateSlots')]"
          },
          {
            "apiVersion": "2015-08-01",
            "name": "Microsoft.ApplicationInsights.AzureWebSites",
            "type": "siteextensions",
            "dependsOn": [
              "[resourceId('Microsoft.Web/Sites', variables('functionAppNameProvider'))]"
            ],
            "properties": {
            }
          }
        ],
        "dependsOn": [
          "[resourceId('Microsoft.Web/serverfarms', variables('functionAppHostingPlanNameProvider'))]",
          "[resourceId('Microsoft.Storage/storageAccounts', variables('storageName'))]"
        ],
        "properties": {
          "serverFarmId": "[concat('/subscriptions/', Subscription().SubscriptionId,'/resourcegroups/', variables('resourceGroupName'), '/providers/Microsoft.Web/serverfarms/', variables('functionAppHostingPlanNameProvider'))]",
          "siteConfig": {
            "appSettings": [
              {
                "name": "APPINSIGHTS_PROFILERFEATURE_VERSION",
                "value": "1.0.0"
              },
              {
                "name": "APPINSIGHTS_SNAPSHOTFEATURE_VERSION",
                "value": "1.0.0"
              },
              {
                "name": "ApplicationInsightsAgent_EXTENSION_VERSION",
                "value": "~2"
              },
              {
                "name": "DiagnosticServices_EXTENSION_VERSION",
                "value": "~3"
              },
              {
                "name": "InstrumentationEngine_EXTENSION_VERSION",
                "value": "disabled"
              },
              {
                "name": "SnapshotDebugger_EXTENSION_VERSION",
                "value": "disabled"
              },
              {
                "name": "WEBSITE_HTTPLOGGING_RETENTION_DAYS",
                "value": "1"
              },
              {
                "name": "XDT_MicrosoftApplicationInsights_BaseExtensions",
                "value": "disabled"
              },
              {
                "name": "XDT_MicrosoftApplicationInsights_Mode",
                "value": "recommended"
              },
              {
                "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
                "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageName'), ';AccountKey=', listKeys(variables('storageAccountId'),'2015-05-01-preview').key1)]"
              },
              {
                "name": "WEBSITE_CONTENTSHARE",
                "value": "[toLower(variables('functionAppNameProvider'))]"
              },
              {
                "name": "FUNCTIONS_EXTENSION_VERSION",
                "value": "2.0.12562.0"
              },
              {
                "name": "WEBSITE_NODE_DEFAULT_VERSION",
                "value": "8.11.1"
              },
              {
                "name": "FUNCTIONS_WORKER_RUNTIME",
                "value": "dotnet"
              },
              {
                "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
                "value": "[parameters('applicationInsightsKey')]"
              },
              {
                "name": "applicationInsights:roleName",
                "value": "Exchange.Rates"
              },
              {
                "name": "AzureWebJobsDashboard",
                "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageName'), ';AccountKey=', listKeys(variables('storageAccountId'),'2015-05-01-preview').key1)]"
              },
              {
                "name": "AzureWebJobsStorage",
                "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageName'), ';AccountKey=', listKeys(variables('storageAccountId'),'2015-05-01-preview').key1)]"
              },
              {
                "name": "ExchangeRatesSyncSchedule",
                "value": "[parameters('exchangeRatesSyncCronSchedule')]"
              },
              {
                "name": "StorageTableName",
                "value": "[variables('storageTableName')]"
              }
            ]
          }
        }
      },
      {
        "type": "Microsoft.Web/serverfarms",
        "comments": "Dynamic consumption plan for function app",
        "apiVersion": "2015-04-01",
        "name": "[variables('functionAppHostingPlanNameSync')]",
        "location": "[variables('resourceGroupLocation')]",
        "properties": {
          "name": "[variables('functionAppHostingPlanNameSync')]",
          "computeMode": "Dynamic",
          "sku": "Dynamic"
        }
      },
      {
        "apiVersion": "2015-08-01",
        "type": "Microsoft.Web/sites",
        "name": "[variables('functionAppNameSync')]",
        "location": "[variables('resourceGroupLocation')]",
        "kind": "functionapp",
        "resources": [
          {
            "apiVersion": "2016-08-01",
            "name": "staging",
            "dependsOn": [
              "[resourceId('Microsoft.Web/sites', variables('functionAppNameSync'))]"
            ],
            "type": "slots",
            "location": "[resourceGroup().location]",
            "properties": {},
            "condition": "[variables('shouldCreateSlots')]"
          },
          {
            "apiVersion": "2015-08-01",
            "name": "Microsoft.ApplicationInsights.AzureWebSites",
            "type": "siteextensions",
            "dependsOn": [
              "[resourceId('Microsoft.Web/Sites', variables('functionAppNameSync'))]"
            ],
            "properties": {
            }
          }
        ],
        "dependsOn": [
          "[resourceId('Microsoft.Web/serverfarms', variables('functionAppHostingPlanNameSync'))]",
          "[resourceId('Microsoft.Storage/storageAccounts', variables('storageName'))]"
        ],
        "properties": {
          "serverFarmId": "[concat('/subscriptions/', Subscription().SubscriptionId,'/resourcegroups/', variables('resourceGroupName'), '/providers/Microsoft.Web/serverfarms/', variables('functionAppHostingPlanNameSync'))]",
          "siteConfig": {
            "appSettings": [
              {
                "name": "APPINSIGHTS_PROFILERFEATURE_VERSION",
                "value": "1.0.0"
              },
              {
                "name": "APPINSIGHTS_SNAPSHOTFEATURE_VERSION",
                "value": "1.0.0"
              },
              {
                "name": "ApplicationInsightsAgent_EXTENSION_VERSION",
                "value": "~2"
              },
              {
                "name": "DiagnosticServices_EXTENSION_VERSION",
                "value": "~3"
              },
              {
                "name": "InstrumentationEngine_EXTENSION_VERSION",
                "value": "disabled"
              },
              {
                "name": "SnapshotDebugger_EXTENSION_VERSION",
                "value": "disabled"
              },
              {
                "name": "WEBSITE_HTTPLOGGING_RETENTION_DAYS",
                "value": "1"
              },
              {
                "name": "XDT_MicrosoftApplicationInsights_BaseExtensions",
                "value": "disabled"
              },
              {
                "name": "XDT_MicrosoftApplicationInsights_Mode",
                "value": "recommended"
              },
              {
                "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
                "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageName'), ';AccountKey=', listKeys(variables('storageAccountId'),'2015-05-01-preview').key1)]"
              },
              {
                "name": "WEBSITE_CONTENTSHARE",
                "value": "[toLower(variables('functionAppNameProvider'))]"
              },
              {
                "name": "FUNCTIONS_EXTENSION_VERSION",
                "value": "2.0.12562.0"
              },
              {
                "name": "WEBSITE_NODE_DEFAULT_VERSION",
                "value": "8.11.1"
              },
              {
                "name": "FUNCTIONS_WORKER_RUNTIME",
                "value": "dotnet"
              },
              {
                "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
                "value": "[parameters('applicationInsightsKey')]"
              },
              {
                "name": "applicationInsights:roleName",
                "value": "Exchange.Rates"
              },
              {
                "name": "AzureWebJobsDashboard",
                "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageName'), ';AccountKey=', listKeys(variables('storageAccountId'),'2015-05-01-preview').key1)]"
              },
              {
                "name": "AzureWebJobsStorage",
                "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageName'), ';AccountKey=', listKeys(variables('storageAccountId'),'2015-05-01-preview').key1)]"
              },
              {
                "name": "ExchangeRatesSyncSchedule",
                "value": "[parameters('exchangeRatesSyncCronSchedule')]"
              },
              {
                "name": "StorageTableName",
                "value": "[variables('storageTableName')]"
              }
            ]
          }
        }
      }      
    ],
    "outputs": {
      "armstorageTableName": {
        "type": "string",
        "value": "[variables('storageTableName')]"
      },
      "armstorageConnectionString": {
        "type": "string",
        "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageName'), ';AccountKey=', listKeys(variables('storageAccountId'),'2015-05-01-preview').key1)]"
      },
      "processingFunctionNameProvider": {
        "type": "string",
        "value": "[variables('functionAppNameProvider')]"
      },
      "processingFunctionNameSync": {
        "type": "string",
        "value": "[variables('functionAppNameProvider')]"
      }    
    }
  }
azure azure-application-insights azure-resource-manager
1个回答
0
投票

确定发现问题,两个功能的角色名称不能相同。

© www.soinside.com 2019 - 2024. All rights reserved.