import argparse
import asyncio
import json
import os
import sys
import time
import traceback
import warnings

import aiohttp
import requests
import roadtools.roadlib.metadef.database as database
from roadtools.roadlib.metadef.database import AZroleDefinition, AZroleAssignment, \
AZsubscription, AZmanagementGroup, AZroleEligibilityScheduleInstance, AZresource, Base, \
lnk_az_roleassignment_user, lnk_az_roleassignment_eligible_user, lnk_az_roleassignment_group, \
lnk_az_roleassignment_eligible_group, lnk_az_roleassignment_serviceprincipal, lnk_az_roleassignment_eligible_serviceprincipal
from roadtools.roadlib.auth import Authentication
from sqlalchemy import bindparam, func, text
from sqlalchemy.dialects.postgresql import insert as pginsert
from sqlalchemy.orm import sessionmaker
from datetime import datetime

warnings.simplefilter('ignore')
token = None
expiretime = None
headers = {}
dburl = ''
urlcounter = 0
groupcounter = 0
totalgroups = 0
devicecounter = 0
totaldevices = 0

tokencounter = 0
tokenfilltime = time.time()

MAX_GROUPS = 3000
MAX_REQ_PER_SEC = 600.0
GATHER_RESOURCE = 'https://management.core.windows.net'

def mknext(url, prevurl):
    if url.startswith('https://'):
        # Absolute URL
        return url
    raise ValueError('Unsupported nextLink value %s, exiting', url)

async def dumphelper(url, method=requests.get):
    global urlcounter, tokencounter
    nexturl = url
    while nexturl:
        checktoken()
        try:
            urlcounter += 1
            async with method(nexturl, headers=headers) as req:
                # Hold off when rate limit is reached
                if req.status == 429:
                    if tokencounter > 0:
                        tokencounter -= 10*MAX_REQ_PER_SEC
                        print('Sleeping because of rate-limit hit')
                    continue
                if req.status != 200:
                    print('Error %d for URL %s' % (req.status, nexturl))
                    # print(await req.text())
                    # print(req.headers)
                    print('')

                await azratelimit(req.headers)
                try:
                    objects = await req.json()
                except json.decoder.JSONDecodeError:
                    # In case we break Azure
                    print(url)
                    print(req.content)
                    print('')
                    return
                try:
                    nexturl = mknext(objects['nextLink'], url)
                except KeyError:
                    nexturl = None
                try:
                    for robject in objects['value']:
                        yield robject
                except KeyError:
                    # print(objects)
                    pass
        except Exception as exc:
            print(exc)
            return

def checktoken():
    global token, expiretime
    if time.time() > expiretime - 300:
        auth = Authentication()
        try:
            auth.client_id = token['_clientId']
        except KeyError:
            auth.client_id = '04b07795-8ddb-461a-bbee-02f9e1bf7b46'
        auth.tenant = token['tenantId']
        auth.tokendata = token
        auth.resource_uri = GATHER_RESOURCE
        if 'useragent' in token:
            auth.set_user_agent(token['useragent'])
        if 'refreshToken' in token:
            print("Access token expired - fetching new token using refresh token")
            # Break out of nested client for this resource
            if '_clientId' in token and token['_clientId'] == 'c44b4083-3bb0-49c1-b47d-974e53cbdf3c' and '_nestedClientId' in token:
                del token['_nestedClientId']
            token = auth.handle_autotoken(token, resource=GATHER_RESOURCE)
            headers['Authorization'] = '%s %s' % (token['tokenType'], token['accessToken'])
            expiretime = time.time() + token['expiresIn']
            return True
        elif time.time() > expiretime:
            print('Access token is expired, but no access to refresh token! Dumping will fail')
            return False
    return True

def commit(session, dbtype, cache, ignore=False):
    global dburl
    if 'postgresql' in dburl and ignore:
        insertst = pginsert(dbtype.__table__)
        statement = insertst.on_conflict_do_nothing(
            index_elements=['objectId']
        )
    elif 'sqlite' in dburl and ignore:
        statement = dbtype.__table__.insert().prefix_with('OR IGNORE')
    else:
        statement = dbtype.__table__.insert()
    session.execute(
        statement,
        cache
    )

def commitlink(session, cachedict, ignore=False):
    global dburl
    for linktable, cache in cachedict.items():
        if 'postgresql' in dburl and ignore:
            insertst = pginsert(linktable)
            statement = insertst.on_conflict_do_nothing(
                index_elements=['objectId']
            )
        elif 'sqlite' in dburl and ignore:
            statement = linktable.insert().prefix_with('OR IGNORE')
        else:
            statement = linktable.insert()
        # print(cache)
        session.execute(
            statement,
            cache
        )


