-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
da9632b
commit 4533f73
Showing
9 changed files
with
187 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
// Community provided sample from: https://github.com/Azure/PSRule.Rules.Azure/issues/2593 | ||
|
||
var task = { | ||
name: 'task1' | ||
parameters: { | ||
B: 5 | ||
} | ||
} | ||
|
||
var tasks = [ | ||
{ | ||
name: task.name | ||
parameters: { | ||
debug: 'A\'${string(task.parameters)}\'' | ||
debugLength: length('A\'${string(task.parameters)}\'') | ||
} | ||
} | ||
] | ||
|
||
#disable-next-line BCP081 no-deployments-resources | ||
resource taskDeployment 'Microsoft.Resources/deployments@2020-10-01' = { | ||
name: 'name' | ||
properties: { | ||
mode: 'Incremental' | ||
template: { | ||
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' | ||
contentVersion: '1.0.0.0' | ||
resources: [ | ||
{ | ||
apiVersion: '2019-12-01' | ||
type: 'Microsoft.ManagedIdentity/userAssignedIdentities' | ||
name: 'test' | ||
properties: { | ||
tasks: tasks | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
|
||
output outTask object = task | ||
output outTasks array = tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"_generator": { | ||
"name": "bicep", | ||
"version": "0.24.24.22086", | ||
"templateHash": "9157129407835921175" | ||
} | ||
}, | ||
"variables": { | ||
"task": { | ||
"name": "task1", | ||
"parameters": { | ||
"B": 5 | ||
} | ||
}, | ||
"tasks": [ | ||
{ | ||
"name": "[variables('task').name]", | ||
"parameters": { | ||
"debug": "[format('A''{0}''', string(variables('task').parameters))]", | ||
"debugLength": "[length(format('A''{0}''', string(variables('task').parameters)))]" | ||
} | ||
} | ||
] | ||
}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Resources/deployments", | ||
"apiVersion": "2020-10-01", | ||
"name": "name", | ||
"properties": { | ||
"mode": "Incremental", | ||
"template": { | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"resources": [ | ||
{ | ||
"apiVersion": "2019-12-01", | ||
"type": "Microsoft.ManagedIdentity/userAssignedIdentities", | ||
"name": "test", | ||
"properties": { | ||
"tasks": "[variables('tasks')]" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"outputs": { | ||
"outTask": { | ||
"type": "object", | ||
"value": "[variables('task')]" | ||
}, | ||
"outTasks": { | ||
"type": "array", | ||
"value": "[variables('tasks')]" | ||
} | ||
} | ||
} |