microsoft / microsoft/finops-toolkit
[PowerShell] Add-FinOpsHubScope (0.0.1)
@akiskips is already working on this.
Since May 15, 2024.
- 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:
- Please vote this issue up (👍) to prioritize it.
- Should this be
Add-FinOpsHubScopeorNew-FinOpsHubScope? - Do we want to specify the scope as a single parameter (
-Id) or multiple (-Subscription "..." -ResourceGroup "...") or support both? - How should we identify the hub instance? Do we have enough parameters?
- Should we support adding multiple scopes at one time?
- Are there any parameters that are missing?
- Leave comments to help us solidify the vision.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.