class DataDumper(object):
    def __init__(self, tenantid, api_version, ahsession=None, engine=None, session=None):
        self.api_version = api_version
        self.tenantid = tenantid
        self.session = session
        self.engine = engine
        self.ahsession = ahsession

    async def dump_subscription_roleassignments(self, subscription):
        cache = []
        rdprefix = f"/subscriptions/{subscription['subscriptionId']}/"
        raurl = f"https://management.azure.com/subscriptions/{subscription['subscriptionId']}/providers/Microsoft.Authorization/roleAssignments?api-version=2022-04-01"
        async for roleassignment in dumphelper(raurl, method=self.ahsession.get):
            roleassignment['properties']['roleDefinitionId'] = roleassignment['properties']['roleDefinitionId'].replace(rdprefix,'/')
            cache.append(az_role_assignment_from_json(roleassignment))
        commit(self.session, AZroleAssignment, cache, ignore=True)
        cache = []
        rdprefix = f"/subscriptions/{subscription['subscriptionId']}/"
        raurl = f"https://management.azure.com/subscriptions/{subscription['subscriptionId']}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances?api-version=2020-10-01"
        async for eligibleroleassignment in dumphelper(raurl, method=self.ahsession.get):
            eligibleroleassignment['properties']['roleDefinitionId'] = eligibleroleassignment['properties']['roleDefinitionId'].replace(rdprefix,'/')
            jera = az_role_eligibility_schedule_instance_from_json(eligibleroleassignment)
            cache.append(jera)

        commit(self.session, AZroleEligibilityScheduleInstance, cache, ignore=True)

    async def query_resources(self, subscriptions, query):
        payload = {
            'query': query,
            'subscriptions': subscriptions
        }
        skip_token = 'initial'
        while skip_token:
            if skip_token != 'initial':
                payload['options'] = {
                    '$skipToken': skip_token
                }
            rurl = "https://management.azure.com/providers/Microsoft.ResourceGraph/resources?api-version=2021-03-01"
            await azratelimit()
            async with self.ahsession.post(rurl, headers=headers, json=payload) as response:
                if response.status != 200:
                    await azratelimit(response.headers)
                    if response.status == 429:
                        # retry
                        continue
                    print(await response.text())
                    print(f"rsp status {response.status}")
                    return
                data = await response.json()
                skip_token = data.get('$skipToken')
                for resource in data['data']:
                    yield resource

    async def dump_resources(self, all_subscriptions):
        query = """resources|extend typeDisplayName1=case(type =~ 'microsoft.insights/components','Application Insights',type =~ 'microsoft.insights/privatelinkscopes','Azure Monitor Private Link Scope',type =~ 'microsoft.insights/webtests','Availability test',(type =~ 'microsoft.insights/workbooks') and (kind =~ 'shared'),'Azure Workbook',(type =~ 'microsoft.insights/workbooks') and (kind =~ 'dashboard'),'Dashboard',type =~ 'microsoft.insights/workbooks','Azure Workbook',type =~ 'microsoft.insights/workbooktemplates','Azure Workbook Template',type =~ 'microsoft.appplatform/spring','Azure Spring Apps',type =~ 'microsoft.cache/redis','Azure Cache for Redis',type =~ 'microsoft.cache/redisenterprise/databases','Redis Enterprise database',(type =~ 'microsoft.cache/redisenterprise') and (kind =~ 'v1'),'Redis Enterprise cluster',(type =~ 'microsoft.cache/redisenterprise') and (kind =~ 'v2'),'Azure Managed Redis (Preview)',type =~ 'microsoft.cache/redisenterprise','Redis Enterprise cluster',type =~ 'microsoft.visualstudio/account','Azure DevOps organization',type =~ 'astronomer.astro/organizations','Astro Organization',type =~ 'microsoft.confluent/organizations','Confluent organization',type =~ 'microsoft.datadog/monitors','Datadog',type =~ 'dell.storage/filesystems','Dell APEX File Storage, An Azure Native Service',type =~ 'dynatrace.observability/monitors','Dynatrace',type =~ 'microsoft.elastic/monitors','Elastic',type =~ 'informatica.datamanagement/organizations','Informatica Organization',type =~ 'microsoft.logz/monitors','Logz.io',type =~ 'microsoft.logz/monitors/accounts','Logz sub account',type =~ 'newrelic.observability/monitors','New Relic',type =~ 'microsoft.weightsandbiases/instances','Azure Native WeightsAndBiases Cloud Service',type =~ 'pinecone.vectordb/organizations','Azure Native Pinecone Cloud Service',type =~ 'mongodb.atlas/organizations','MongoDB Atlas Organization',type =~ 'lambdatest.hyperexecute/organizations','Azure Native LambdaTest Cloud Service',type =~ 'commvault.contentstore/cloudaccounts','Commvault Cloud Account',type =~ 'arizeai.observabilityeval/organizations','Azure Native Arize AI Cloud Service',type =~ 'neon.postgres/organizations','Neon Serverless Postgres Organization',type =~ 'nginx.nginxplus/nginxdeployments','NGINXaaS',type =~ 'paloaltonetworks.cloudngfw/firewalls','Cloud NGFW by Palo Alto Networks',type =~ 'paloaltonetworks.cloudngfw/globalrulestacks','Global Rulestack',type =~ 'paloaltonetworks.cloudngfw/localrulestacks','Local Rulestack for Cloud NGFW by Palo Alto Networks',type =~ 'microsoft.liftrpilot/organizations','Azure Pilot',type =~ 'purestorage.block/storagepools/avsstoragecontainers','PureStorage.Block storage pools avs storage container',type =~ 'purestorage.block/reservations','Azure Native Pure Storage Cloud Service',type =~ 'purestorage.block/storagepools','Storage pool',type =~ 'qumulo.storage/filesystems','Azure Native Qumulo Scalable File Service',type =~ 'microsoft.samplepartner/organizations','Sample Partner Resource',type =~ 'solarwinds.observability/organizations','SolarWinds Observability',type =~ 'microsoft.resourcegraph/queries','Resource Graph query',type =~ 'microsoft.portal/dashboards','Shared dashboard',type =~ 'microsoft.portal/virtual-privatedashboards','Private dashboard',type =~ 'microsoft.resources/subscriptions/resourcegroups','Resource group',type =~ 'microsoft.azureactivedirectory/guestusages','Guest Usage',type =~ 'microsoft.azureactivedirectory/ciamdirectories','External Configuration Tenant',type =~ 'microsoft.azureactivedirectory/b2cdirectories','B2C Tenant',type =~ 'microsoft.aad/domainservices','Microsoft Entra Domain Services',type =~ 'microsoft.aadiam/privatelinkforazuread','Private Link for Microsoft Entra ID',type =~ 'providers.test/statefulibizaengines','EngageHub Portal',type =~ 'microsoft.azurestackhci/edgenodepools','Azure Stack | Preview',type =~ 'microsoft.azurestackhci/galleryimages','Azure Local Gallery image',type =~ 'microsoft.azurestackhci/logicalnetworks','Azure Local Logical network',type =~ 'microsoft.azurestackhci/marketplacegalleryimages','Azure Local Marketplace Gallery image',type =~ 'microsoft.azurestackhci/networkinterfaces','Azure Local VM Network Interface',type =~ 'microsoft.azurestackhci/networksecuritygroups','Azure Local Network Security Group',type =~ 'microsoft.azurestackhci/clusters','Azure Local',type =~ 'microsoft.azurestackhci/storagecontainers','Azure Local Storage path',type =~ 'microsoft.all/hcivirtualmachines','Azure Local Virtual Machine - Azure Arc',type =~ 'microsoft.edge/disconnectedoperations','Azure Local - disconnected operations',type =~ 'private.aszlabhardware/labservers','AszLabHardware Lab Server',type =~ 'private.aszlabhardware/reservations','AszLabHardware Reservation',type =~ 'private.aszlabhardware/servers','AszLabHardware Server',type =~ 'microsoft.deviceupdate/accounts','Device Update for IoT Hub',(type =~ 'microsoft.cdn/profiles') and (kind =~ 'frontdoor'),'Front Door and CDN profile',type =~ 'microsoft.cdn/profiles','Front Door and CDN profile',type =~ 'microsoft.agfoodplatform/farmbeats','Azure Data Manager for Agriculture',type =~ 'microsoft.agricultureplatform/agriservices','Agriculture data solutions',type =~ 'microsoft.analysisservices/servers','Analysis Services',type =~ 'microsoft.fabric/capacities','Fabric Capacity',type =~ 'microsoft.network/networkmanagers/verifierworkspaces','Verifier Workspace',type =~ 'microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes/attacheddatanetworks','Attached Data Network',type =~ 'microsoft.mobilenetwork/packetcorecontrolplanes','Packet Core Control Plane',type =~ 'microsoft.mobilenetwork/mobilenetworks/datanetworks','Data Network',type =~ 'microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes','Packet Core Data Plane',type =~ 'microsoft.mobilenetwork/mobilenetworks','Mobile Network',type =~ 'microsoft.mobilenetwork/radioaccessnetworks','Radio Access Network Insights',type =~ 'microsoft.mobilenetwork/mobilenetworks/services','Service',type =~ 'microsoft.mobilenetwork/simgroups/sims','SIM',type =~ 'microsoft.mobilenetwork/simgroups','SIM Group',type =~ 'microsoft.mobilenetwork/mobilenetworks/simpolicies','SIM Policy',type =~ 'microsoft.mobilenetwork/mobilenetworks/sites','Mobile Network Site',type =~ 'microsoft.mobilenetwork/mobilenetworks/slices','Slice',type =~ 'microsoft.apicenter/services','API Center',type =~ 'microsoft.apimanagement/gateways','Gateway',type =~ 'microsoft.apimanagement/service','API Management service',type =~ 'microsoft.apicenter/services/workspaces','Workspace',type =~ 'microsoft.apimanagement/service/workspaces','Workspace',type =~ 'microsoft.solutions/applicationdefinitions','Service catalog managed application definition',type =~ 'microsoft.solutions/applications','Managed application',type =~ 'microsoft.vsonline/plans','Visual Studio Online Plan',type =~ 'microsoft.appsecurity/policies','App Protect Policy',type =~ 'microsoft.arc/allfairfax','Azure Arc enabled resource',type =~ 'microsoft.arc/all','Azure Arc enabled resource',type =~ 'microsoft.kubernetesruntime/loadbalancers','Arc Load Balancer',type =~ 'microsoft.attestation/attestationproviders','Attestation provider',type =~ 'microsoft.automanage/serviceprincipals','ServicePrincipals',type =~ 'microsoft.automation/automationaccounts','Automation Account',type =~ 'microsoft.automation/automationaccounts/modules','Module',type =~ 'microsoft.automation/automationaccounts/hybridrunbookworkergroups','Hybrid Worker Group',type =~ 'microsoft.automation/automationaccounts/runbooks','Runbook',type =~ 'microsoft.maintenance/maintenanceconfigurationsbladeresource','Maintenance configuration (preview)',type =~ 'microsoft.appconfiguration/configurationstores','App Configuration',type =~ 'microsoft.azurefleet/fleetscomputehub','Compute Fleet',type =~ 'microsoft.azurefleet/fleets','Compute Fleet',type =~ 'microsoft.batch/batchaccounts','Batch account',type =~ 'microsoft.resources/subscriptions','Subscription',(type =~ 'microsoft.botservice/botservices') and (kind =~ 'bot'),'Bot Channels Registration',(type =~ 'microsoft.botservice/botservices') and (kind =~ 'sdk'),'Web App Bot',(type =~ 'microsoft.botservice/botservices') and (kind =~ 'function'),'Functions Bot',(type =~ 'microsoft.botservice/botservices') and (kind =~ 'designer'),'Conversation Designer Bot',(type =~ 'microsoft.botservice/botservices') and (kind =~ 'azurebot'),'Azure Bot',type =~ 'microsoft.botservice/botservices','Bot Service',type =~ 'microsoft.cdn/profiles/endpoints/origins','Origin',type =~ 'microsoft.cdn/profiles/securitypolicies','Security policy',type =~ 'microsoft.cdn/profiles/secrets','Secret',type =~ 'microsoft.cdn/profiles/rulesets','Rule set',type =~ 'microsoft.cdn/profiles/rulesets/rules','Rule',type =~ 'microsoft.cdn/profiles/afdendpoints/routes','Route',type =~ 'microsoft.cdn/profiles/origingroups','Origin group',type =~ 'microsoft.cdn/profiles/origingroups/origins','Origin',type =~ 'microsoft.cdn/profiles/afdendpoints','Endpoint',type =~ 'microsoft.cdn/profiles/customdomains','Custom domain',type =~ 'microsoft.cdn/profiles/endpoints','Endpoint',type =~ 'microsoft.cdn/profiles/endpoints/customdomains','Custom domain',type =~ 'microsoft.chaos/privateaccesses','Agent Private Access',type =~ 'microsoft.chaos/experiments','Chaos Experiment',type =~ 'microsoft.classiccompute/virtualmachines','Virtual machine (classic)',type =~ 'microsoft.classicstorage/storageaccounts/vmimages','VM image (classic)',type =~ 'microsoft.classicstorage/storageaccounts/osimages','OS image (classic)',type =~ 'microsoft.classicstorage/storageaccounts/disks','Disk (classic)',type =~ 'microsoft.sovereign/transparencylogs','Transparency log',type =~ 'microsoft.sovereign/landingzoneregistrations','Landing Zone Registration',type =~ 'microsoft.sovereign/landingzoneconfigurations','Landing Zone Configuration',type =~ 'microsoft.sovereign/landingzoneaccounts/landingzoneregistrations','Landing Zone Registration',type =~ 'microsoft.sovereign/landingzoneaccounts','Landing zone accounts',type =~ 'microsoft.sovereign/landingzoneaccounts/landingzoneconfigurations','Landing Zone Configuration',type =~ 'microsoft.hardwaresecuritymodules/cloudhsmclusters','Azure Cloud HSM',type =~ 'microsoft.loadtestservice/loadtests','Azure Load Testing',type =~ 'microsoft.classiccompute/domainnames','Cloud service (classic)',type =~ 'microsoft.classiccompute/domainnames/slots/roles','Cloud service role (classic)',type =~ 'microsoft.compute/cloudservices','Cloud service (extended support)',type =~ 'microsoft.cloudtest/accounts','CloudTest Account',type =~ 'microsoft.cloudtest/buildcaches','1ES Build Cache',type =~ 'microsoft.cloudtest/hostedpools','1ES Hosted Pool',type =~ 'microsoft.cloudtest/images','1ES Image',type =~ 'microsoft.cloudtest/pools','CloudTest Pool',type =~ 'microsoft.codesigning/codesigningaccounts','Trusted Signing Account',type =~ 'microsoft.communication/communicationservices','Communication Service',type =~ 'microsoft.voiceservices/communicationsgateways/testlines','Communications Gateway Test Line',type =~ 'microsoft.voiceservices/communicationsgateways','Communications Gateway',type =~ 'microsoft.community/communitytrainings','Community Training',type =~ 'microsoft.compute/virtualmachinescalesetscomputehub','Virtual machine scale set',type =~ 'microsoft.compute/virtualmachinescalesets','Virtual machine scale set',type =~ 'microsoft.compute/virtualmachinecomputehub','Virtual machine',type =~ 'microsoft.compute/virtualmachines','Virtual machine',type =~ 'microsoft.all/virtualmachines','Virtual machine',type =~ 'microsoft.compute/sshpublickeys','SSH key',type =~ 'microsoft.compute/proximityplacementgroupscomputehub','Proximity placement group',type =~ 'microsoft.compute/proximityplacementgroups','Proximity placement group',type =~ 'microsoft.compute/virtualmachineflexinstances','Instance',type =~ 'microsoft.compute/standbypoolinstance','Standby pool',type =~ 'microsoft.compute/computefleetscalesets','Virtual machine scale set',type =~ 'microsoft.compute/computefleetinstances','Instance',type =~ 'microsoft.compute/hostgroups/hosts','Host',type =~ 'microsoft.compute/hostgroupscomputehub','Host group',type =~ 'microsoft.compute/hostgroups','Host group',type =~ 'microsoft.compute/capacityreservationgroupscomputehub','Capacity Reservation Group',type =~ 'microsoft.compute/capacityreservationgroups','Capacity Reservation Group',type =~ 'microsoft.compute/availabilitysets','Availability set',type =~ 'microsoft.computehub/windowsostype','Windows OS',type =~ 'microsoft.computehub/provisioningstatesucceededresources','Provisioning states',type =~ 'microsoft.computehub/provisioningstatefailedresources','Provisioning states',type =~ 'microsoft.computehub/powerstatestopped','Power states',type =~ 'microsoft.computehub/powerstaterunning','Power states',type =~ 'microsoft.computehub/powerstatedeallocated','Power states',type =~ 'microsoft.computehub/outages','Outages',type =~ 'microsoft.computehub/microsoftdefenderstandardsubscription','Microsoft defender',type =~ 'microsoft.computehub/microsoftdefenderfreetrialsubscription','Microsoft defender',type =~ 'microsoft.computehub/linuxostype','Linux OS',type =~ 'microsoft.computehub/healthevents','Health events',type =~ 'microsoft.computehub/computehubmain','Compute infrastructure',type =~ 'microsoft.computehub/backup','Backup job',type =~ 'microsoft.computehub/all','All resources',type =~ 'microsoft.computehub/advisorsecurity','Recommendations',type =~ 'microsoft.computehub/advisorreliability','Recommendations',type =~ 'microsoft.computehub/advisorperformance','Recommendations',type =~ 'microsoft.computehub/advisoroperationalexcellence','Recommendations',type =~ 'microsoft.computehub/advisorcost','Recommendations',type =~ 'microsoft.confidentialledger/ledgers','Confidential Ledger',type =~ 'microsoft.confidentialledger/managedccfs','Managed CCF App',type =~ 'microsoft.containerregistry/registries','Container registry',type =~ 'microsoft.containerregistry/registries/replications','Container registry replication',type =~ 'microsoft.containerregistry/registries/scopemaps','Container registry scope map',type =~ 'microsoft.containerregistry/registries/tokens','Container registry token',type =~ 'microsoft.containerregistry/registries/webhooks','Container registry webhook',type =~ 'microsoft.containerservice/managedclusters/microsoft.kubernetesconfiguration/fluxconfigurations','GitOps configuration',type =~ 'microsoft.kubernetes/connectedclusters/microsoft.kubernetesconfiguration/fluxconfigurations','GitOps configuration',type =~ 'microsoft.containerservice/managedclusters/microsoft.kubernetesconfiguration/namespaces','Kubernetes namespace',type =~ 'microsoft.kubernetes/connectedclusters/microsoft.kubernetesconfiguration/namespaces','Kubernetes - Azure Arc namespace',type =~ 'microsoft.containerinstance/containergroups','Container instances',(type =~ 'microsoft.containerservice/managedclusters') and (kind =~ 'base'),'Kubernetes service',(type =~ 'microsoft.containerservice/managedclusters') and (kind =~ 'automatic'),'Kubernetes service - Automatic (Preview)',type =~ 'microsoft.containerservice/managedclusters','Kubernetes service',type =~ 'microsoft.containerservice/managedclusters/microsoft.kubernetesconfiguration/extensions','Kubernetes service extension',type =~ 'microsoft.kubernetesconfiguration/extensions','Kubernetes service extension',type =~ 'microsoft.containerservice/fleets','Kubernetes fleet manager',type =~ 'microsoft.redhatopenshift/openshiftclusters','Azure Red Hat OpenShift cluster',type =~ 'microsoft.containerstorage/pools','Container storage',type =~ 'microsoft.portalservices/extensions/deployments','Extension Deployment',type =~ 'microsoft.portalservices/extensions','Portal Extension',type =~ 'microsoft.portalservices/extensions/slots','Extension Slot',type =~ 'microsoft.portalservices/extensions/versions','Extension Version',type =~ 'microsoft.azuredatatransfer/pipelines','Pipeline',type =~ 'microsoft.azuredatatransfer/connections/flows','Flow',type =~ 'microsoft.azuredatatransfer/connections','Connection',type =~ 'microsoft.managedservices/registrationdefinitions','Azure Lighthouse',type =~ 'microsoft.dashboard/grafana','Azure Managed Grafana',type =~ 'microsoft.databasewatcher/watchers','Database watcher',type =~ 'microsoft.databricks/accessconnectors','Access Connector for Azure Databricks',type =~ 'microsoft.databricks/workspaces','Azure Databricks Service',type =~ 'microsoft.datafactory/datafactories','Data factory',type =~ 'microsoft.datafactory/factories','Data factory (V2)',type =~ 'microsoft.datalakeanalytics/accounts','Data Lake Analytics',type =~ 'microsoft.datalakestore/accounts','Data Lake Storage Gen1',type =~ 'microsoft.dataprotection/resourceguards','Resource Guard',type =~ 'microsoft.dataprotection/backupvaults','Backup vault',type =~ 'microsoft.datashare/accounts','Data Share',type =~ 'microsoft.clusterstor/nodes','ClusterStor',type =~ 'microsoft.securitydetonation/chambers','Security Detonation Chamber',type =~ 'microsoft.devcenter/projects','Project',type =~ 'microsoft.devcenter/projects/pools','Pool',type =~ 'microsoft.devcenter/plans','Dev center plan',type =~ 'microsoft.devcenter/networkconnections','Network connection',type =~ 'microsoft.devcenter/devcenters','Dev center',type =~ 'microsoft.devcenter/devcenters/devboxdefinitions','Dev Box definition',type =~ 'microsoft.deviceregistry/schemaregistries','IoT Schema Registry',type =~ 'microsoft.deviceregistry/devices','IoT Device',type =~ 'microsoft.deviceregistry/assetendpointprofiles','IoT Asset Endpoint Profile',type =~ 'microsoft.deviceregistry/assets','IoT Asset',type =~ 'microsoft.deviceupdate/updateaccounts','Device Update Account',type =~ 'microsoft.deviceupdate/updateaccounts/updates','Device Update',type =~ 'microsoft.deviceupdate/updateaccounts/deviceclasses','Device Update Device Class',type =~ 'microsoft.deviceupdate/updateaccounts/deployments','Device Update Deployment',type =~ 'microsoft.deviceupdate/updateaccounts/agents','Device Update Agent',type =~ 'microsoft.deviceupdate/updateaccounts/activedeployments','Device Update Active Deployment',type =~ 'microsoft.devopsinfrastructure/pools','Managed DevOps Pool',type =~ 'microsoft.devtestlab/labs/virtualmachines','Virtual machine',type =~ 'microsoft.devtestlab/labs','DevTest Lab',type =~ 'microsoft.devtunnels/tunnelplans','Dev Tunnels Domain',type =~ 'microsoft.digitaltwins/digitaltwinsinstances','Azure Digital Twins',type =~ 'microsoft.compute/snapshots','Snapshot',type =~ 'microsoft.compute/galleries','Azure compute gallery',type =~ 'microsoft.compute/restorepointcollections','Restore Point Collection',type =~ 'microsoft.compute/restorepointcollections/restorepoints','Restore Point',type =~ 'microsoft.compute/galleries/images/versions','VM image version',type =~ 'microsoft.virtualmachineimages/imagetemplates','Image template',type =~ 'microsoft.compute/imagescomputehub','Image',type =~ 'microsoft.compute/images','Image',type =~ 'microsoft.compute/galleries/imagescomputehub','VM image definition',type =~ 'microsoft.compute/galleries/images','VM image definition',type =~ 'microsoft.compute/galleries/applications/versions','VM application version',type =~ 'microsoft.compute/galleries/applications','VM application definition',type =~ 'microsoft.compute/diskencryptionsets','Disk Encryption Set',type =~ 'microsoft.compute/diskaccesses','Disk Access',type =~ 'microsoft.compute/disks','Disk',type =~ 'microsoft.compute/locations/communitygalleries/imagescomputehub','Community image',type =~ 'microsoft.compute/locations/communitygalleries/images','Community image',type =~ 'microsoft.datamigration/services','Azure Database Migration Service (classic)',type =~ 'microsoft.datamigration/services/projects','Azure Database Migration Project',type =~ 'microsoft.datamigration/sqlmigrationservices','Azure Database Migration Service',type =~ 'microsoft.network/trafficmanagerprofiles','Traffic Manager profile',type =~ 'microsoft.network/dnszones','DNS zone',type =~ 'microsoft.network/dnsforwardingrulesets','DNS forwarding ruleset',type =~ 'microsoft.network/dnsresolvers','DNS private resolver',type =~ 'microsoft.network/dnsresolverdomainlists','DNS Domain List',type =~ 'microsoft.network/dnsresolverpolicies','DNS Security Policy',type =~ 'microsoft.documentdb/mongoclusters','Azure Cosmos DB for MongoDB (vCore)',(type =~ 'microsoft.dbforpostgresql/servergroupsv2') and (kind =~ 'cosmosdbforpostgresql'),'Azure Cosmos DB for PostgreSQL Cluster',type =~ 'microsoft.dbforpostgresql/servergroupsv2','Azure Cosmos DB for PostgreSQL Cluster',type =~ 'microsoft.documentdb/cassandraclusters','Azure Managed Instance for Apache Cassandra',type =~ 'microsoft.documentdb/fleets','Cosmos DB Fleet',(type =~ 'microsoft.documentdb/databaseaccounts') and (kind =~ 'mongodb'),'Azure Cosmos DB for MongoDB account (RU)',type =~ 'microsoft.documentdb/databaseaccounts','Azure Cosmos DB account',type =~ 'microsoft.easm/workspaces','Microsoft Defender EASM',type =~ 'private.easm/workspaces','Microsoft Defender EASM (Preview)',type =~ 'microsoft.impact/connectors','Impact Reporting Connector',type =~ 'microsoft.cdn/edgeactions','Edge Action',(type =~ 'microsoft.databoxedge/databoxedgedevices') and (kind =~ 'azurestackedge'),'Azure Stack Edge',(type =~ 'microsoft.databoxedge/databoxedgedevices') and (kind =~ 'azurestackhub'),'Azure Stack Edge',(type =~ 'microsoft.databoxedge/databoxedgedevices') and (kind =~ 'azuremodulardatacentre'),'Azure Stack Edge',(type =~ 'microsoft.databoxedge/databoxedgedevices') and (kind =~ 'azuredataboxgateway'),'Azure Data Box Gateway',(type =~ 'microsoft.databoxedge/databoxedgedevices') and (kind =~ 'azurestackedgegroup'),'Azure Stack Edge',type =~ 'microsoft.databoxedge/databoxedgedevices','Azure Stack Edge',type =~ 'microsoft.edgeorder/addresses','Azure Edge Hardware Center Address',type =~ 'microsoft.edgeorder/bootstrapconfigurations','Site Key',type =~ 'microsoft.edgeorder/orderitems','Azure Edge Hardware Center',type =~ 'microsoft.edgeorder/virtual_orderitems','Device',type =~ 'microsoft.elasticsan/elasticsans','Elastic SAN',type =~ 'microsoft.logic/workflows','Logic app',type =~ 'microsoft.logic/integrationserviceenvironments/managedapis','Managed Connector',type =~ 'microsoft.logic/integrationaccounts','Integration account',type =~ 'microsoft.web/connectiongateways','On-premises data gateway',type =~ 'microsoft.web/customapis','Logic apps custom connector',type =~ 'microsoft.web/connections','API Connection',type =~ 'microsoft.communication/emailservices','Email Communication Service',type =~ 'microsoft.communication/emailservices/domains','Email Communication Services Domain',type =~ 'microsoft.workloads/epicvirtualinstances','Virtual Instance for Epic solution',type =~ 'microsoft.eventgrid/namespaces/topicspaces','Event Grid Topic Space',type =~ 'microsoft.eventgrid/topics','Event Grid Topic',type =~ 'microsoft.eventgrid/systemtopics/eventsubscriptions','Event Grid Subscriptions',type =~ 'microsoft.eventgrid/systemtopics','Event Grid System Topic',type =~ 'microsoft.eventgrid/namespaces/topics/eventsubscriptions','Event Subscription',type =~ 'microsoft.eventgrid/namespaces','Event Grid Namespace',type =~ 'microsoft.eventgrid/partnertopics','Event Grid Partner Topic',type =~ 'microsoft.eventgrid/partnerregistrations','Event Grid Partner Registration',type =~ 'microsoft.eventgrid/partnernamespaces','Event Grid Partner Namespace',type =~ 'microsoft.eventgrid/partnerdestinations','Event Grid Partner Destination',type =~ 'microsoft.eventgrid/partnerconfigurations','Event Grid Partner Configuration',type =~ 'microsoft.eventgrid/namespaces/topics','Event Grid Namespace Topic',type =~ 'microsoft.eventgrid/domains/topics','Event Grid Domain Topic',type =~ 'microsoft.eventgrid/domains','Event Grid Domain',type =~ 'microsoft.eventgrid/partnernamespaces/channels','Event Grid Channel',type =~ 'microsoft.eventhub/namespaces/disasterrecoveryconfigs','Event Hubs Geo-DR Alias',type =~ 'microsoft.eventhub/namespaces/schemagroups','Schema Group',type =~ 'microsoft.eventhub/namespaces/eventhubs','Event Hubs Instance',type =~ 'microsoft.eventhub/clusters','Event Hubs Cluster',type =~ 'microsoft.eventhub/namespaces','Event Hubs Namespace',type =~ 'microsoft.experimentation/experimentworkspaces','Experiment Workspace',type =~ 'microsoft.databox/jobs','Azure Data Box',type =~ 'microsoft.fairfieldgardens/provisioningresources','Fairfield Gardens',type =~ 'microsoft.fairfieldgardens/provisioningresources/provisioningpolicies','Provisioning policy',type =~ 'microsoft.fileshares/fileshares','File share',type =~ 'microsoft.iotfirmwaredefense/workspaces','Firmware analysis workspace',type =~ 'microsoft.fluidrelay/fluidrelayservers','Fluid Relay',type =~ 'microsoft.network/frontdoors','Front Door and CDN profiles',type =~ 'microsoft.hdinsight/clusters','HDInsight cluster',type =~ 'microsoft.healthbot/healthbots','Healthcare agent service',type =~ 'microsoft.healthdataaiservices/deidservices','De-identification Service',type =~ 'microsoft.healthmodel/healthmodels','Health Model (preview)',(type =~ 'microsoft.hybridcompute/machines/microsoft.connectedvmwarevsphere/virtualmachineinstances') and (kind =~ 'avs'),'AVS virtual machine',(type =~ 'microsoft.hybridcompute/machines/microsoft.connectedvmwarevsphere/virtualmachineinstances') and (kind =~ 'vmware'),'VMware virtual machine - Azure Arc',type =~ 'microsoft.hybridcompute/machines/microsoft.connectedvmwarevsphere/virtualmachineinstances','VMware + AVS virtual machine',(type =~ 'microsoft.connectedvmwarevsphere/virtualmachines') and (kind =~ 'avs'),'AVS virtual machine',(type =~ 'microsoft.connectedvmwarevsphere/virtualmachines') and (kind =~ 'vmware'),'VMware virtual machine - Azure Arc',type =~ 'microsoft.connectedvmwarevsphere/virtualmachines','VMware + AVS virtual machine',type =~ 'microsoft.connectedvmwarevsphere/vcenters','VMware vCenter',type =~ 'microsoft.hybridcompute/machinessoftwareassurance','Machine - Azure Arc',type =~ 'microsoft.hybridcompute/machinespaygo','Machine - Azure Arc',type =~ 'microsoft.hybridcompute/licenses','Extended Security Updates - Windows Server 2012/R2',type =~ 'microsoft.hybridcompute/machinesesu','Machine - Azure Arc',type =~ 'microsoft.hybridcompute/gateways','Arc gateway',type =~ 'microsoft.scvmm/vmmservers','SCVMM management server',type =~ 'microsoft.scvmm/virtualmachines','SCVMM virtual machine - Azure Arc',type =~ 'microsoft.hybridcompute/privatelinkscopes','Azure Arc Private Link Scope',type =~ 'microsoft.hybridconnectivity/publiccloudconnectors','Multicloud connector',type =~ 'microsoft.hybridcompute/machines/microsoft.awsconnector/ec2instances','Microsoft.AwsConnector ec2 instance',type =~ 'microsoft.hybridcompute/machinessovereign','Machine - Azure Arc',(type =~ 'microsoft.hybridcompute/machines') and (kind =~ 'avs'),'Machine - Azure Arc (AVS)',(type =~ 'microsoft.hybridcompute/machines') and (kind =~ 'vmware'),'Machine - Azure Arc (VMware)',(type =~ 'microsoft.hybridcompute/machines') and (kind =~ 'scvmm'),'Machine - Azure Arc (SCVMM)',(type =~ 'microsoft.hybridcompute/machines') and (kind =~ 'hci'),'Machine - Azure Arc (Azure Local)',type =~ 'microsoft.hybridcompute/machines','Machine - Azure Arc',type =~ 'microsoft.hybridcompute/arcserverwithwac','Machine - Azure Arc',type =~ 'microsoft.extendedlocation/customlocations','Custom location',type =~ 'microsoft.azurestackhci/virtualmachines','Azure Local virtual machine - Azure Arc',type =~ 'microsoft.all/arcvirtualmachines','Azure Arc virtual machine',type =~ 'microsoft.arc/kubernetesresources','Azure Arc Kubernetes cluster',type =~ 'microsoft.hybridcontainerservice/provisionedclusters','Kubernetes hybrid - Azure Arc',type =~ 'microsoft.kubernetes/connectedclusters/microsoft.kubernetesconfiguration/extensions','Kubernetes - Azure Arc extension',(type =~ 'microsoft.kubernetes/connectedclusters') and (kind =~ 'provisionedcluster'),'Kubernetes - Azure Arc',type =~ 'microsoft.kubernetes/connectedclusters','Kubernetes - Azure Arc',type =~ 'microsoft.resourceconnector/appliances','Resource bridge',type =~ 'microsoft.azurearcdata/datacontrollers','Azure Arc data controller',type =~ 'microsoft.azurearcdata/postgresinstances','PostgreSQL server – Azure Arc',type =~ 'microsoft.azurearcdata/mysqlserver','MySql Server - Azure Arc',type =~ 'microsoft.azurearcdata/postgressqlserver','PostgresSql Server - Azure Arc',type =~ 'microsoft.azurearcdata/sqlmanagedinstances','SQL managed instance - Azure Arc',type =~ 'microsoft.azurearcdata/sqlserveresulicenses','SQL Server ESU license',type =~ 'microsoft.azurearcdata/sqlserverinstances','SQL Server - Azure Arc',type =~ 'microsoft.azurearcdata/sqlserverinstances/databases','SQL Server database - Azure Arc',type =~ 'microsoft.azurearcdata/sqlserverlicenses','SQL Server License',type =~ 'microsoft.network/vpngateways','VPN Gateway (Site to Site)',type =~ 'microsoft.network/networkvirtualappliances','Microsoft.Network network virtual appliance',type =~ 'microsoft.network/virtualwans','Virtual WAN',(type =~ 'microsoft.network/virtualhubs') and (kind =~ 'routeserver'),'Route Server',type =~ 'microsoft.network/virtualhubs','Microsoft.Network/virtualHub',type =~ 'microsoft.network/virtualnetworkgateways','Virtual network gateway',type =~ 'microsoft.network/routefilters','Route filter',type =~ 'microsoft.network/p2svpngateways','VPN Gateway (Point to Site)',type =~ 'microsoft.networkfunction/meshvpns','Mesh VPN',type =~ 'microsoft.network/localnetworkgateways','Local network gateway',type =~ 'microsoft.network/ipgroups','IP Group',type =~ 'microsoft.network/firewallpolicies','Firewall Policy',type =~ 'microsoft.networkfunction/azuretrafficcollectors','ExpressRoute traffic collector',type =~ 'microsoft.network/expressroutegateways/expressrouteconnections','Microsoft.Network express route gateways express route connection',type =~ 'microsoft.network/expressroutegateways','ExpressRoute Gateway',type =~ 'microsoft.network/expressrouteports','ExpressRoute Direct',type =~ 'microsoft.network/expressroutecircuits','ExpressRoute circuit',type =~ 'microsoft.network/connections','Connection',type =~ 'microsoft.network/azurefirewalls','Firewall',type =~ 'microsoft.network/bastionhosts','Bastion',type =~ 'microsoft.network/applicationgateways','Application gateway',type =~ 'microsoft.servicenetworking/trafficcontrollers','Application Gateway for Containers',type =~ 'microsoft.devhub/iacprofiles','Infrastructure as Code Automation',type =~ 'microsoft.iotcentral/iotapps','IoT Central Application',type =~ 'microsoft.devices/iothubs','IoT Hub',type =~ 'microsoft.devices/provisioningservices','Azure IoT Hub Device Provisioning Service (DPS)',type =~ 'microsoft.iotoperations/instances','Azure IoT Operations',type =~ 'microsoft.network/networkmanagers/ipampools','IP address pool',type =~ 'microsoft.storagesync/storagesyncservices','Storage Sync Service',type =~ 'microsoft.keyvault/vaults','Key vault',type =~ 'microsoft.synapse/workspaces/kustopools/databases','Data Explorer Database',type =~ 'microsoft.synapse/workspaces/kustopools','Data Explorer pool (preview)',type =~ 'microsoft.kusto/clusters/databases','Azure Data Explorer Database',type =~ 'microsoft.kusto/clusters','Azure Data Explorer Cluster',type =~ 'microsoft.maps/accounts','Azure Maps Account',type =~ 'microsoft.maps/accounts/creators','Azure Maps Creator Resource',type =~ 'microsoft.maintenance/maintenanceconfigurations','Maintenance Configuration',type =~ 'microsoft.keyvault/managedhsms','Azure Key Vault Managed HSM',type =~ 'microsoft.labservices/labaccounts/labs','Lab',type =~ 'microsoft.labservices/labplans','Lab plan',type =~ 'microsoft.labservices/labaccounts','Lab account',type =~ 'microsoft.labservices/labs','Lab',type =~ 'microsoft.network/networkmanagers/routingconfigurations','Network manager',type =~ 'microsoft.network/networkmanagers/securityuserconfigurations','Network manager',type =~ 'microsoft.network/networkmanagers/securityadminconfigurations','Network manager',type =~ 'microsoft.network/networkmanagers/networkgroups','Network manager',type =~ 'microsoft.network/networkmanagers/connectivityconfigurations','Network manager',type =~ 'microsoft.network/networkmanagers','Network manager',type =~ 'microsoft.managedidentity/userassignedidentities','Managed Identity',type =~ 'microsoft.saas/resources','SaaS',type =~ 'microsoft.saas/applications','Software as a Service (classic)',type =~ 'microsoft.saas/saasresources','SaaS (classic)',type =~ 'microsoft.gallery/myareas/galleryitems','Template',type =~ 'microsoft.professionalservice/resources','Professional Service',type =~ 'microsoft.migrate/projects','Migration project',(type =~ 'microsoft.machinelearningservices/workspaces') and (kind =~ 'default'),'Azure Machine Learning workspace',(type =~ 'microsoft.machinelearningservices/workspaces') and (kind =~ 'featurestore'),'Azure Machine Learning feature store',(type =~ 'microsoft.machinelearningservices/workspaces') and (kind =~ 'hub'),'Azure AI hub',(type =~ 'microsoft.machinelearningservices/workspaces') and (kind =~ 'project'),'Azure AI project',(type =~ 'microsoft.machinelearningservices/workspaces') and (kind =~ 'lean'),'Azure AI project',type =~ 'microsoft.machinelearningservices/workspaces','Azure Machine Learning workspace',type =~ 'microsoft.machinelearningservices/aistudio','Azure AI Foundry',type =~ 'microsoft.machinelearningservices/registries','Azure Machine Learning registry',type =~ 'microsoft.machinelearningservices/workspaces/onlineendpoints','Machine learning online endpoint',type =~ 'microsoft.machinelearningservices/workspaces/onlineendpoints/deployments','Machine learning online deployment',type =~ 'microsoft.dashboard/dashboards','Azure Monitor Dashboard',type =~ 'private.monitorgrafana/dashboards','Azure Monitor Dashboard (PrivateRP)',type =~ 'microsoft.monitor/pipelinegroups','Azure Monitor pipeline (preview)',type =~ 'microsoft.eventhub/namespaces/providers/diagnosticsettings','Diagnostic settings',type =~ 'microsoft.insights/diagnosticsettings','Diagnostic settings',type =~ 'microsoft.insights/datacollectionendpoints','Data collection endpoint',type =~ 'microsoft.insights/datacollectionrules','Data collection rule',type =~ 'microsoft.monitor/accounts','Azure Monitor workspace',type =~ 'microsoft.alertsmanagement/prometheusrulegroups','Prometheus rule group',type =~ 'microsoft.alertsmanagement/smartdetectoralertrules','Smart detector alert rule',type =~ 'microsoft.insights/metricalerts','Metric alert rule',type =~ 'microsoft.insights/scheduledqueryrules','Log search alert rule',type =~ 'microsoft.alertsmanagement/actionrules','Alert processing rule',type =~ 'microsoft.insights/activitylogalerts','Activity log alert rule',type =~ 'microsoft.insights/actiongroups','Action group',type =~ 'microsoft.netapp/netappaccounts/capacitypools/volumes/volumequotarules','User and group quota',type =~ 'microsoft.netapp/netappaccounts/volumegroups','VolumeGroup',type =~ 'microsoft.netapp/netappaccounts/capacitypools/volumes','Volume',type =~ 'microsoft.netapp/netappaccounts/snapshotpolicies','Snapshot policy',type =~ 'microsoft.netapp/netappaccounts/capacitypools/volumes/snapshots','Snapshot',type =~ 'microsoft.netapp/netappaccounts/capacitypools','Capacity pool',type =~ 'microsoft.netapp/netappaccounts/backupvaults','Backup vault',type =~ 'microsoft.netapp/netappaccounts/backuppolicies','Backup Policy',type =~ 'microsoft.netapp/netappaccounts','NetApp account',type =~ 'microsoft.network/frontdoorwebapplicationfirewallpolicies','Front Door WAF policy',type =~ 'microsoft.cdn/cdnwebapplicationfirewallpolicies','Content Delivery Network WAF policy',type =~ 'microsoft.network/applicationgatewaywebapplicationfirewallpolicies','Application Gateway WAF policy',type =~ 'microsoft.network/virtualnetworktaps','Virtual network terminal access point',type =~ 'microsoft.network/virtualnetworks','Virtual network',(type =~ 'microsoft.network/serviceendpointpolicies') and (kind =~ 'internal'),'Service endpoint policy',type =~ 'microsoft.network/serviceendpointpolicies','Service endpoint policy',type =~ 'microsoft.network/routetables','Route table',type =~ 'microsoft.authorization/resourcemanagementprivatelinks','Resource management private link',type =~ 'microsoft.classicnetwork/reservedips','Reserved IP address (classic)',type =~ 'microsoft.network/publicipprefixes','Public IP Prefix',type =~ 'microsoft.network/publicipaddresses','Public IP address',type =~ 'microsoft.network/privatelinkservices','Private link service',type =~ 'microsoft.management/managementgroups/providers/privatelinkassociations','Application Gateway',type =~ 'microsoft.network/privateendpoints','Private endpoint',type =~ 'microsoft.network/networkwatchers/flowlogs','Flow log',type =~ 'microsoft.network/networkwatchers','Network Watcher',type =~ 'microsoft.network/networksecuritygroups','Network security group',(type =~ 'microsoft.network/networkinterfaces') and (kind =~ 'regular'),'Network Interface',(type =~ 'microsoft.network/networkinterfaces') and (kind =~ 'elastic'),'Elastic Network Interface',(type =~ 'microsoft.network/networkinterfaces') and (kind =~ 'parent'),'Parent Network Interface',type =~ 'microsoft.network/networkinterfaces','Network interface',type =~ 'microsoft.network/natgateways','NAT gateway',type =~ 'microsoft.network/loadbalancers','Load balancer',type =~ 'microsoft.connectedvmwarevsphere/virtualmachines/providers/guestconfigurationassignments','Guest Assignment',type =~ 'microsoft.compute/virtualmachinescalesets/providers/guestconfigurationassignments','Guest Assignment',type =~ 'microsoft.hybridcompute/machines/providers/guestconfigurationassignments','Guest Assignment',type =~ 'microsoft.compute/virtualmachines/providers/guestconfigurationassignments','Guest Assignment',type =~ 'microsoft.network/ddosprotectionplans','DDoS protection plan',type =~ 'microsoft.network/customipprefixes','Custom IP Prefix',type =~ 'microsoft.classicnetwork/virtualnetworks','Virtual network (classic)',type =~ 'microsoft.classicnetwork/networksecuritygroups','Network security group (classic)',type =~ 'microsoft.network/applicationsecuritygroups','Application security group',type =~ 'microsoft.managednetworkfabric/routepolicies','Route Policy (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/networktaprules','Network Tap Rule (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/networktaps','Network Tap (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/networkracks','Network Rack (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/networkpacketbrokers','Network Packet Broker (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/networkdevices/networkinterfaces','Network Interface (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/networkfabriccontrollers','Network Fabric Controller (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/networkfabrics','Network Fabric (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/networkdevices','Network Device (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/neighborgroups','Neighbor Group (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/networkfabrics/networktonetworkinterconnects','Network to Network Interconnect (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/l3isolationdomains','Layer 3 Isolation Domain (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/l2isolationdomains','Layer 2 Isolation Domain (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/ipprefixes','IP Prefix (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/ipextendedcommunities','IP Extended Community (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/ipcommunities','IP Community (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/internetgatewayrules','Internet Gateway Rule (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/internetgateways','Internet Gateway (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/l3isolationdomains/internalnetworks','Internal Network (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/l3isolationdomains/externalnetworks','External Network (Operator Nexus)',type =~ 'microsoft.managednetworkfabric/accesscontrollists','Access Control List (Operator Nexus)',type =~ 'microsoft.networkcloud/volumes','Volume (Operator Nexus)',type =~ 'microsoft.networkcloud/virtualmachines/consoles','Virtual Machine Console (Operator Nexus)',type =~ 'microsoft.networkcloud/virtualmachines','Virtual Machine (Operator Nexus)',type =~ 'microsoft.networkcloud/trunkednetworks','Trunked Network (Operator Nexus)',type =~ 'microsoft.networkcloud/storageappliances','Storage Appliance (Operator Nexus)',type =~ 'microsoft.networkcloud/kubernetesclusters/features','Kubernetes Cluster Feature (Operator Nexus)',type =~ 'microsoft.networkcloud/kubernetesclusters','Kubernetes Cluster (Operator Nexus)',type =~ 'microsoft.networkcloud/l3networks','Layer 3 Network (Operator Nexus)',type =~ 'microsoft.networkcloud/l2networks','Layer 2 Network (Operator Nexus)',type =~ 'microsoft.networkcloud/racks','Compute Rack (Operator Nexus)',type =~ 'microsoft.networkcloud/clusters/metricsconfigurations','Cluster Metrics Configuration (Operator Nexus)',type =~ 'microsoft.networkcloud/clustermanagers','Cluster Manager (Operator Nexus)',type =~ 'microsoft.networkcloud/clusters/baremetalmachinekeysets','Cluster Bare Metal Machine Key Set (Operator Nexus)',type =~ 'microsoft.networkcloud/clusters/bmckeysets','Cluster Baseboard Management Controller Key Set (Operator Nexus)',type =~ 'microsoft.networkcloud/clusters','Cluster (Operator Nexus)',type =~ 'microsoft.networkcloud/cloudservicesnetworks','Cloud Services Network (Operator Nexus)',type =~ 'microsoft.networkcloud/baremetalmachines','Bare Metal Machine (Operator Nexus)',type =~ 'microsoft.networkcloud/kubernetesclusters/agentpools','Agent Pool (Operator Nexus)',type =~ 'microsoft.network/networksecurityperimeters','Network Security Perimeter',type =~ 'microsoft.network/networksecurityperimeters/profiles','Network Security Perimeter Profile',type =~ 'microsoft.notificationhubs/namespaces','Notification Hub Namespace',type =~ 'microsoft.notificationhubs/namespaces/notificationhubs','Notification Hub',type =~ 'microsoft.resources/resourcegraphvisualizer','Resource Graph Visualizer',type =~ 'microsoft.resources/resourcechange','Change Analysis (preview)',type =~ 'microsoft.onlineexperimentation/workspaces','Online Experimentation Workspace',type =~ 'microsoft.openenergyplatform/energyservices','Azure Data Manager for Energy',type =~ 'microsoft.scom/managedinstances','SCOM managed instance',type =~ 'microsoft.orbital/l2connections','L2 Connection',type =~ 'microsoft.orbital/groundstations','Ground Station',type =~ 'microsoft.orbital/geocatalogs','GeoCatalog',type =~ 'microsoft.orbital/edgesites','Edge Site',type =~ 'microsoft.dbforpostgresql/flexibleservers','Azure Database for PostgreSQL flexible server',type =~ 'microsoft.dbformysql/flexibleservers','Azure Database for MySQL flexible server',type =~ 'microsoft.durabletask/schedulers/taskhubs','Task Hub',type =~ 'microsoft.integrationspaces/spaces','Integration Environment',type =~ 'microsoft.durabletask/schedulers','Durable Task Scheduler',type =~ 'microsoft.logic/businessprocesses','Business Process',type =~ 'microsoft.app/spaces','App Space',type =~ 'microsoft.peering/peerings','Peering',type =~ 'microsoft.peering/peeringservices','Peering Service',type =~ 'microsoft.peering/peeringservices/prefixes','Peering Service Prefix',type =~ 'microsoft.peering/peerings/registeredasns','Registered ASN',type =~ 'microsoft.peering/peerings/registeredprefixes','Registered prefix',type =~ 'microsoft.azureplaywrightservice/accounts','Playwright Testing',type =~ 'microsoft.portalservices/dashboards','Shared dashboard (preview)',type =~ 'microsoft.powerbidedicated/capacities','Power BI Embedded',type =~ 'private.aiforscience/catalogs','Catalog',type =~ 'microsoft.network/privatednszones','Private DNS zone',type =~ 'microsoft.programmableconnectivity/operatorapiplans','APC Operator API Plan',type =~ 'microsoft.programmableconnectivity/operatorapiconnections','APC Operator API Connection',type =~ 'microsoft.programmableconnectivity/gateways','APC Gateway',type =~ 'microsoft.purview/accounts','Microsoft Purview account',type =~ 'microsoft.cognitiveservices/browseaiservices','Azure AI services',type =~ 'microsoft.cognitiveservices/browseallinone','Azure AI services multi-service account',type =~ 'microsoft.cognitiveservices/browseallservices','All Resources',type =~ 'microsoft.cognitiveservices/browseanomalydetector','Anomaly detector',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'todofix'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'anomalydetector'),'Anomaly detector',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'bing.autosuggest'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'bing.autosuggest.v7'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'bing.customsearch'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'bing.customvisualsearch'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'bing.entitysearch'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'bing.search'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'bing.search.v7'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'bing.speech'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'bing.spellcheck'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'bing.spellcheck.v7'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'cognitiveservices'),'Azure AI services multi-service account',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'computervision'),'Computer vision',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'contentmoderator'),'Content moderator',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'contentsafety'),'Content safety',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'customvision.prediction'),'Custom vision',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'customvision.training'),'Custom vision',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'emotion'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'face'),'Face API',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'formrecognizer'),'Document intelligence',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'immersivereader'),'Immersive reader',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'healthdecisionsupport'),'Health decision support',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'inkrecognizer'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'luis'),'Language understanding',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'luis.authoring'),'Language understanding',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'metricsadvisor'),'Metrics advisor',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'openai'),'Azure OpenAI',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'personalizer'),'Personalizer',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'qnamaker'),'QnA maker',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'speakerrecognition'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'speechservices'),'Speech service',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'speechtranslation'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'textanalytics'),'Language',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'texttranslation'),'Translator',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'videointelligence'),'Azure AI services',(type =~ 'microsoft.cognitiveservices/accounts') and (kind =~ 'aiservices'),'Azure AI services',type =~ 'microsoft.cognitiveservices/accounts','Azure AI services',type =~ 'microsoft.cognitiveservices/browsecomputervision','Computer vision',type =~ 'microsoft.cognitiveservices/browsecontentmoderator','Content moderator',type =~ 'microsoft.cognitiveservices/browsecontentsafety','Content safety',type =~ 'microsoft.cognitiveservices/browsecustomvision','Custom vision',type =~ 'microsoft.cognitiveservices/browseface','Face API',type =~ 'microsoft.cognitiveservices/browseformrecognizer','Document intelligence',type =~ 'microsoft.cognitiveservices/browsehealthdecisionsupport','Health decision support',type =~ 'microsoft.cognitiveservices/browsehealthinsights','Health Insights',type =~ 'microsoft.cognitiveservices/browseimmersivereader','Immersive reader',type =~ 'microsoft.cognitiveservices/browseluis','Language understanding',type =~ 'microsoft.cognitiveservices/browsemetricsadvisor','Metrics advisor',type =~ 'microsoft.cognitiveservices/browseopenai','Azure OpenAI',type =~ 'microsoft.cognitiveservices/browsepersonalizer','Personalizer',type =~ 'microsoft.cognitiveservices/browseqnamaker','QnA maker',type =~ 'microsoft.cognitiveservices/browsespeechservices','Speech service',type =~ 'microsoft.cognitiveservices/browsetextanalytics','Language',type =~ 'microsoft.cognitiveservices/browsetexttranslation','Translator',type =~ 'microsoft.sustainabilityservices/calculations','Project Sustainability Calculator (Preview)',type =~ 'microsoft.quantum/workspaces','Quantum Workspace',type =~ 'microsoft.recommendationsservice/accounts','Intelligent Recommendations Account',type =~ 'microsoft.recommendationsservice/accounts/modeling','Modeling',type =~ 'microsoft.recommendationsservice/accounts/serviceendpoints','Service Endpoint',type =~ 'microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers/protecteditems','Backup Item',type =~ 'microsoft.recoveryservicesintd2/vaults','Recovery Services INTD2',type =~ 'microsoft.recoveryservicesintd/vaults','Recovery Services INTD',type =~ 'microsoft.recoveryservicesbvtd2/vaults','Recovery Services BVTD2',type =~ 'microsoft.recoveryservicesbvtd/vaults','Recovery Services BVTD',type =~ 'microsoft.recoveryservices/vaults','Recovery Services vault',type =~ 'microsoft.relay/namespaces/wcfrelays','WCF Relay',type =~ 'microsoft.relay/namespaces','Relay',type =~ 'microsoft.relay/namespaces/hybridconnections','Hybrid Connection',type =~ 'microsoft.billing/billingaccounts/incentiveschedules','Incentive Schedule',type =~ 'microsoft.billingbenefits/incentiveschedules','Incentive Schedule',type =~ 'microsoft.capacity/reservationorders/reservations','Reservation',type =~ 'microsoft.billing/billingaccounts/savingsplanorders/savingsplans','Savings plan',type =~ 'microsoft.billingbenefits/savingsplanorders/savingsplans','Savings plan',type =~ 'microsoft.billingbenefits/maccs','Microsoft Azure Consumption Commitment',type =~ 'microsoft.billing/billingaccounts/incentiveschedules/milestones','Milestone',type =~ 'microsoft.billingbenefits/incentiveschedules/milestones','Milestone',type =~ 'microsoft.capacity/reservationorders','Reservation order',type =~ 'microsoft.billing/billingaccounts/savingsplanorders','Savings plan order',type =~ 'microsoft.billingbenefits/savingsplanorders','Savings plan order',type =~ 'microsoft.relationships/servicegroupmember','Service group member relationship',type =~ 'microsoft.relationships/dependencyof','Dependency Relationship',type =~ 'microsoft.resources/virtualsubscriptionsforresourcepicker','Subscription',type =~ 'microsoft.resources/resourcechanges','Resource change',type =~ 'microsoft.resources/deletedresources','Recycle Bin',type =~ 'microsoft.management/managementgroups/microsoft.resources/deploymentstacks','Deployment stack',type =~ 'microsoft.resources/deploymentstacks','Deployment stack',type =~ 'microsoft.deploymentmanager/rollouts','Rollout',type =~ 'microsoft.features/featureprovidernamespaces/featureconfigurations','Preview features',type =~ 'microsoft.saashub/cloudservices/hidden','Microsoft SaaS (Preview)',type =~ 'microsoft.azurelargeinstance/azurelargeinstances','Azure Large Instance',type =~ 'microsoft.baremetalinfrastructure/baremetalinstances','BareMetal Instance',type =~ 'microsoft.hanaonazure/hanainstances','SAP HANA on Azure',type =~ 'microsoft.workloads/sapvirtualinstances/applicationinstances','App server instance for SAP solutions',type =~ 'microsoft.workloads/sapvirtualinstances/centralinstances','Central service instance for SAP solutions',type =~ 'microsoft.workloads/sapvirtualinstances/databaseinstances','Database for SAP solutions',type =~ 'microsoft.workloads/sapvirtualinstances','Virtual Instance for SAP solutions',type =~ 'microsoft.search/searchservices','Search service',type =~ 'microsoft.security/locations/alerts','Security Alert',type =~ 'microsoft.securityinsightsarg/sentinel','Microsoft Sentinel',type =~ 'microsoft.servicebus/namespaces/topics','Service Bus Topic',type =~ 'microsoft.servicebus/namespaces/topics/subscriptions','Service Bus Subscription',type =~ 'microsoft.servicebus/namespaces/queues','Service Bus Queue',type =~ 'microsoft.servicebus/namespaces/disasterrecoveryconfigs','Service Bus Geo-DR Alias',type =~ 'microsoft.servicebus/namespaces','Service Bus Namespace',type =~ 'microsoft.servicefabric/clusters','Service Fabric cluster',type =~ 'microsoft.servicefabric/managedclusters','Service Fabric managed cluster',type =~ 'microsoft.providerhub/providerregistrations','Resource Provider as a Service',type =~ 'microsoft.providerhub/providerregistrations/resourcetyperegistrations','Resource Type',type =~ 'microsoft.providerhub/providerregistrations/resourcetyperegistrations/resourcetyperegistrations','Resource Type',type =~ 'microsoft.providerhub/providerregistrations/customrollouts','Rollout',type =~ 'microsoft.providerhub/providerregistrations/defaultrollouts','Rollout',type =~ 'microsoft.signalrservice/webpubsub/replicas','Web PubSub Service Replica',(type =~ 'microsoft.signalrservice/webpubsub') and (kind =~ 'webpubsub'),'Web PubSub Service',(type =~ 'microsoft.signalrservice/webpubsub') and (kind =~ 'socketio'),'Web PubSub for Socket.IO',type =~ 'microsoft.signalrservice/webpubsub','Web PubSub Service',type =~ 'microsoft.signalrservice/signalr/replicas','SignalR Replica',\"\")|extend typeDisplayName2=case(type =~ 'microsoft.signalrservice/signalr','SignalR',type =~ 'microsoft.edge/configurations','Site configuration',type =~ 'microsoft.edge/sites','Site manager - Azure Arc',type =~ 'microsoft.azuresphere/catalogs','Azure Sphere Catalog',type =~ 'microsoft.storage/storageaccounts','Storage account',type =~ 'microsoft.classicstorage/storageaccounts','Storage account (classic)',type =~ 'microsoft.storagecache/caches','HPC cache',type =~ 'microsoft.storagecache/amlfilesystems','Azure Managed Lustre',type =~ 'microsoft.storagediscovery/storagediscoveryworkspaces','Storage Discovery workspace',type =~ 'microsoft.storagemover/storagemovers','Storage mover',type =~ 'microsoft.storageactions/storagetasks','Storage task - Azure Storage Actions',type =~ 'microsoft.streamanalytics/clusters','Stream Analytics cluster',type =~ 'microsoft.streamanalytics/streamingjobs','Stream Analytics job',type =~ 'microsoft.support/supporttickets','Support Request',type =~ 'microsoft.synapse/privatelinkhubs','Synapse private link hub',type =~ 'microsoft.synapse/workspaces/scopepools','SCOPE pool',type =~ 'microsoft.synapse/workspaces/bigdatapools','Apache Spark pool',(type =~ 'microsoft.synapse/workspaces/sqlpools') and (kind =~ 'v3'),'Dedicated SQL pool',type =~ 'microsoft.synapse/workspaces/sqlpools','Dedicated SQL pool',type =~ 'microsoft.synapse/workspaces','Synapse workspace',type =~ 'microsoft.resources/builtintemplatespecs','Built-in template spec',type =~ 'microsoft.resources/templatespecs','Template spec',type =~ 'microsoft.management/managementgroups/providers/templatespecs','Template spec',type =~ 'microsoft.resources/deploymentscripts','Deployment Script',type =~ 'microsoft.usagebilling/accounts/pipelines/outputselectors','Microsoft.UsageBilling accounts pipelines output selector',type =~ 'microsoft.usagebilling/accounts/pipelines','Microsoft.UsageBilling accounts pipeline',type =~ 'microsoft.usagebilling/accounts/pav2outputs','Microsoft.UsageBilling accounts pav2output',type =~ 'microsoft.usagebilling/accounts/metricexports','Microsoft.UsageBilling accounts metric export',type =~ 'microsoft.usagebilling/accounts/inputs','Microsoft.UsageBilling accounts input',type =~ 'microsoft.usagebilling/accounts/dataexports','Microsoft.UsageBilling accounts data export',type =~ 'microsoft.usagebilling/accounts','Microsoft.UsageBilling account',type =~ 'microsoft.mission/virtualenclaves/workloads','Workload',type =~ 'microsoft.mission/virtualenclaves','Enclave',type =~ 'microsoft.mission/communities/transithubs','Transit hub',type =~ 'microsoft.mission/virtualenclaves/enclaveendpoints','Enclave endpoint',type =~ 'microsoft.mission/enclaveconnections','Enclave connection',type =~ 'microsoft.mission/communities/communityendpoints','Community endpoint',type =~ 'microsoft.mission/communities','Community',type =~ 'microsoft.mission/catalogs','Catalog',type =~ 'microsoft.mission/approvals','Approval',type =~ 'microsoft.hybridnetwork/networkfunctions','Azure Network Function Manager – Network Function',type =~ 'microsoft.hybridnetwork/vendors','Azure Network Function Manager – vendor',type =~ 'microsoft.hybridnetwork/devices','Azure Network Function Manager – Device',type =~ 'microsoft.hybridnetwork/sitenetworkservices','Site Network Service',type =~ 'microsoft.hybridnetwork/sites','Site',type =~ 'microsoft.hybridnetwork/publishers','Publisher',type =~ 'microsoft.hybridnetwork/publishers/artifactstores','Publisher Artifact Store',type =~ 'microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests','Publisher Artifact Manifest',type =~ 'microsoft.hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions','Network Service Design Version',type =~ 'microsoft.hybridnetwork/publishers/networkservicedesigngroups','Network Service Design',type =~ 'microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions','Network Function Definition Version',type =~ 'microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups','Network Function Definition',type =~ 'microsoft.hybridnetwork/publishers/configurationgroupschemas','Configuration Group Schema',type =~ 'microsoft.hybridnetwork/configurationgroupvalues','Configuration Group Value',type =~ 'private.edgeinternal/winfields','Winfield | Preview',type =~ 'microsoft.workloads/insights','Microsoft.Workloads insight',type =~ 'microsoft.hanaonazure/sapmonitors','Azure Monitor for SAP Solutions (classic)',type =~ 'microsoft.workloads/monitors','Azure Monitor for SAP solutions',type =~ 'microsoft.desktopvirtualization/workspaces','Workspace',type =~ 'microsoft.desktopvirtualization/scalingplans','Scaling plan',type =~ 'microsoft.desktopvirtualization/hostpools','Host pool',(type =~ 'microsoft.desktopvirtualization/applicationgroups') and (kind =~ 'desktop'),'Application group',(type =~ 'microsoft.desktopvirtualization/applicationgroups') and (kind =~ 'railapplications'),'Application group',type =~ 'microsoft.desktopvirtualization/applicationgroups','Application group',type =~ 'microsoft.desktopvirtualization/appattachpackages','App attach package',type =~ 'microsoft.zerotrustsegmentation/segmentationmanagers','Segmentation Manager',(type =~ 'microsoft.bing/accounts') and (kind =~ 'bing.autosuggest.v7'),'Bing Resource',(type =~ 'microsoft.bing/accounts') and (kind =~ 'bing.customsearch'),'Bing Resource',(type =~ 'microsoft.bing/accounts') and (kind =~ 'bing.entitysearch'),'Bing Resource',(type =~ 'microsoft.bing/accounts') and (kind =~ 'bing.search.v7'),'Bing Resource',(type =~ 'microsoft.bing/accounts') and (kind =~ 'bing.spellcheck.v7'),'Bing Resource',(type =~ 'microsoft.bing/accounts') and (kind =~ 'bing.grounding'),'Bing Resource',(type =~ 'microsoft.bing/accounts') and (kind =~ 'bing.groundingcustomsearch'),'Bing Resource',type =~ 'microsoft.bing/accounts','Bing Resource',type =~ 'microsoft.cloudhealth/healthmodels','Health Model',type =~ 'microsoft.mixedreality/remoterenderingaccounts','Remote Rendering Account',type =~ 'microsoft.connectedcache/enterprisemcccustomers','Connected Cache for Enterprise & Education',type =~ 'microsoft.connectedcache/enterprisemcccustomers/enterprisemcccachenodes','MCC CacheNode for Enterprise',type =~ 'microsoft.connectedcache/ispcustomers','Connected Cache for ISP',type =~ 'microsoft.healthcareapis/workspaces/fhirservices','FHIR service',type =~ 'microsoft.healthcareapis/workspaces/iotconnectors','MedTech service',type =~ 'microsoft.test/healthdataaiservices','Azure Health Data and AI Services',type =~ 'microsoft.healthcareapis/workspaces','Health Data Services workspace',type =~ 'microsoft.healthcareapis/services','Azure API for FHIR',type =~ 'microsoft.healthcareapis/workspaces/dicomservices','DICOM service',type =~ 'microsoft.manufacturingplatform/manufacturingdataservices','Factory Operations Agent in Azure AI Foundry',type =~ 'microsoft.operationalinsights/clusters','Log Analytics dedicated cluster',type =~ 'microsoft.operationsmanagement/solutions','Solution',type =~ 'microsoft.operationalinsights/workspaces','Log Analytics workspace',type =~ 'microsoft.operationalinsights/querypacks','Log Analytics query pack',type =~ 'microsoft.securitycopilot/capacities','Microsoft Security Copilot compute capacity',type =~ 'microsoft.serviceshub/connectors','Services Hub Connector',type =~ 'microsoft.videoindexer/accounts','Azure AI Video Indexer',type =~ 'oracle.database/exadbvmclusters','Oracle Exascale VM Cluster',type =~ 'oracle.database/exascaledbstoragevaults','Oracle Exascale DB Storage Vault',type =~ 'oracle.database/cloudvmclusters','Oracle Exadata VM Cluster',type =~ 'oracle.database/cloudexadatainfrastructures','Oracle Exadata Infrastructure',type =~ 'oracle.database/oraclesubscriptions','OracleSubscription',type =~ 'oracle.database/autonomousdatabases','Autonomous Database',type =~ 'microsoft.azurescan/scanningaccounts','ESRP Scan',type =~ 'microsoft.sql/virtualclusters','Virtual cluster',type =~ 'microsoft.sqlvirtualmachine/sqlvirtualmachines','SQL virtual machine',(type =~ 'microsoft.sql/servers') and (kind =~ 'v12.0,analytics'),'SQL server',type =~ 'microsoft.sql/servers','SQL server',type =~ 'microsoft.dbforpostgresql/servers','Azure Database for PostgreSQL single server',type =~ 'microsoft.dbformysql/servers','Azure Database for MySQL single server',type =~ 'microsoft.dbformariadb/servers','Azure Database for MariaDB server',type =~ 'microsoft.sql/managedinstances','SQL managed instance',type =~ 'microsoft.sql/managedinstances/databases','Managed database',type =~ 'microsoft.sql/instancepools','Instance pool',type =~ 'microsoft.databasefleetmanager/fleets/tiers','tier',type =~ 'microsoft.databasefleetmanager/fleets/fleetspaces','Fleetspaces',type =~ 'microsoft.databasefleetmanager/fleets/fleetspaces/databases','Fleet managed database',type =~ 'microsoft.databasefleetmanager/fleets','Database fleet manager',type =~ 'microsoft.sql/servers/elasticpools','SQL elastic pool',type =~ 'microsoft.sql/servers/jobagents','Elastic Job agent',(type =~ 'microsoft.sql/servers/databases') and (kind =~ 'system'),'SQL database',(type =~ 'microsoft.sql/servers/databases') and (kind =~ 'v2.0,system'),'SQL database',(type =~ 'microsoft.sql/servers/databases') and (kind =~ 'v12.0,system'),'SQL database',(type =~ 'microsoft.sql/servers/databases') and (kind =~ 'v12.0,system,serverless'),'SQL database',(type =~ 'microsoft.sql/servers/databases') and (kind =~ 'v2.0,user'),'SQL database',(type =~ 'microsoft.sql/servers/databases') and (kind =~ 'v12.0,user'),'SQL database',(type =~ 'microsoft.sql/servers/databases') and (kind =~ 'v12.0,user,vcore'),'SQL database',(type =~ 'microsoft.sql/servers/databases') and (kind =~ 'v12.0,user,vcore,hyperscale'),'Azure SQL Database Hyperscale',(type =~ 'microsoft.sql/servers/databases') and (kind =~ 'v12.0,user,vcore,serverless'),'SQL database',(type =~ 'microsoft.sql/servers/databases') and (kind =~ 'v12.0,user,stretch'),'SQL Server stretch database',(type =~ 'microsoft.sql/servers/databases') and (kind =~ 'v12.0,user,datawarehouse'),'Dedicated SQL pool (formerly SQL DW)',(type =~ 'microsoft.sql/servers/databases') and (kind =~ 'v12.0,user,datawarehouse,gen2'),'Dedicated SQL pool (formerly SQL DW)',(type =~ 'microsoft.sql/servers/databases') and (kind =~ 'v12.0,user,datawarehouse,gen2,analytics'),'SQL database',type =~ 'microsoft.sql/servers/databases','SQL database',type =~ 'microsoft.sql/azuresql','Azure SQL resource',type =~ 'microsoft.avs/privateclouds','Azure VMware Solution private cloud',type =~ 'wandisco.fusion/migrators/datatransferagents','Data Transfer Agent',type =~ 'wandisco.fusion/migrators/exclusiontemplates','Exclusion',type =~ 'wandisco.fusion/migrators/livedatamigrations','Migration',type =~ 'wandisco.fusion/migrators/metadatamigrations','Metadata Migration',type =~ 'wandisco.fusion/migrators/metadatatargets','Metadata Target',type =~ 'wandisco.fusion/migrators/verifications','Verification',type =~ 'wandisco.fusion/migrators','LiveData Migrator',type =~ 'wandisco.fusion/migrators/pathmappings','Path Mapping',type =~ 'wandisco.fusion/migrators/targets','Target',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'functionapp'),'Function App',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'functionapp,linux'),'Function App',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'functionapp,linux,container'),'Function App',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'functionapp,linux,container,kubernetes'),'Function App',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'functionapp,linux,kubernetes'),'Function App',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'functionapp,kubernetes'),'Function App',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'functionapp,linux,container,azurecontainerapps'),'Function App',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'functionapp,workflowapp'),'Logic App (Standard)',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'functionapp,linux,workflowapp'),'Logic App (Standard)',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'functionapp,linux,container,workflowapp'),'Logic App (Standard)',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'functionapp,linux,container,workflowapp,kubernetes'),'Logic App (Standard)',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'functionapp,linux,workflowapp,kubernetes'),'Logic App (Standard)',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'functionapp,workflowapp,kubernetes'),'Logic App (Standard)',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'functionapp,container,workflowapp,kubernetes'),'Logic App (Standard)',(type =~ 'microsoft.web/sites/slots') and (kind =~ 'workflowapp,functionapp,linux,container,azurecontainerapps'),'Logic App (Standard)',type =~ 'microsoft.web/sites/slots','App Service (Slot)',(type =~ 'microsoft.web/sites') and (kind =~ 'default'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'mobileapp'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'mobileapp,entitlement'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'webjob'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'app'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'app,linux'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'app,linux,container'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'app,container,windows'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'api'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'api,linux'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'linux,api'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'api,linux,container'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'api,linux,container,kubernetes'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'api,linux,kubernetes'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'api,kubernetes'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'apiapp'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'api,entitlement'),'App Service',(type =~ 'microsoft.web/sites') and (kind =~ 'functionapp'),'Function App',(type =~ 'microsoft.web/sites') and (kind =~ 'functionapp,linux'),'Function App',(type =~ 'microsoft.web/sites') and (kind =~ 'functionapp,linux,container'),'Function App',(type =~ 'microsoft.web/sites') and (kind =~ 'functionapp,linux,container,kubernetes'),'Function App',(type =~ 'microsoft.web/sites') and (kind =~ 'functionapp,linux,kubernetes'),'Function App',(type =~ 'microsoft.web/sites') and (kind =~ 'functionapp,kubernetes'),'Function App',(type =~ 'microsoft.web/sites') and (kind =~ 'functionapp,linux,container,azurecontainerapps'),'Function App',(type =~ 'microsoft.web/sites') and (kind =~ 'functionapp,workflowapp'),'Logic App (Standard)',(type =~ 'microsoft.web/sites') and (kind =~ 'functionapp,linux,workflowapp'),'Logic App (Standard)',(type =~ 'microsoft.web/sites') and (kind =~ 'functionapp,linux,container,workflowapp'),'Logic App (Standard)',(type =~ 'microsoft.web/sites') and (kind =~ 'functionapp,linux,container,workflowapp,kubernetes'),'Logic App (Standard)',(type =~ 'microsoft.web/sites') and (kind =~ 'functionapp,linux,workflowapp,kubernetes'),'Logic App (Standard)',(type =~ 'microsoft.web/sites') and (kind =~ 'functionapp,workflowapp,kubernetes'),'Logic App (Standard)',(type =~ 'microsoft.web/sites') and (kind =~ 'functionapp,container,workflowapp,kubernetes'),'Logic App (Standard)',(type =~ 'microsoft.web/sites') and (kind =~ 'workflowapp,functionapp,linux,container,azurecontainerapps'),'Logic App (Standard)',type =~ 'microsoft.web/sites','App Service',(type =~ 'microsoft.web/serverfarms') and (kind =~ 'app,linux'),'App Service plan',(type =~ 'microsoft.web/serverfarms') and (kind =~ 'app,linux,container'),'App Service plan',(type =~ 'microsoft.web/serverfarms') and (kind =~ 'functionapp,linux'),'App Service plan',(type =~ 'microsoft.web/serverfarms') and (kind =~ 'functionapp,linux,container'),'App Service plan',(type =~ 'microsoft.web/serverfarms') and (kind =~ 'linux'),'App Service plan',(type =~ 'microsoft.web/serverfarms') and (kind =~ 'functionapp'),'App Service plan',(type =~ 'microsoft.web/serverfarms') and (kind =~ 'xenon'),'App Service plan',(type =~ 'microsoft.web/serverfarms') and (kind =~ 'windows'),'App Service plan',(type =~ 'microsoft.web/serverfarms') and (kind =~ 'elastic'),'App Service plan',(type =~ 'microsoft.web/serverfarms') and (kind =~ 'elastic,linux'),'App Service plan',type =~ 'microsoft.web/serverfarms','App Service plan',type =~ 'microsoft.web/staticsites','Static Web App',type =~ 'microsoft.certificateregistration/certificateorders','App Service Certificate',type =~ 'microsoft.app/sessionpools','Container App Session Pool',type =~ 'microsoft.app/jobs','Container App Job',type =~ 'microsoft.app/managedenvironments','Container Apps Environment',type =~ 'microsoft.app/connectedenvironments','Container Apps Connected Environment',(type =~ 'microsoft.app/containerapps') and (kind =~ 'default'),'Container App',(type =~ 'microsoft.app/containerapps') and (kind =~ 'workflowapp'),'Logic App (Hybrid)',type =~ 'microsoft.app/containerapps','Container App',(type =~ 'microsoft.web/kubeenvironments') and (kind =~ 'default'),'App Service Kubernetes Environment',(type =~ 'microsoft.web/kubeenvironments') and (kind =~ 'containerenvironment'),'Container Apps Environment',type =~ 'microsoft.web/kubeenvironments','App Service Kubernetes Environment',type =~ 'microsoft.web/hostingenvironments','App Service Environment',type =~ 'microsoft.domainregistration/domains','App Service Domain',\"\")|extend typeDisplayName=coalesce(typeDisplayName1,typeDisplayName2,type)|extend locationDisplayName=case(location =~ 'eastus','East US',location =~ 'southcentralus','South Central US',location =~ 'westus2','West US 2',location =~ 'westus3','West US 3',location =~ 'australiaeast','Australia East',location =~ 'southeastasia','Southeast Asia',location =~ 'northeurope','North Europe',location =~ 'swedencentral','Sweden Central',location =~ 'uksouth','UK South',location =~ 'westeurope','West Europe',location =~ 'centralus','Central US',location =~ 'southafricanorth','South Africa North',location =~ 'centralindia','Central India',location =~ 'eastasia','East Asia',location =~ 'indonesiacentral','Indonesia Central',location =~ 'japaneast','Japan East',location =~ 'japanwest','Japan West',location =~ 'koreacentral','Korea Central',location =~ 'newzealandnorth','New Zealand North',location =~ 'canadacentral','Canada Central',location =~ 'francecentral','France Central',location =~ 'germanywestcentral','Germany West Central',location =~ 'italynorth','Italy North',location =~ 'norwayeast','Norway East',location =~ 'polandcentral','Poland Central',location =~ 'spaincentral','Spain Central',location =~ 'switzerlandnorth','Switzerland North',location =~ 'mexicocentral','Mexico Central',location =~ 'uaenorth','UAE North',location =~ 'brazilsouth','Brazil South',location =~ 'israelcentral','Israel Central',location =~ 'qatarcentral','Qatar Central',location =~ 'centralusstage','Central US (Stage)',location =~ 'eastusstage','East US (Stage)',location =~ 'eastus2stage','East US 2 (Stage)',location =~ 'northcentralusstage','North Central US (Stage)',location =~ 'southcentralusstage','South Central US (Stage)',location =~ 'westusstage','West US (Stage)',location =~ 'westus2stage','West US 2 (Stage)',location =~ 'asia','Asia',location =~ 'asiapacific','Asia Pacific',location =~ 'australia','Australia',location =~ 'brazil','Brazil',location =~ 'canada','Canada',location =~ 'europe','Europe',location =~ 'france','France',location =~ 'germany','Germany',location =~ 'global','Global',location =~ 'india','India',location =~ 'israel','Israel',location =~ 'italy','Italy',location =~ 'japan','Japan',location =~ 'korea','Korea',location =~ 'newzealand','New Zealand',location =~ 'norway','Norway',location =~ 'poland','Poland',location =~ 'qatar','Qatar',location =~ 'singapore','Singapore',location =~ 'southafrica','South Africa',location =~ 'sweden','Sweden',location =~ 'switzerland','Switzerland',location =~ 'uae','United Arab Emirates',location =~ 'uk','United Kingdom',location =~ 'unitedstates','United States',location =~ 'unitedstateseuap','United States EUAP',location =~ 'eastasiastage','East Asia (Stage)',location =~ 'southeastasiastage','Southeast Asia (Stage)',location =~ 'brazilus','Brazil US',location =~ 'eastus2','East US 2',location =~ 'northcentralus','North Central US',location =~ 'westus','West US',location =~ 'jioindiawest','Jio India West',location =~ 'westcentralus','West Central US',location =~ 'southafricawest','South Africa West',location =~ 'australiacentral','Australia Central',location =~ 'australiacentral2','Australia Central 2',location =~ 'australiasoutheast','Australia Southeast',location =~ 'jioindiacentral','Jio India Central',location =~ 'koreasouth','Korea South',location =~ 'southindia','South India',location =~ 'westindia','West India',location =~ 'canadaeast','Canada East',location =~ 'francesouth','France South',location =~ 'germanynorth','Germany North',location =~ 'norwaywest','Norway West',location =~ 'switzerlandwest','Switzerland West',location =~ 'ukwest','UK West',location =~ 'uaecentral','UAE Central',location =~ 'brazilsoutheast','Brazil Southeast',location)|extend subscriptionDisplayName=case(subscriptionId =~ 'b966765e-7da0-4371-b9d1-bfea70472e0c','OS Resource subscription',subscriptionId)|where ((type in~ ('microsoft.insights/components','microsoft.insights/privatelinkscopes','microsoft.insights/webtests','microsoft.insights/workbooks','microsoft.insights/workbooktemplates','microsoft.appplatform/spring','microsoft.cache/redis','microsoft.cache/redisenterprise/databases','microsoft.cache/redisenterprise','microsoft.visualstudio/account','astronomer.astro/organizations','microsoft.confluent/organizations','microsoft.datadog/monitors','dell.storage/filesystems','dynatrace.observability/monitors','microsoft.elastic/monitors','informatica.datamanagement/organizations','microsoft.logz/monitors','microsoft.logz/monitors/accounts','newrelic.observability/monitors','microsoft.weightsandbiases/instances','pinecone.vectordb/organizations','mongodb.atlas/organizations','lambdatest.hyperexecute/organizations','commvault.contentstore/cloudaccounts','arizeai.observabilityeval/organizations','neon.postgres/organizations','nginx.nginxplus/nginxdeployments','paloaltonetworks.cloudngfw/firewalls','paloaltonetworks.cloudngfw/globalrulestacks','paloaltonetworks.cloudngfw/localrulestacks','microsoft.liftrpilot/organizations','purestorage.block/storagepools/avsstoragecontainers','purestorage.block/reservations','purestorage.block/storagepools','qumulo.storage/filesystems','microsoft.samplepartner/organizations','solarwinds.observability/organizations','microsoft.resourcegraph/queries','microsoft.portal/dashboards','microsoft.portal/virtual-privatedashboards','microsoft.resources/subscriptions/resourcegroups','microsoft.azureactivedirectory/guestusages','microsoft.azureactivedirectory/ciamdirectories','microsoft.azureactivedirectory/b2cdirectories','microsoft.aad/domainservices','microsoft.aadiam/privatelinkforazuread','providers.test/statefulibizaengines','microsoft.azurestackhci/edgenodepools','microsoft.azurestackhci/galleryimages','microsoft.azurestackhci/logicalnetworks','microsoft.azurestackhci/marketplacegalleryimages','microsoft.azurestackhci/networkinterfaces','microsoft.azurestackhci/networksecuritygroups','microsoft.azurestackhci/clusters','microsoft.azurestackhci/storagecontainers','microsoft.all/hcivirtualmachines','microsoft.edge/disconnectedoperations','private.aszlabhardware/labservers','private.aszlabhardware/reservations','private.aszlabhardware/servers','microsoft.deviceupdate/accounts','microsoft.cdn/profiles','microsoft.agfoodplatform/farmbeats','microsoft.agricultureplatform/agriservices','microsoft.analysisservices/servers','microsoft.fabric/capacities','microsoft.network/networkmanagers/verifierworkspaces','microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes/attacheddatanetworks','microsoft.mobilenetwork/packetcorecontrolplanes','microsoft.mobilenetwork/mobilenetworks/datanetworks','microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes','microsoft.mobilenetwork/mobilenetworks','microsoft.mobilenetwork/radioaccessnetworks','microsoft.mobilenetwork/mobilenetworks/services','microsoft.mobilenetwork/simgroups/sims','microsoft.mobilenetwork/simgroups','microsoft.mobilenetwork/mobilenetworks/simpolicies','microsoft.mobilenetwork/mobilenetworks/sites','microsoft.mobilenetwork/mobilenetworks/slices','microsoft.apicenter/services','microsoft.apimanagement/gateways','microsoft.apimanagement/service','microsoft.apicenter/services/workspaces','microsoft.apimanagement/service/workspaces','microsoft.solutions/applicationdefinitions','microsoft.solutions/applications','microsoft.vsonline/plans','microsoft.appsecurity/policies','microsoft.arc/allfairfax','microsoft.arc/all','microsoft.kubernetesruntime/loadbalancers','microsoft.attestation/attestationproviders','microsoft.automanage/serviceprincipals','microsoft.automation/automationaccounts','microsoft.automation/automationaccounts/modules','microsoft.automation/automationaccounts/hybridrunbookworkergroups','microsoft.automation/automationaccounts/runbooks','microsoft.maintenance/maintenanceconfigurationsbladeresource','microsoft.appconfiguration/configurationstores','microsoft.azurefleet/fleetscomputehub','microsoft.azurefleet/fleets','microsoft.batch/batchaccounts','microsoft.resources/subscriptions','microsoft.botservice/botservices','microsoft.cdn/profiles/endpoints/origins','microsoft.cdn/profiles/securitypolicies','microsoft.cdn/profiles/secrets','microsoft.cdn/profiles/rulesets','microsoft.cdn/profiles/rulesets/rules','microsoft.cdn/profiles/afdendpoints/routes','microsoft.cdn/profiles/origingroups','microsoft.cdn/profiles/origingroups/origins','microsoft.cdn/profiles/afdendpoints','microsoft.cdn/profiles/customdomains','microsoft.cdn/profiles/endpoints','microsoft.cdn/profiles/endpoints/customdomains','microsoft.chaos/privateaccesses','microsoft.chaos/experiments','microsoft.classiccompute/virtualmachines','microsoft.classicstorage/storageaccounts/vmimages','microsoft.classicstorage/storageaccounts/osimages','microsoft.classicstorage/storageaccounts/disks','microsoft.sovereign/transparencylogs','microsoft.sovereign/landingzoneregistrations','microsoft.sovereign/landingzoneconfigurations','microsoft.sovereign/landingzoneaccounts/landingzoneregistrations','microsoft.sovereign/landingzoneaccounts','microsoft.sovereign/landingzoneaccounts/landingzoneconfigurations','microsoft.hardwaresecuritymodules/cloudhsmclusters','microsoft.loadtestservice/loadtests','microsoft.classiccompute/domainnames','microsoft.classiccompute/domainnames/slots/roles','microsoft.compute/cloudservices','microsoft.cloudtest/accounts','microsoft.cloudtest/buildcaches','microsoft.cloudtest/hostedpools','microsoft.cloudtest/images','microsoft.cloudtest/pools','microsoft.codesigning/codesigningaccounts','microsoft.communication/communicationservices','microsoft.voiceservices/communicationsgateways/testlines','microsoft.voiceservices/communicationsgateways','microsoft.community/communitytrainings','microsoft.compute/virtualmachinescalesetscomputehub','microsoft.compute/virtualmachinescalesets','microsoft.compute/virtualmachinecomputehub','microsoft.compute/virtualmachines','microsoft.all/virtualmachines','microsoft.compute/sshpublickeys','microsoft.compute/proximityplacementgroupscomputehub','microsoft.compute/proximityplacementgroups','microsoft.compute/virtualmachineflexinstances','microsoft.compute/standbypoolinstance','microsoft.compute/computefleetscalesets','microsoft.compute/computefleetinstances','microsoft.compute/hostgroups/hosts','microsoft.compute/hostgroupscomputehub','microsoft.compute/hostgroups','microsoft.compute/capacityreservationgroupscomputehub','microsoft.compute/capacityreservationgroups','microsoft.compute/availabilitysets','microsoft.computehub/windowsostype','microsoft.computehub/provisioningstatesucceededresources','microsoft.computehub/provisioningstatefailedresources','microsoft.computehub/powerstatestopped','microsoft.computehub/powerstaterunning','microsoft.computehub/powerstatedeallocated','microsoft.computehub/outages','microsoft.computehub/microsoftdefenderstandardsubscription','microsoft.computehub/microsoftdefenderfreetrialsubscription','microsoft.computehub/linuxostype','microsoft.computehub/healthevents','microsoft.computehub/computehubmain','microsoft.computehub/backup','microsoft.computehub/all','microsoft.computehub/advisorsecurity','microsoft.computehub/advisorreliability','microsoft.computehub/advisorperformance','microsoft.computehub/advisoroperationalexcellence','microsoft.computehub/advisorcost','microsoft.confidentialledger/ledgers','microsoft.confidentialledger/managedccfs','microsoft.containerregistry/registries','microsoft.containerregistry/registries/replications','microsoft.containerregistry/registries/scopemaps','microsoft.containerregistry/registries/tokens','microsoft.containerregistry/registries/webhooks','microsoft.containerservice/managedclusters/microsoft.kubernetesconfiguration/fluxconfigurations','microsoft.kubernetes/connectedclusters/microsoft.kubernetesconfiguration/fluxconfigurations','microsoft.containerservice/managedclusters/microsoft.kubernetesconfiguration/namespaces','microsoft.kubernetes/connectedclusters/microsoft.kubernetesconfiguration/namespaces','microsoft.containerinstance/containergroups','microsoft.containerservice/managedclusters','microsoft.containerservice/managedclusters/microsoft.kubernetesconfiguration/extensions','microsoft.kubernetesconfiguration/extensions','microsoft.containerservice/fleets','microsoft.redhatopenshift/openshiftclusters','microsoft.containerstorage/pools','microsoft.portalservices/extensions/deployments','microsoft.portalservices/extensions','microsoft.portalservices/extensions/slots','microsoft.portalservices/extensions/versions','microsoft.azuredatatransfer/pipelines','microsoft.azuredatatransfer/connections/flows','microsoft.azuredatatransfer/connections','microsoft.managedservices/registrationdefinitions','microsoft.dashboard/grafana','microsoft.databasewatcher/watchers','microsoft.databricks/accessconnectors','microsoft.databricks/workspaces','microsoft.datafactory/datafactories','microsoft.datafactory/factories','microsoft.datalakeanalytics/accounts','microsoft.datalakestore/accounts','microsoft.dataprotection/resourceguards','microsoft.dataprotection/backupvaults','microsoft.datashare/accounts','microsoft.clusterstor/nodes','microsoft.securitydetonation/chambers','microsoft.devcenter/projects','microsoft.devcenter/projects/pools','microsoft.devcenter/plans','microsoft.devcenter/networkconnections','microsoft.devcenter/devcenters','microsoft.devcenter/devcenters/devboxdefinitions','microsoft.deviceregistry/schemaregistries','microsoft.deviceregistry/devices','microsoft.deviceregistry/assetendpointprofiles','microsoft.deviceregistry/assets','microsoft.deviceupdate/updateaccounts','microsoft.deviceupdate/updateaccounts/updates','microsoft.deviceupdate/updateaccounts/deviceclasses','microsoft.deviceupdate/updateaccounts/deployments','microsoft.deviceupdate/updateaccounts/agents','microsoft.deviceupdate/updateaccounts/activedeployments','microsoft.devopsinfrastructure/pools','microsoft.devtestlab/labs/virtualmachines','microsoft.devtestlab/labs','microsoft.devtunnels/tunnelplans','microsoft.digitaltwins/digitaltwinsinstances','microsoft.compute/snapshots','microsoft.compute/galleries','microsoft.compute/restorepointcollections','microsoft.compute/restorepointcollections/restorepoints','microsoft.compute/galleries/images/versions','microsoft.virtualmachineimages/imagetemplates','microsoft.compute/imagescomputehub','microsoft.compute/images','microsoft.compute/galleries/imagescomputehub','microsoft.compute/galleries/images','microsoft.compute/galleries/applications/versions','microsoft.compute/galleries/applications','microsoft.compute/diskencryptionsets','microsoft.compute/diskaccesses','microsoft.compute/disks','microsoft.compute/locations/communitygalleries/imagescomputehub','microsoft.compute/locations/communitygalleries/images','microsoft.datamigration/services','microsoft.datamigration/services/projects','microsoft.datamigration/sqlmigrationservices','microsoft.network/trafficmanagerprofiles','microsoft.network/dnszones','microsoft.network/dnsforwardingrulesets','microsoft.network/dnsresolvers','microsoft.network/dnsresolverdomainlists','microsoft.network/dnsresolverpolicies','microsoft.documentdb/mongoclusters','microsoft.dbforpostgresql/servergroupsv2','microsoft.documentdb/cassandraclusters','microsoft.documentdb/fleets','microsoft.documentdb/databaseaccounts','microsoft.easm/workspaces','private.easm/workspaces','microsoft.impact/connectors','microsoft.cdn/edgeactions','microsoft.databoxedge/databoxedgedevices','microsoft.edgeorder/addresses','microsoft.edgeorder/bootstrapconfigurations','microsoft.edgeorder/orderitems','microsoft.edgeorder/virtual_orderitems','microsoft.elasticsan/elasticsans','microsoft.logic/workflows','microsoft.logic/integrationserviceenvironments/managedapis','microsoft.logic/integrationaccounts','microsoft.web/connectiongateways','microsoft.web/customapis','microsoft.web/connections','microsoft.communication/emailservices','microsoft.communication/emailservices/domains','microsoft.workloads/epicvirtualinstances','microsoft.eventgrid/namespaces/topicspaces','microsoft.eventgrid/topics','microsoft.eventgrid/systemtopics/eventsubscriptions','microsoft.eventgrid/systemtopics','microsoft.eventgrid/namespaces/topics/eventsubscriptions','microsoft.eventgrid/namespaces','microsoft.eventgrid/partnertopics','microsoft.eventgrid/partnerregistrations','microsoft.eventgrid/partnernamespaces','microsoft.eventgrid/partnerdestinations','microsoft.eventgrid/partnerconfigurations','microsoft.eventgrid/namespaces/topics','microsoft.eventgrid/domains/topics','microsoft.eventgrid/domains','microsoft.eventgrid/partnernamespaces/channels','microsoft.eventhub/namespaces/disasterrecoveryconfigs','microsoft.eventhub/namespaces/schemagroups','microsoft.eventhub/namespaces/eventhubs','microsoft.eventhub/clusters','microsoft.eventhub/namespaces','microsoft.experimentation/experimentworkspaces','microsoft.databox/jobs','microsoft.fairfieldgardens/provisioningresources','microsoft.fairfieldgardens/provisioningresources/provisioningpolicies','microsoft.fileshares/fileshares','microsoft.iotfirmwaredefense/workspaces','microsoft.fluidrelay/fluidrelayservers','microsoft.network/frontdoors','microsoft.hdinsight/clusters','microsoft.healthbot/healthbots','microsoft.healthdataaiservices/deidservices','microsoft.healthmodel/healthmodels','microsoft.hybridcompute/machines/microsoft.connectedvmwarevsphere/virtualmachineinstances','microsoft.connectedvmwarevsphere/virtualmachines','microsoft.connectedvmwarevsphere/vcenters','microsoft.hybridcompute/machinessoftwareassurance','microsoft.hybridcompute/machinespaygo','microsoft.hybridcompute/licenses','microsoft.hybridcompute/machinesesu','microsoft.hybridcompute/gateways','microsoft.scvmm/vmmservers','microsoft.scvmm/virtualmachines','microsoft.hybridcompute/privatelinkscopes','microsoft.hybridconnectivity/publiccloudconnectors','microsoft.hybridcompute/machines/microsoft.awsconnector/ec2instances','microsoft.hybridcompute/machinessovereign','microsoft.hybridcompute/machines','microsoft.hybridcompute/arcserverwithwac','microsoft.extendedlocation/customlocations','microsoft.azurestackhci/virtualmachines','microsoft.all/arcvirtualmachines','microsoft.arc/kubernetesresources','microsoft.hybridcontainerservice/provisionedclusters','microsoft.kubernetes/connectedclusters/microsoft.kubernetesconfiguration/extensions','microsoft.kubernetes/connectedclusters','microsoft.resourceconnector/appliances','microsoft.azurearcdata/datacontrollers','microsoft.azurearcdata/postgresinstances','microsoft.azurearcdata/mysqlserver','microsoft.azurearcdata/postgressqlserver','microsoft.azurearcdata/sqlmanagedinstances','microsoft.azurearcdata/sqlserveresulicenses','microsoft.azurearcdata/sqlserverinstances','microsoft.azurearcdata/sqlserverinstances/databases','microsoft.azurearcdata/sqlserverlicenses','microsoft.network/vpngateways','microsoft.network/networkvirtualappliances','microsoft.network/virtualwans','microsoft.network/virtualhubs','microsoft.network/virtualnetworkgateways','microsoft.network/routefilters','microsoft.network/p2svpngateways','microsoft.networkfunction/meshvpns','microsoft.network/localnetworkgateways','microsoft.network/ipgroups','microsoft.network/firewallpolicies','microsoft.networkfunction/azuretrafficcollectors','microsoft.network/expressroutegateways/expressrouteconnections','microsoft.network/expressroutegateways','microsoft.network/expressrouteports','microsoft.network/expressroutecircuits','microsoft.network/connections','microsoft.network/azurefirewalls','microsoft.network/bastionhosts','microsoft.network/applicationgateways','microsoft.servicenetworking/trafficcontrollers','microsoft.devhub/iacprofiles','microsoft.iotcentral/iotapps','microsoft.devices/iothubs','microsoft.devices/provisioningservices','microsoft.iotoperations/instances','microsoft.network/networkmanagers/ipampools','microsoft.storagesync/storagesyncservices','microsoft.keyvault/vaults','microsoft.synapse/workspaces/kustopools/databases','microsoft.synapse/workspaces/kustopools','microsoft.kusto/clusters/databases','microsoft.kusto/clusters','microsoft.maps/accounts','microsoft.maps/accounts/creators','microsoft.maintenance/maintenanceconfigurations','microsoft.keyvault/managedhsms','microsoft.labservices/labaccounts/labs','microsoft.labservices/labplans','microsoft.labservices/labaccounts','microsoft.labservices/labs','microsoft.network/networkmanagers/routingconfigurations','microsoft.network/networkmanagers/securityuserconfigurations','microsoft.network/networkmanagers/securityadminconfigurations','microsoft.network/networkmanagers/networkgroups','microsoft.network/networkmanagers/connectivityconfigurations','microsoft.network/networkmanagers','microsoft.managedidentity/userassignedidentities','microsoft.saas/resources','microsoft.saas/applications','microsoft.saas/saasresources','microsoft.gallery/myareas/galleryitems','microsoft.professionalservice/resources','microsoft.migrate/projects','microsoft.machinelearningservices/workspaces','microsoft.machinelearningservices/aistudio','microsoft.machinelearningservices/registries','microsoft.machinelearningservices/workspaces/onlineendpoints','microsoft.machinelearningservices/workspaces/onlineendpoints/deployments','microsoft.dashboard/dashboards','private.monitorgrafana/dashboards','microsoft.monitor/pipelinegroups','microsoft.eventhub/namespaces/providers/diagnosticsettings','microsoft.insights/diagnosticsettings','microsoft.insights/datacollectionendpoints','microsoft.insights/datacollectionrules','microsoft.monitor/accounts','microsoft.alertsmanagement/prometheusrulegroups','microsoft.alertsmanagement/smartdetectoralertrules','microsoft.insights/metricalerts','microsoft.insights/scheduledqueryrules','microsoft.alertsmanagement/actionrules','microsoft.insights/activitylogalerts','microsoft.insights/actiongroups','microsoft.netapp/netappaccounts/capacitypools/volumes/volumequotarules','microsoft.netapp/netappaccounts/volumegroups','microsoft.netapp/netappaccounts/capacitypools/volumes','microsoft.netapp/netappaccounts/snapshotpolicies','microsoft.netapp/netappaccounts/capacitypools/volumes/snapshots','microsoft.netapp/netappaccounts/capacitypools','microsoft.netapp/netappaccounts/backupvaults','microsoft.netapp/netappaccounts/backuppolicies','microsoft.netapp/netappaccounts','microsoft.network/frontdoorwebapplicationfirewallpolicies','microsoft.cdn/cdnwebapplicationfirewallpolicies','microsoft.network/applicationgatewaywebapplicationfirewallpolicies','microsoft.network/virtualnetworktaps','microsoft.network/virtualnetworks','microsoft.network/serviceendpointpolicies','microsoft.network/routetables','microsoft.authorization/resourcemanagementprivatelinks','microsoft.classicnetwork/reservedips','microsoft.network/publicipprefixes','microsoft.network/publicipaddresses','microsoft.network/privatelinkservices','microsoft.management/managementgroups/providers/privatelinkassociations','microsoft.network/privateendpoints','microsoft.network/networkwatchers/flowlogs','microsoft.network/networkwatchers','microsoft.network/networksecuritygroups','microsoft.network/networkinterfaces','microsoft.network/natgateways','microsoft.network/loadbalancers','microsoft.connectedvmwarevsphere/virtualmachines/providers/guestconfigurationassignments','microsoft.compute/virtualmachinescalesets/providers/guestconfigurationassignments','microsoft.hybridcompute/machines/providers/guestconfigurationassignments','microsoft.compute/virtualmachines/providers/guestconfigurationassignments','microsoft.network/ddosprotectionplans','microsoft.network/customipprefixes','microsoft.classicnetwork/virtualnetworks','microsoft.classicnetwork/networksecuritygroups','microsoft.network/applicationsecuritygroups','microsoft.managednetworkfabric/routepolicies','microsoft.managednetworkfabric/networktaprules','microsoft.managednetworkfabric/networktaps','microsoft.managednetworkfabric/networkracks','microsoft.managednetworkfabric/networkpacketbrokers','microsoft.managednetworkfabric/networkdevices/networkinterfaces','microsoft.managednetworkfabric/networkfabriccontrollers','microsoft.managednetworkfabric/networkfabrics','microsoft.managednetworkfabric/networkdevices','microsoft.managednetworkfabric/neighborgroups','microsoft.managednetworkfabric/networkfabrics/networktonetworkinterconnects','microsoft.managednetworkfabric/l3isolationdomains','microsoft.managednetworkfabric/l2isolationdomains','microsoft.managednetworkfabric/ipprefixes','microsoft.managednetworkfabric/ipextendedcommunities','microsoft.managednetworkfabric/ipcommunities','microsoft.managednetworkfabric/internetgatewayrules','microsoft.managednetworkfabric/internetgateways','microsoft.managednetworkfabric/l3isolationdomains/internalnetworks','microsoft.managednetworkfabric/l3isolationdomains/externalnetworks','microsoft.managednetworkfabric/accesscontrollists','microsoft.networkcloud/volumes','microsoft.networkcloud/virtualmachines/consoles','microsoft.networkcloud/virtualmachines','microsoft.networkcloud/trunkednetworks','microsoft.networkcloud/storageappliances','microsoft.networkcloud/kubernetesclusters/features','microsoft.networkcloud/kubernetesclusters','microsoft.networkcloud/l3networks','microsoft.networkcloud/l2networks','microsoft.networkcloud/racks','microsoft.networkcloud/clusters/metricsconfigurations','microsoft.networkcloud/clustermanagers','microsoft.networkcloud/clusters/baremetalmachinekeysets','microsoft.networkcloud/clusters/bmckeysets','microsoft.networkcloud/clusters','microsoft.networkcloud/cloudservicesnetworks','microsoft.networkcloud/baremetalmachines','microsoft.networkcloud/kubernetesclusters/agentpools','microsoft.network/networksecurityperimeters','microsoft.network/networksecurityperimeters/profiles','microsoft.notificationhubs/namespaces','microsoft.notificationhubs/namespaces/notificationhubs','microsoft.resources/resourcegraphvisualizer','microsoft.resources/resourcechange','microsoft.onlineexperimentation/workspaces','microsoft.openenergyplatform/energyservices','microsoft.scom/managedinstances','microsoft.orbital/l2connections','microsoft.orbital/groundstations','microsoft.orbital/geocatalogs','microsoft.orbital/edgesites','microsoft.dbforpostgresql/flexibleservers','microsoft.dbformysql/flexibleservers','microsoft.durabletask/schedulers/taskhubs','microsoft.integrationspaces/spaces','microsoft.durabletask/schedulers','microsoft.logic/businessprocesses','microsoft.app/spaces','microsoft.peering/peerings','microsoft.peering/peeringservices','microsoft.peering/peeringservices/prefixes','microsoft.peering/peerings/registeredasns','microsoft.peering/peerings/registeredprefixes','microsoft.azureplaywrightservice/accounts','microsoft.portalservices/dashboards','microsoft.powerbidedicated/capacities','private.aiforscience/catalogs','microsoft.network/privatednszones','microsoft.programmableconnectivity/operatorapiplans','microsoft.programmableconnectivity/operatorapiconnections','microsoft.programmableconnectivity/gateways','microsoft.purview/accounts','microsoft.cognitiveservices/browseaiservices','microsoft.cognitiveservices/browseallinone','microsoft.cognitiveservices/browseallservices','microsoft.cognitiveservices/browseanomalydetector','microsoft.cognitiveservices/accounts','microsoft.cognitiveservices/browsecomputervision','microsoft.cognitiveservices/browsecontentmoderator','microsoft.cognitiveservices/browsecontentsafety','microsoft.cognitiveservices/browsecustomvision','microsoft.cognitiveservices/browseface','microsoft.cognitiveservices/browseformrecognizer','microsoft.cognitiveservices/browsehealthdecisionsupport','microsoft.cognitiveservices/browsehealthinsights','microsoft.cognitiveservices/browseimmersivereader','microsoft.cognitiveservices/browseluis','microsoft.cognitiveservices/browsemetricsadvisor','microsoft.cognitiveservices/browseopenai','microsoft.cognitiveservices/browsepersonalizer','microsoft.cognitiveservices/browseqnamaker','microsoft.cognitiveservices/browsespeechservices','microsoft.cognitiveservices/browsetextanalytics','microsoft.cognitiveservices/browsetexttranslation','microsoft.sustainabilityservices/calculations','microsoft.quantum/workspaces','microsoft.recommendationsservice/accounts','microsoft.recommendationsservice/accounts/modeling','microsoft.recommendationsservice/accounts/serviceendpoints','microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers/protecteditems','microsoft.recoveryservicesintd2/vaults','microsoft.recoveryservicesintd/vaults','microsoft.recoveryservicesbvtd2/vaults','microsoft.recoveryservicesbvtd/vaults','microsoft.recoveryservices/vaults','microsoft.relay/namespaces/wcfrelays','microsoft.relay/namespaces','microsoft.relay/namespaces/hybridconnections','microsoft.billing/billingaccounts/incentiveschedules','microsoft.billingbenefits/incentiveschedules','microsoft.capacity/reservationorders/reservations','microsoft.billing/billingaccounts/savingsplanorders/savingsplans','microsoft.billingbenefits/savingsplanorders/savingsplans','microsoft.billingbenefits/maccs','microsoft.billing/billingaccounts/incentiveschedules/milestones','microsoft.billingbenefits/incentiveschedules/milestones','microsoft.capacity/reservationorders','microsoft.billing/billingaccounts/savingsplanorders','microsoft.billingbenefits/savingsplanorders','microsoft.relationships/servicegroupmember','microsoft.relationships/dependencyof','microsoft.resources/virtualsubscriptionsforresourcepicker','microsoft.resources/resourcechanges','microsoft.resources/deletedresources','microsoft.management/managementgroups/microsoft.resources/deploymentstacks','microsoft.resources/deploymentstacks','microsoft.deploymentmanager/rollouts','microsoft.features/featureprovidernamespaces/featureconfigurations','microsoft.saashub/cloudservices/hidden','microsoft.azurelargeinstance/azurelargeinstances','microsoft.baremetalinfrastructure/baremetalinstances','microsoft.hanaonazure/hanainstances','microsoft.workloads/sapvirtualinstances/applicationinstances','microsoft.workloads/sapvirtualinstances/centralinstances','microsoft.workloads/sapvirtualinstances/databaseinstances','microsoft.workloads/sapvirtualinstances','microsoft.search/searchservices','microsoft.security/locations/alerts','microsoft.securityinsightsarg/sentinel','microsoft.servicebus/namespaces/topics','microsoft.servicebus/namespaces/topics/subscriptions','microsoft.servicebus/namespaces/queues','microsoft.servicebus/namespaces/disasterrecoveryconfigs','microsoft.servicebus/namespaces','microsoft.servicefabric/clusters','microsoft.servicefabric/managedclusters','microsoft.providerhub/providerregistrations','microsoft.providerhub/providerregistrations/resourcetyperegistrations','microsoft.providerhub/providerregistrations/resourcetyperegistrations/resourcetyperegistrations','microsoft.providerhub/providerregistrations/customrollouts','microsoft.providerhub/providerregistrations/defaultrollouts','microsoft.signalrservice/webpubsub/replicas','microsoft.signalrservice/webpubsub','microsoft.signalrservice/signalr/replicas','microsoft.signalrservice/signalr','microsoft.edge/configurations','microsoft.edge/sites','microsoft.azuresphere/catalogs','microsoft.storage/storageaccounts','microsoft.classicstorage/storageaccounts','microsoft.storagecache/caches','microsoft.storagecache/amlfilesystems','microsoft.storagediscovery/storagediscoveryworkspaces','microsoft.storagemover/storagemovers','microsoft.storageactions/storagetasks','microsoft.streamanalytics/clusters','microsoft.streamanalytics/streamingjobs','microsoft.support/supporttickets','microsoft.synapse/privatelinkhubs','microsoft.synapse/workspaces/scopepools','microsoft.synapse/workspaces/bigdatapools','microsoft.synapse/workspaces/sqlpools','microsoft.synapse/workspaces','microsoft.resources/builtintemplatespecs','microsoft.resources/templatespecs','microsoft.management/managementgroups/providers/templatespecs','microsoft.resources/deploymentscripts','microsoft.usagebilling/accounts/pipelines/outputselectors','microsoft.usagebilling/accounts/pipelines','microsoft.usagebilling/accounts/pav2outputs','microsoft.usagebilling/accounts/metricexports','microsoft.usagebilling/accounts/inputs','microsoft.usagebilling/accounts/dataexports','microsoft.usagebilling/accounts','microsoft.mission/virtualenclaves/workloads','microsoft.mission/virtualenclaves','microsoft.mission/communities/transithubs','microsoft.mission/virtualenclaves/enclaveendpoints','microsoft.mission/enclaveconnections','microsoft.mission/communities/communityendpoints','microsoft.mission/communities','microsoft.mission/catalogs','microsoft.mission/approvals','microsoft.hybridnetwork/networkfunctions','microsoft.hybridnetwork/vendors','microsoft.hybridnetwork/devices','microsoft.hybridnetwork/sitenetworkservices','microsoft.hybridnetwork/sites','microsoft.hybridnetwork/publishers','microsoft.hybridnetwork/publishers/artifactstores','microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests','microsoft.hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions','microsoft.hybridnetwork/publishers/networkservicedesigngroups','microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions','microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups','microsoft.hybridnetwork/publishers/configurationgroupschemas','microsoft.hybridnetwork/configurationgroupvalues','private.edgeinternal/winfields','microsoft.workloads/insights','microsoft.hanaonazure/sapmonitors','microsoft.workloads/monitors','microsoft.desktopvirtualization/workspaces','microsoft.desktopvirtualization/scalingplans','microsoft.desktopvirtualization/hostpools','microsoft.desktopvirtualization/applicationgroups','microsoft.desktopvirtualization/appattachpackages','microsoft.zerotrustsegmentation/segmentationmanagers','microsoft.bing/accounts','microsoft.cloudhealth/healthmodels','microsoft.mixedreality/remoterenderingaccounts','microsoft.connectedcache/enterprisemcccustomers','microsoft.connectedcache/enterprisemcccustomers/enterprisemcccachenodes','microsoft.connectedcache/ispcustomers','microsoft.healthcareapis/workspaces/fhirservices','microsoft.healthcareapis/workspaces/iotconnectors','microsoft.test/healthdataaiservices','microsoft.healthcareapis/workspaces','microsoft.healthcareapis/services','microsoft.healthcareapis/workspaces/dicomservices','microsoft.manufacturingplatform/manufacturingdataservices','microsoft.operationalinsights/clusters','microsoft.operationsmanagement/solutions','microsoft.operationalinsights/workspaces','microsoft.operationalinsights/querypacks','microsoft.securitycopilot/capacities','microsoft.serviceshub/connectors','microsoft.videoindexer/accounts','oracle.database/exadbvmclusters','oracle.database/exascaledbstoragevaults','oracle.database/cloudvmclusters','oracle.database/cloudexadatainfrastructures','oracle.database/oraclesubscriptions','oracle.database/autonomousdatabases','microsoft.azurescan/scanningaccounts','microsoft.sql/virtualclusters','microsoft.sqlvirtualmachine/sqlvirtualmachines','microsoft.sql/servers','microsoft.dbforpostgresql/servers','microsoft.dbformysql/servers','microsoft.dbformariadb/servers','microsoft.sql/managedinstances','microsoft.sql/managedinstances/databases','microsoft.sql/instancepools','microsoft.databasefleetmanager/fleets/tiers','microsoft.databasefleetmanager/fleets/fleetspaces','microsoft.databasefleetmanager/fleets/fleetspaces/databases','microsoft.databasefleetmanager/fleets','microsoft.sql/servers/elasticpools','microsoft.sql/servers/jobagents','microsoft.sql/servers/databases','microsoft.sql/azuresql','microsoft.avs/privateclouds','wandisco.fusion/migrators/datatransferagents','wandisco.fusion/migrators/exclusiontemplates','wandisco.fusion/migrators/livedatamigrations','wandisco.fusion/migrators/metadatamigrations','wandisco.fusion/migrators/metadatatargets','wandisco.fusion/migrators/verifications','wandisco.fusion/migrators','wandisco.fusion/migrators/pathmappings','wandisco.fusion/migrators/targets','microsoft.web/sites/slots','microsoft.web/sites','microsoft.web/serverfarms','microsoft.web/staticsites','microsoft.certificateregistration/certificateorders','microsoft.app/sessionpools','microsoft.app/jobs','microsoft.app/managedenvironments','microsoft.app/connectedenvironments','microsoft.app/containerapps','microsoft.web/kubeenvironments','microsoft.web/hostingenvironments','microsoft.domainregistration/domains')) or (isempty(type)))|where (type !~ ('dell.storage/filesystems'))|where (type !~ ('microsoft.weightsandbiases/instances'))|where (type !~ ('pinecone.vectordb/organizations'))|where (type !~ ('mongodb.atlas/organizations'))|where (type !~ ('lambdatest.hyperexecute/organizations'))|where (type !~ ('commvault.contentstore/cloudaccounts'))|where (type !~ ('arizeai.observabilityeval/organizations'))|where (type !~ ('paloaltonetworks.cloudngfw/globalrulestacks'))|where (type !~ ('microsoft.liftrpilot/organizations'))|where (type !~ ('purestorage.block/storagepools/avsstoragecontainers'))|where (type !~ ('purestorage.block/reservations'))|where (type !~ ('purestorage.block/storagepools'))|where (type !~ ('solarwinds.observability/organizations'))|where (type !~ ('microsoft.agfoodplatform/farmbeats'))|where (type !~ ('microsoft.agricultureplatform/agriservices'))|where (type !~ ('microsoft.appsecurity/policies'))|where (type !~ ('microsoft.arc/allfairfax'))|where (type !~ ('microsoft.arc/all'))|where (type !~ ('microsoft.cdn/profiles/securitypolicies'))|where (type !~ ('microsoft.cdn/profiles/secrets'))|where (type !~ ('microsoft.cdn/profiles/rulesets'))|where (type !~ ('microsoft.cdn/profiles/rulesets/rules'))|where (type !~ ('microsoft.cdn/profiles/afdendpoints/routes'))|where (type !~ ('microsoft.cdn/profiles/origingroups'))|where (type !~ ('microsoft.cdn/profiles/origingroups/origins'))|where (type !~ ('microsoft.cdn/profiles/afdendpoints'))|where (type !~ ('microsoft.cdn/profiles/customdomains'))|where (type !~ ('microsoft.chaos/privateaccesses'))|where (type !~ ('microsoft.sovereign/transparencylogs'))|where (type !~ ('microsoft.sovereign/landingzoneconfigurations'))|where (type !~ ('microsoft.hardwaresecuritymodules/cloudhsmclusters'))|where (type !~ ('microsoft.cloudtest/accounts'))|where (type !~ ('microsoft.cloudtest/hostedpools'))|where (type !~ ('microsoft.cloudtest/images'))|where (type !~ ('microsoft.cloudtest/pools'))|where (type !~ ('microsoft.compute/virtualmachineflexinstances'))|where (type !~ ('microsoft.compute/standbypoolinstance'))|where (type !~ ('microsoft.compute/computefleetscalesets'))|where (type !~ ('microsoft.compute/computefleetinstances'))|where (type !~ ('microsoft.containerservice/managedclusters/microsoft.kubernetesconfiguration/fluxconfigurations'))|where (type !~ ('microsoft.kubernetes/connectedclusters/microsoft.kubernetesconfiguration/fluxconfigurations'))|where (type !~ ('microsoft.containerservice/managedclusters/microsoft.kubernetesconfiguration/namespaces'))|where (type !~ ('microsoft.kubernetes/connectedclusters/microsoft.kubernetesconfiguration/namespaces'))|where (type !~ ('microsoft.containerservice/managedclusters/microsoft.kubernetesconfiguration/extensions'))|where (type !~ ('microsoft.kubernetesconfiguration/extensions'))|where (type !~ ('microsoft.portalservices/extensions/deployments'))|where (type !~ ('microsoft.portalservices/extensions'))|where (type !~ ('microsoft.portalservices/extensions/slots'))|where (type !~ ('microsoft.portalservices/extensions/versions'))|where (type !~ ('microsoft.deviceregistry/devices'))|where (type !~ ('microsoft.deviceupdate/updateaccounts'))|where (type !~ ('microsoft.deviceupdate/updateaccounts/updates'))|where (type !~ ('microsoft.deviceupdate/updateaccounts/deviceclasses'))|where (type !~ ('microsoft.deviceupdate/updateaccounts/deployments'))|where (type !~ ('microsoft.deviceupdate/updateaccounts/agents'))|where (type !~ ('microsoft.deviceupdate/updateaccounts/activedeployments'))|where (type !~ ('microsoft.documentdb/fleets'))|where (type !~ ('private.easm/workspaces'))|where (type !~ ('microsoft.workloads/epicvirtualinstances'))|where (type !~ ('microsoft.fairfieldgardens/provisioningresources'))|where (type !~ ('microsoft.fairfieldgardens/provisioningresources/provisioningpolicies'))|where (type !~ ('microsoft.healthmodel/healthmodels'))|where (type !~ ('microsoft.hybridcompute/machinessoftwareassurance'))|where (type !~ ('microsoft.hybridcompute/machinespaygo'))|where (type !~ ('microsoft.hybridcompute/machinesesu'))|where (type !~ ('microsoft.hybridcompute/machinessovereign'))|where (type !~ ('microsoft.hybridcompute/arcserverwithwac'))|where (type !~ ('microsoft.network/networkvirtualappliances'))|where (type !~ ('microsoft.network/virtualhubs')) or ((kind =~ ('routeserver')))|where (type !~ ('microsoft.devhub/iacprofiles'))|where (type !~ ('microsoft.dashboard/dashboards'))|where (type !~ ('private.monitorgrafana/dashboards'))|where (type !~ ('microsoft.insights/diagnosticsettings'))|where not((type =~ ('microsoft.network/serviceendpointpolicies')) and ((kind =~ ('internal'))))|where (type !~ ('microsoft.resources/resourcegraphvisualizer'))|where (type !~ ('microsoft.orbital/l2connections'))|where (type !~ ('microsoft.orbital/groundstations'))|where (type !~ ('microsoft.orbital/geocatalogs'))|where (type !~ ('microsoft.orbital/edgesites'))|where (type !~ ('microsoft.recommendationsservice/accounts/modeling'))|where (type !~ ('microsoft.recommendationsservice/accounts/serviceendpoints'))|where (type !~ ('microsoft.recoveryservicesintd2/vaults'))|where (type !~ ('microsoft.recoveryservicesintd/vaults'))|where (type !~ ('microsoft.recoveryservicesbvtd2/vaults'))|where (type !~ ('microsoft.recoveryservicesbvtd/vaults'))|where (type !~ ('microsoft.relationships/servicegroupmember'))|where (type !~ ('microsoft.relationships/dependencyof'))|where (type !~ ('microsoft.resources/virtualsubscriptionsforresourcepicker'))|where (type !~ ('microsoft.resources/deletedresources'))|where (type !~ ('microsoft.deploymentmanager/rollouts'))|where (type !~ ('microsoft.features/featureprovidernamespaces/featureconfigurations'))|where (type !~ ('microsoft.saashub/cloudservices/hidden'))|where (type !~ ('microsoft.providerhub/providerregistrations'))|where (type !~ ('microsoft.providerhub/providerregistrations/customrollouts'))|where (type !~ ('microsoft.providerhub/providerregistrations/defaultrollouts'))|where (type !~ ('microsoft.edge/configurations'))|where (type !~ ('microsoft.storagediscovery/storagediscoveryworkspaces'))|where not((type =~ ('microsoft.synapse/workspaces/sqlpools')) and ((kind =~ ('v3'))))|where (type !~ ('microsoft.mission/virtualenclaves/workloads'))|where (type !~ ('microsoft.mission/virtualenclaves'))|where (type !~ ('microsoft.mission/communities/transithubs'))|where (type !~ ('microsoft.mission/virtualenclaves/enclaveendpoints'))|where (type !~ ('microsoft.mission/enclaveconnections'))|where (type !~ ('microsoft.mission/communities/communityendpoints'))|where (type !~ ('microsoft.mission/communities'))|where (type !~ ('microsoft.mission/catalogs'))|where (type !~ ('microsoft.mission/approvals'))|where (type !~ ('microsoft.workloads/insights'))|where (type !~ ('microsoft.hanaonazure/sapmonitors'))|where (type !~ ('microsoft.zerotrustsegmentation/segmentationmanagers'))|where (type !~ ('microsoft.cloudhealth/healthmodels'))|where (type !~ ('microsoft.connectedcache/enterprisemcccustomers/enterprisemcccachenodes'))|where not((type =~ ('microsoft.sql/servers')) and ((kind =~ ('v12.0,analytics'))))|where not((type =~ ('microsoft.sql/servers/databases')) and ((kind in~ ('system','v2.0,system','v12.0,system','v12.0,system,serverless','v12.0,user,datawarehouse,gen2,analytics')))) | project id, name, type, typeDisplayName, resourceGroup, locationDisplayName, subscriptionDisplayName, kind, location, subscriptionId, tags, extendedLocation"""
        tasks = []
        for sublist in split_list(all_subscriptions, 200):
            tasks.append(self.dump_resources_part(sublist, query))
        await asyncio.gather(*tasks)

    async def dump_resources_part(self, subscriptions, query):
        cache = []
        async for resource in self.query_resources(subscriptions, query):
            cache.append(az_resource_from_json(resource))

        commit(self.session, AZresource, cache, ignore=True)

