Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Deploy-AzTemplate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ else {
}
"managementGroup" {
New-AzManagementGroupDeployment -Name $DeploymentName `
-ManagementGroupId $managementGroupId
-ManagementGroupId $(get-azcontext).Tenant.Id
-Location $Location `
@TemplateArgs `
@OptionalParameters `
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-08-01/tenantDeploymentTemplate.json#",
"$schema": "https://schema.management.azure.com/schemas/2019-08-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"functions": [],
Expand Down
9 changes: 9 additions & 0 deletions lz-lifecycle-mg/BYOT/byot2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-08-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"functions": [],
"variables": {},
"resources": [],
"outputs": {}
}
61 changes: 61 additions & 0 deletions lz-lifecycle-mg/byotdeploy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-08-01/managementGroupDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"byot": {
"type": "array"
},
"_artifactsLocation": {
"type": "string",
"metadata": {
"description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated."
},
"defaultValue": "[deployment().properties.templateLink.uri]"
},
"_artifactsLocationSasToken": {
"type": "securestring",
"metadata": {
"description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated."
},
"defaultValue": ""
}
},
"resources": [

{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2019-10-01",
"name": "[concat('byotDeployment-', parameters('byot')[copyIndex()])]",
"location": "[deployment().location]",
"subscriptionId": "[if(not(empty(parameters('byot')[copyIndex()].subscriptionId)), parameters('byot')[copyIndex()].subscriptionId, json('null'))]",
"resourceGroup": "[if(not(empty(parameters('byot')[copyIndex()].resourceGroupName)), parameters('byot')[copyIndex()].resourceGroupName, json('null'))]",
"copy": {
"name": "byotLoop",
"count": "[length(parameters('byot'))]",
"mode": "Serial"
},
"properties": {
"mode": "Incremental",
"templateLink": {
"contentVersion": "1.0.0.0",
"uri": "[uri(parameters('_artifactsLocation'), concat(parameters('byot')[copyIndex()].templateFileName, parameters('_artifactsLocationSasToken')))]"
},
"parametersLink": {
"uri": "[if(not(empty(parameters('byot')[copyIndex()].parameterFileName)),
uri(parameters('_artifactsLocation'), concat(parameters('byot')[copyIndex()].parameterFileName, parameters('_artifactsLocationSasToken'))),
json('null'))]"
}
}
}
],
"outputs": {
"BYOTs": {
"type": "array",
"copy": {
"count": "[length(parameters('byot'))]",
"input": "[parameters('byot')[copyIndex()]]"

}
}
}
}
22 changes: 22 additions & 0 deletions lz-lifecycle-mg/byotdeploy.parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"byot": {
"value": [
{
"subscriptionId": "0cec7090-2e08-4498-9337-eb96ade50821",
"resourceGroupName": "byot1",
"templateFileName": "./byot/byot1.json",
"parameterFileName": ""
},
{
"subscriptionId": "0cec7090-2e08-4498-9337-eb96ade50821",
"resourceGroupName": "byot2",
"templateFileName": "./byot/byot2.json",
"parameterFileName": ""
}
]
}
}
}
24 changes: 24 additions & 0 deletions lz-lifecycle-mg/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,30 @@
"pwsh": "true",
"workingDirectory": ""
}
},
{
"environment": {},
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Deploy BYOT Template",
"timeoutInMinutes": 0,
"condition": "succeeded()",
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "2.*",
"definitionType": "task"
},
"inputs": {
"targetType": "filePath",
"filePath": "Deploy-AzTemplate.ps1",
"arguments": "-ArtifactStagingDirectory \"BYOT\" -Location \"westus\" ",
"errorActionPreference": "stop",
"failOnStderr": "false",
"ignoreLASTEXITCODE": "false",
"pwsh": "true",
"workingDirectory": ""
}
}
],
"name": "Agent job 1",
Expand Down