Skip to content

Check if a Private Endpoint connection exists on an App Service using Bicep #14315

Discussion options

You must be logged in to vote

Like most of the time, what actually matters is if the properties you need are present in the resource definition and not if Bicep's types knows it or not.

In this case, there are two properties you can use to check if a private endpoint exists. Example below with the values returned when a private endpoint does not exists.

resource function 'Microsoft.Web/sites@2023-12-01' existing = {
  name: 'myfunc'
}

// null if no private endpoint
output privateLinkIdentifierNotPresent bool = function.properties.privateLinkIdentifiers == null || function.properties.privateLinkIdentifiers == ''

// [] if no private endpoint
output privateEndpointConnectionsNotPresent bool = function.properties.privat…

Replies: 1 comment 1 reply

Comment options

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

Answer selected by chelhernandez
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