简体   繁体   中英

Azure ARM template accessing storage key

I am trying to access azure OMS ID, primary key for the same OMS, storage account key, following is the command where I want to pass these details for installation in this format sh ./install-master.sh <OMS ID> <OMS Key> <Storage Account Name> <Storage Account Key>

"protectedSettings": {
      "commandToExecute": "[concat('sh ./install-master.sh ',reference(resourceId(parameters('omsResourceGroup'),'Microsoft.OperationalInsights/workspaces/', parameters('omsWorkspace')), '2015-11-01-preview').customerId,' ',listKeys(resourceId(parameters('omsResourceGroup'),'Microsoft.OperationalInsights/workspaces/', parameters('omsWorkspace')), '2015-11-01-preview').primarySharedKey,' ',parameters('scriptStorageAccount'),' ',listKeys(resourceId('Microsoft.Storage/storageAccounts',parameters('scriptStorageAccount')),providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value))]"
     }

I am getting following error message

InvalidTemplate: Deployment template validation failed: 'The template resource 'node1/CustomInstall' at line '265' and column '10' is not valid: Unable to parse language expression 'concat('sh ./nifi-install-master.sh ',reference(resourceId(parameters('omsResourceGroup'),'Microsoft.OperationalInsights/workspaces/', parameters('omsWorkspace')), '2015-11-01-preview').customerId,' ',listKeys(resourceId(parameters('omsResourceGroup'),'Microsoft.OperationalInsights/workspaces/', parameters('omsWorkspace')), '2015-11-01-preview').primarySharedKey,' ',parameters('scriptStorageAccount'),' ',listKeys(resourceId('Microsoft.Storage/storageAccounts',parameters('scriptStorageAccount')),providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value))': expected token 'EndOfData' and actual 'RightParenthesis'.. Please see https://aka.ms/arm-template-expressions for usage details.'.

Is there any other way I can test the reference I am passing in the ARM ?

错误有点暗示您有1个右括号:

xxx.keys[0].value))]" <<< remove one in the end

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