簡體   English   中英

ARM 文件中的標簽在 Azure 門戶中不可見

[英]Tags in ARM file not visible in Azure portal

我的部署 yml 文件中提到了多個標簽,但它們在 Azure 門戶應用程序服務中不可見。 以下標簽均對 Azure 門戶不可見。 只能找到成本中心標記。

 "resources": [
    {
          "apiVersion": "2016-08-01",
          "type": "Microsoft.Web/sites/slots",
          "comments": "",
          "location": "[resourceGroup().location]",
          "dependsOn": [
           "[variables('webAppDeployment')]"
          ],
          "kind": "app",
          "name": "[concat(parameters('siteName'),'/','staging')]",
          "properties": {
            "serverFarmId": "[parameters('appServicePlanResourceId')]"
          },
          "tags": {
            "displayName": "TEST",
            "Module": "MM",
            "SubModule": "ABD"
          }
]

為了在我們的本地環境中對此進行測試,我們創建了一個新的 ARM 模板,該模板將創建一個應用程序服務計划、web 應用程序和該 web 應用程序的暫存槽,其中包含上面共享的標簽列表。

在測試模板時,部署成功並且我們能夠在門戶中看到 webapp 插槽的標簽。

下面是樣本output供參考:

在此處輸入圖像描述

作為參考,這里是我們創建的用於測試的示例 ARM 模板:

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "web-appname": {
            "type": "string"
        },
        "appservicename": {
            "type": "string"
        }
    },
    "functions": [],
    "variables": {},
    "resources": [
 {
     "name": "[parameters('appservicename')]",
     "type": "Microsoft.Web/serverfarms",
     "apiVersion": "2020-12-01",
     "location": "[resourceGroup().location]",
     "sku": {
         "name": "S1"
     },
     "properties": {
         "name": "[parameters('appservicename')]"
     }
 },
{
    "name": "[parameters('web-appname')]",
    "type": "Microsoft.Web/sites",
    "apiVersion": "2020-12-01",
    "location": "[resourceGroup().location]",
    "dependsOn": [
        "[resourceId('Microsoft.Web/serverfarms',parameters('appservicename'))]"
    ],
    "properties": {
        "name": "[parameters('web-appname')]",
        "serverFarmId": "[resourceId('Microsoft.Web/serverfarms',parameters('appservicename'))]"
    }
},
{
    "name":"[concat(parameters('web-appname'),'/','stagging')]",
    "type": "Microsoft.Web/sites/slots",
    "apiVersion": "2021-02-01",
    "location": "[resourceGroup().location]",
    "dependsOn": [
        "[resourceId('Microsoft.Web/sites', parameters('web-appname'))]"
    ],
    "tags": {
        "displayName": "TEST",
            "Module": "MM",
            "SubModule": "ABD",
            "Createdfor": "repro",
            "depart":"test"
    },
    "properties": {
        "httpsOnly": true
    }
}
    ],
    "outputs": {}
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM