【问题标题】:az mesh secret list not showing the secretsaz mesh 机密列表未显示机密
【发布时间】:2019-06-29 23:39:43
【问题描述】:

我创建了一个全新的网格应用程序,它运行良好。现在我更新了服务 yaml 以添加一个秘密,如下所示:

Secrets:
        - name: MySecret.txt
          description: My Mesh Application Secret
          secret_type: inlinedValue
          content_type: SecretStoreRef
          value: mysecret
        - name: mysecret:1.0
          description: My Mesh Application Secret Value
          secret_type: value
          content_type: text/plain
          value: "P@ssw0rd#1234"

我从微软官方文档中获取了这个例子。现在,当我运行以下命令时,重新部署甚至全新部署(都尝试过)应用程序后:

az mesh secret list -g <resourcegroupname>

我得到和 [] 列表,即没有显示任何秘密。请注意,应用程序运行良好,部署也成功。请帮忙。

【问题讨论】:

  • 好的,经过进一步调查,Visual Studio工具似乎不支持yaml文件中提到的秘密在发布期间合并到ARM JSON文件中。所以我只是手动更新了官方Mesh文档中提到的ARM JSON。
  • 但是现在当我将模板部署到 Azure 时,Azure 会抛出模板验证错误:"Deployment template validation failed: 'The template resource 'websecret:1.0' for type 'Microsoft.ServiceFabricMesh/secrets/values' at line '163' and column '9' has incorrect segment lengths. A nested resource type must have identical number of segments as its resource name. A root resource type must have segment length one greater than its resource name

标签: azure-service-fabric-mesh


【解决方案1】:

我在该页面上打开了一个问题,因为该文档存在许多问题。为了部署模板,我必须对 ARM 模板执行以下操作:

将密钥名称更改为“MySecret.txt/1”

改变

properties": {
  "kind": "inlinedValue",
  "description": "My Mesh Application Secret",
  "contentType": "SecretsStoreRef",
  "value": "mysecret",
}

"properties": {
  "kind": "inlinedValue",
  "description": "My Mesh Application Secret",
  "contentType": "text/plain",
}

要访问您的密钥,您必须向您的 codePackages 节点添加一个设置:

"settings": [
  {
    "name": "MySecretPasswordSetting",
    "value": "[resourceId('Microsoft.ServiceFabricMesh/secrets/values','MySecret.txt','v1')]"
  }
]

我还必须将“Microsoft.ServiceFabricMesh/secrets/MySecret.txt/values/v1”添加到我的 Microsoft.ServiceFabricMesh/applications.dependsOn。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-19
    • 1970-01-01
    • 1970-01-01
    • 2021-04-06
    • 2022-10-20
    • 2018-12-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多