I am working on a template to help streamline our deployments to our on-premise IIS Servers. Usernames and passwords are stored in an Azure Key Vault, but when I go to use them in the Web App Management Task, I cannot access them. I am thinking I just have the syntax wrong.
To get the keys in the Azure Key Vault, I am using the following task. This works in that it finds the keys and doesn't give me an error.
- task: AzureKeyVault@1
inputs:
azureSubscription : '_MyServiceConnectionHere_'
KeyVaultName : '_MyVaultNameHere_'
SecretsFilter : '${{ parameters.websiteName }}-AppPoolUsername,${{ parameters.websiteName }}-AppPoolPassword'
This is how I am using them in the IIS Web App Manage Task. (I have abbreviated the following to the relevant parts.)
- task: IISWebAppManagementOnMachineGroup@0
displayName: Update Website and App Pool
inputs:
AppPoolNameForWebsite: ${{ parameters.websiteName }}
DotNetVersionForWebsite: 'No Managed Code'
AppPoolIdentityForWebsite: 'specificUser'
AppPoolUsernameForWebsite: ${{variables['${{parameters.websiteName}}-AppPoolUsername']}}
AppPoolPasswordForWebsite: ${{variables['${{parameters.websiteName}}-AppPoolPassword']}}
AppPoolName: ${{ parameters.websiteName }}
Here, the username and password don't resolve. As you can see, I am attempting to retrieve them using the following syntax:
${{variables['${{parameters.websiteName}}-AppPoolUsername']}}
What is the proper syntax for retrieving variables by a key name that has been composed?