Skip to main content

Azure

The Azure scrapers scrapes your azure account to fetch all the resources & save them as configs.

azure-scraper.yaml
apiVersion: configs.flanksource.com/v1
kind: ScrapeConfig
metadata:
name: azure-scraper
spec:
azure:
- connection: connection://azure/flanksource # connection provides the clientID, clientSecret & the tenant id
organisation: flanksource
subscriptionID: e3911016-5810-415f-b075-682db169988f
transform:
relationship:
# Link AKS Cluster to Kubernetes Cluster
- filter: config_class == 'KubernetesCluster'
expr: |
[{
"type": "Kubernetes::Cluster",
"labels": {
"aks-nodeResourceGroup": config["properties"]["nodeResourceGroup"],
"azure/subscription-id": tags["azure-subscription-id"]
},
}].toJSON()

Scraper

FieldDescriptionSchemeRequired
logLevelSpecify the level of logging.string
scheduleSpecify the interval to scrape in cron format. Defaults to every 60 minutes.string
retentionSettings for retaining changes, analysis and scraped itemsRetention
azureAzure scrape config[]Azure

Azure

FieldDescriptionSchemeRequired
connectionSpecify the connection that provides the clientID, clientSecret & tenantIDstring
subscriptionIDAzure subscription IDstring
organisationAzure organisation IDstring
tenantIDAzure tenant IDstring
clientIDMicrosoft Entra ID app client idEnvVar
clientSecretMicrosoft Entra ID app client secretEnvVar
exclusionsSpecifies the Azure projects to scrapeExclusion
propertiesCustom templatable properties for the scraped config items.[]ConfigProperty
transformField to transform resultTransform
tagsSet custom tags on the scraped config itemsmap[string]string
note

Either the connection name or the credentials (clientID, clientSecret & tenatnID) are required

Transform

FieldDescriptionSchemeRequired
gotemplateGo template to transform the scraped config itemstring
javascriptJavascript to transform the scraped config itemstring
jsonpathSpecify JSONPathjsonpath
exprSpecify Cel expressioncel-expression
changesApply transformation on the scraped changes[]Changes
excludeFields to remove from the config, useful for removing sensitive data and fields that change often without a material impact i.e. Last Scraped Time[]Exclude
maskSpecify configurations to replace sensitive fields with hash functions or static string.[]Mask
relationshipForm relationships between config items using selectors[]RelationshipConfig
info

Both the go template and javascript receive ScrapeResult as the template variable.

Azure Exclusion

FieldDescriptionSchemeRequired
activityLogsA list of operations to exclude from activity logs[]string