【发布时间】: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