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.
You can currently query the following attributes and connections on a Function App
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
}
actionGroups {
id
}
}
}
Get data for a single Function App key that you know the ID for:
query {
getazureFunctionApp(id: "12345") {
id
}
}
Get data for all of the Function App in a certain Azure subscription:
query {
queryazureFunctionApp(filter: { subscriptionId: { eq: "12345" } }) {
id
}
}
Get data for all of the Function Apps that are NOT in a certain Azure subscription:
query {
queryazureFunctionApp(filter: { not: { subscriptionId: { eq: "12345" } } }) {
id
}
}
Get data for all of the Function Apps that are connected to an actionGroup:
query {
queryazureFunctionApp(filter: { has: actionGroups }) {
id
}
}
You can order the results you get back either asc or desc depending on your preference:
query {
queryazureFunctionApp(order: { desc: name }) {
id
}
}
Only select and return the first two Function Apps that are found:
query {
queryazureFunctionApp(first: 2, order: { desc: name }) {
id
}
}
Only select and return the first two Function Apps that are found, but offset by one so keys two & three are returned:
query {
queryazureFunctionApp(first: 2, order: { desc: name }, offset: 1) {
id
}
}
Count the number of Function Apps across all scanned Azure subscriptions:
query {
aggregateazureFunctionApp {
count
}
}
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:
query {
aggregateazureFunctionApp(filter: { subscriptionId: { eq: "12345" } }) {
count
}
}
Find all of the Function Apps that are in the eastus region across all your accounts:
query {
queryazureFunctionApp(filter: { region: { eq: "eastus" } }) {
id
}
}
Find all of the Function Apps that have a tag of Environment:Production for a single Azure Subscription:
query {
queryazureTag(
filter: { key: { eq: "Environment" }, value: { eq: "Production" } }
) {
functionApps(filter: { subscriptionId: { eq: "12345" } }) {
id
}
}
}
With CloudGraph you can run multiple queries at the same time so you can combine the above two queries if you like:
query {
queryazureFunctionApp(filter: { region: { eq: "eastus" } }) {
id
}
queryazureTag(
filter: { key: { eq: "Environment" }, value: { eq: "Production" } }
) {
functionApps(filter: { subscriptionId: { eq: "12345" } }) {
id
}
}
}
Putting it all together; get all data for all Function Apps across all regions for all scanned Azure subscriptions in a single query.
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
}
eventHubs {
id
}
roleDefinitions {
id
}
resourceGroup {
id
}
}
}
}