Azure / Azure/arm-ttk

Could not extract inner templates error when recursing qs test folder with non-empty tenmplate

Open
#584 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
PowerShell
Stars
468
Forks
208
PR merge metrics
No merged PRs in 30d

Description

Same repro as #583 in the quickstarts folder but with a different template, new error is:

```
Write-Error: C:\Users\bmoore\source\repos\arm-ttk\arm-ttk\Test-AzTemplate.ps1:713
Line |
713 | Test-FileList # we just call it directly.
| ~~~~~~~~~~~~~
| Could not extract inner templates for '.\azuredeploy.json'.
```

template:
```
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.4.1124.51302",
"templateHash": "18030597390279146961"
}
},
"resources": [
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"name": "budgetDeploy",
"location": "[deployment().location]",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
},
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.4.1124.51302",
"templateHash": "7127556100598991854"
}
},
"parameters": {
"startDate": {
"type": "string",
"defaultValue": "2022-01-01"
},
"amount": {
"type": "int",
"defaultValue": 1000
},
"forecastThreshold": {
"type": "int",
"defaultValue": 100
},
"actualThreshold": {
"type": "int",
"defaultValue": 100
},
"contactEmails": {
"type": "array",
"defaultValue": []
},
"contactRoles": {
"type": "array",
"defaultValue": [
"Owner",
"Contributor"
]
},
"contactGroups": {
"type": "array",
"defaultValue": []
}
},
"resources": [
{
"type": "Microsoft.Consumption/budgets",
"apiVersion": "2021-10-01",
"name": "[format('budget-{0}', subscription().displayName)]",
"properties": {
"timePeriod": {
"startDate": "[parameters('startDate')]"
},
"timeGrain": "Monthly",
"amount": "[parameters('amount')]",
"category": "Cost",
"notifications": {
"NotificationForExceededBudget1": {
"enabled": true,
"operator": "GreaterThan",
"threshold": "[parameters('forecastThreshold')]",
"thresholdType": "Forecasted",
"contactEmails": "[parameters('contactEmails')]",
"contactRoles": "[parameters('contactRoles')]",
"contactGroups": "[parameters('contactGroups')]"
},
"NotificationForExceededBudget2": {
"enabled": true,
"operator": "GreaterThan",
"threshold": "[parameters('actualThreshold')]",
"contactEmails": "[parameters('contactEmails')]",
"contactRoles": "[parameters('contactRoles')]",
"contactGroups": "[parameters('contactGroups')]"
}
}
}
}
]
}
}
}
]
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in Test-AzTemplate.ps1 around line 713 and reproduce the error by recursing the quickstarts folder with the provided azuredeploy.json template. Trace the inner-template extraction path, using issue #583 as related context. Done means the non-empty nested template can be processed without the “Could not extract inner templates” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.