YannickRe / azuredevops-buildagents

Generate self-hosted build agents for Azure DevOps, just like Microsoft does.
MIT License
153 stars 90 forks source link

Build variable names not compatible with keyvault #76

Open robbert-nlo opened 9 months ago

robbert-nlo commented 9 months ago

Hi Yannick,

First of all thanks for your excellent work!

I am using your repo to fully automatically update our buildagents. In the spirit of having everything as code, I deploy the environment (the RGs, SIG, image definitions, etc) using Terraform. I'm using a Keyvault to set the image generation variables directly from Terraform (as it knows the resource names), and then link this keyvault to the DevOps 'Image Generation Variables' variable group.

Unfortunately, keyvault is notoriously known for not supporting secret names with underscores (_) in them. That's why I have to remove all underscores from the build variables to make this work. So CLIENT_ID becomes CLIENTID etc. This works well, but it causes a permanent diff with your code, which I'm not happy with.

Would you consider adding support for build variables using keyvault supported naming?

YannickRe commented 9 months ago

@robbert-nlo I'm open to considering it, but given that all my variables have underscores in them this will have a significant impact.

Can you list, in detail, every variable you adjust in your code to make it work? After that I can see how I can make this as simple a transition as possible :)

robbert-nlo commented 9 months ago

@YannickRe : I am currently patching only the variables needed for a SIG build, because we only use a SIG. If I wanted to do VMSS builds, I'd have to patch those variables as well. So, in other words, for complete keyvault compatibility, all environments variables containing underscores need to be adjusted (i.e. all env vars mentioned in the README).

For reference, this is what my patch looks like at the moment: https://github.com/YannickRe/azuredevops-buildagents/commit/0ffbbefc827d5d008f284a8d680c7f3841afcdc4

robbert-nlo commented 2 weeks ago

@YannickRe Hi Yannick, do you think this will be implemented at some point?