def split_list(input_list, chunk_size):
    return [input_list[i:i + chunk_size] for i in range(0, len(input_list), chunk_size)]

IS_RATELIMITING = False
async def azratelimit(headers=None):
    global IS_RATELIMITING
    if headers and 'x-ms-user-quota-remaining' in headers:
        if int(headers['x-ms-user-quota-remaining']) < 1:
            # Handles ratelimit for this request
            IS_RATELIMITING = True
            # print('I AM THE RATELIMITER')
            await asyncio.sleep(5)
            IS_RATELIMITING = False
    elif IS_RATELIMITING:
        # other aio function is ratelimiting
        while IS_RATELIMITING:
            # print('Somebody else is ratelimiting')
            await asyncio.sleep(1)

def az_role_definition_from_json(data):
    return {
        "id": data.get("id"),
        "name": data.get("name"),
        "type": data.get("type"),
        "role_name": data.get("properties", {}).get("roleName"),
        "description": data.get("properties", {}).get("description"),
        "role_type": data.get("properties", {}).get("type"),
        "created_on": data.get("properties", {}).get("createdOn"),
        "permissions": data.get("properties", {}).get("permissions")
    }

def az_role_assignment_from_json(data):
    return {
        "id": data.get("id"),
        "name": data.get("name"),
        "type": data.get("type"),
        "scope": data.get("properties", {}).get("scope"),
        "role_definition_id": data.get("properties", {}).get("roleDefinitionId"),
        "principal_id": data.get("properties", {}).get("principalId"),
        "principal_type": data.get("properties", {}).get("principalType"),
        "description": data.get("properties", {}).get("description"),
        "condition": data.get("properties", {}).get("condition"),
        "condition_version": data.get("properties", {}).get("conditionVersion"),
        "created_on": data.get("properties", {}).get("createdOn"),
        "delegated_managed_identity_resource_id": data.get("properties", {}).get("delegatedManagedIdentityResourceId")
    }

