Skip to content

Get resource with its name pattern or type? #7609

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

You must be logged in to vote

There could be a few approaches for this...

Would it work to go from a known resource name with something that references the VNET ?

I think you could find a reference from any of these

  • app gateway
  • cluster
  • load balancer

Something like ...

resource cluster 'Microsoft.ContainerService/managedClusters@2022-05-02-preview' existing = {
  name: 'myCluster01'

  resource agentPool 'agentPools@2022-05-02-preview' existing = {
    name: 'myPool01'
  }
}

var subnetId = cluster::agentPool.properties.vnetSubnetID

output subnetId string = subnetId

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@jianawu
Comment options

@brwilkinson
Comment options

@jianawu
Comment options

@brwilkinson
Comment options

@brwilkinson
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