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 Private DNS Zone
query {
queryazurePrivateDnsZone {
id
subscriptionId
region
name
type
etag
maxNumberOfRecordSets
numberOfRecordSets
maxNumberOfVirtualNetworkLinks
numberOfVirtualNetworkLinks
maxNumberOfVirtualNetworkLinksWithRegistration
numberOfVirtualNetworkLinksWithRegistration
provisioningState
internalId
tags {
id
key
value
}
resourceGroup {
id
}
}
}
Get data for a single Azure Private DNS Zone key that you know the ID for:
query {
getazurePrivateDnsZone(id: "12345") {
id
}
}
Get data for all of the Private DNS Zones in a certain Azure subscription:
query {
queryazurePrivateDnsZone(filter: { subscriptionId: { eq: "12345" } }) {
id
}
}
Get data for all of the Private DNS Zones that are NOT in a certain Azure subscription:
query {
queryazurePrivateDnsZone(filter: { not: { subscriptionId: { eq: "12345" } } }) {
id
}
}
Get data for all of the Private DNS Zones that are connected to a resourceGroup:
query {
queryazurePrivateDnsZone(filter: { has: resourceGroup }) {
id
}
}
You can order the results you get back either asc or desc depending on your preference:
query {
queryazurePrivateDnsZone(order: { desc: maxNumberOfRecordSets }) {
id
}
}
Only select and return the first two Private DNS Zones that are found:
query {
queryazurePrivateDnsZone(first: 2, order: { desc: maxNumberOfRecordSets }) {
id
}
}
Only select and return the first two Private DNS Zones that are found, but offset by one so keys two & three are returned:
query {
queryazurePrivateDnsZone(first: 2, order: { desc: maxNumberOfRecordSets }, offset: 1) {
id
}
}
Count the number of Private DNS Zones across all scanned Azure subscriptions:
query {
aggregateazurePrivateDnsZone {
count
}
}
Count the number of Private DNS Zones in a single account. Note that you can apply all of the same filters that are listed above to aggregate queries:
query {
aggregateazurePrivateDnsZone(filter: { subscriptionId: { eq: "12345" } }) {
count
}
}
Find all of the Private DNS Zones that are in the eastus region across all your accounts:
query {
queryazurePrivateDnsZone(filter: { region: { eq: "eastus" } }) {
id
}
}
Find all of the Private DNS Zones that have a tag of Environment:Production for a single Azure Subscription:
query {
queryazureTag(
filter: { key: { eq: "Environment" }, value: { eq: "Production" } }
) {
privateDns(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 {
queryazurePrivateDnsZone(filter: { region: { eq: "eastus" } }) {
id
}
queryazureTag(
filter: { key: { eq: "Environment" }, value: { eq: "Production" } }
) {
privateDns(filter: { subscriptionId: { eq: "12345" } }) {
id
}
}
}
Putting it all together; get all data for all Private Dns Zones 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, privateDnsZone -> resourceGroup -> virtualNetworks ...etc:
query {
queryazurePrivateDnsZone {
id
subscriptionId
region
name
type
etag
maxNumberOfRecordSets
numberOfRecordSets
maxNumberOfVirtualNetworkLinks
numberOfVirtualNetworkLinks
maxNumberOfVirtualNetworkLinksWithRegistration
numberOfVirtualNetworkLinksWithRegistration
provisioningState
internalId
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
}
}
}
}