def az_subscription_from_json(data):
    return {
        "id": data.get("id"),
        "subscription_id": data.get("subscriptionId"),
        "display_name": data.get("displayName"),
        "state": data.get("state"),
        "subscription_policies": data.get("subscriptionPolicies"),
        "authorization_source": data.get("authorizationSource")
    }

def az_management_group_from_json(data):
    return {
        "id": data.get("id"),
        "name": data.get("name"),
        "type": data.get("type"),
        "display_name": data.get("displayName"),
        "tenant_id": data.get("tenantId"),
        "details": data.get("details")
    }

def az_role_eligibility_schedule_instance_from_json(data):
    properties = data.get("properties", {})
    return {
        "id": data.get("id"),
        "name": data.get("name"),
        "type": data.get("type"),
        "role_definition_id": properties.get("roleDefinitionId"),
        "principal_id": properties.get("principalId"),
        "principal_type": properties.get("principalType"),
        "scope": properties.get("scope"),
        "role_eligibility_schedule_id": properties.get("roleEligibilityScheduleId"),
        "status": properties.get("status"),
        "start_date_time": properties.get("startDateTime"),
        "end_date_time": properties.get("endDateTime"),
        "member_type": properties.get("memberType"),
        "condition": properties.get("condition"),
        "condition_version": properties.get("conditionVersion"),
        "created_on": properties.get("createdOn"),
        "expanded_properties": properties.get("expandedProperties")
    }

