简体   繁体   中英

Error Refrencine Azure Key Vault Secret for SSH Key Linux VM ARM Template

I'm trying to ingest a ssh public for a Linux vm via arm template. The public key lives as a secrete on the keyvault.

Has anyone encountered an issue like this below? If so what was the fix? I've tried multiple keys that I have generated with ssh-keygen -t rsa -b 2048 . If I copy the key string directly into the keydata property as a string it works.

I've copied the following code from Microsoft docs assuming I could use for ssh key instead of adminpassword

"ssh": {
                            "publicKeys": [
                                {
                                    "path": "/home/bluecat/.ssh/authorized_keys",
                                    "keyData": {
                                        "reference": {
                                             "keyVault": {
                                                "id": "[resourceId(subscription().subscriptionId,resourceGroup().name,'Microsoft.KeyVault/vaults','kvbluecat')]"
                                                    },
                                            "secretName":"bluecatpub"
                                        }
                                    }
                                }
                            ]

After parsing a value an unexpected character was encountered: :. Path 'properties.osProfile.linuxConfiguration.ssh.publicKeys[0].keyData', line 1, position 958.",

I solved my own issue. It turns out the reference attributes (reference {}) used in this way is only available in the parameters schema not in main deployment template schema that houses the template json.

After the reference attributes for key vault secret into the parameter json file the issue resolved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM