{ "version": "Notebook/1.0", "items": [ { "type": 1, "content": { "json": "# Azure Orphaned Resources v3.0\r\nUse this workbook to analyze all your Orphaned resources." }, "name": "text - Title" }, { "type": 9, "content": { "version": "KqlParameterItem/1.0", "crossComponentResources": [ "{Subscription}" ], "parameters": [ { "id": "91c13326-3422-4d1c-b3e3-1aa27414e7ae", "version": "KqlParameterItem/1.0", "name": "Subscription", "type": 6, "description": "All Subscriptions", "isRequired": true, "multiSelect": true, "quote": "'", "delimiter": ",", "typeSettings": { "additionalResourceOptions": [ "value::all" ], "includeAll": true, "showDefault": false }, "timeContext": { "durationMs": 86400000 }, "value": [ "value::all" ] }, { "id": "df0ab425-e03c-44c6-a468-9e96455ac591", "version": "KqlParameterItem/1.0", "name": "ResourceGroup", "label": "Resource Group", "type": 5, "description": "All Resource Groups", "isRequired": true, "multiSelect": true, "quote": "'", "delimiter": ",", "query": "ResourceContainers\r\n| where type =~ \"microsoft.resources/subscriptions/resourcegroups\"\r\n| distinct resourceGroup", "crossComponentResources": [ "{Subscription}" ], "typeSettings": { "additionalResourceOptions": [ "value::all" ], "showDefault": false }, "queryType": 1, "value": [ "value::all" ] }, { "id": "b20f40c6-577a-4ab1-aa93-d225672e6c87", "version": "KqlParameterItem/1.0", "name": "EnableDeletion", "label": "Enable Deletion", "type": 2, "description": "By default, this feature is disabled. Enable it to allow resource deletion.", "isRequired": true, "query": "{\"version\":\"1.0.0\",\"content\":\"[\\r\\n {\\\"value\\\": \\\"false\\\", \\\"label\\\": \\\"Disable\\\", \\\"selected\\\":true},\\r\\n\\t{\\\"value\\\": \\\"true\\\", \\\"label\\\": \\\"Enable\\\"}\\r\\n]\",\"transformers\":null}", "typeSettings": { "additionalResourceOptions": [], "showDefault": false }, "queryType": 8, "value": "true" } ], "style": "pills", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources" }, "name": "parameters - Filter by Subscription" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "tabs", "links": [ { "id": "4d474c43-d09f-4c07-929e-82d46b1e90af", "cellValue": "mainTab", "linkTarget": "parameter", "linkLabel": "Overview", "subTarget": "overview", "style": "link", "linkIsContextBlade": true }, { "id": "0fb04c14-d289-4e05-aa49-ec7e34aed8e9", "cellValue": "mainTab", "linkTarget": "parameter", "linkLabel": "Compute", "subTarget": "compute", "style": "link" }, { "id": "36a36461-8f96-4d01-a9f9-b918dffeb4ff", "cellValue": "mainTab", "linkTarget": "parameter", "linkLabel": "Storage", "subTarget": "storage", "style": "link" }, { "id": "7688ca90-bb93-4017-b79c-c505b7f5ba46", "cellValue": "mainTab", "linkTarget": "parameter", "linkLabel": "Database", "subTarget": "database", "style": "link" }, { "id": "fe44dca2-c58c-419a-9dbf-899697e07bef", "cellValue": "mainTab", "linkTarget": "parameter", "linkLabel": "Networking", "subTarget": "networking", "style": "link" }, { "id": "3b796649-537c-44c2-be19-95cd16e4eae1", "cellValue": "mainTab", "linkTarget": "parameter", "linkLabel": "Others", "subTarget": "others", "style": "link" } ] }, "name": "links - Main Tabs" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Azure Orphaned Resources Workbook\r\n\r\nThe purpose of this workbook is to provide an overview of your orphaned resources, enabling you to enhance eficiency by:\r\n\r\n- Saving money\r\n- Prevent misconfiguration\r\n- Simplify operations\r\n\r\n\r\n [Please submit any issues ](https://github.com/dolevshor/azure-orphan-resources/issues) with the workbook template to GitHub.", "style": "upsell" }, "conditionalVisibility": { "parameterName": "mainTab", "comparison": "isEqualTo", "value": "overview" }, "showPin": false, "name": "text - Overview" }, { "type": 1, "content": { "json": "💲 This is a sign that the resource costs money", "style": "info" }, "conditionalVisibility": { "parameterName": "mainTab", "comparison": "isEqualTo", "value": "overview" }, "name": "text - Overview - Cost" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.web/serverfarms\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.numberOfSites == 0\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.web/serverfarms\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": "💲", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - App Service Plans Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.compute/availabilitysets\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.virtualMachines == \"[]\"\r\n| where not(name endswith \"-asr\")\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.compute/availabilitysets\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": " ", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Availability Sets Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.compute/disks\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend diskState = tostring(properties.diskState)\r\n| where managedBy == \"\"\r\n| where not(name endswith \"-ASRReplica\" or name startswith \"ms-asr-\" or name startswith \"asrseeddisk-\")\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.compute/disks\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": " 💲", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Managed Disks Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.sql/servers/elasticpools\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| project elasticPoolId = tolower(id), Resource = id, type\r\n| extend Details = pack_all()\r\n| join kind=leftouter (resources\r\n| where type =~ \"microsoft.sql/servers/databases\"\r\n| project id, properties\r\n| extend elasticPoolId = tolower(properties.elasticPoolId)) on elasticPoolId\r\n| summarize databaseCount = countif(id != '') by Resource, type\r\n| where databaseCount == 0\r\n| project-away databaseCount\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.sql/servers/elasticpools\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": "💲", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - SQL elastic pools Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/publicipaddresses\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.ipConfiguration == \"\" and properties.natGateway == \"\" and properties.publicIPPrefix == \"\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/publicipaddresses\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": "💲", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Public IPs Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/networkinterfaces\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.privateEndpoint)\r\n| where isnull(properties.privateLinkService)\r\n| where properties.hostedWorkloads == \"[]\"\r\n| where properties !has 'virtualmachine'\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/networkinterfaces\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": " ", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Network Interfaces Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/networksecuritygroups\" and isnull(properties.networkInterfaces) and isnull(properties.subnets)\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/networksecuritygroups\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": " ", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Network Security Group Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/routetables\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.subnets)\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/routetables\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": " ", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Route Tables Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/loadbalancers\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.backendAddressPools == \"[]\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/loadbalancers\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": "💲", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Load Balancers Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/frontdoorwebapplicationfirewallpolicies\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.frontendEndpointLinks== \"[]\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/frontdoorwebapplicationfirewallpolicies\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": " ", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Front Door WAF Policy Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/trafficmanagerprofiles\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.endpoints == \"[]\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/trafficmanagerprofiles\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": " ", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Traffic Manager Profiles Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/applicationgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend backendPoolsCount = array_length(properties.backendAddressPools),SKUName= tostring(properties.sku.name), SKUTier= tostring(properties.sku.tier),SKUCapacity=properties.sku.capacity,backendPools=properties.backendAddressPools , AppGwId = tostring(id)\r\n| project AppGwId, name, SKUName, SKUTier, SKUCapacity, type\r\n| join (\r\n resources\r\n | where type =~ \"microsoft.network/applicationgateways\"\r\n | mvexpand backendPools = properties.backendAddressPools\r\n | extend backendIPCount = array_length(backendPools.properties.backendIPConfigurations)\r\n | extend backendAddressesCount = array_length(backendPools.properties.backendAddresses)\r\n | extend backendPoolName = backendPools.properties.backendAddressPools.name\r\n | extend AppGwId = tostring(id)\r\n | summarize backendIPCount = sum(backendIPCount) ,backendAddressesCount=sum(backendAddressesCount) by AppGwId\r\n) on AppGwId\r\n| project-away AppGwId1\r\n| where (backendIPCount == 0 or isempty(backendIPCount)) and (backendAddressesCount==0 or isempty(backendAddressesCount))\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/applicationgateways\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": "💲", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Application Gateway Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworks\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.subnets == \"[]\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/virtualnetworks\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": " ", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Virtual Networks Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworks\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend subnet = properties.subnets\r\n| mv-expand subnet\r\n| extend ipConfigurations = subnet.properties.ipConfigurations\r\n| extend delegations = subnet.properties.delegations\r\n| extend applicationGatewayIPConfigurations = subnet.properties.applicationGatewayIPConfigurations\r\n| where isnull(ipConfigurations) and delegations == \"[]\" and isnull(applicationGatewayIPConfigurations) \r\n| extend subnets_str = \"Subnets\"\r\n| summarize count_ = count() by type, subnets_str\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(subnets_str:string, count_:long) [\"Subnets\", 0])\r\n| summarize total_count = max(count_) by subnets_str", "size": 3, "title": " ", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "subnets_str", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Subnets Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/natgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.subnets)\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/natgateways\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": "💲", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - NAT Gateways Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/ipgroups\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.firewalls == \"[]\" and properties.firewallPolicies == \"[]\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/ipgroups\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": " ", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - IP Groups Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/privatednszones\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.numberOfVirtualNetworkLinks == 0\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/privatednszones\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": "💲", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Private DNS zones Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/privateendpoints\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend connection = iff(array_length(properties.manualPrivateLinkServiceConnections) > 0, properties.manualPrivateLinkServiceConnections[0], properties.privateLinkServiceConnections[0])\r\n| extend stateEnum = tostring(connection.properties.privateLinkServiceConnectionState.status)\r\n| where stateEnum == \"Disconnected\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/privateendpoints\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": "💲", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Private Endpoints Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworkgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend vpnClientConfiguration = properties.vpnClientConfiguration\r\n| extend Resource = id\r\n| join kind=leftouter (\r\n resources\r\n | where type =~ \"microsoft.network/connections\"\r\n | mv-expand Resource = pack_array(properties.virtualNetworkGateway1.id, properties.virtualNetworkGateway2.id) to typeof(string)\r\n | project Resource, connectionId = id, ConnectionProperties=properties\r\n ) on Resource \r\n| where isempty(vpnClientConfiguration) and isempty(connectionId)\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/virtualnetworkgateways\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": "💲", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Virtual Network Gateways Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/ddosprotectionplans\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.virtualNetworks)\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/ddosprotectionplans\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": "💲", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - DDoS protection plans Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "ResourceContainers\r\n| where type =~ \"microsoft.resources/subscriptions/resourcegroups\"\r\n| extend rgAndSub = strcat(resourceGroup, \"--\", subscriptionId)\r\n| join kind=leftouter (\r\n Resources\r\n | extend rgAndSub = strcat(resourceGroup, \"--\", subscriptionId)\r\n | summarize count() by rgAndSub\r\n) on rgAndSub\r\n| where isnull(count_)\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.resources/subscriptions/resourcegroups\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": " ", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Resource Groups Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.web/connections\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| project resourceId = id , apiName = name, subscriptionId, resourceGroup, tags, location, type\r\n| join kind = leftouter (\r\n resources\r\n | where type == 'microsoft.logic/workflows'\r\n | extend resourceGroup, location, subscriptionId, properties\r\n | extend var_json = properties[\"parameters\"][\"$connections\"][\"value\"]\r\n\t| mvexpand var_connection = var_json\r\n | where notnull(var_connection)\r\n | extend connectionId = extract(\"connectionId\\\":\\\"(.*?)\\\"\", 1, tostring(var_connection))\r\n | project connectionId, name\r\n )\r\n on $left.resourceId == $right.connectionId\r\n| where connectionId == \"\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.web/connections\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": " ", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - API Connections Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.web/certificates\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend expiresOn = todatetime(properties.expirationDate)\r\n| where expiresOn <= now()\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"certificates\", 0])\r\n| summarize total_count = max(count_) by type", "size": 3, "title": " ", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true } }, "customWidth": "16.5", "name": "query - Overview - Certificates Count" } ] }, "conditionalVisibility": { "parameterName": "mainTab", "comparison": "isEqualTo", "value": "overview" }, "name": "group - Overview - Summary" } ] }, "conditionalVisibility": { "parameterName": "mainTab", "comparison": "isEqualTo", "value": "overview" }, "name": "group - Overview" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 11, "content": { "version": "LinkItem/1.0", "style": "tabs", "links": [ { "id": "8e1c6962-5369-4cc3-9fe9-1ff6ed0d92af", "cellValue": "computeTab", "linkTarget": "parameter", "linkLabel": "App Service Plans 💲", "subTarget": "appsp", "style": "link", "linkIsContextBlade": true }, { "id": "85598350-5dc0-4087-ae66-b50d4aeadba7", "cellValue": "computeTab", "linkTarget": "parameter", "linkLabel": "Availability Sets", "subTarget": "avset", "style": "link" } ] }, "name": "links - Compute Tabs" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned App Service Plans" }, "name": "text - Title - App Service Plan" }, { "type": 1, "content": { "json": "[App Service plans](https://learn.microsoft.com/en-us/azure/app-service/overview-hosting-plans) without hosting Apps.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.web/serverfarms\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.numberOfSites == 0\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.web/serverfarms\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - App Service Plan count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.web/serverfarms\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.numberOfSites == 0\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - App Service Plan by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.web/serverfarms\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.numberOfSites == 0\r\n| summarize count(type) by tostring(sku.name)", "size": 4, "title": "Count by SKU", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - App Service Plan by SKU" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.web/serverfarms\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.numberOfSites == 0\r\n| summarize count(type) by tostring(sku.tier)", "size": 4, "title": "Count by Tier", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - App Service Plan by Tier" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.web/serverfarms\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.numberOfSites == 0\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, SKU=sku.name, Tier=sku.tier, tags ,Details", "size": 3, "title": "Orphaned App Service Plans", "noDataMessage": "No orphaned App Service Plans found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "SKU", "formatter": 1 }, { "columnMatch": "Tier", "formatter": 1 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "SKU", "label": "Sku" }, { "columnId": "Tier", "label": "Tier" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - Orphan App Service Plans" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following App Service Plan(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "computeTab", "comparison": "isEqualTo", "value": "appsp" }, "name": "group - Compute - App Service Plan" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned Availability Set" }, "name": "text - Title - Availability Set" }, { "type": 1, "content": { "json": "[Availability Sets](https://learn.microsoft.com/en-us/azure/virtual-machines/availability-set-overview) that not associated to any Virtual Machine (VM) or Virtual Machine Scale Set (VMSS) and not related to Azure Site Recovery.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.compute/availabilitysets\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.virtualMachines == \"[]\"\r\n| where not(name endswith \"-asr\")\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.compute/availabilitysets\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Availability Set Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.compute/availabilitysets\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.virtualMachines == \"[]\"\r\n| where not(name endswith \"-asr\")\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Availability Set by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ 'microsoft.compute/availabilitysets'\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.virtualMachines == \"[]\"\r\n| where not(name endswith \"-asr\")\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, tags, Details", "size": 3, "title": "Orphaned Availability Set", "noDataMessage": "No orphaned Availability Set found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - Orphan Availability Set" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Availability Set(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "computeTab", "comparison": "isEqualTo", "value": "avset" }, "name": "group - Compute - Availability Set" } ] }, "conditionalVisibility": { "parameterName": "mainTab", "comparison": "isEqualTo", "value": "compute" }, "name": "group - Compute" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 11, "content": { "version": "LinkItem/1.0", "style": "tabs", "links": [ { "id": "b2a47b9d-1023-418a-8ffc-67a693c0d5a6", "cellValue": "storageTab", "linkTarget": "parameter", "linkLabel": "Managed Disks 💲", "subTarget": "disks", "style": "link", "linkIsContextBlade": true } ] }, "name": "links - Storage Tabs" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned Managed Disks" }, "name": "text - Title - Disks" }, { "type": 1, "content": { "json": "[Managed Disks](https://learn.microsoft.com/en-us/azure/virtual-machines/managed-disks-overview) with 'Unattached' state and not related to Azure Site Recovery.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.compute/disks\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend diskState = tostring(properties.diskState)\r\n| where managedBy == \"\"\r\n| where not(name endswith \"-ASRReplica\" or name startswith \"ms-asr-\" or name startswith \"asrseeddisk-\")\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.compute/disks\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Total Disks Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.compute/disks\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend diskState = tostring(properties.diskState)\r\n| where managedBy == \"\"\r\n| where not(name endswith \"-ASRReplica\" or name startswith \"ms-asr-\" or name startswith \"asrseeddisk-\")\r\n| extend SizeGB = tolong(properties.diskSizeGB)\r\n| summarize ['Total Disk Size (GB)']=sum(SizeGB)", "size": 4, "title": "Total Disk Size (GB)", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "formatter": 1 }, "leftContent": { "columnMatch": "Total Disk Size (GB)", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Total Disk Size (GB)" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.compute/disks\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend diskState = tostring(properties.diskState)\r\n| where managedBy == \"\"\r\n| where not(name endswith \"-ASRReplica\" or name startswith \"ms-asr-\" or name startswith \"asrseeddisk-\")\r\n| summarize Count=count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Disks by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.compute/disks\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend diskState = tostring(properties.diskState)\r\n| where managedBy == \"\"\r\n| where not(name endswith \"-ASRReplica\" or name startswith \"ms-asr-\" or name startswith \"asrseeddisk-\")\r\n| summarize Count=count(type) by DiskType=tostring(sku.name)", "size": 4, "title": "Count by Disk Type", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Disks by DiskType" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.compute/disks\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend diskState = tostring(properties.diskState)\r\n| where managedBy == \"\" or diskState == 'Unattached'\r\n| where not(name endswith \"-ASRReplica\" or name startswith \"ms-asr-\" or name startswith \"asrseeddisk-\")\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, diskType=sku.name, diskSizeGB=properties.diskSizeGB, timeCreated=properties.timeCreated, tags, Details\r\n", "size": 3, "title": "Orphaned Managed Disks", "noDataMessage": "No orphaned Managed Disks found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "diskType", "formatter": 1 }, { "columnMatch": "diskSizeGB", "formatter": 1 }, { "columnMatch": "timeCreated", "formatter": 6 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "sortBy": [ { "itemKey": "diskSizeGB", "sortOrder": 1 } ], "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "diskType", "label": "Disk Type" }, { "columnId": "diskSizeGB", "label": "Disk Size (GB)" }, { "columnId": "timeCreated", "label": "Time Created" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] }, "sortBy": [ { "itemKey": "diskSizeGB", "sortOrder": 1 } ] }, "name": "query - Managed Disks" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Managed Disk(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "storageTab", "comparison": "isEqualTo", "value": "disks" }, "name": "group - Storage - Manaded Disks" } ] }, "conditionalVisibility": { "parameterName": "mainTab", "comparison": "isEqualTo", "value": "storage" }, "name": "group - Storage" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 11, "content": { "version": "LinkItem/1.0", "style": "tabs", "links": [ { "id": "b2a47b9d-1023-418a-8ffc-67a693c0d5a6", "cellValue": "databaseTab", "linkTarget": "parameter", "linkLabel": "SQL elastic pools 💲", "subTarget": "sqlelasticpools", "style": "link", "linkIsContextBlade": true } ] }, "name": "links - Database Tabs" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned SQL elastic pools" }, "name": "text - Title - SQL elastic pools" }, { "type": 1, "content": { "json": "[SQL elastic pools](https://learn.microsoft.com/en-us/azure/azure-sql/database/elastic-pool-overview) without databases.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.sql/servers/elasticpools\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| project elasticPoolId = tolower(id), Resource = id, type\r\n| extend Details = pack_all()\r\n| join kind=leftouter (resources\r\n| where type =~ \"microsoft.sql/servers/databases\"\r\n| project id, properties\r\n| extend elasticPoolId = tolower(properties.elasticPoolId)) on elasticPoolId\r\n| summarize databaseCount = countif(id != '') by Resource, type\r\n| where databaseCount == 0\r\n| project-away databaseCount\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.sql/servers/elasticpools\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Total SQL elastic pools Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.sql/servers/elasticpools\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| project elasticPoolId = tolower(id), Resource = id, type, location\r\n| extend Details = pack_all()\r\n| join kind=leftouter (resources\r\n| where type =~ 'Microsoft.Sql/servers/databases'\r\n| project id, properties\r\n| extend elasticPoolId = tolower(properties.elasticPoolId)) on elasticPoolId\r\n| summarize databaseCount = countif(id != '') by Resource, type, location\r\n| where databaseCount == 0\r\n| project-away databaseCount\r\n| summarize Count=count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - SQL elastic pools by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.sql/servers/elasticpools\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| project elasticPoolId = tolower(id), Resource = id, type, skuName = sku.name\r\n| extend Details = pack_all()\r\n| join kind=leftouter (resources\r\n| where type =~ 'Microsoft.Sql/servers/databases'\r\n| project id, properties\r\n| extend elasticPoolId = tolower(properties.elasticPoolId)) on elasticPoolId\r\n| summarize databaseCount = countif(id != '') by Resource, type, tostring(skuName)\r\n| where databaseCount == 0\r\n| project-away databaseCount\r\n| summarize Count=count(type) by skuName", "size": 4, "title": "Count by Type", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - SQL elastic pools by Type" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.sql/servers/elasticpools\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| project elasticPoolId = tolower(id), Resource = id, type, skuTier = sku.tier\r\n| extend Details = pack_all()\r\n| join kind=leftouter (resources\r\n| where type =~ \"Microsoft.Sql/servers/databases\"\r\n| project id, properties\r\n| extend elasticPoolId = tolower(properties.elasticPoolId)) on elasticPoolId\r\n| summarize databaseCount = countif(id != '') by Resource, type, tostring(skuTier)\r\n| where databaseCount == 0\r\n| project-away databaseCount\r\n| summarize Count=count(type) by skuTier", "size": 4, "title": "Count by Tier", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - SQL elastic pools by Tier" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.sql/servers/elasticpools\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| project elasticPoolId = tolower(id), Resource = id, resourceGroup, location, skuName = sku.name, skuTier = sku.tier, subscriptionId, tags, properties, Details = pack_all()\r\n| join kind=leftouter (resources\r\n| where type =~ 'Microsoft.Sql/servers/databases'\r\n| project id, properties\r\n| extend elasticPoolId = tolower(properties.elasticPoolId)) on elasticPoolId\r\n| summarize databaseCount = countif(id != '') by Resource, resourceGroup, location, Type=tostring(skuName), Tier=tostring(skuTier), subscriptionId, Tags=tostring(tags), tostring(Details)\r\n| where databaseCount == 0\r\n| project-away databaseCount", "size": 3, "title": "Orphaned SQL elastic pools", "noDataMessage": "No orphaned SQL elastic pools found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "Type", "formatter": 1 }, { "columnMatch": "Tier", "formatter": 1 }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Tags", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkIsContextBlade": true } }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "Type", "label": "Type" }, { "columnId": "Tier", "label": "Tier" }, { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - SQL elastic pools" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following SQL Elastic Pool(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "databaseTab", "comparison": "isEqualTo", "value": "sqlelasticpools" }, "name": "group - Database - SQL elastic pools" } ] }, "conditionalVisibility": { "parameterName": "mainTab", "comparison": "isEqualTo", "value": "database" }, "name": "group - Database" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 11, "content": { "version": "LinkItem/1.0", "style": "tabs", "links": [ { "id": "75dbecf0-d939-484a-a9b6-7ac357384d56", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "Public IPs 💲", "subTarget": "publicips", "style": "link" }, { "id": "b2a47b9d-1023-418a-8ffc-67a693c0d5a6", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "Network Interfaces", "subTarget": "nics", "style": "link", "linkIsContextBlade": true }, { "id": "08ce5f59-a9bd-4a43-93c6-1c6221ec734f", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "Network Security Groups", "subTarget": "nsg", "style": "link" }, { "id": "66b996b0-d586-40d7-9097-c707ff68a6da", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "Route Tables", "subTarget": "routetables", "style": "link" }, { "id": "6fcbb7f1-d77e-4efb-9f3f-d520801aa8f6", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "Load Balancers 💲", "subTarget": "loadbalancers", "style": "link" }, { "id": "3582e9a9-f35a-4ebb-9077-09e22aae768c", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "Front Door WAF Policy", "subTarget": "fdwafpolicy", "style": "link" }, { "id": "a63893e8-9852-4406-a6dd-22af3738b25c", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "Traffic Managers", "subTarget": "tmprofiles", "style": "link" }, { "id": "de4a5d0f-4ad2-4616-931f-039bd72b9dc0", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "Application Gateways 💲", "subTarget": "appgw", "style": "link" }, { "id": "1069ee4a-8cd4-4b81-8bdc-0f80a11f02ac", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "Virtual Networks", "subTarget": "vnets", "style": "link" }, { "id": "388ae01a-7666-4f02-ae9e-fd6debfa177d", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "NAT Gateways 💲", "subTarget": "natgw", "style": "link" }, { "id": "4c4a8734-1a0c-4d83-826c-9c7310e2e9be", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "IP Groups", "subTarget": "ipgroup", "style": "link" }, { "id": "a538397c-15d8-449c-9068-1eef3caa9a80", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "Private DNS zones 💲", "subTarget": "privatednszones", "style": "link" }, { "id": "30275d35-8385-4327-bb0e-4497057f63f0", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "Private Endpoints 💲", "subTarget": "privateendpoints", "style": "link" }, { "id": "2b5c6c87-9f7e-4afa-894e-e2e0804dd473", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "Virtual Network Gateways 💲", "subTarget": "vngs", "style": "link" }, { "id": "5a32b401-ae7a-43da-897f-b6f18bbc125b", "cellValue": "networkingTab", "linkTarget": "parameter", "linkLabel": "DDoS protection plans 💲", "subTarget": "DDoSplans", "style": "link" } ] }, "name": "links - Networking Tabs" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned Public IPs" }, "name": "text - Title - Public IPs" }, { "type": 1, "content": { "json": "[Public IPs](https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/public-ip-addresses) that are not attached to any resource (VM, NAT Gateway, Load Balancer, Application Gateway, Public IP Prefix, etc.).", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/publicipaddresses\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.ipConfiguration == \"\" and properties.natGateway == \"\" and properties.publicIPPrefix == \"\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/publicipaddresses\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Public IPs Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/publicipaddresses\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.ipConfiguration == \"\" and properties.natGateway == \"\" and properties.publicIPPrefix == \"\"\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Public IPs by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/publicipaddresses\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.ipConfiguration == \"\" and properties.natGateway == \"\" and properties.publicIPPrefix == \"\"\r\n| summarize count(type) by tostring(sku.name)", "size": 4, "title": "Count by Type", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Public IPs by Type" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/publicipaddresses\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.ipConfiguration == \"\" and properties.natGateway == \"\" and properties.publicIPPrefix == \"\"\r\n| summarize count(type) by AllocationMethod=tostring(properties.publicIPAllocationMethod)", "size": 4, "title": "Count by Allocation Method", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Public IPs by Allocation Method" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/publicipaddresses\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.ipConfiguration == \"\" and properties.natGateway == \"\" and properties.publicIPPrefix == \"\"\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, Type=tostring(sku.name), AllocationMethod=tostring(properties.publicIPAllocationMethod), tags, Details", "size": 3, "title": "Orphaned Public IPs", "noDataMessage": "No orphaned Public IPs found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "Type", "formatter": 1 }, { "columnMatch": "AllocationMethod", "formatter": 1 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "Type", "label": "Type" }, { "columnId": "AllocationMethod", "label": "Allocation Method" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - Public IPs" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Public IP(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "publicips" }, "name": "group - Networking - Public IPs" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned Network Interfaces" }, "name": "text - Title - Network Interfaces" }, { "type": 1, "content": { "json": "[Network Interfaces](https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/private-ip-addresses) that are not attached to any resource.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/networkinterfaces\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.privateEndpoint)\r\n| where isnull(properties.privateLinkService)\r\n| where properties.hostedWorkloads == \"[]\"\r\n| where properties !has 'virtualmachine'\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/networkinterfaces\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Network Interfaces Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/networkinterfaces\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.privateEndpoint)\r\n| where isnull(properties.privateLinkService)\r\n| where properties.hostedWorkloads == \"[]\"\r\n| where properties !has 'virtualmachine'\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Network Interfaces by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/networkinterfaces\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.privateEndpoint)\r\n| where isnull(properties.privateLinkService)\r\n| where properties.hostedWorkloads == \"[]\"\r\n| where properties !has 'virtualmachine'\r\n| summarize count(type) by kind", "size": 4, "title": "Count by Kind", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Network Interfaces by kind" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/networkinterfaces\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.privateEndpoint)\r\n| where isnull(properties.privateLinkService)\r\n| where properties.hostedWorkloads == \"[]\"\r\n| where properties !has 'virtualmachine'\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, kind, tags, Details", "size": 3, "title": "Orphaned Network Interfaces", "noDataMessage": "No orphaned Network Interfaces found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "exportToExcelOptions": "all", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "kind", "formatter": 1 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "kind", "label": "Kind" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - Network Interfaces" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Network Interface(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "nics" }, "name": "group - Networking - Network Interfaces" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned Network Security Groups" }, "name": "text - Title - Network Security Groups" }, { "type": 1, "content": { "json": "[Network Security Group](https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview) (NSGs) that are not attached to any network interface or subnet.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/networksecuritygroups\" and isnull(properties.networkInterfaces) and isnull(properties.subnets)\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/networksecuritygroups\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - NSGs Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/networksecuritygroups\" and isnull(properties.networkInterfaces) and isnull(properties.subnets)\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - NSGs by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "Resources\r\n| where type =~ \"microsoft.network/networksecuritygroups\" and isnull(properties.networkInterfaces) and isnull(properties.subnets)\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, tags, Details", "size": 3, "title": "Orphaned Network Security Group", "noDataMessage": "No orphaned NSGs found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - NSGs" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following NSG(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "nsg" }, "name": "group - Networking - Network Security Groups" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned Route Tables" }, "name": "text - Title - Route Tables" }, { "type": 1, "content": { "json": "[Route Tables](https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-udr-overview) that not attached to any subnet.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/routetables\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.subnets)\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/routetables\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Route Tables Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/routetables\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.subnets)\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Route Tables by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/routetables\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.subnets)\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, tags, Details", "size": 3, "title": "Orphaned Route Tables", "noDataMessage": "No orphaned Route Tables found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "showPin": false, "name": "query - Route Tables" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Route Table(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "routetables" }, "name": "group - Networking - Route Tables" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned Load Balancers" }, "name": "text - Title - Load Balancers" }, { "type": 1, "content": { "json": "[Load Balancers](https://learn.microsoft.com/en-us/azure/load-balancer/load-balancer-overview) with empty backend address pools.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/loadbalancers\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.backendAddressPools == \"[]\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/loadbalancers\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Load Balancers count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/loadbalancers\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.backendAddressPools == \"[]\"\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Load Balancers by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/loadbalancers\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.backendAddressPools == \"[]\"\r\n| summarize count(type) by tostring(sku.name)", "size": 4, "title": "Count by Type", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Load Balancers by Type" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/loadbalancers\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.backendAddressPools == \"[]\"\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, Type=tostring(sku.name), tags, Details", "size": 3, "title": "Orphaned Load Balances", "noDataMessage": "No orphaned Load Balances found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "Type", "formatter": 1 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "Type", "label": "Type" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - Load Balancers" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Load Balancer(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "loadbalancers" }, "name": "group - Networking - Load Balancers" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned Front Door WAF Policy" }, "name": "text - Title - Front Door WAF Policy" }, { "type": 1, "content": { "json": "[Front Door WAF Policy](https://learn.microsoft.com/en-us/azure/web-application-firewall/afds/afds-overview) without associations.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/frontdoorwebapplicationfirewallpolicies\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.frontendEndpointLinks== \"[]\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/frontdoorwebapplicationfirewallpolicies\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Front Door WAF Policy count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/frontdoorwebapplicationfirewallpolicies\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.frontendEndpointLinks== \"[]\"\r\n| summarize count(type) by tostring(sku.name)", "size": 4, "title": "Count by SKU", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query Front Door WAF Policy by SKU" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/frontdoorwebapplicationfirewallpolicies\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.frontendEndpointLinks == \"[]\" and properties.securityPolicyLinks == \"[]\"\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, SKU=sku.name, tags, Details", "size": 3, "title": "Orphaned Front Door WAF Policy", "noDataMessage": "No orphaned Front Door WAF Policy found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "SKU", "formatter": 1 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "SKU", "label": "Sku" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - Front Door WAF Policy" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Front Door WAF Policy(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "fdwafpolicy" }, "name": "group - Networking - Front Door WAF Policy" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned Traffic Managers" }, "name": "text - Title - Traffic Manager Profiles" }, { "type": 1, "content": { "json": "[Traffic Manager](https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-overview) without endpoints.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/trafficmanagerprofiles\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.endpoints == \"[]\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/trafficmanagerprofiles\", 0])\r\n| summarize total_count = max(count_) by type\r\n", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": true, "size": "auto" } }, "customWidth": "15", "name": "query - Traffic Manager Profiles" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/trafficmanagerprofiles\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.endpoints == \"[]\"\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, tags, Details", "size": 3, "title": "Orphaned Traffic Managers", "noDataMessage": "No orphaned Traffic Managers found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - Traffic Managers" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Traffic Manager(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "tmprofiles" }, "name": "group - Networking - Traffic Managers" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned Application Gateway" }, "name": "text - Title - Application Gateway" }, { "type": 1, "content": { "json": "[Application Gateways](https://learn.microsoft.com/en-us/azure/application-gateway/overview) without backend targets. (in backend pools)", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/applicationgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend backendPoolsCount = array_length(properties.backendAddressPools),SKUName= tostring(properties.sku.name), SKUTier= tostring(properties.sku.tier),SKUCapacity=properties.sku.capacity,backendPools=properties.backendAddressPools , AppGwId = tostring(id)\r\n| project AppGwId, name, SKUName, SKUTier, SKUCapacity, type\r\n| join (\r\n resources\r\n | where type =~ \"microsoft.network/applicationgateways\"\r\n | mvexpand backendPools = properties.backendAddressPools\r\n | extend backendIPCount = array_length(backendPools.properties.backendIPConfigurations)\r\n | extend backendAddressesCount = array_length(backendPools.properties.backendAddresses)\r\n | extend backendPoolName = backendPools.properties.backendAddressPools.name\r\n | extend AppGwId = tostring(id)\r\n | summarize backendIPCount = sum(backendIPCount) ,backendAddressesCount=sum(backendAddressesCount) by AppGwId\r\n) on AppGwId\r\n| project-away AppGwId1\r\n| where (backendIPCount == 0 or isempty(backendIPCount)) and (backendAddressesCount==0 or isempty(backendAddressesCount))\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/applicationgateways\", 0])\r\n| summarize total_count = max(count_) by type\r\n", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Application Gateway" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/applicationgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend backendPoolsCount = array_length(properties.backendAddressPools),SKUName= tostring(properties.sku.name), SKUTier= tostring(properties.sku.tier),SKUCapacity=properties.sku.capacity,backendPools=properties.backendAddressPools , AppGwId = tostring(id)\r\n| project AppGwId, name, location, SKUName, SKUTier, SKUCapacity\r\n| join (\r\n resources\r\n | where type =~ \"microsoft.network/applicationgateways\"\r\n | mvexpand backendPools = properties.backendAddressPools\r\n | extend backendIPCount = array_length(backendPools.properties.backendIPConfigurations)\r\n | extend backendAddressesCount = array_length(backendPools.properties.backendAddresses)\r\n | extend backendPoolName = backendPools.properties.backendAddressPools.name\r\n | extend AppGwId = tostring(id)\r\n | summarize backendIPCount = sum(backendIPCount) ,backendAddressesCount=sum(backendAddressesCount) by AppGwId\r\n) on AppGwId\r\n| project-away AppGwId1\r\n| where (backendIPCount == 0 or isempty(backendIPCount)) and (backendAddressesCount==0 or isempty(backendAddressesCount))\r\n| summarize count(AppGwId) by tostring(location)", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Application Gateway by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/applicationgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend backendPoolsCount = array_length(properties.backendAddressPools),SKUName= tostring(properties.sku.name), SKUTier= tostring(properties.sku.tier),SKUCapacity=properties.sku.capacity,backendPools=properties.backendAddressPools , AppGwId = tostring(id)\r\n| project AppGwId, name, SKUName, SKUTier, SKUCapacity\r\n| join (\r\n resources\r\n | where type =~ \"microsoft.network/applicationgateways\"\r\n | mvexpand backendPools = properties.backendAddressPools\r\n | extend backendIPCount = array_length(backendPools.properties.backendIPConfigurations)\r\n | extend backendAddressesCount = array_length(backendPools.properties.backendAddresses)\r\n | extend backendPoolName = backendPools.properties.backendAddressPools.name\r\n | extend AppGwId = tostring(id)\r\n | summarize backendIPCount = sum(backendIPCount) ,backendAddressesCount=sum(backendAddressesCount) by AppGwId\r\n) on AppGwId\r\n| project-away AppGwId1\r\n| where (backendIPCount == 0 or isempty(backendIPCount)) and (backendAddressesCount==0 or isempty(backendAddressesCount))\r\n| summarize count(AppGwId) by tostring(SKUTier)", "size": 4, "title": "Count by SKU", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Application Gateway by SKU" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/applicationgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend backendPoolsCount = array_length(properties.backendAddressPools),SKUName= tostring(properties.sku.name), SKUTier= tostring(properties.sku.tier),SKUCapacity=properties.sku.capacity,backendPools=properties.backendAddressPools , AppGwId = tostring(id)\r\n| project subscriptionId, AppGwId, resourceGroup, location, tags, name, SKUName, SKUTier, SKUCapacity\r\n| join (\r\n resources\r\n | where type =~ \"microsoft.network/applicationgateways\"\r\n | mvexpand backendPools = properties.backendAddressPools\r\n | extend backendIPCount = array_length(backendPools.properties.backendIPConfigurations)\r\n | extend backendAddressesCount = array_length(backendPools.properties.backendAddresses)\r\n | extend backendPoolName = backendPools.properties.backendAddressPools.name\r\n | extend AppGwId = tostring(id)\r\n | summarize backendIPCount = sum(backendIPCount) ,backendAddressesCount=sum(backendAddressesCount) by AppGwId\r\n) on AppGwId\r\n| project-away AppGwId1\r\n| where (backendIPCount == 0 or isempty(backendIPCount)) and (backendAddressesCount==0 or isempty(backendAddressesCount))\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=AppGwId, resourceGroup, location, SKUTier, SKUCapacity, tags, Details", "size": 3, "title": "Orphaned Application Gateway", "noDataMessage": "No orphaned Application Gateway found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "SKUTier", "formatter": 1 }, { "columnMatch": "SKUCapacity", "formatter": 1 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "SKUTier", "label": "SKu" }, { "columnId": "SKUCapacity", "label": "Capacity" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - Application Gateway" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Application Gateway(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "appgw" }, "name": "group - Networking - Application Gateway" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 11, "content": { "version": "LinkItem/1.0", "style": "tabs", "links": [ { "id": "8e1c6962-5369-4cc3-9fe9-1ff6ed0d92af", "cellValue": "VirtualNetworksTab", "linkTarget": "parameter", "linkLabel": "Virtual Networks", "subTarget": "vnets", "style": "link", "linkIsContextBlade": true }, { "id": "85598350-5dc0-4087-ae66-b50d4aeadba7", "cellValue": "VirtualNetworksTab", "linkTarget": "parameter", "linkLabel": "Subnets", "subTarget": "subnets", "style": "link" } ] }, "name": "links - Virtual Networks Tabs" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned Virtual Networks" }, "name": "text - Title - Virtual Networks" }, { "type": 1, "content": { "json": "[Virtual Networks](https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-overview) (VNETs) without subnets.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworks\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.subnets == \"[]\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/virtualnetworks\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Virtual Networks" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworks\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.subnets == \"[]\"\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Virtual Networks by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworks\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.subnets == \"[]\"\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, tags, Details", "size": 3, "title": "Orphaned Virtual Networks", "noDataMessage": "No orphaned Virtual Networks found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - Virtual Networks" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Virtual network(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "VirtualNetworksTab", "comparison": "isEqualTo", "value": "vnets" }, "name": "group - Networking - Virtual Networks - VNETs" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned Subnets" }, "name": "text - Title - Subnets" }, { "type": 1, "content": { "json": "Subnets without Connected Devices or Delegation. (Empty Subnets)", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type == \"microsoft.network/virtualnetworks\"\r\n| extend subnet = properties.subnets\r\n| mv-expand subnet\r\n| extend ipConfigurations = subnet.properties.ipConfigurations\r\n| extend delegations = subnet.properties.delegations\r\n| extend applicationGatewayIPConfigurations = subnet.properties.applicationGatewayIPConfigurations\r\n| where isnull(ipConfigurations) and delegations == \"[]\" and isnull(applicationGatewayIPConfigurations) \r\n| extend subnets_str = \"Subnets\"\r\n| summarize count_ = count() by type, subnets_str\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(subnets_str:string, count_:long) [\"Subnets\", 0]) // Add a row with 0 if no results\r\n| summarize total_count = max(count_) by subnets_str", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "subnets_str", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Subnets Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworks\"\r\n| extend subnet = properties.subnets\r\n| mv-expand subnet\r\n| extend ipConfigurations = subnet.properties.ipConfigurations\r\n| extend delegations = subnet.properties.delegations\r\n| extend applicationGatewayIPConfigurations = subnet.properties.applicationGatewayIPConfigurations\r\n| where isnull(ipConfigurations) and delegations == \"[]\" and isnull(applicationGatewayIPConfigurations) \r\n| summarize count(subnet) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Subnets by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworks\"\r\n| extend subnet = properties.subnets\r\n| mv-expand subnet\r\n| extend ipConfigurations = subnet.properties.ipConfigurations\r\n| extend delegations = subnet.properties.delegations\r\n| extend applicationGatewayIPConfigurations = subnet.properties.applicationGatewayIPConfigurations\r\n| where isnull(ipConfigurations) and delegations == \"[]\" and isnull(applicationGatewayIPConfigurations) \r\n| summarize count(subnet) by resourceGroup", "size": 4, "title": "Count by Resource Group", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Subnets by Resource Group" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworks\"\r\n| extend subnet = properties.subnets\r\n| mv-expand subnet\r\n| extend ipConfigurations = subnet.properties.ipConfigurations\r\n| extend delegations = subnet.properties.delegations\r\n| extend applicationGatewayIPConfigurations = subnet.properties.applicationGatewayIPConfigurations\r\n| where isnull(ipConfigurations) and delegations == \"[]\" and isnull(applicationGatewayIPConfigurations) \r\n| extend SubnetName = subnet.name, SubnetId = subnet.id\r\n| extend Details = pack_all()\r\n| project subscriptionId, SubnetName, vNetId=id, SubnetId ,resourceGroup, location, vNetName=name, Details", "size": 3, "title": "Orphaned Subnets", "noDataMessage": "No orphaned Subnets found", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "SubnetId", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "SubnetName", "formatter": 5 }, { "columnMatch": "vNetId", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "SubnetId", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "linkIsContextBlade": true, "showIcon": true } }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "DeleteResource", "formatter": 7, "formatOptions": { "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Resource", "linkIsContextBlade": true, "armActionContext": { "path": "[\"SubnetId\"]", "headers": [], "params": [ { "key": "api-version", "value": "[\"apiVersion\"]" } ], "isLongOperation": true, "httpMethod": "DELETE", "title": "Delete Subnet", "description": "# ⛔ **Attention!** ⛔\n\n## **This action will permanently delete this subnet!**\n\n## **[\"SubnetName\"]**\n\n## Resource Details:\n\n| | |\n| ---------------------- | --------------------- |\n| Subnet Name | **[\"SubnetName\"]** |\n| vNet Name | **[\"vNetName\"]** |\n| Resource Group | **[\"resourceGroup\"]** |\n| Location | **[\"location\"]** |\n\n\n### Recommended steps before deletion\n\n- Review the resource information thoroughly before continuing with the deletion.\n- Ensure that this subnet is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group where the subnet located.", "actionName": "Delete Subnet", "runLabel": "Delete Resource" } } }, { "columnMatch": "vNetName", "formatter": 5 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "SubnetName" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "SubnetName", "label": "Subnet Name" }, { "columnId": "vNetId", "label": "vNet Name" }, { "columnId": "SubnetId", "label": "vNet/Subnet" }, { "columnId": "resourceGroup", "label": "Resource GRoup" }, { "columnId": "location", "label": "Location" }, { "columnId": "vNetName", "label": "vNet Name" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - Subnets" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Subnet(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "VirtualNetworksTab", "comparison": "isEqualTo", "value": "subnets" }, "name": "group - Networking - Virtual Networks - Subnets" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "vnets" }, "name": "group - Networking - Virtual Networks" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned NAT Gateways" }, "name": "text - Title - NAT Gateway" }, { "type": 1, "content": { "json": "[NAT Gateways](https://learn.microsoft.com/en-us/azure/nat-gateway/nat-overview) that not attached to any subnet.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/natgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.subnets)\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/natgateways\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - NAT Gateways" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/natgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.subnets)\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - NAT Gateways by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/natgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.subnets)\r\n| summarize count(type) by tostring(sku.name)", "size": 4, "title": "Count by SKU", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - NAT Gateways by SKU" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/natgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.subnets)\r\n| summarize count(type) by tostring(sku.tier)", "size": 4, "title": "Count by Tier", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - NAT Gateways by Tier" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/natgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.subnets)\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, Sku=tostring(sku.name), Tier=tostring(sku.tier), tags, Details", "size": 3, "title": "Orphaned NAT Gateways", "noDataMessage": "No orphaned NAT Gateways found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "Sku", "formatter": 1 }, { "columnMatch": "Tier", "formatter": 1 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "Sku", "label": "Sku" }, { "columnId": "Tier", "label": "Tier" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - NAT Gateways" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following NAT Gateway(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "natgw" }, "name": "group - Networking - NAT Gateway" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# IP Groups" }, "name": "text - Title - IP Group" }, { "type": 1, "content": { "json": "[IP Groups](https://learn.microsoft.com/en-us/azure/firewall/ip-groups) that not attached to any Azure Firewall.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/ipgroups\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.firewalls == \"[]\" and properties.firewallPolicies == \"[]\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/ipgroups\", 0])\r\n| summarize total_count = max(count_) by type\r\n", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - IP Group" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/ipgroups\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.firewalls == \"[]\" and properties.firewallPolicies == \"[]\"\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - IP Group by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/ipgroups\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.firewalls == \"[]\" and properties.firewallPolicies == \"[]\"\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, tags, Details", "size": 3, "title": "Orphaned IP Groups", "noDataMessage": "No orphaned IP Groups found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - IP Group" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following IP Group(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "ipgroup" }, "name": "group - Networking - IP Group" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Private DNS zones" }, "name": "text - Title - Private DNS zones" }, { "type": 1, "content": { "json": "[Private DNS zones](https://learn.microsoft.com/en-us/azure/dns/private-dns-privatednszone) without [Virtual Network Links](https://learn.microsoft.com/en-us/azure/dns/private-dns-virtual-network-links).", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/privatednszones\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.numberOfVirtualNetworkLinks == 0\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/privatednszones\", 0])\r\n| summarize total_count = max(count_) by type\r\n", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Private DNS zones" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/privatednszones\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.numberOfVirtualNetworkLinks == 0\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Private DNS zones by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/privatednszones\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where properties.numberOfVirtualNetworkLinks == 0\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, NumberOfRecordSets=properties.numberOfRecordSets, tags, Details", "size": 3, "title": "Orphaned Private DNS zones", "noDataMessage": "No orphaned Private DNS zones found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "NumberOfRecordSets", "formatter": 1 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "NumberOfRecordSets", "label": "Number Of Record Sets" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - Private DNS zones" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Private DNS(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "privatednszones" }, "name": "group - Networking - Private DNS Zone Group" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Private Endpoints" }, "name": "text - Title - Private Endpoints" }, { "type": 1, "content": { "json": "[Private Endpoints](https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-overview) that are not connected to any resource.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/privateendpoints\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend connection = iff(array_length(properties.manualPrivateLinkServiceConnections) > 0, properties.manualPrivateLinkServiceConnections[0], properties.privateLinkServiceConnections[0])\r\n| extend stateEnum = tostring(connection.properties.privateLinkServiceConnectionState.status)\r\n| where stateEnum == \"Disconnected\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/privateendpoints\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Private Endpoints" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/privateendpoints\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend connection = iff(array_length(properties.manualPrivateLinkServiceConnections) > 0, properties.manualPrivateLinkServiceConnections[0], properties.privateLinkServiceConnections[0])\r\n| extend stateEnum = tostring(connection.properties.privateLinkServiceConnectionState.status)\r\n| where stateEnum == \"Disconnected\"\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Private Endpoints by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/privateendpoints\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend connection = iff(array_length(properties.manualPrivateLinkServiceConnections) > 0, properties.manualPrivateLinkServiceConnections[0], properties.privateLinkServiceConnections[0])\r\n| extend serviceId = tostring(connection.properties.privateLinkServiceId)\r\n| extend serviceIdSplit = split(serviceId, \"/\")\r\n| extend serviceName = tostring(serviceIdSplit[8])\r\n| extend serviceTypeEnum = iff(isnotnull(serviceIdSplit[6]), tolower(strcat(serviceIdSplit[6], \"/\", serviceIdSplit[7])), \"microsoft.network/privatelinkservices\")\r\n| extend stateEnum = tostring(connection.properties.privateLinkServiceConnectionState.status)\r\n| where stateEnum == \"Disconnected\"\r\n| summarize count(type) by serviceTypeEnum", "size": 4, "title": "Count by Resource type", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Private Endpoints by Resource type" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/privateendpoints\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend connection = iff(array_length(properties.manualPrivateLinkServiceConnections) > 0, properties.manualPrivateLinkServiceConnections[0], properties.privateLinkServiceConnections[0])\r\n| extend stateEnum = tostring(connection.properties.privateLinkServiceConnectionState.status)\r\n| extend groupIds = tostring(connection.properties.groupIds[0])\r\n| where stateEnum == \"Disconnected\"\r\n| summarize count(type) by groupIds", "size": 4, "title": "Count by Target sub-resource", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Private Endpoints by Target sub-resource" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/privateendpoints\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend connection = iff(array_length(properties.manualPrivateLinkServiceConnections) > 0, properties.manualPrivateLinkServiceConnections[0], properties.privateLinkServiceConnections[0])\r\n| extend subnetId = properties.subnet.id\r\n| extend subnetName = tostring(split(subnetId, \"/\")[-1])\r\n| extend subnetIdSplit = split(subnetId, \"/\")\r\n| extend vnetId = strcat_array(array_slice(subnetIdSplit,0,8), \"/\")\r\n| extend vnetName = tostring(split(vnetId, \"/\")[-1])\r\n| extend serviceId = tostring(connection.properties.privateLinkServiceId)\r\n| extend serviceIdSplit = split(serviceId, \"/\")\r\n| extend serviceName = tostring(serviceIdSplit[8])\r\n| extend serviceTypeEnum = iff(isnotnull(serviceIdSplit[6]), tolower(strcat(serviceIdSplit[6], \"/\", serviceIdSplit[7])), \"microsoft.network/privatelinkservices\")\r\n| extend stateEnum = tostring(connection.properties.privateLinkServiceConnectionState.status)\r\n| extend groupIds = tostring(connection.properties.groupIds[0])\r\n| where stateEnum == \"Disconnected\"\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, serviceName, serviceTypeEnum, groupIds, vnetId, vnetName, subnetId, subnetName, tags, Details", "size": 3, "title": "Orphaned Private Endpoints", "noDataMessage": "No orphaned Private Endpoints found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "linkLabel": "", "linkIsContextBlade": false, "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "vnetName", "formatter": 5 }, { "columnMatch": "subnetId", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "linkIsContextBlade": true, "showIcon": true } }, { "columnMatch": "subnetName", "formatter": 5 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } }, { "columnMatch": "PrivateEndpointNameId", "formatter": 5 } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "serviceName", "label": "Private link resource" }, { "columnId": "serviceTypeEnum", "label": "Resource type" }, { "columnId": "groupIds", "label": "Target sub-resource" }, { "columnId": "vnetId", "label": "Virtual Network" }, { "columnId": "vnetName", "label": "Virtual Network Name" }, { "columnId": "subnetId", "label": "Subnet" }, { "columnId": "subnetName", "label": "Subnet Name" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - Private Endpoints" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Private Endpoint(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "privateendpoints" }, "name": "group - Networking - Private Endpoint" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Virtual Network Gateways" }, "name": "text - Title - Virtual Network Gateways" }, { "type": 1, "content": { "json": "[Virtual Network Gateways](https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-about-vpngateways) without Point-to-site configuration or Connections.", "style": "upsell" }, "name": "text - Title - Info - Virtual Network Gateways" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworkgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend vpnClientConfiguration = properties.vpnClientConfiguration\r\n| extend Resource = id\r\n| join kind=leftouter (\r\n resources\r\n | where type =~ \"microsoft.network/connections\"\r\n | mv-expand Resource = pack_array(properties.virtualNetworkGateway1.id, properties.virtualNetworkGateway2.id) to typeof(string)\r\n | project Resource, connectionId = id, ConnectionProperties=properties\r\n ) on Resource \r\n| where isempty(vpnClientConfiguration) and isempty(connectionId)\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/virtualnetworkgateways\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Virtual Network Gateways" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworkgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend vpnClientConfiguration = properties.vpnClientConfiguration\r\n| extend Resource = id\r\n| join kind=leftouter (\r\n resources\r\n | where type =~ \"microsoft.network/connections\"\r\n | mv-expand Resource = pack_array(properties.virtualNetworkGateway1.id, properties.virtualNetworkGateway2.id) to typeof(string)\r\n | project Resource, connectionId = id, ConnectionProperties=properties\r\n ) on Resource \r\n| where isempty(vpnClientConfiguration) and isempty(connectionId)\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "20", "name": "query - Virtual Network Gateways by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworkgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend GatewayType = tostring(properties.gatewayType)\r\n| extend vpnClientConfiguration = properties.vpnClientConfiguration\r\n| extend Resource = id\r\n| join kind=leftouter (\r\n resources\r\n | where type =~ \"microsoft.network/connections\"\r\n | mv-expand Resource = pack_array(properties.virtualNetworkGateway1.id, properties.virtualNetworkGateway2.id) to typeof(string)\r\n | project Resource, connectionId = id, ConnectionProperties=properties\r\n ) on Resource \r\n| where isempty(vpnClientConfiguration) and isempty(connectionId)\r\n| summarize count(type) by GatewayType", "size": 4, "title": "Count by Gateway Type", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "20", "name": "query - Virtual Network Gateways by Gateway Type" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworkgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend SKU = tostring(properties.sku.name)\r\n| extend vpnClientConfiguration = properties.vpnClientConfiguration\r\n| extend Resource = id\r\n| join kind=leftouter (\r\n resources\r\n | where type =~ \"microsoft.network/connections\"\r\n | mv-expand Resource = pack_array(properties.virtualNetworkGateway1.id, properties.virtualNetworkGateway2.id) to typeof(string)\r\n | project Resource, connectionId = id, ConnectionProperties=properties\r\n ) on Resource \r\n| where isempty(vpnClientConfiguration) and isempty(connectionId)\r\n| summarize count(type) by SKU", "size": 4, "title": "Count by Sku", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "20", "name": "query - Virtual Network Gateways by Sku" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworkgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend Tier = tostring(properties.sku.tier)\r\n| extend vpnClientConfiguration = properties.vpnClientConfiguration\r\n| extend Resource = id\r\n| join kind=leftouter (\r\n resources\r\n | where type =~ \"microsoft.network/connections\"\r\n | mv-expand Resource = pack_array(properties.virtualNetworkGateway1.id, properties.virtualNetworkGateway2.id) to typeof(string)\r\n | project Resource, connectionId = id, ConnectionProperties=properties\r\n ) on Resource \r\n| where isempty(vpnClientConfiguration) and isempty(connectionId)\r\n| summarize count(type) by Tier", "size": 4, "title": "Count by Tier", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "20", "name": "query - Virtual Network Gateways by Tier" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/virtualnetworkgateways\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend Details = pack_all()\r\n| extend SKU = tostring(properties.sku.name)\r\n| extend Tier = tostring(properties.sku.tier)\r\n| extend GatewayType = tostring(properties.gatewayType)\r\n| extend vpnClientConfiguration = properties.vpnClientConfiguration\r\n| extend Resource = id\r\n| join kind=leftouter (\r\n resources\r\n | where type =~ \"microsoft.network/connections\"\r\n | mv-expand Resource = pack_array(properties.virtualNetworkGateway1.id, properties.virtualNetworkGateway2.id) to typeof(string)\r\n | project Resource, connectionId = id, ConnectionProperties=properties\r\n ) on Resource \r\n| where isempty(vpnClientConfiguration) and isempty(connectionId)\r\n| project subscriptionId, Resource, resourceGroup, location, GatewayType, SKU, Tier, tags, Details", "size": 3, "title": "Orphaned Virtual Network Gateways", "noDataMessage": "No orphaned Virtual Network Gateways found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "GatewayType", "formatter": 1 }, { "columnMatch": "SKU", "formatter": 1 }, { "columnMatch": "Tier", "formatter": 1 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "GatewayType", "label": "Gateway Type" }, { "columnId": "SKU", "label": "Sku" }, { "columnId": "Tier", "label": "Tier" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - Virtual Network Gateways" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Virtual Network Gateway(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "vngs" }, "name": "group - Networking - Virtual Network Gateways" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# DDoS Protections" }, "name": "text - Title - DDoS protection plans" }, { "type": 1, "content": { "json": "[DDoS protection](https://learn.microsoft.com/en-us/azure/ddos-protection/ddos-protection-overview) without protected resources. (=without Virtual Networks accosiated)", "style": "upsell" }, "name": "text - Title - Info - DDoS protection plans" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/ddosprotectionplans\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.virtualNetworks)\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.network/ddosprotectionplans\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "id", "formatter": 5 }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "id" } }, "sortBy": [], "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true, "compositeBarSettings": { "labelText": "", "columnSettings": [] } } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "sortOrderField": 1, "size": "auto" }, "graphSettings": { "type": 0, "topContent": { "columnMatch": "vmSize", "formatter": 1 }, "centerContent": { "columnMatch": "Count", "formatter": 1, "numberFormat": { "unit": 17, "options": { "maximumSignificantDigits": 3, "maximumFractionDigits": 2 } } } }, "textSettings": { "style": "bignumber" } }, "customWidth": "15", "name": "query - DDoS protection plans" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/ddosprotectionplans\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.virtualNetworks)\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "noDataMessage": "No results.", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "id", "formatter": 5 }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "id" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource Name" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "tags", "label": "Tags" } ] }, "sortBy": [], "tileSettings": { "titleContent": { "columnMatch": "DiskType", "formatter": 1 }, "leftContent": { "columnMatch": "Count", "formatter": 12, "formatOptions": { "palette": "auto" }, "numberFormat": { "unit": 17, "options": { "maximumSignificantDigits": 3, "maximumFractionDigits": 2 } } }, "showBorder": true }, "graphSettings": { "type": 0, "topContent": { "columnMatch": "vmSize", "formatter": 1 }, "centerContent": { "columnMatch": "Count", "formatter": 1, "numberFormat": { "unit": 17, "options": { "maximumSignificantDigits": 3, "maximumFractionDigits": 2 } } } }, "chartSettings": { "showMetrics": false, "showLegend": true }, "mapSettings": { "locInfo": "LatLong", "sizeSettings": "Count", "sizeAggregation": "Sum", "legendMetric": "Count", "legendAggregation": "Sum", "itemColorSettings": { "type": "heatmap", "colorAggregation": "Sum", "nodeColorField": "Count", "heatmapPalette": "greenRed" } } }, "customWidth": "20", "name": "query - DDoS protection plans by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.network/ddosprotectionplans\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| where isnull(properties.virtualNetworks)\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, tags, Details", "size": 3, "title": "Orphaned DDoS protection plans", "noDataMessage": "No orphaned DDoS protection plans found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - DDoS protection plans" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following DDoS Protection(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "networkingTab", "comparison": "isEqualTo", "value": "DDoSplans" }, "name": "group - Networking - DDoS protection plans" } ] }, "conditionalVisibility": { "parameterName": "mainTab", "comparison": "isEqualTo", "value": "networking" }, "name": "group - Networking" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 11, "content": { "version": "LinkItem/1.0", "style": "tabs", "links": [ { "id": "75dbecf0-d939-484a-a9b6-7ac357384d56", "cellValue": "othersTab", "linkTarget": "parameter", "linkLabel": "Resource Groups", "subTarget": "rgs", "style": "link" }, { "id": "f1783382-6614-4f1a-9be3-ea8be37e9bb8", "cellValue": "othersTab", "linkTarget": "parameter", "linkLabel": "API Connections", "subTarget": "apiconnections", "style": "link" }, { "id": "4397efb4-240b-4f96-b734-c946c59e941d", "cellValue": "othersTab", "linkTarget": "parameter", "linkLabel": "Certificates", "subTarget": "certificates", "style": "link" } ] }, "name": "links - Other Tabs" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned Resource Groups" }, "name": "text - Title - Resource Groups" }, { "type": 1, "content": { "json": "[Resource Groups](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/overview) without resources (including hidden types resources).", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "ResourceContainers\r\n| where type == \"microsoft.resources/subscriptions/resourcegroups\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend rgAndSub = strcat(resourceGroup, \"--\", subscriptionId)\r\n| join kind=leftouter (\r\n Resources\r\n | extend rgAndSub = strcat(resourceGroup, \"--\", subscriptionId)\r\n | summarize count() by rgAndSub\r\n) on rgAndSub\r\n| where isnull(count_)\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.resources/subscriptions/resourcegroups\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - Resource Groups Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "ResourceContainers\r\n| where type == \"microsoft.resources/subscriptions/resourcegroups\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend rgAndSub = strcat(resourceGroup, \"--\", subscriptionId)\r\n| join kind=leftouter (\r\n Resources\r\n | extend rgAndSub = strcat(resourceGroup, \"--\", subscriptionId)\r\n | summarize count() by rgAndSub\r\n ) on rgAndSub\r\n| where isnull(count_)\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - Resource Groups by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "ResourceContainers\r\n| where type =~ \"microsoft.resources/subscriptions/resourcegroups\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend rgAndSub = strcat(resourceGroup, \"--\", subscriptionId)\r\n| join kind=leftouter (\r\n Resources\r\n | extend rgAndSub = strcat(resourceGroup, \"--\", subscriptionId)\r\n | summarize count() by rgAndSub\r\n ) on rgAndSub\r\n| where isnull(count_)\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, tags ,Details", "size": 3, "title": "Orphaned Resource Groups", "noDataMessage": "No orphaned Resource Groups found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "resourceGroup", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "resourceGroup", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "location", "label": "Location" }, { "columnId": "tags", "label": "Tags" } ] } }, "name": "query - Resource Groups" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Resource Group(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "othersTab", "comparison": "isEqualTo", "value": "rgs" }, "name": "group - Others - Resource Groups" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned API Connections" }, "name": "text - Title - API Connections" }, { "type": 1, "content": { "json": "[API Connections](https://learn.microsoft.com/en-us/azure/active-directory/external-identities/api-connectors-overview/) that not related to any Logic App.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.web/connections\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| project resourceId = id , apiName = name, subscriptionId, resourceGroup, tags, location, type\r\n| join kind = leftouter (\r\n resources\r\n | where type == 'microsoft.logic/workflows'\r\n | extend resourceGroup, location, subscriptionId, properties\r\n | extend var_json = properties[\"parameters\"][\"$connections\"][\"value\"]\r\n\t| mvexpand var_connection = var_json\r\n | where notnull(var_connection)\r\n | extend connectionId = extract(\"connectionId\\\":\\\"(.*?)\\\"\", 1, tostring(var_connection))\r\n | project connectionId, name\r\n )\r\n on $left.resourceId == $right.connectionId\r\n| where connectionId == \"\"\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"microsoft.web/connections\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "size": "auto" } }, "customWidth": "15", "name": "query - API Connections Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.web/connections\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| project resourceId = id , apiName = name, subscriptionId, resourceGroup, tags, location\r\n| join kind = leftouter (\r\n resources\r\n | where type =~ 'microsoft.logic/workflows'\r\n | extend resourceGroup, location, subscriptionId, properties\r\n | extend var_json = properties[\"parameters\"][\"$connections\"][\"value\"]\r\n\t| mvexpand var_connection = var_json\r\n | where notnull(var_connection)\r\n | extend connectionId = extract(\"connectionId\\\":\\\"(.*?)\\\"\", 1, tostring(var_connection))\r\n | project connectionId, name\r\n )\r\n on $left.resourceId == $right.connectionId\r\n| where connectionId == \"\"\r\n| summarize count() by location", "size": 4, "title": "Count by Location", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "chartSettings": { "showMetrics": false, "showLegend": true } }, "customWidth": "25", "name": "query - API Connections by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.web/connections\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| project subscriptionId, Resource = id , apiName = name, resourceGroup, tags, location\r\n| join kind = leftouter (\r\n resources\r\n | where type =~ 'microsoft.logic/workflows'\r\n | extend resourceGroup, location, subscriptionId, properties\r\n | extend var_json = properties[\"parameters\"][\"$connections\"][\"value\"]\r\n\t| mvexpand var_connection = var_json\r\n | where notnull(var_connection)\r\n | extend connectionId = extract(\"connectionId\\\":\\\"(.*?)\\\"\", 1, tostring(var_connection))\r\n | project connectionId, name\r\n )\r\n on $left.Resource == $right.connectionId\r\n| where connectionId == \"\"\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource, resourceGroup, location, tags, Details", "size": 3, "title": "Orphaned API Connections", "noDataMessage": "No orphaned API Connections found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } }, { "columnMatch": "resourceId", "formatter": 5 } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "tags", "label": "Tags" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - API Connections" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following API Connection(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "othersTab", "comparison": "isEqualTo", "value": "apiconnections" }, "name": "group - Others - API Connections" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "# Orphaned Certificates" }, "name": "text - Title - Certificates" }, { "type": 1, "content": { "json": "Expired certificates.", "style": "upsell" }, "name": "text - Title - Info" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.web/certificates\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend expiresOn = todatetime(properties.expirationDate)\r\n| where expiresOn <= now()\r\n| summarize count_ = count() by type\r\n| extend count_ = iff(count_ == 0, 0, count_)\r\n| union (datatable(type:string, count_:long) [\"certificates\", 0])\r\n| summarize total_count = max(count_) by type", "size": 4, "title": "Total", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "tiles", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "id", "formatter": 5 }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "id" } }, "sortBy": [], "tileSettings": { "titleContent": { "columnMatch": "type", "formatter": 16, "formatOptions": { "showIcon": true } }, "leftContent": { "columnMatch": "total_count", "formatter": 12, "formatOptions": { "palette": "auto" } }, "showBorder": false, "sortCriteriaField": "count_type", "sortOrderField": 2, "size": "auto" }, "graphSettings": { "type": 0, "topContent": { "columnMatch": "vmSize", "formatter": 1 }, "centerContent": { "columnMatch": "Count", "formatter": 1, "numberFormat": { "unit": 17, "options": { "maximumSignificantDigits": 3, "maximumFractionDigits": 2 } } } }, "textSettings": { "style": "bignumber" } }, "customWidth": "15", "name": "query - Certificates Count" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.web/certificates\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend expiresOn = todatetime(properties.expirationDate)\r\n| where expiresOn <= now()\r\n| summarize count(type) by location", "size": 4, "title": "Count by Location", "noDataMessage": "No results.", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "piechart", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "id", "formatter": 5 }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "id" } }, "sortBy": [], "tileSettings": { "titleContent": { "columnMatch": "DiskType", "formatter": 1 }, "leftContent": { "columnMatch": "Count", "formatter": 12, "formatOptions": { "palette": "auto" }, "numberFormat": { "unit": 17, "options": { "maximumSignificantDigits": 3, "maximumFractionDigits": 2 } } }, "showBorder": true }, "graphSettings": { "type": 0, "topContent": { "columnMatch": "vmSize", "formatter": 1 }, "centerContent": { "columnMatch": "Count", "formatter": 1, "numberFormat": { "unit": 17, "options": { "maximumSignificantDigits": 3, "maximumFractionDigits": 2 } } } }, "chartSettings": { "showMetrics": false, "showLegend": true }, "mapSettings": { "locInfo": "LatLong", "sizeSettings": "Count", "sizeAggregation": "Sum", "legendMetric": "Count", "legendAggregation": "Sum", "itemColorSettings": { "type": "heatmap", "colorAggregation": "Sum", "nodeColorField": "Count", "heatmapPalette": "greenRed" } } }, "customWidth": "30", "name": "query - Certificates by Location" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "resources\r\n| where type =~ \"microsoft.web/certificates\"\r\n| where resourceGroup in~ ({ResourceGroup:value})\r\n| extend expiresOn = todatetime(properties.expirationDate)\r\n| where expiresOn <= now()\r\n| extend Details = pack_all()\r\n| project subscriptionId, Resource=id, resourceGroup, location, Details", "size": 3, "title": "Orphaned Certificates", "noDataMessage": "No orphaned Certificates found.", "exportMultipleValues": true, "exportedParameters": [ { "fieldName": "Resource", "parameterName": "resources", "parameterType": 5 } ], "showExportToExcel": true, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "crossComponentResources": [ "{Subscription}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "$gen_group", "formatter": 13, "formatOptions": { "linkTarget": "Resource", "showIcon": true } }, { "columnMatch": "subscriptionId", "formatter": 5 }, { "columnMatch": "Resource", "formatter": 5 }, { "columnMatch": "location", "formatter": 17 }, { "columnMatch": "Details", "formatter": 7, "formatOptions": { "linkTarget": "CellDetails", "linkLabel": "🔍 View Details", "linkIsContextBlade": true } } ], "rowLimit": 1000, "filter": true, "hierarchySettings": { "treeType": 1, "groupBy": [ "subscriptionId" ], "expandTopLevel": true, "finalBy": "Resource" }, "labelSettings": [ { "columnId": "subscriptionId", "label": "Subscription" }, { "columnId": "Resource", "label": "Resource" }, { "columnId": "resourceGroup", "label": "Resource Group" }, { "columnId": "location", "label": "Location" }, { "columnId": "Details", "label": "Details" } ] } }, "name": "query - Certificates" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "### Delete Resource(s)\r\n\r\nTo delete resource(s), select the resource(s) from the table above and click the `⛔ Delete Selected Resource(s)` button below.", "style": "info" }, "name": "text - Delete Resource(s)" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "list", "links": [ { "id": "d5b3b979-66d5-48e8-9008-1c39ffc04e1a", "cellValue": "{resources}", "linkTarget": "ArmAction", "linkLabel": "⛔ Delete Selected Resource(s)", "preText": "", "postText": "", "style": "primary", "linkIsContextBlade": true, "armActionContext": { "path": "/{resources}", "headers": [], "params": [ { "key": "api-version", "value": "2021-04-01" } ], "isLongOperation": true, "httpMethod": "DELETE", "applyToMultipleResourcesParameter": "resources", "title": "Delete Resource(s)", "description": "# ⛔ **Attention!** ⛔\n\n## This action will permanently delete the following Certificate(s):\n\n{resources:grid}\n\n\n### Recommended steps before deletion\n\n- Review the resource(s) information thoroughly before continuing with the deletion.\n- Ensure that the resource(s) is not currently in use.\n\n\n### Required Permissions\n\n- To complete this action, you must have _Contributor_ permissions for the Resource Group(s) where the resource(s) are located.", "actionName": "Delete Resource(s)", "runLabel": "Delete Resource(s)" } } ] }, "name": "links - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "EnableDeletion", "comparison": "isEqualTo", "value": "true" }, "name": "group - Delete Resource(s)" } ] }, "conditionalVisibility": { "parameterName": "othersTab", "comparison": "isEqualTo", "value": "certificates" }, "name": "group - Others - Certificates" } ] }, "conditionalVisibility": { "parameterName": "mainTab", "comparison": "isEqualTo", "value": "others" }, "name": "group - Others" } ], "fallbackResourceIds": [ "Azure Monitor" ], "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json" }