def az_resource_from_json(data):
    return {
        "id": data.get("id"),
        "name": data.get("name"),
        "type": data.get("type"),
        "type_display_name": data.get("typeDisplayName"),
        "resource_group": data.get("resourceGroup"),
        "location_display_name": data.get("locationDisplayName"),
        "subscription_display_name": data.get("subscriptionDisplayName"),
        "kind": data.get("kind"),
        "location": data.get("location"),
        "subscription_id": data.get("subscriptionId"),
        "tags": data.get("tags"),
        "extended_location": data.get("extendedLocation")
    }

def json_to_subscription(json_data):
    subscription = AZsubscription(
        id=json_data.get("id"),
        subscription_id=json_data.get("subscriptionId"),
        display_name=json_data.get("displayName"),
        state=json_data.get("state"),
        subscription_policies=json_data.get("subscriptionPolicies"),
        authorization_source=json_data.get("authorizationSource"),
    )
    return subscription

def json_to_management_group(json_data):
    management_group = AZmanagementGroup(
        id=json_data.get("id"),
        name=json_data.get("name"),
        type=json_data.get("type"),
        display_name=json_data.get("displayName"),
        tenant_id=json_data.get("tenantId"),
        details=json_data.get("details"),
    )
    return management_group

async def run(args):
    global token, expiretime, headers, dburl
    if 'tenantId' in token:
        tenantid = token['tenantId']
    elif args.tenant:
        tenantid = args.tenant
    else:
        tenantid = 'myorganization'
    expiretime = time.mktime(time.strptime(token['expiresOn'].split('.')[0], '%Y-%m-%d %H:%M:%S'))
    headers = {
        'Authorization': '%s %s' % (token['tokenType'], token['accessToken'])
    }
    if args.user_agent:
        # Alias support, get temp auth object
        auth = Authentication()
        auth.set_user_agent(args.user_agent)
        headers['User-Agent'] = auth.user_agent
        # Store this in the token as well
        token['useragent'] = auth.user_agent

    if not checktoken():
        return
    # Recreate DB

    destroy_db = False

    engine = database.init(destroy_db, dburl=dburl)

    Session = sessionmaker(bind=engine)
    Base.metadata.create_all(engine)
    dbsession = Session()

    # Clear previous data

    dbsession.query(AZroleDefinition).delete()
    dbsession.query(AZroleAssignment).delete()
    dbsession.query(AZsubscription).delete()
    dbsession.query(AZmanagementGroup).delete()
    dbsession.query(AZroleEligibilityScheduleInstance).delete()
    dbsession.query(AZresource).delete()

    dumper = DataDumper(tenantid, '1.61-internal', engine=engine)
    async with aiohttp.ClientSession() as ahsession:
        print('Starting data gathering phase 1 of 2 (collecting objects)')
        dumper.ahsession = ahsession
        dumper.session = dbsession
        url = 'https://management.azure.com/providers/Microsoft.Authorization/roleDefinitions?api-version=2015-06-01'
        cache = []
        async for rd in dumphelper(url, method=ahsession.get):
            cache.append(az_role_definition_from_json(rd))
        commit(dbsession, AZroleDefinition, cache, ignore=True)

        tasks = []
        url = 'https://management.azure.com/subscriptions?api-version=2024-11-01'
        all_subscriptions = []
        async for subscription in dumphelper(url, method=ahsession.get):
            # print(subscription)
            dbsession.add(json_to_subscription(subscription))
            tasks.append(dumper.dump_subscription_roleassignments(subscription))
            all_subscriptions.append(subscription['subscriptionId'])
        tasks.append(dumper.dump_resources(all_subscriptions))

        await asyncio.gather(*tasks)


    print('Phase 2 - calculate IAM permissions')
    linktable_mapping = {
        'Group': (lnk_az_roleassignment_group, 'AZroleAssignment', 'Group'),
        'User': (lnk_az_roleassignment_user, 'AZroleAssignment', 'User'),
        'ServicePrincipal': (lnk_az_roleassignment_serviceprincipal, 'AZroleAssignment', 'ServicePrincipal'),
    }
    linkcache = {}
    for roleassignment in dbsession.query(AZroleAssignment).all():
        linkobjecttype = roleassignment.principal_type
        try:
            linktable, leftcol, rightcol = linktable_mapping[linkobjecttype]
        except KeyError:
            print('Unsupported member type: %s ' % (str(linkobjecttype)))
            continue
        try:
            linkcache[linktable].append({leftcol: roleassignment.id, rightcol: roleassignment.principal_id})
        except KeyError:
            linkcache[linktable] = [{leftcol: roleassignment.id, rightcol: roleassignment.principal_id}]
    linktable_mapping = {
        'Group': (lnk_az_roleassignment_eligible_group, 'AZroleEligibilityScheduleInstance', 'Group'),
        'User': (lnk_az_roleassignment_eligible_user, 'AZroleEligibilityScheduleInstance', 'User'),
        'ServicePrincipal': (lnk_az_roleassignment_eligible_serviceprincipal, 'AZroleEligibilityScheduleInstance', 'ServicePrincipal'),
    }
    for roleassignment in dbsession.query(AZroleEligibilityScheduleInstance).all():
        linkobjecttype = roleassignment.principal_type
        try:
            linktable, leftcol, rightcol = linktable_mapping[linkobjecttype]
        except KeyError:
            print('Unsupported member type: %s ' % (str(linkobjecttype)))
            continue
        try:
            linkcache[linktable].append({leftcol: roleassignment.id, rightcol: roleassignment.principal_id})
        except KeyError:
            linkcache[linktable] = [{leftcol: roleassignment.id, rightcol: roleassignment.principal_id}]
    commitlink(dbsession, linkcache)

    dbsession.commit()
    dbsession.close()

