Skip to content

General best practices documentation update#1090

Open
nteyan wants to merge 1 commit intodevfrom
General-best-practices-updates
Open

General best practices documentation update#1090
nteyan wants to merge 1 commit intodevfrom
General-best-practices-updates

Conversation

@nteyan
Copy link
Copy Markdown
Contributor

@nteyan nteyan commented Nov 4, 2024

🛠️ Description

This documentation update introduces new queries to summarize the counts of various resources. The aim is to provide users with an overview of their resource inventory, helping them understand the distribution and quantity of resources in their environment.

📷 Screenshots

📋 Checklist

🔬 How did you test this change?

  • 🤏 Lint tests
  • 🤞 PS -WhatIf / az validate
  • 👍 Manually deployed + verified
  • 💪 Unit tests
  • 🙌 Integration tests

🙋‍♀️ Do any of the following that apply?

  • 🚨 This is a breaking change.
  • 🤏 The change is less than 20 lines of code.

📑 Did you update docs/changelog.md?

  • ✅ Updated changelog (required for dev PRs)
  • ➡️ Will add log in a future PR (feature branch PRs only)
  • ❎ Log not needed (small/internal change)

📖 Did you update documentation?

  • ✅ Public docs in docs (required for dev)
  • ✅ Internal dev docs in src (required for dev)
  • ➡️ Will add docs in a future PR (feature branch PRs only)
  • ❎ Docs not needed (small/internal change)

@nteyan nteyan changed the title adding resource inventory qummary queries adding resource inventory summary queries Nov 4, 2024
@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs: Review 👀 PR that is ready to be reviewed label Nov 4, 2024
@microsoft-github-policy-service microsoft-github-policy-service Bot added Skill: Documentation Documentation updates Tool: FinOps guide Implementing FinOps guide labels Nov 4, 2024
@nteyan nteyan changed the title adding resource inventory summary queries General best practices documentation update Nov 4, 2024

---

## Resource inventory summary
Copy link
Copy Markdown
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?


---

## Resource inventory summary
Copy link
Copy Markdown
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.


## Resource inventory summary

### Query: Count of all resources
Copy link
Copy Markdown
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.


<br>

### Query: Count of all resources per subscription
Copy link
Copy Markdown
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?

Comment on lines +62 to +64
resources
| summarize Count=count(id) by subscriptionId
| order by Count desc
Copy link
Copy Markdown
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
resources
| summarize Count=count(id) by subscriptionId
| order by Count desc
Copy link
Copy Markdown
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.

```kql
Resources
| extend type = case(
type contains 'microsoft.netapp/netappaccounts', 'NetApp Accounts',
Copy link
Copy Markdown
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.

Comment on lines +177 to +178
resources
| summarize count() by location
Copy link
Copy Markdown
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

@microsoft-github-policy-service microsoft-github-policy-service Bot added Needs: Attention 👋 Issue or PR needs to be reviewed by the author or it will be closed due to no activity and removed Needs: Review 👀 PR that is ready to be reviewed labels Nov 5, 2024
@microsoft-github-policy-service
Copy link
Copy Markdown

@nteyan: you have some new feedback!

Please review and resolve all comments and I'll let reviewers know by removing the Needs: Attention label. If I miss anything, just reply with #needs-review and I'll update the status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Attention 👋 Issue or PR needs to be reviewed by the author or it will be closed due to no activity Skill: Documentation Documentation updates Tool: FinOps guide Implementing FinOps guide

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants