website logo
HomeGithubSlack
⌘K
Overview
Quick Start
Supported Services
Running CloudGraph in EKS
Compliance
Rules Engine
AWS
Querying AWS Data
AWS Policy Packs
Billing Data
Services
Azure
Querying Azure Data
Azure Policy Packs
Services
GCP
Querying GCP Data
GCP Policy Packs
Services
K8s
Querying Kubernetes Data
Services
Docs powered by archbee 

Function App

16min

dNote: if you are running CloudGraph locally you can view the interactive, automatically generated documentation in either GraphQL Playground or Altair by clicking the docs button on the right-hand side of the screen. After reading the below information we highly suggest you use one of these tools to test your queries as they will autocomplete fields for you and let you know if your queries are valid before you even submit them.

Overview

You can currently query the following attributes and connections on a Function App

GraphQL
|
query {
  queryazureFunctionApp{
    id
    name
    type
    kind
    subscriptionId
    region
    resourceGroupId
    availabilityState
    clientAffinityEnabled
    clientCertEnabled
    clientCertExclusionPaths
    clientCertMode
    containerSize
    customDomainVerificationId
    dailyMemoryTimeQuota
    defaultHostName
    enabled
    enabledHostNames
    extendedLocation{
      name
      type
    }
    hostNames
    hostNamesDisabled
    hostingEnvironmentProfile{
      id
    }
    httpsOnly
    hyperV
    inProgressOperationId
    isDefaultContainer
    isXenon
    keyVaultReferenceIdentity
    lastModifiedTimeUtc
    maxNumberOfWorkers
    outboundIpAddresses
    possibleOutboundIpAddresses
    redundancyMode
    repositorySiteName
    reserved
    scmSiteAlsoStopped
    serverFarmId
    state
    storageAccountRequired
    suspendedTill
    targetSwapSlot
    trafficManagerHostNames
    usageState
    virtualNetworkSubnetId
    functions{
      configHref
      functionAppId
      href
      invokeUrlTemplate
      isDisabled
      language
      location
      resourceGroupId
      scriptHref
      scriptRootPathHref
      secretsFileHref
      testData
      testDataHref
    }
    tags {
      id
      key
      value
    }
    resourceGroup {
      id
      # Other fields and connections here...
    }
    actionGroups {
      id
      # Other fields and connections here...
    }
  }
}


Filtering

Get data for a single Function App key that you know the ID for:

GraphQL
|
query {
  getazureFunctionApp(id: "12345") {
    id
    # Other fields and connections here...
  }
}


Get data for all of the Function App in a certain Azure subscription:

GraphQL
|
query {
  queryazureFunctionApp(filter: { subscriptionId: { eq: "12345" } }) {
    id
    # Other fields and connections here...
  }
}

# Note that in addition to "subscriptionId" you can
# Filter based on any of the following attributes:

# id
# name
# type
# kind
# region
# resourceGroupId
# availabilityState
# clientAffinityEnabled
# clientCertEnabled
# clientCertExclusionPaths
# clientCertMode
# containerSize
# customDomainVerificationId
# dailyMemoryTimeQuota
# defaultHostName
# enabled
# enabledHostNames
# extendedLocation
# hostNames
# hostNamesDisabled
# hostingEnvironmentProfile
# httpsOnly
# hyperV
# inProgressOperationId
# isDefaultContainer
# isXenon
# keyVaultReferenceIdentity
# lastModifiedTimeUtc
# maxNumberOfWorkers
# outboundIpAddresses
# possibleOutboundIpAddresses
# redundancyMode
# repositorySiteName
# reserved
# scmSiteAlsoStopped
# serverFarmId
# state
# storageAccountRequired
# suspendedTill
# targetSwapSlot
# trafficManagerHostNames
# usageState
# virtualNetworkSubnetId
# functions

# And the following Dgraph filters can also be applied:

# has
# and
# or
# not
# regexp (regular expressions)

# fulltext filters

# alloftext
# anyoftext


Get data for all of the Function Apps that are NOT in a certain Azure subscription:

GraphQL
|
query {
  queryazureFunctionApp(filter: { not: { subscriptionId: { eq: "12345" } } }) {
    id
    # Other fields and connections here...
  }
}


Advanced Filtering

Get data for all of the Function Apps that are connected to an actionGroup:

GraphQL
|
query {
  queryazureFunctionApp(filter: { has: actionGroups }) {
    id
    # Other fields and connections here...
  }
}

# Note that in addition to "actionGroups" you can filter
# Using "has" based on any of the following attributes:

# id
# name
# type
# kind
# region
# resourceGroupId
# availabilityState
# clientAffinityEnabled
# clientCertEnabled
# clientCertExclusionPaths
# clientCertMode
# containerSize
# customDomainVerificationId
# dailyMemoryTimeQuota
# defaultHostName
# enabled
# enabledHostNames
# extendedLocation
# hostNames
# hostNamesDisabled
# hostingEnvironmentProfile
# httpsOnly
# hyperV
# inProgressOperationId
# isDefaultContainer
# isXenon
# keyVaultReferenceIdentity
# lastModifiedTimeUtc
# maxNumberOfWorkers
# outboundIpAddresses
# possibleOutboundIpAddresses
# redundancyMode
# repositorySiteName
# reserved
# scmSiteAlsoStopped
# serverFarmId
# state
# storageAccountRequired
# suspendedTill
# targetSwapSlot
# trafficManagerHostNames
# usageState
# virtualNetworkSubnetId
# functions
# resourceGroup
# tags


Ordering

You can order the results you get back either asc or desc depending on your preference:

GraphQL
|
query {
  queryazureFunctionApp(order: { desc: name }) {
    id
    # Other fields and connections here...
  }
}

# Note that in addition to "name" you can filter
# Using "asc" or "desc" based on any of the following attributes:

# id
# name
# type
# kind
# subscriptionId
# region
# resourceGroupId
# availabilityState
# clientAffinityEnabled
# clientCertEnabled
# clientCertExclusionPaths
# clientCertMode
# containerSize
# customDomainVerificationId
# dailyMemoryTimeQuota
# defaultHostName
# enabled
# extendedLocation
# hostNamesDisabled
# hostingEnvironmentProfile
# httpsOnly
# hyperV
# inProgressOperationId
# isDefaultContainer
# isXenon
# keyVaultReferenceIdentity
# lastModifiedTimeUtc
# maxNumberOfWorkers
# redundancyMode
# repositorySiteName
# reserved
# scmSiteAlsoStopped
# serverFarmId
# state
# storageAccountRequired
# suspendedTill
# targetSwapSlot
# usageState
# virtualNetworkSubnetId


Only select and return the first two Function Apps that are found:

GraphQL
|
query {
  queryazureFunctionApp(first: 2, order: { desc: name }) {
    id
    # Other fields and connections here...
  }
}


Only select and return the first two Function Apps that are found, but offset by one so keys two & three are returned:

GraphQL
|
query {
  queryazureFunctionApp(first: 2, order: { desc: name }, offset: 1) {
    id
    # Other fields and connections here...
  }
}


Aggregation

Count the number of Function Apps across all scanned Azure subscriptions:

GraphQL
|
query {
  aggregateazureFunctionApp {
    count
    # Other fields and connections here...
  }
}

# Note that in addition to "count" you can request the
# Following min and max values based on attributes of your Disks

# idMin
# idMax
# nameMin
# nameMax
# typeMin
# typeMax
# kindMin
# kindMax
# subscriptionIdMin
# subscriptionIdMax
# regionMin
# regionMax
# resourceGroupIdMin
# resourceGroupIdMax
# availabilityStateMin
# availabilityStateMax
# clientCertExclusionPathsMin
# clientCertExclusionPathsMax
# clientCertModeMin
# clientCertModeMax
# containerSizeMin
# containerSizeMax
# containerSizeSum
# containerSizeAvg
# customDomainVerificationIdMin
# customDomainVerificationIdMax
# dailyMemoryTimeQuotaMin
# dailyMemoryTimeQuotaMax
# dailyMemoryTimeQuotaSum
# dailyMemoryTimeQuotaAvg
# defaultHostNameMin
# defaultHostNameMax
# inProgressOperationIdMin
# inProgressOperationIdMax
# keyVaultReferenceIdentityMin
# keyVaultReferenceIdentityMax
# lastModifiedTimeUtcMin
# lastModifiedTimeUtcMax
# maxNumberOfWorkersMin
# maxNumberOfWorkersMax
# maxNumberOfWorkersSum
# maxNumberOfWorkersAvg
# outboundIpAddressesMin
# outboundIpAddressesMax
# possibleOutboundIpAddressesMin
# possibleOutboundIpAddressesMax
# redundancyModeMin
# redundancyModeMax
# repositorySiteNameMin
# repositorySiteNameMax
# serverFarmIdMin
# serverFarmIdMax
# stateMin
# stateMax
# suspendedTillMin
# suspendedTillMax
# targetSwapSlotMin
# targetSwapSlotMax
# usageStateMin
# usageStateMax
# virtualNetworkSubnetIdMin
# virtualNetworkSubnetIdMax


