Skip to content

How do you output just the private IP address #3660

Answered by brwilkinson
deniscooper asked this question in Q&A
Discussion options

You must be logged in to vote

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

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@deniscooper
Comment options

Answer selected by brwilkinson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants