CompositionalIT / farmer

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

Storage account IP-rules not accepting ARM expressions #997

Closed Thorium closed 11 months ago

Thorium commented 1 year ago

If I pass an arm-expression to restrict_to_ip then the build will fail saying it cannot recognize the IP address format.

I would like to do something like this:

storageAccount {
   //...
   restrict_to_ip (myVMconfig.PublicIpAddress.Value.Eval())
}
Thorium commented 1 year ago

Looking into this a bit, and it might be that it's not possible:

ARM template for StorageAccounts

There are some possible workarounds (with other consequences), for example:

isaacabraham commented 1 year ago

Hmmmm. @Thorium it might be worth reaching out to someone on the Azure Storage team to find out how to do this - the docs are often not clear.

ninjarobot commented 1 year ago

@Thorium I see the issue after trying this. The ipRules field needs the address to be a CIDR block, so for a single IP, it will need to have "/32" appended to the end, so if you VM public IP is 100.72.65.55, you'll need to pass 100.72.64.55/32. This will require a "concat" in the ARM expression so you can reference the VM's IP in the deployment.

martinbryant commented 1 year ago

@Thorium are we ok to close this issue?