One of the new features of Azure Automation is still somewhat hidden. It needs to be enabled before you see it in the GUI

This blog post gives a quick overview of what is needed to use it.

 

Step 1: Enable the extension in your Azure Account

The command registers the azure automation dsv extension on your account. This shows the DSC Nodes tile in your automation account:

 

image

 

Step 2: Select subscription and default values

Before you can run any command you will need to select your subscription.

additionally each of the command needs 2 values ResourceGroupName and AutomationAccountName To keep the code easy to read, you can use the $PSDefaultParameter values to save the values

 

Step 3: Write configuration

A DSC configuration needs to be created. This example is very simple and will end up having the configuraiton name “psug.webserver”

 

Create and save this file as PSIUG.ps1

NB! it is important that the filename is the same as configuration name.

 

Step 4: Import and Compile configuration

Next step is to import and conpile the configuration for your DSC node.

the import will upload your file to Azure automation DSC (will not be shown in any gui yet) after the import, the configuration needs to be compiled to be used on your machines. This will generate a configration called configurationName.NodeName in this example psug.webserver

 

Step 5: Create or Register machine / node

this code snippet contains a few example to check the node and unregister

To add the extension to an existing machine using Azure Preview Portal:

1. Open Machine overview

2. Click “all Settings”

3. Select “extensions”

4. Click Add

image

5. Select “Azure Automation DSC”

6. Click Create

7. Set Registration URL and Key. These can be found in the dashboard of the automation account as seen in this picture:

 

image

8. Set Trigger intervals and configuration mode.

In the example we use “applyandautocorrect” whcih will keep the machine compliant in the future

Read more about the options available here:

https://technet.microsoft.com/en-us/library/dn249922.aspx

image 

9. Click OK

 

You can use the same technique when creating a new Azure Machine.

It can also be created from PowerShell using the example from the documentation.

 

Documentation:

https://azure.microsoft.com/en-us/documentation/articles/automation-dsc-overview/

 

Other commands

this code snippet contains a few example to check the node and unregister