Note: 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 an Azure CDN Profiles
query {
queryazureCdnProfile {
id
subscriptionId
region
name
type
resourceState
provisioningState
frontdoorId
resourceGroupId
sku
tags {
id
key
value
}
resourceGroup {
id
}
cdnEndpoints {
id
}
}
}
Get data for a single Azure CDN Profile key that you know the ID for:
query {
getazureCdnProfile(id: "12345") {
id
}
}
Get data for all of the CDN Profiles in a certain Azure subscription:
query {
queryazureCdnProfile(filter: { subscriptionId: { eq: "12345" } }) {
id
}
}
Get data for all of the CDN Profiles that are NOT in a certain Azure subscription:
query {
queryazureCdnProfile(filter: { not: { subscriptionId: { eq: "12345" } } }) {
id
}
}
Get data for all of the CDN Profiles that are connected to a cdnEndpoint:
query {
queryazureCdnProfile(filter: { has: cdnEndpoints }) {
id
}
}
You can order the results you get back either asc or desc depending on your preference:
query {
queryazureCdnProfile(order: { desc: name }) {
id
}
}
Only select and return the first two CDN Profiles that are found:
query {
queryazureCdnProfile(first: 2, order: { desc: name }) {
id
}
}
Only select and return the first two CDN Profiles that are found, but offset by one so keys two & three are returned:
query {
queryazureCdnProfile(first: 2, order: { desc: name }, offset: 1) {
id
}
}
Count the number of CDN Profiles across all scanned Azure subscriptions:
query {
aggregateazureCdnProfile {
count
}
}
Count the number of CDN Profiles in a single account. Note that you can apply all of the same filters that are listed above to aggregate queries:
query {
aggregateazureCdnProfile(filter: { subscriptionId: { eq: "12345" } }) {
count
}
}
Find all of the CDN Profiles that are in the eastus region across all your accounts:
query {
queryazureCdnProfile(filter: { region: { eq: "eastus" } }) {
id
}
}
Find all of the CDN Profiles that have a tag of Environment:Production for a single Azure Subscription:
query {
queryazureTag(
filter: { key: { eq: "Environment" }, value: { eq: "Production" } }
) {
cdnProfiles(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 {
queryazureCdnProfile(filter: { region: { eq: "eastus" } }) {
id
}
queryazureTag(
filter: { key: { eq: "Environment" }, value: { eq: "Production" } }
) {
cdnProfiles(filter: { subscriptionId: { eq: "12345" } }) {
id
}
}
}
Putting it all together; get all data for all CDN Profiles across all regions for all scanned Azure subscriptions in a single query. For the purposes of this example, we will only get direct children of the keys but if you want to it's easy to go from say, cdnProfile -> cdnEndpoints -> cdnCustomDomains ...etc:
query {
queryazureCdnProfile {
id
subscriptionId
region
name
type
resourceState
provisioningState
frontdoorId
resourceGroupId
sku
tags {
id
key
value
}
resourceGroup {
id
name
type
kind
subscriptionId
region
managedBy
disks {
id
}
dns {
id
}
firewalls {
id
}
functionApps {
id
}
keyVaults {
id
}
networkInterfaces {
id
}
publicIps {
id
}
securityGroups {
id
}
storageAccounts {
id
}
storageContainers {
id
}
virtualMachines {
id
}
virtualNetworks {
id
}
tags{
id
key
value
}
}
cdnEndpoints {
id
subscriptionId
region
name
type
kind
originPath
contentTypesToCompress
originHostHeader
isCompressionEnabled
isHttpAllowed
isHttpsAllowed
queryStringCachingBehavior
optimizationType
probePath
geoFilters {
id
relativePath
action
countryCodes
}
defaultOriginGroupId
urlSigningKeys {
id
keySourceParameters {
odataType
subscriptionId
resourceGroupName
vaultName
secretName
secretVersion
}
}
deliveryPolicy {
description
rules {
id
name
order
conditions {
id
name
parameters {
odataType
selector
operator
negateCondition
matchValues
transforms
}
}
actions {
id
name
parameters {
odataType
redirectType
destinationProtocol
customPath
customHostname
customQueryString
customFragment
algorithm
parameterNameOverride {
id
paramIndicator
paramName
}
originGroup {
id
}
sourcePattern
destination
preserveUnmatchedPath
headerAction
headerName
value
cacheBehavior
cacheType
cacheDuration
queryStringBehavior
queryParameters
}
}
}
}
webApplicationFirewallPolicyLinkId
hostName
resourceState
provisioningState
tags {
id
key
value
}
resourceGroup {
id
}
cdnProfiles {
id
}
cdnCustomDomains {
id
}
cdnOrigins {
id
}
cdnOriginGroups {
id
}
}
}
}