What can we configure with PowerShell
Configuring computers with a desired status
The Azure Automation state configuration allows you to set configurations for your servers and ensure that these servers are in the specified state over time.
- Integrate a virtual machine with Azure Automation DSC management
- Upload a configuration to Azure Automation
- Compiling a configuration into a node configuration
- Assign a node configuration to a managed node
- Check the compliance status of a managed node
For this tutorial we will use a simple DSC configuration that will ensure that IIS is installed on the VM.
Partial configuration support
Azure Automation State Configuration supports the use of partial configurations. In this scenario, DSC is configured to allow multiple configurations to be managed independently, with each configuration being pulled from Azure Automation. However, only one configuration can be assigned to a node using an automation account. This means that if you are using two configurations for one node, you will need two automation accounts.
For details on registering a sub-configuration from a pull service, see the sub-configuration documentation.
For more information about how teams can work together to co-manage servers using configuration as code, see Understanding DSC's Role in a CI / CD Pipeline.
Sign in to Azure
Sign in to your Azure subscription using the Connect-AzAccount cmdlet and follow the on-screen instructions.
Create and upload a configuration in Azure Automation
Type the following into a text editor and save the file locally as a TestConfig.ps1.
In more complex scenarios where multiple modules need to be imported that provide DSC resources, you need to ensure that each module has a unique line of type in your configuration.
Call the Import-AzAutomationDscConfiguration cmdlet to upload the configuration to your Automation account.
Compiling a configuration into a node configuration
A DSC configuration must be compiled into a node configuration before it can be assigned to a node. See DSC Configurations for more information.
Call the Start-AzAutomationDscCompilationJob cmdlet to compile the configuration into a node configuration named in your Automation account.
Register a virtual machine for state configuration management
With Azure Automation State Configuration, you can manage Azure virtual machines (using the classic model or the Resource Manager model), local virtual machines, Linux machines, AWS virtual machines, and local physical machines. This topic covers registering only Azure Resource Manager VMs. For information about registering other types of computers, see Integrate computers for management by Azure Automation state configuration.
Call the Register-AzAutomationDscNode cmdlet to register your virtual machine as a managed node with the Azure Automation State Configuration.
Specify the configuration mode settings
Use the Register-AzAutomationDscNode cmdlet to register a virtual machine as a managed node and to specify configuration properties. You can e.g. For example, specify that the state of the computer should only be applied once by specifying the value of the property. State Configuration does not attempt to apply the configuration after the initial verification.
You can also specify how often DSC checks the configuration state by using the property. For more information about DSC configuration settings, see Configuring Local Configuration Manager.
Assign a node configuration to a managed node
Now we can assign the compiled node configuration to the VM to be configured.
This assigns the node configuration named to the registered DSC node. By default, the DSC node is checked for compliance with the node configuration every 30 minutes. To change the compliance check interval, see Configuring Local Configuration Manager.
Check the compliance status of a managed node
You can get reports on the compliance status of a managed node by using the Get-AzAutomationDscNodeReport cmdlet.
- What is the nature of technology
- What is America's oldest bourbon distillery
- What are bottlenecks in MUDRA Yojana
- How many times did life appear on earth
- What is a picnic spot in Pune
- Can I delete my POF account offline?
- Is YouTube TV better than Hulu
- Is there a song about Bette Davis
- How is hypothermia used in surgery
- What is the full form of EWS
- How do you recognize good sun protection?
- How does a hydrofoil generate lift?
- I can meditate anytime
- How long does the eLitmus exam take
- FWB occurs in India
- What is causing your nose to bleed?
- Can electric fields cancel each other out
- Why is the Pope never a woman
- Is Beyonce currently under a record deal
- Why are photons constant
- What is the definition of a cappella
- What is more important than the human connection
- What is the acceleration at zero speed
- What is an example of a strange movie