-
Notifications
You must be signed in to change notification settings - Fork 186
Open
Labels
Needs: Triage 🔍Untriaged issue needs to be reviewedUntriaged issue needs to be reviewedType: Bug 🐛Something isn't workingSomething isn't working
Description
🐛 Problem
When deploying the FinOps toolkit to Azure and passing the scopesToMonitor parameter, the scopes are not properly populated in in the settings.json
👣 Repro steps
- Compile the bicep code
az bicep build --file ./finops-hub-0.12/main.bicep - Create the deployment
az deployment group create --resource-group "finops-rg" --template-file $(Build.BuildId)/finops-hub-0.12/main.json --parameters scopesToMonitor="/sub/123-abc|/sub/456-def" - Verify full deployment is completed
- Examine settings.json from the storage account
- Below is in the
settings.jsonfile
"scopes": {
"scope": "/sub/123-abc"
}🤔 Expected
Expected all subscriptions as part of the scopesToMonitor parameter to be in the settings.json
"scopes": [
{
"scope": "/sub/123-abc"
},
{
"scope": "/sub/456-def"
}
],
ℹ️ Additional context
The problem is in my view caused by the following to things in the Copy-FileToAzureBlob.ps1 script:
- The object created for
$newScopesis differently structure, compared to$json.scopes, resulting in not just merging them using the+ - The validation for scopes is wrongly set, as now the length of the dictionary is checked (which is 1), and not the length of the
stringvalue for the actualscopekey, causing all scopes to be discarded
Metadata
Metadata
Assignees
Labels
Needs: Triage 🔍Untriaged issue needs to be reviewedUntriaged issue needs to be reviewedType: Bug 🐛Something isn't workingSomething isn't working