Azure工作簿部署失败,并显示“sharedType不能为null”

unguejic  于 2023-08-07  发布在  其他
关注(0)|答案(1)|浏览(117)

我尝试在Azure中部署工作簿,但始终收到此错误:

{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":\[{"code":"BadRequest","message":"Value cannot be null.\\r\\nParameter name: sharedType"}\]}

字符串
sharedType的含义是什么?我在蓝色文件里没找到任何相关的东西
https://learn.microsoft.com/en-us/search/?terms=sharedType&scope=Azure&fromNavSearch=true
也在谷歌上搜索了这个错误,但没有找到任何有用的信息。以前有人犯过同样的错误吗?在Azure文档中,我是否遗漏了有关sharedType的任何内容?

gijlo24d

gijlo24d1#

当你这样做的时候,你使用的是什么API版本?您是否正在发布到microsoft.insights/workbooksmicrosoft.insights/myworkbooks(不再支持)
工作簿 * 曾经 * 有“私人”和“共享”的概念,所以你 * 不应该 * 必须设置这个了(或很长一段时间?))。您的模板中是否缺少“种类”字段?
kind: "shared"是一种方法。
我只使用了这个模板:

{
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "type": "string",
      "defaultValue": "Workbook 12332160",
      "metadata": {
        "description": "The friendly name for the workbook that is used in the Gallery or Saved List.  This name must be unique within a resource group."
      }
    },
    "workbookType": {
      "type": "string",
      "defaultValue": "workbook",
      "metadata": {
        "description": "The gallery that the workbook will been shown under. Supported values include workbook, tsg, etc. Usually, this is 'workbook'"
      }
    },
    "workbookSourceId": {
      "type": "string",
      "defaultValue": "Azure Monitor",
      "metadata": {
        "description": "The id of resource instance to which the workbook will be associated"
      }
    },
    "workbookId": {
      "type": "string",
      "defaultValue": "[newGuid()]",
      "metadata": {
        "description": "The unique guid for this workbook instance"
      }
    }
  },
  "resources": [
    {
      "name": "[parameters('workbookId')]",
      "type": "microsoft.insights/workbooks",
      "location": "[resourceGroup().location]",
      "apiVersion": "2022-04-01",
      "dependsOn": [],
      "kind": "shared",
      "properties": {
        "displayName": "[parameters('workbookDisplayName')]",
        "serializedData": "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":{\"json\":\"# test\"},\"name\":\"text - 0\"}],\"isLocked\":false,\"fallbackResourceIds\":[\"Azure Monitor\"]}",
        "version": "1.0",
        "sourceId": "[parameters('workbookSourceId')]",
        "category": "[parameters('workbookType')]"
      }
    }
  ],
  "outputs": {
    "workbookId": {
      "type": "string",
      "value": "[resourceId( 'microsoft.insights/workbooks', parameters('workbookId'))]"
    }
  },
  "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#"
}

字符串
它没有sharedType,但在Azure门户内部有“kind”,并且成功完成。

相关问题