CompositionalIT / farmer

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

Add CORS rule on Storage account #1003

Closed MarcoGix closed 1 year ago

MarcoGix commented 1 year ago

Hi,

I'm facing this issue while deploying a StorageAccontConfig.

When I'm adding the CORS Rule

    let myUrl: string = "https://mylink.com"
    let myUrl2: string = "https://mylinkNew.com"

    let dataStorageAccount =
        storageAccount {
            name "NameHere"

            add_cors_rules [        
                StorageService.Blobs, { CorsRule.AllowAll with AllowedOrigins = Specific [ System.Uri myUrl] }
                StorageService.Blobs, CorsRule.create ([ myUrl2], [ GET ])
            ]
        }

The generated template file has a / in the end that made the settings not working properly once deployed

              "allowedOrigins": [
                "https://mylink.com/"
              ],

Is possible to avoid this? I think has to be the choose of the developrt to add or not that. Thanks!

ninjarobot commented 1 year ago

@MarcoGix agreed, it needs to respect the format of the URI passed when defining the rules. Can you please review #1017 to verify this resolves the issue?

ninjarobot commented 1 year ago

@MarcoGix this is fixed in 1.7.18 and available on nuget.