microsoft / microsoft/finops-toolkit

[PowerShell] Add-FinOpsHubScope (0.0.1)

Open
#237 3 comments 1 reaction 1 assignee View on GitHub

@akiskips is already working on this.

Since May 15, 2024.

Tool: FinOps hubs Tool: PowerShell Type: Feature 💎
Dominant language
PowerShell
Stars
603
Forks
248
Avg merge
7d 11h
Merged PRs (30d)
11

Description

📝 Scenario

As a hub admin, I need to add scopes to a hub instance in order to start monitoring a new scope

💎 Solution

Create an Add-FinOpsHubScope function to create exports and optionally back-fill data.

Synopsis

Starts monitoring a scope within a FinOps hub instance.

Syntax
Add-FinOpsHubScope `
    [-Id] <string> `
    -HubName <string> `
    [-Backfill]
Description

The Add-FinOpsHubScope cmdlet adds a scope to be monitored by a FinOps hub instance. By default, this will start only start pulling data for the current month, which should be available within 30 minutes. To import historical data, use the -Backfill option.

Parameters
Parameter Description
-Id Required. Resource ID of the scope to remove.
-HubName Required. Name of the hub instance to update.
-Backfill Optional. Indicates whether to remove data for this scope from storage. Default = false.

ℹ️ Additional info

In 0.0.1, exports are managed manually. When the command is called, run the following:

$hub = Get-FinOpsHub -Name $HubName
# Validate there's only 1 hub returned
New-FinOpsCostExport `
  -Name "$HubName-monthly-AmortizedCost" `
  -Scope $Id `
  -DataSet AmortizedCost `
  -StorageAccountId $hub.properties.resources.storage `
  -StorageContainer msexports `
  -StoragePath $Id.Trim("/") `
  -Execute `
  -Backfill 13

🙋‍♀️ Ask for the community

We could use your help:

  1. Please vote this issue up (👍) to prioritize it.
  2. Should this be Add-FinOpsHubScope or New-FinOpsHubScope?
  3. Do we want to specify the scope as a single parameter (-Id) or multiple (-Subscription "..." -ResourceGroup "...") or support both?
  4. How should we identify the hub instance? Do we have enough parameters?
  5. Should we support adding multiple scopes at one time?
  6. Are there any parameters that are missing?
  7. Leave comments to help us solidify the vision.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.