Open
Description
π Scenario
As a hub admin, I need to get metadata about a hub instance with all dependant resources in order to manage delete all resources
π Solution
Update Get-FinOpsHub command to get all related resources.
Synopsis, syntax, description, and parameters stay the same. The only thing that changes is the output.
βΉοΈ Additional info
Use the following code to get any addtional resources that were not identified via the tag:
$kv = $hub.Resources | Where-Object ResourceType -eq "Microsoft.KeyVault/vaults"
$uniqueId = $kv[0].Substring($kv[0].LastIndexOf("-") + 1)
$resources = Get-AzResource -ResourceGroupName $ResourceGroup | Where-Object Name -like "*$uniqueId*"
The output object should look this:
{
// ID is added as a cm-resource-parent tag to all deployed resources as part of the bicep code
Id: "/subscriptions/.../resourceGroups/.../providers/Microsoft.Cloud/hubs/...",
// Type and name can be parsed out of the ID
Type: "Microsoft.Cloud/hubs",
Name: "...",
// Location would be pulled from the resources
Location: "...",
// Version pulled from settings.json
Version: "0.0.1",
// Resources determined at runtime via tags or with the unique deployment id in the name
Resources: [
{ ... },
{ ... },
{ ... },
...
],
}
πββοΈ Ask for the community
We could use your help:
- Please vote this issue up (π) to prioritize it.
- Leave comments to help us solidify the vision.
Metadata
Metadata
Assignees
Type
Projects
Status
π In progress