def getargs(gather_parser):
    gather_parser.add_argument('-d',
                               '--database',
                               action='store',
                               help='Database file. Can be the local database name for SQLite, or an SQLAlchemy compatible URL such as postgresql+psycopg2://dirkjan@/roadtools. Default: roadrecon.db',
                               default='roadrecon.db')
    gather_parser.add_argument('-f',
                               '--tokenfile',
                               action='store',
                               help='File to read credentials from obtained by roadrecon auth',
                               default='.roadtools_auth')
    gather_parser.add_argument('--tokens-stdin',
                               action='store_true',
                               help='Read tokens from stdin instead of from disk')
    gather_parser.add_argument('--mfa',
                               action='store_true',
                               help='Dump MFA details (requires use of a privileged account)')
    gather_parser.add_argument('--skip-first-phase',
                               action='store_true',
                               help='Skip the first phase (assumes this has been previously completed)')
    gather_parser.add_argument('-t',
                               '--tenant',
                               action='store',
                               help='Tenant ID to gather, if this info is not stored in the token')
    gather_parser.add_argument('-ua', '--user-agent', action='store',
                                help='Custom user agent to use. By default aiohttp default user agent is used, and python-requests is used for token renewal')
    gather_parser.add_argument('--autotoken',
                               action='store_true',
                               help='Use refresh token to request access token for the required API automatically')

