CompositionalIT / farmer

Repeatable Azure deployments with ARM templates - made easy!
https://compositionalit.github.io/farmer
MIT License
526 stars 156 forks source link

When making app-settings into key-vault secret names sanitize the name. #1046

Closed mike-wade closed 1 year ago

mike-wade commented 1 year ago

This PR closes #1035

The changes in this PR are as follows:

I have read the contributing guidelines and have completed the following:

open Farmer
open Farmer.Builders

let webApplication = webApp {
    name "mw-farmer-test"
    secret_setting "csection:secret"
    sku WebApp.Sku.Free
    use_keyvault
}

let template = arm {
    location Location.WestEurope
    add_resources [
        webApplication
    ]
}

template
|> Writer.quickWrite "mw-farmer-test"

If I haven't completed any of the tasks above, I include the reasons why here:

mike-wade commented 1 year ago

Thanks @ninjarobot, this worked in my test to a real Azure sub.

Its worth pointing out that the secret parameter name gets updated with a key-vault friendly parameter name so csection:secret needs a param with name of csection-secret at deploy time. Is this fine?

ninjarobot commented 1 year ago

@mike-wade yes, that's fine, if there's a reasonable way to add that to the docs, it might help users. If not, they'll get prompted about missing parameters at least.

ninjarobot commented 1 year ago

@mike-wade this is merged and released and now available in Farmer 1.7.26. Thanks for the contribution!