我正在使用该AzureKeyVault
任务从 Key Vault 中检索机密。秘密的名称是StorageAccountKey
。此名称存储在变量中KeyName
。我这样做
- task: AzureKeyVault@1
displayName: 'Get key'
name: GetKey
inputs:
azureSubscription: '${{ parameters.azureSubscription }}'
KeyVaultName: '$(KeyVaultName)'
SecretsFilter: '$(KeyName)'
现在,在后续任务中,我想访问该密钥。鉴于秘密的名称本身存储在变量中,我该怎么做?以下似乎不起作用
- task: Bash@3
displayName: Create container
inputs:
targetType: 'inline'
script: |
az storage container create \
--name raw \
--account-name storageaccountname \
--account-key $($(dataLakeAccountKeyKeyName))
failOnStderr: true
我收到错误
/mnt/azp/azp-linux1_5/_temp/6719378a-b3ee-45d8-aad8-4f6a5e8b581e.sh: line 1: StorageAccountKey: command not found
ERROR: az storage container create: error: argument --account-key: expected one argument
因此,它似乎确实解决了内部变量,但仍然失败。