az mesh secret list not showing the secrets

84 Views Asked by At

I created a fresh mesh app and it is working fine. Now I updated the service yaml to add one secret as following:

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"

I have taken this example from the official microsoft documentation. Now after redeploying or even fresh with fresh deployment (tried both) the application when I run the following command :

az mesh secret list -g <resourcegroupname>

I get and [] list i.e. no secrets are shown. Please note that the applications are working fine and also the deployment too succeeded. Please assist.

1

There are 1 best solutions below

0
sirdank On

I have an issue open on that page for a number of problems that document has. Here's what I had to do to my ARM templates to get the template deploying:

Change the secret name to "MySecret.txt/1"

Change

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

to

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

To access your secret, you'll have to add a setting to your codePackages node:

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

I also had to add "Microsoft.ServiceFabricMesh/secrets/MySecret.txt/values/v1" to my Microsoft.ServiceFabricMesh/applications.dependsOn.