Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General best practices documentation update #1090

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 152 additions & 0 deletions docs/_docs/best-practices/general/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Discover essential FinOps best practices to optimize cost efficiency and governa
<details open markdown="1">
<summary class="fs-2 text-uppercase">On this page</summary>

- [Resource inventory summary](#resource-inventory-summary)
- [Carbon Optimization](#carbon-optimization)
- [πŸ™‹β€β™€οΈ Looking for more?](#️-looking-for-more)
- [🧰 Related tools](#-related-tools)
Expand All @@ -28,6 +29,157 @@ Discover essential FinOps best practices to optimize cost efficiency and governa

---

## Resource inventory summary
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a service. Maybe use "Resource Manager" instead?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this after ACO so it's sorted alphabetically.


### Query: Count of all resources
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really necessary? It feels too simple to document. What scenario does this actually address? Fwiw, I think we have a larger effort to document scenarios across the entire BPL, but it's fine if we don't do that right now.


This Azure Resource Graph (ARG) query counts all resources within the specified scope.

<h4>Category</h4>

Inventory

<h4>Query</h4>

```kql
Resources
| summarize count()
```

<br>

### Query: Count of all resources per subscription
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still feels too simplistic, right? If we think this and the previous one are needed, should we merge both with the next one, which is closer to what I think people are looking for with a resource inventory?


This Azure Resource Graph (ARG) query counts all resources within the specified scope per subscription.

<h4>Category</h4>

Inventory

<h4>Query</h4>

```kql
resources
| summarize Count=count(id) by subscriptionId
| order by Count desc
Comment on lines +62 to +64
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Query styling

Suggested change
resources
| summarize Count=count(id) by subscriptionId
| order by Count desc
Resources
| summarize Count = count(id) by subscriptionId
| order by Count desc

Comment on lines +62 to +64
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'm on the fence as to whether we should put sorting in the queries. We don't want unnecessary load on the server. I get it may be useful in some scenarios, but I'd probably leave that to the user to decide on their own unless sorting is critical for the scenario.

```

<br>

### Query: Count of all resources per type

This Azure Resource Graph (ARG) query counts all resources within the specified scope per type.

<h4>Category</h4>

Inventory

<h4>Query</h4>

```kql
Resources
| extend type = case(
type contains 'microsoft.netapp/netappaccounts', 'NetApp Accounts',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unmaintainable and not technically accurate, if I'm reading it correctly. We should discuss this one.

type contains "microsoft.compute", "Azure Compute",
type contains "microsoft.logic", "LogicApps",
type contains 'microsoft.keyvault/vaults', "Key Vaults",
type contains 'microsoft.storage/storageaccounts', "Storage Accounts",
type contains 'microsoft.compute/availabilitysets', 'Availability Sets',
type contains 'microsoft.operationalinsights/workspaces', 'Azure Monitor Resources',
type contains 'microsoft.operationsmanagement', 'Operations Management Resources',
type contains 'microsoft.insights', 'Azure Monitor Resources',
type contains 'microsoft.desktopvirtualization/applicationgroups', 'WVD Application Groups',
type contains 'microsoft.desktopvirtualization/workspaces', 'WVD Workspaces',
type contains 'microsoft.desktopvirtualization/hostpools', 'WVD Hostpools',
type contains 'microsoft.recoveryservices/vaults', 'Backup Vaults',
type contains 'microsoft.web', 'App Services',
type contains 'microsoft.managedidentity/userassignedidentities','Managed Identities',
type contains 'microsoft.storagesync/storagesyncservices', 'Azure File Sync',
type contains 'microsoft.hybridcompute/machines', 'ARC Machines',
type contains 'Microsoft.EventHub', 'Event Hub',
type contains 'Microsoft.EventGrid', 'Event Grid',
type contains 'Microsoft.Sql', 'SQL Resources',
type contains 'Microsoft.HDInsight/clusters', 'HDInsight Clusters',
type contains 'microsoft.devtestlab', 'DevTest Labs Resources',
type contains 'microsoft.containerinstance', 'Container Instances Resources',
type contains 'microsoft.portal/dashboards', 'Azure Dashboards',
type contains 'microsoft.containerregistry/registries', 'Container Registry',
type contains 'microsoft.automation', 'Automation Resources',
type contains 'sendgrid.email/accounts', 'SendGrid Accounts',
type contains 'microsoft.datafactory/factories', 'Data Factory',
type contains 'microsoft.databricks/workspaces', 'Databricks Workspaces',
type contains 'microsoft.machinelearningservices/workspaces', 'Machine Learnings Workspaces',
type contains 'microsoft.alertsmanagement/smartdetectoralertrules', 'Azure Monitor Resources',
type contains 'microsoft.apimanagement/service', 'API Management Services',
type contains 'microsoft.dbforpostgresql', 'PostgreSQL Resources',
type contains 'microsoft.scheduler/jobcollections', 'Scheduler Job Collections',
type contains 'microsoft.visualstudio/account', 'Azure DevOps Organization',
type contains 'microsoft.network/', 'Network Resources',
type contains 'microsoft.migrate/' or type contains 'microsoft.offazure', 'Azure Migrate Resources',
type contains 'microsoft.servicebus/namespaces', 'Service Bus Namespaces',
type contains 'microsoft.classic', 'ASM Obsolete Resources',
type contains 'microsoft.resources/templatespecs', 'Template Spec Resources',
type contains 'microsoft.virtualmachineimages', 'VM Image Templates',
type contains 'microsoft.documentdb', 'CosmosDB DB Resources',
type contains 'microsoft.alertsmanagement/actionrules', 'Azure Monitor Resources',
type contains 'microsoft.kubernetes/connectedclusters', 'ARC Kubernetes Clusters',
type contains 'microsoft.purview', 'Purview Resources',
type contains 'microsoft.security', 'Security Resources',
type contains 'microsoft.cdn', 'CDN Resources',
type contains 'microsoft.devices','IoT Resources',
type contains 'microsoft.datamigration', 'Data Migraiton Services',
type contains 'microsoft.cognitiveservices', 'Congitive Services',
type contains 'microsoft.customproviders', 'Custom Providers',
type contains 'microsoft.appconfiguration', 'App Services',
type contains 'microsoft.search', 'Search Services',
type contains 'microsoft.maps', 'Maps',
type contains 'microsoft.containerservice/managedclusters', 'AKS',
type contains 'microsoft.signalrservice', 'SignalR',
type contains 'microsoft.resourcegraph/queries', 'Resource Graph Queries',
type contains 'microsoft.batch', 'MS Batch',
type contains 'microsoft.analysisservices', 'Analysis Services',
type contains 'microsoft.synapse/workspaces', 'Synapse Workspaces',
type contains 'microsoft.synapse/workspaces/sqlpools', 'Synapse SQL Pools',
type contains 'microsoft.kusto/clusters', 'ADX Clusters',
type contains 'microsoft.resources/deploymentscripts', 'Deployment Scripts',
type contains 'microsoft.aad/domainservices', 'AD Domain Services',
type contains 'microsoft.labservices/labaccounts', 'Lab Accounts',
type contains 'microsoft.automanage/accounts', 'Automanage Accounts',
type contains 'microsoft.relay/namespaces', 'Azure Relay',
type contains 'microsoft.notificationhubs/namespaces', 'Notification Hubs',
type contains 'microsoft.digitaltwins/digitaltwinsinstances', 'Digital Twins',
type contains 'microsoft.monitor/accounts', 'Monitor Accounts',
type contains 'microsoft.dashboard/grafana', 'Grafana',
type contains 'microsoft.scom/managedinstances', 'SCOM Managed instances',
type contains 'microsoft.datareplication/replicationvaults', 'Replication Vaults',
type contains 'microsoft.avs/privateclouds', 'Azure VMWare Solution',
type contains 'microsoft.machinelearningservices/registries', 'Machine learning registries',
type contains 'microsoft.dbformysql/flexibleservers', 'MySQL flexible servers',
type contains 'microsoft.dataprotection/backupvaults', 'Backup vaults',
strcat("Not Translated: ", type))
| summarize count() by type
| order by count_ desc
```

<br>

### Query: Count of all resources per region

This Azure Resource Graph (ARG) query counts all resources within the specified scope per region.

<h4>Category</h4>

Inventory

<h4>Query</h4>

```kql
resources
| summarize count() by location
Comment on lines +177 to +178
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Query styling...

Suggested change
resources
| summarize count() by location
Resources
| summarize Count = count() by location

```

<br>

## Carbon Optimization

### Query: Carbon emissions
Expand Down