Count the number of Function Apps in a single account. Note that you can apply all of the same filters that are listed above to aggregate queries:

GraphQL
|
query {
  aggregateazureFunctionApp(filter: { subscriptionId: { eq: "12345" } }) {
    count
    # Other fields and connections here...
  }
}


Examples

Find all of the Function Apps that are in the eastus region across all your accounts:

GraphQL
|
query {
  queryazureFunctionApp(filter: { region: { eq: "eastus" } }) {
    id
    # Other fields and connections here...
  }
}


Find all of the Function Apps that have a tag of Environment:Production for a single Azure Subscription:

GraphQL
|
query {
  queryazureTag(
    filter: { key: { eq: "Environment" }, value: { eq: "Production" } }
  ) {
    functionApps(filter: { subscriptionId: { eq: "12345" } }) {
      id
      # Other fields and connections here...
    }
  }
}


With CloudGraph you can run multiple queries at the same time so you can combine the above two queries if you like:

GraphQL
|
query {
  queryazureFunctionApp(filter: { region: { eq: "eastus" } }) {
    id
    # Other fields and connections here...
  }
  queryazureTag(
    filter: { key: { eq: "Environment" }, value: { eq: "Production" } }
  ) {
    functionApps(filter: { subscriptionId: { eq: "12345" } }) {
      id
      # Other fields and connections here...
    }
  }
}


Kitchen Sink

Putting it all together; get all data for all Function Apps across all regions for all scanned Azure subscriptions in a single query.

GraphQL
|
query {
  queryazureFunctionApp{
    id
    name
    type
    kind
    subscriptionId
    region
    resourceGroupId
    availabilityState
    clientAffinityEnabled
    clientCertEnabled
    clientCertExclusionPaths
    clientCertMode
    containerSize
    customDomainVerificationId
    dailyMemoryTimeQuota
    defaultHostName
    enabled
    enabledHostNames
    extendedLocation{
      name
      type
    }
    hostNames
    hostNamesDisabled
    hostingEnvironmentProfile{
      id
    }
    httpsOnly
    hyperV
    inProgressOperationId
    isDefaultContainer
    isXenon
    keyVaultReferenceIdentity
    lastModifiedTimeUtc
    maxNumberOfWorkers
    outboundIpAddresses
    possibleOutboundIpAddresses
    redundancyMode
    repositorySiteName
    reserved
    scmSiteAlsoStopped
    serverFarmId
    state
    storageAccountRequired
    suspendedTill
    targetSwapSlot
    trafficManagerHostNames
    usageState
    virtualNetworkSubnetId
    functions{
      configHref
      functionAppId
      href
      invokeUrlTemplate
      isDisabled
      language
      location
      resourceGroupId
      scriptHref
      scriptRootPathHref
      secretsFileHref
      testData
      testDataHref
    }
    tags {
      id
      key
      value
    }
    resourceGroup {
      id
      name
      type
      kind
      subscriptionId
      region
      managedBy
    }
    actionGroups {
      id
      name
      type
      kind
      subscriptionId
      region
      resourceGroupId
      enabled
      groupShortName
      emailReceivers {
        id
        name
        emailAddress
        useCommonAlertSchema
      }
      smsReceivers {
        id
        name
        countryCode
        phoneNumber
        status
      }
      webhookReceivers {
        id
        name
        serviceUri
        useCommonAlertSchema
        useAadAuth
        objectId
        identifierUri
        tenantId
      }
      tags {
        id
        key
        value
      }
      functionApps {
        id
        # Other fields and connections here...
      }
      eventHubs {
        id
        # Other fields and connections here...
      }
      roleDefinitions {
        id
        # Other fields and connections here...
      }
      resourceGroup {
        id
        # Other fields and connections here...
      }
    }
  }
}


References

Dgraph documentation on querying

Azure Functions Documentation

Updated 03 Mar 2023
Did this page help you?
Yes
No
PREVIOUS
Firewall
NEXT
Event Grid
Docs powered by archbee 
TABLE OF CONTENTS
Overview
Filtering
Advanced Filtering
Ordering
Aggregation
Examples
Kitchen Sink
References