def main(args=None):
    global token, headers, dburl, urlcounter
    if args is None:
        parser = argparse.ArgumentParser(add_help=True, description='ROADrecon - Gather Azure AD information', formatter_class=argparse.RawDescriptionHelpFormatter)
        getargs(parser)
        args = parser.parse_args()
        if len(sys.argv) < 2:
            parser.print_help()
            sys.exit(1)
    if args.tokens_stdin:
        token = json.loads(sys.stdin.read())
    else:
        with open(args.tokenfile, 'r') as infile:
            token = json.load(infile)
    if not ':/' in args.database:
        if args.database[0] != '/':
            dburl = 'sqlite:///' + os.path.join(os.getcwd(), args.database)
        else:
            dburl = 'sqlite:///' + args.database
    else:
        dburl = args.database
    try:
        _, tokendata = Authentication.parse_accesstoken(token['accessToken'])
    except KeyError:
        print('No access token found in tokenfile')
        return
    if tokendata['aud'] not in ('https://management.core.windows.net', 'https://management.core.windows.net/', 'https://management.azure.com/', '00000002-0000-0000-c000-000000000000'):
        if args.autotoken:
            auth = Authentication()
            # Break out of nested client for this resource
            if '_clientId' in token and token['_clientId'] == 'c44b4083-3bb0-49c1-b47d-974e53cbdf3c' and '_nestedClientId' in token:
                del token['_nestedClientId']
            token = auth.handle_autotoken(token, args=args, resource=GATHER_RESOURCE)
        else:
            print(f"Wrong token audience, got {tokendata['aud']} but expected https://management.core.windows.net")
            print("Make sure to request a token with -r https://management.core.windows.net")
            return

    headers['Authorization'] = f"Bearer {token['accessToken']}"

    seconds = time.perf_counter()
    asyncio.run(run(args))
    elapsed = time.perf_counter() - seconds
    print("ROADrecon azgather executed in {0:0.2f} seconds and issued {1} HTTP requests.".format(elapsed, urlcounter))

if __name__ == "__main__":
    main()
