Skip to content

Commit

Permalink
Merge pull request #20 from agri-marche/powershell-dsc
Browse files Browse the repository at this point in the history
host now configured with DSC
  • Loading branch information
rtlefrancois authored Sep 2, 2021
2 parents 493bfc2 + 8a25391 commit 128fcf6
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@
"App": "[parameters('app')]",
"PatchPolicy": "[parameters('patchPolicy')]"
},
"workspaceName": "la-workspace-agri-default"
"workspaceName": "la-workspace-agri-default",
"nodeConfigurationName": "ServerBaseConfiguration.localhost",
"automationAccountName": "automation-vm-management"
},
"resources": [
{
Expand Down Expand Up @@ -320,24 +322,46 @@
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('dnsLabelPrefix'),'/installDefaults')]",
"name": "[concat(parameters('dnsLabelPrefix'), '/powershellDSC')]",
"apiVersion": "2018-06-01",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines/', parameters('dnsLabelPrefix'))]"
"[concat('Microsoft.Compute/virtualMachines/', parameters('dnsLabelPrefix'))]"
],
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomscriptExtension",
"typeHandlerVersion": "1.10",
"publisher": "Microsoft.Powershell",
"type": "DSC",
"typeHandlerVersion": "2.77",
"autoUpgradeMinorVersion": true,
"protectedSettings": {
"fileUris": [
"https://raw.githubusercontent.com/agri-marche/windows-arm-template/main/DeploymentScript.ps1"
],
"commandToExecute": "powershell.exe -file DeploymentScript.ps1"
"Items": {
"registrationKeyPrivate": "[listKeys(resourceId('rg-automation-gen', 'Microsoft.Automation/automationAccounts/', variables('automationAccountName')), '2018-06-30').Keys[0].value]"
}
},
"settings": {
"Properties": [
{
"Name": "RegistrationKey",
"Value": {
"UserName": "PLACEHOLDER_DONOTUSE",
"Password": "PrivateSettingsRef:registrationKeyPrivate"
},
"TypeName": "System.Management.Automation.PSCredential"
},
{
"Name": "RegistrationUrl",
"Value": "[reference(resourceId('rg-automation-gen', 'Microsoft.Automation/automationAccounts/', variables('automationAccountName')), '2018-06-30').registrationUrl]",
"TypeName": "System.String"
},
{
"Name": "NodeConfigurationName",
"Value": "[variables('nodeConfigurationName')]",
"TypeName": "System.String"
}
]
}
}
}

]
}

0 comments on commit 128fcf6

Please sign in to comment.