Modules/Extras/Retirement.txt
resources
| extend ServiceID= case( type contains "microsoft.compute/virtualmachine" and (tostring(properties.hardwareProfile.vmSize) in~ ('basic_a0','basic_a1','basic_a2','basic_a3','basic_a4','standard_a0','standard_a1','standard_a2','standard_a3','standard_a4','standard_a5','standard_a6','standard_a7','standard_a9') or tostring(sku.name) in~ ('basic_a0','basic_a1','basic_a2','basic_a3','basic_a4','standard_a0','standard_a1','standard_a2','standard_a3','standard_a4','standard_a5','standard_a6','standard_a7','standard_a9')),60 ,type =~ "microsoft.web/hostingenvironments" and kind in~ ('ASEV1','ASEV2'),13 ,type =~ "microsoft.compute/virtualmachines" and isempty(properties.storageProfile.osDisk.managedDisk),84 ,type =~ "microsoft.dbforpostgresql/servers" ,86 ,type =~ "microsoft.dbformysql/servers" ,243 ,type =~ "microsoft.network/loadbalancers" and sku.name=~'Basic',94 ,type =~ "microsoft.operationsmanagement/solutions" and plan.product=~'OMSGallery/ServiceMap',213 ,type =~ 'microsoft.classicstorage/storageaccounts',7 ,type =~ 'microsoft.classiccompute/domainnames', 38 ,type =~ "microsoft.dbforpostgresql/servers" and properties.version == "11",225 ,type =~ "microsoft.logic/integrationserviceenvironments",139 ,type =~ 'microsoft.classicnetwork/virtualnetworks',88 ,type =~ "microsoft.network/applicationgateways" and properties.sku.tier in~ ('Standard','WAF'),298 ,type =~ 'microsoft.classicnetwork/reservedips',8802 ,type =~ 'microsoft.classicnetwork/networksecuritygroups',8801 ,type =~ 'Microsoft.CognitiveServices/accounts' and kind=~'QnAMaker',76 ,type contains "microsoft.compute/virtualmachine" and (tostring(properties.hardwareProfile.vmSize) in~ ('Standard_HB60rs','Standard_HB60-45rs','Standard_HB60-30rs','Standard_HB60-15rs') or tostring(sku.name) in~ ('Standard_HB60rs','Standard_HB60-45rs','Standard_HB60-30rs','Standard_HB60-15rs')) ,62 ,type contains "Microsoft.MachineLearning/",40 ,type =~ "Microsoft.Network/publicIPAddresses" and sku.name=~'Basic',220 ,type =~ 'Microsoft.CognitiveServices/accounts' and kind contains 'LUIS',160 ,type =~ "microsoft.dbforpostgresql/servers" and properties.version == "11",249 ,type contains "microsoft.media/mediaservices",394 ,type =~ "microsoft.maps/accounts" and (sku has "S1" or sku has "S0"),465 ,type =~ "microsoft.insights/webtests" and properties.Kind =~ "ping",154 ,type =~ 'microsoft.healthcareapis/services',354 ,type =~ 'microsoft.healthcareapis' and properties.authenticationConfiguration.smartProxyEnabled =~ 'true',387 ,type contains "Microsoft.DBforMariaDB",398 ,type =~ "microsoft.cache/redis" and properties['minimumTlsVersion'] in ("1.1","1.0") ,403 ,type =~ "microsoft.cognitiveservices/accounts" and kind =~ "Personalizer", 408 ,type =~ "microsoft.cognitiveservices/accounts" and kind =~ "AnomalyDetector", 405 ,type =~ "microsoft.cognitiveservices/accounts" and kind =~ "MetricsAdvisor", 407 ,type =~ "microsoft.cognitiveservices/accounts" and kind =~ "ContentModerator", 561 ,type contains "microsoft.compute/virtualmachine" and (tostring(properties.hardwareProfile.vmSize) in~ ('Standard_M192is_v2') or tostring(sku.name) in~ ('Standard_M192is_v2')) ,495 ,type contains "microsoft.compute/virtualmachine" and (tostring(properties.hardwareProfile.vmSize) in~ ('Standard_M192ims_v2') or tostring(sku.name) in~ ('Standard_M192ims_v2')) ,496 ,type contains "microsoft.compute/virtualmachine" and (tostring(properties.hardwareProfile.vmSize) in~ ('Standard_M192ids_v2') or tostring(sku.name) in~ ('Standard_M192ids_v2')) ,497 ,type contains "microsoft.compute/virtualmachine" and (tostring(properties.hardwareProfile.vmSize) in~ ('Standard_M192idms_v2') or tostring(sku.name) in~ ('Standard_M192idms_v2')) ,498 ,type contains "microsoft.storagecache/caches" ,500 ,type contains "microsoft.compute/virtualmachine" and (tostring(properties.hardwareProfile.vmSize) in~ ('Standard_NC6s_v3','Standard_NC12s_v3','Standard_NC24s_v3') or tostring(sku.name) in~ ('Standard_NC6s_v3','Standard_NC12s_v3','Standard_NC24s_v3')) ,514 ,type contains "microsoft.network/applicationgateways" and properties['sku']['tier'] in~ ("WAF_v2") and isnotnull(properties['webApplicationFirewallConfiguration']), 519 ,type contains "microsoft.dashboard/grafana" and (properties.grafanaMajorVersion == 9),554 ,type contains "HDInsight" and (strcat(split(properties.clusterVersion,'.')[0],'.',split(properties.clusterVersion,'.')[1])) in ('4.0'), 562 ,type contains "HDInsight" and (strcat(split(properties.clusterVersion,'.')[0],'.',split(properties.clusterVersion,'.')[1])) in ('5.0'), 563 ,type contains "microsoft.compute/virtualmachine" and (tostring(properties.hardwareProfile.vmSize) in~ ('Standard_NC24rs_v3') or tostring(sku.name) in~ ('Standard_NC24rs_v3')) ,582 ,type contains "Microsoft.ApiManagement/service" and tolower(properties.platformVersion) == tolower('stv1') ,204 ,type contains "microsoft.network/virtualnetworkgateways" and (tostring(properties.sku.name) in~ ('Standard') or tostring(properties.sku.name) in~ ('HighPerformance') ) and tostring(properties.gatewayType) contains ('Vpn'), 481 ,type in~ ("microsoft.labservices/labplans", "microsoft.labservices/labs","microsoft.labservices/labaccounts"), 624 ,type contains "microsoft.eventgrid/" and tostring(properties['minimumTlsVersionAllowed']) in ("1.1","1.0"), 669 ,type contains "microsoft.mixedreality/remoterenderingaccounts", 660 ,type =~ "microsoft.network/virtualnetworkgateways" and tostring(parse_json(properties)["sku"]["name"]) in ("VpnGw1","VpnGw2","VpnGw3","VpnGw4","VpnGw5") and tostring(parse_json(properties)['gatewayType']) contains "Vpn" , 611 ,type startswith "microsoft.cdn" and parse_json(sku).name =~"Standard_Microsoft", 619 ,type =~ "microsoft.appplatform/spring" and parse_json(sku).tier =~ "StandardGen2", 623 ,type contains "microsoft.documentdb/databaseaccounts" and properties['minimalTlsVersion'] in ("Tls11","Tls"), 703 ,type == "microsoft.network/applicationgateways" and (properties['sslPolicy']['minProtocolVersion'] != "TLSv1_2" and ​properties['sslPolicy']['minProtocolVersion'] != "TLSv1_3"​ and properties['sslPolicy']['policyName'] !contains "2022" and properties['sslPolicy']['policyName'] !contains "401S" and properties['defaultPredefinedSslPolicy'] !contains "2022"),714 ,type == "microsoft.servicebus/namespaces" and isnotempty(tostring(parse_json(properties).minimumTlsVersion)) and tostring(parse_json(properties).minimumTlsVersion) in ("1.0","1.1"),43502, type == 'microsoft.datalakeanalytics/accounts' and not(location in ('westcentralus','westus2','westus3')) and properties contains 'defaultDataLakeStoreAccount', 18, type contains 'Microsoft.TimeSeriesInsights',31, type =~ "microsoft.insights/workbooks" and properties.category =~ "tsg",143, type =~ "Microsoft.DataBoxEdge/dataBoxEdgeDevices" and set_has_element(todynamic(properties.configuredRoleTypes), "IOT"),153, type == "microsoft.insights/components" and isempty(properties.WorkspaceResourceId) ,181, type == "microsoft.datalakestore/accounts" and not(location in ('westcentralus','westus2')),182, type =~ "microsoft.migrate/projects",187, type =~ "microsoft.insights/alertrules",200, type contains "microsoft.media/mediaservices",394 ,-9999) | where ServiceID >0 | project ServiceID , subscriptionId, type, resourceGroup, location, id, tags = tostring(tags) | union ( resources | where (type =~ "microsoft.synapse/workspaces/bigdatapools" and todouble(properties.sparkVersion) in (2.4,3.1,3.2, 3.3)) or (type contains "microsoft.hdinsight/clusters") or (type == 'microsoft.network/loadbalancers' and sku.name =~ "Standard") | extend workspaceId = tostring(split(id,'/')[8]), sparkVersion = todouble(properties.sparkVersion) | join kind = leftouter ( Resources | where type =~ "microsoft.synapse/workspaces" and properties.adlaResourceId == "" | project workspaceId = name | distinct workspaceId ) on workspaceId | where (type =~ "microsoft.synapse/workspaces/bigdatapools" and isnotempty(workspaceId1)) or (type contains "microsoft.hdinsight/clusters") or (type == 'microsoft.network/loadbalancers' and sku.name == "Standard") | mv-expand properties.computeProfile.roles | mv-expand properties_computeProfile_roles | mv-expand inboundNatRules = todynamic(properties["inboundNatRules"]) , inboundNatPools = properties.inboundNatPools | extend vmSize = properties_computeProfile_roles.hardwareProfile.vmSize | project subscriptionId, ServiceID = case ( ['type'] =~ "microsoft.synapse/workspaces/bigdatapools" and sparkVersion == 2.4, 328, ['type'] =~ "microsoft.synapse/workspaces/bigdatapools" and sparkVersion == 3.1, 325, ['type'] =~ "microsoft.synapse/workspaces/bigdatapools" and sparkVersion == 3.2, 583, ['type'] =~ "microsoft.synapse/workspaces/bigdatapools" and sparkVersion == 3.3, 643, ['type'] =~ "microsoft.hdinsight/clusters" and vmSize in~ ("standard_a0","standard_a1","standard_a2","standard_a3","standard_a4","standard_a5","standard_a6","standard_a7"), 564, ['type'] =~ 'microsoft.network/loadbalancers' and sku.name =~ "Standard" and ((isnotempty(inboundNatRules.properties.backendIPConfiguration) and array_length(inboundNatPools) == 0) or (array_length(inboundNatPools) != 0)) , 666, -9999), id, resourceGroup, location, type, tags = tostring(tags) | where ServiceID > 0 | distinct ServiceID , subscriptionId, type, resourceGroup, location, id, tags ) |union // Query for Classic Redis caches retired ( AdvisorResources | where type =~'microsoft.advisor/recommendations' | where properties.shortDescription contains 'Cloud service caches are being retired' or properties.shortDescription contains 'Move to Azure Update Manager as Automation Update Management will be deprecated' or properties.shortDescription contains 'Upgrade NSG flow logs to VNet flow logs' | project id=tolower(tostring(properties.resourceMetadata.resourceId)) | join kind = inner ( resources | where type in~ ('microsoft.cache/redis','microsoft.automation/automationAccounts','MICROSOFT.NETWORK/NETWORKWATCHERS/FLOWLOGS') | extend ServiceID = case (type contains 'microsoft.cache/redis', 124 , type contains 'microsoft.automation/automationAccounts', 245, type contains 'MICROSOFT.NETWORK/NETWORKWATCHERS/FLOWLOGS', 524, -9999) | extend joiningId = tolower(case (type contains 'MICROSOFT.NETWORK/NETWORKWATCHERS/FLOWLOGS', tostring(properties.targetResourceId), id)) | project ServiceID, subscriptionId, location, type, id=tolower(id), tags = tostring(tags), joiningId,resourceGroup ) on $left.id == $right.joiningId | project ServiceID, subscriptionId, type, resourceGroup, location, id = id1, tags ) |