irom
irom

Reputation: 3606

How to reference an existing resource item in azure template variable

I am trying to reference existing resource (static IP address) in the ARM template

"variables":{
"WebPublicIPName": "[reference('/subscriptions/.../resourceGroups/PANAZ-GROUP/providers/Microsoft.Network/publicIPAddresses/VPNPublicIP-Dev_B')]"}

But I am getting following error: Deployment template validation failed: 'The template variable 'WebPublicIPName' is not valid: The template function 'reference' is not expected at this location.

Upvotes: 1

Views: 3536

Answers (1)

4c74356b41
4c74356b41

Reputation: 72191

You cannot use reference function in a variable, so this is not possible.

I'm not sure what you are trying to achieve, there might be different ways to solve whatever you are trying to solve

Upvotes: 3

Related Questions