Skip to content

Instantly share code, notes, and snippets.

View jochenvw's full-sized avatar

Jochen van Wylick jochenvw

  • Microsoft
  • Amsterdam
View GitHub Profile
<#
.SYNOPSIS
Checks Advanced Threat Protection (ATP) status for all CosmosDB accounts across all accessible Azure subscriptions.
.DESCRIPTION
This script enumerates all Azure subscriptions you have access to, switches context to each subscription, and lists all CosmosDB accounts within each. For each CosmosDB account, it queries the ATP (Advanced Threat Protection) status and collects the results.
The results are displayed in a table and exported to a CSV file.
.REQUIREMENTS
- Azure CLI (az) must be installed and logged in.
/*
Deploys a opinionated network foundation - work in progress
- Log analytics workspace
- VNET with default subnets
- Diagnostics settings for all resources - pushing all logs+metrics to the log analytics workspace
*/
var resourceNamePrefix = 'jvw-lbspike'
var resourceLocation = 'westeurope'
/*
<!-- Custom caching policy for on HTTP POST for Azure API Management:
1. Policy looks in the Request body - 'cacheKey' property which then used as cache key.
Expected values are: <null>, ALL or NOEXPIRED
Defaults to ALL in case <null>
2. Cache expiration set to 60 seconds/1 minute
!-->
<policies>
<inbound>
<base />