This repo contains scripts to use foe setting up Azure Automation Accounts for DSC and onboarding systems for management via DSC.
In order to use these scripts, you need to install the AzureRM PowerShell module. If you have PowerShell 5 or later, you can install with the following commands:
Install-Module AzureRm
Install-AzureRm
Import-AzureRm
Setting up an account in EA's Azure subscription is done by invoking AzureAutomation-setup.ps1. Below are the parameters to supply.
This parameter is required. Provide a name that is descriptive of the server class or grouping that you will manage.
A pscredential object for your Azure Ad identity you use to access and manage resources in the Azure subscription.
You can specify an Azure subscription to use.
You can specify the Azure region in which you want to place your automation account.
.\AzureAutomation-setup.ps1 -AutomationAccountName "DomainControllers" -Credential "user@address.com"
This command will create an account called DomainControllers
in your subscription, and specified region. When you run this a login window will appear to enter password.
Joining an on premises machine to an Azure Automation DSC account can be done using the AzureDscNode-setup.ps1 script.
The following parameters are used:
Resource group the Automation account resides in. If you used the script above to set up your automation account, the resource group name will be the same as the account name.
Automation account name.
PS Credential object for the Azure AD account you use to access and manage resources in your Azure subscription.
PS Credential object for either a local or domain account with admin rights to the node you are joining to the account.
The FQDN host name of the computer you are joining to the account.
.\AzureDscNode-setup.ps1 -ComputerName "server01.domain.local" -AutomationaAccountName "DomainControllers" -ResourceGroupName "DomainControllers" -AzureCredential "kevin@domain.local" -LocalCredential "domain.local\kevin"