How do you output just the private IP address #3660
Answered
by
brwilkinson
deniscooper
asked this question in
Q&A
-
Looking to output the private dynamically assigned IP address for a VM during the deployment so I can re-use the IP address in a further deployment script. I can output the entire ip configuration using output ipAddress array = networkInterface.properties.ipConfiguration and it shows the private IP address within the array properties, but I can't figure out how to just output the ipaddress |
Beta Was this translation helpful? Give feedback.
Answered by
brwilkinson
Jul 19, 2021
Replies: 1 comment 1 reply
-
Since ipConfigurations is an array, you can hard code to reference the first element with [0] var nicName = 'ACU1-BRW-HAA-P0-nicJMP01'
resource networkInterface 'Microsoft.Network/networkInterfaces@2021-02-01' existing = {
name: nicName
}
output IPV4First string = networkInterface.properties.ipConfigurations[0].properties.privateIPAddress |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
brwilkinson
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since ipConfigurations is an array, you can hard code to reference the first element with [0]