Skip to content

Commit 404744f

Browse files
authored
fix 509 and 528 (#538)
1 parent c8c54f8 commit 404744f

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

arm-ttk/testcases/deploymentTemplate/CommandToExecute-Must-Use-ProtectedSettings-For-Secrets.test.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $TemplateObject
1414
# Find all references to an commandToExecute.
1515
$commandsToExecute = $TemplateObject |
1616
Find-JsonContent -Key commandToExecute -Value * -Like |
17-
Where-Object { $_.ParentObject[0].type -imatch 'CustomScript$' } # on a customScript resource.
17+
Where-Object { $_.ParentObject[0].type -imatch 'CustomScript|CustomScriptExtension|CustomScriptForLinux' } # on a customScript resource.
1818

1919

2020
foreach ($command in $commandsToExecute) {

arm-ttk/testcases/deploymentTemplate/Template-Should-Not-Contain-Blanks.test.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ $PropertiesThatCanBeEmpty = 'resources',
4646
'notEquals', # Microsoft.Authorization/policyDefinitions policyRule'
4747
'clientId', # Microsoft.ContainerService/managedClusters.properties.servicePrincipalProfile
4848
'allowedCallerIpAddresses', # Microsoft.Logic/workflows Access Control
49-
'workerPools' # Microsoft.Web/hostingEnvironments
49+
'workerPools', # Microsoft.Web/hostingEnvironments
50+
'AzureMonitor' # Microsoft.Insights/VMDiagnosticsSettings
5051

5152
if ($emptyItems) {
5253
foreach ($emptyItem in $emptyItems) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"secure": {
6+
"type": "secureObject"
7+
}
8+
},
9+
"resources": [
10+
{
11+
"name": "vm/CustomScriptExtension",
12+
"type": "Microsoft.HybridCompute/machines/extensions",
13+
"apiVersion": "2019-08-02-preview",
14+
"properties": {
15+
"publisher": "Microsoft.Compute",
16+
"type": "CustomScriptExtension",
17+
"autoUpgradeMinorVersion": true,
18+
"settings": {
19+
"fileUris": "https://foo.bar/script.ps1",
20+
"commandToExecute": "[concat('powershell -Arguments ', parameters('secure'))]"
21+
}
22+
}
23+
}
24+
]
25+
}

0 commit comments

Comments
 (0)