Skip to content

Commit 01a4c85

Browse files
authored
Merge pull request #183336 from mgreenegit/patch-31
Simplify very confusing page
2 parents 18c2796 + 43cb7a9 commit 01a4c85

File tree

2 files changed

+64
-64
lines changed

2 files changed

+64
-64
lines changed

articles/automation/automation-dsc-onboarding.md

Lines changed: 62 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -57,64 +57,24 @@ You can use the [Register-AzAutomationDscNode](/powershell/module/az.automation/
5757

5858
The best way to register VMs from other Azure subscriptions is to use the DSC extension in an Azure Resource Manager deployment template. Examples are provided in [Desired State Configuration extension with Azure Resource Manager templates](../virtual-machines/extensions/dsc-template.md).
5959

60-
To find the registration key and registration URL to use as parameters in the template, see [Enable machines securely using registration](#enable-machines-securely-using-registration).
60+
## Use DSC metaconfiguration to register hybrid machines
6161

62-
## Enable physical/virtual Windows machines
62+
You can enable machines securely for an Azure Automation account through the DSC metaconfiguration. The protocols implemented in DSC use information from the
63+
metaconfiguration to authenticate to Azure Automation State Configuration. The node registers with the service at the registration URL and authenticates using
64+
a registration key. During registration, the DSC node and DSC service negotiate a unique certificate for the node to use for authentication to the server
65+
post-registration. This process prevents enabled nodes from impersonating one another, for example, if a node is compromised and behaving maliciously.
66+
After registration, the registration key is not used for authentication again, and is deleted from the node.
6367

64-
You can enable Windows servers running on-premises or in other cloud environments (including AWS EC2 instances) to Azure Automation State Configuration. The servers must have [outbound access to Azure](automation-dsc-overview.md#network-planning).
65-
66-
1. Make sure that the latest version of [WMF 5](https://aka.ms/wmf5latest) is installed on the machines to enable for State Configuration. In addition, WMF 5 must be installed on the computer that you are using for enabling the machines.
67-
1. Follow the directions in [Generate DSC metaconfigurations](#generate-dsc-metaconfigurations) to create a folder containing the required DSC metaconfigurations.
68-
1. Use the following cmdlet to apply the PowerShell DSC metaconfigurations remotely to the machines to enable.
69-
70-
```powershell
71-
Set-DscLocalConfigurationManager -Path C:\Users\joe\Desktop\DscMetaConfigs -ComputerName MyServer1, MyServer2
72-
```
73-
74-
1. If you can't apply the PowerShell DSC metaconfigurations remotely, copy the **metaconfigurations** folder to the machines that you are enabling. Then add code to call [Set-DscLocalConfigurationManager](/powershell/module/psdesiredstateconfiguration/set-dsclocalconfigurationmanager) locally on the machines.
75-
1. Using the Azure portal or cmdlets, verify that the machines appear as State Configuration nodes registered in your Azure Automation account.
76-
77-
## Enable physical/virtual Linux machines
78-
79-
You can enable Linux servers running on-premises or in other cloud environments for State Configuration. The servers must have [outbound access to Azure](automation-dsc-overview.md#network-planning).
80-
81-
1. Make sure that the latest version of [PowerShell Desired State Configuration for Linux](https://github.com/Microsoft/PowerShell-DSC-for-Linux) is installed on the machines to enable for State Configuration.
82-
2. If the [PowerShell DSC Local Configuration Manager defaults](/powershell/dsc/managing-nodes/metaConfig4) match your use case, and you want to enable machines so that they both pull from and report to State Configuration:
83-
84-
- On each Linux machine to enable, use `Register.py` to enable the machine with the PowerShell DSC Local Configuration Manager defaults.
85-
86-
`/opt/microsoft/dsc/Scripts/Register.py <Automation account registration key> <Automation account registration URL>`
87-
88-
- To find the registration key and registration URL for your Automation account, see [Enable machines securely using registration](#enable-machines-securely-using-registration).
89-
90-
3. If the PowerShell DSC Local Configuration Manager (LCM) defaults don't match your use case, or you want to enable machines that only report to Azure Automation State Configuration, follow steps 4-7. Otherwise, proceed directly to step 7.
91-
92-
4. Follow the directions in [Generate DSC metaconfigurations](#generate-dsc-metaconfigurations) section to produce a folder containing the required DSC metaconfigurations.
93-
94-
5. Make sure that the latest version of [WMF 5](https://aka.ms/wmf5latest) is installed on the computer being used to enable your machines for State Configuration.
95-
96-
6. Add code as follows to apply the PowerShell DSC metaconfigurations remotely to the machines to enable.
97-
98-
```powershell
99-
$SecurePass = ConvertTo-SecureString -String '<root password>' -AsPlainText -Force
100-
$Cred = New-Object System.Management.Automation.PSCredential 'root', $SecurePass
101-
$Opt = New-CimSessionOption -UseSsl -SkipCACheck -SkipCNCheck -SkipRevocationCheck
102-
103-
# need a CimSession for each Linux machine to onboard
104-
$Session = New-CimSession -Credential $Cred -ComputerName <your Linux machine> -Port 5986 -Authentication basic -SessionOption $Opt
105-
106-
Set-DscLocalConfigurationManager -CimSession $Session -Path C:\Users\joe\Desktop\DscMetaConfigs
107-
```
108-
109-
7. If you can't apply the PowerShell DSC metaconfigurations remotely, copy the metaconfigurations corresponding to the remote machines from the folder described in step 4 to the Linux machines.
68+
You can get the information required for the State Configuration registration protocol from **Keys** under **Account Settings** in the Azure portal.
11069

111-
8. Add code to call `Set-DscLocalConfigurationManager.py` locally on each Linux machine to enable for State Configuration.
70+
![Azure automation keys and URL](./media/automation-dsc-onboarding/DSC_Onboarding_4.png)
11271

113-
`/opt/microsoft/dsc/Scripts/SetDscLocalConfigurationManager.py -configurationmof <path to metaconfiguration file>`
72+
- Registration URL is the URL field on the Keys page.
73+
- Registration key is the value of the **Primary access key** field or the **Secondary access key** field on the Keys page. Either key can be used.
11474

115-
9. Using the Azure portal or cmdlets, ensure that the machines to enable now show up as DSC nodes registered in your Azure Automation account.
75+
For added security, you can regenerate the primary and secondary access keys of an Automation account at any time on the Keys page. Key regeneration prevents future node registrations from using previous keys.
11676

117-
## Generate DSC metaconfigurations
77+
### Generate DSC metaconfigurations
11878

11979
To enable any machine for State Configuration, you can generate a [DSC metaconfiguration](/powershell/dsc/managing-nodes/metaConfig). This configuration tells the DSC agent to pull from and/or report to Azure Automation State Configuration. You can generate a DSC metaconfiguration for Azure Automation State Configuration using either a PowerShell DSC configuration or the Azure Automation PowerShell cmdlets.
12080

@@ -241,7 +201,7 @@ Proxy support for metaconfigurations is controlled by the [Local Configuration M
241201
DscMetaConfigs @Params
242202
```
243203

244-
1. Fill in the registration key and URL for your Automation account, as well as the names of the machines to enable. All other parameters are optional. To find the registration key and registration URL for your Automation account, see [Enable machines securely using registration](#enable-machines-securely-using-registration).
204+
1. Fill in the registration key and URL for your Automation account, as well as the names of the machines to enable. All other parameters are optional. To find the registration key and registration URL for your Automation account, see [Use DSC metaconfiguration to register hybrid machines](#use-dsc-metaconfiguration-to-register-hybrid-machines).
245205

246206
1. If you want the machines to report DSC status information to Azure Automation State Configuration, but not pull configuration or PowerShell modules, set the `ReportOnly` parameter to true.
247207

@@ -281,19 +241,60 @@ enable machines to both pull from and report to Azure Automation State Configura
281241
Set-DscLocalConfigurationManager -Path $env:UserProfile\Desktop\DscMetaConfigs
282242
```
283243
284-
## Enable machines securely using registration
244+
### Enable physical/virtual Windows machines
285245
286-
You can enable machines securely for an Azure Automation account through the WMF 5 DSC registration protocol. This protocol allows a DSC node to authenticate to a PowerShell DSC pull or report server, including Azure Automation State Configuration. The node registers with the server at the registration URL and authenticates using a registration key. During registration, the DSC node and DSC pull/report server negotiate a unique certificate for the node to use for authentication to the server post-registration. This process prevents enabled nodes from
287-
impersonating one another, for example, if a node is compromised and behaving maliciously. After registration, the registration key is not used for authentication again, and is deleted from the node.
246+
You can enable Windows servers running on-premises or in other cloud environments (including AWS EC2 instances) to Azure Automation State Configuration. The servers must have [outbound access to Azure](automation-dsc-overview.md#network-planning).
288247
289-
You can get the information required for the State Configuration registration protocol from **Keys** under **Account Settings** in the Azure portal.
248+
1. Make sure that the latest version of [WMF 5](https://aka.ms/wmf5latest) is installed on the machines to enable for State Configuration. In addition, WMF 5 must be installed on the computer that you are using for enabling the machines.
249+
1. Follow the directions in [Generate DSC metaconfigurations](#generate-dsc-metaconfigurations) to create a folder containing the required DSC metaconfigurations.
250+
1. Use the following cmdlet to apply the PowerShell DSC metaconfigurations remotely to the machines to enable.
290251
291-
![Azure automation keys and URL](./media/automation-dsc-onboarding/DSC_Onboarding_4.png)
252+
```powershell
253+
Set-DscLocalConfigurationManager -Path C:\Users\joe\Desktop\DscMetaConfigs -ComputerName MyServer1, MyServer2
254+
```
292255

293-
- Registration URL is the URL field on the Keys page.
294-
- Registration key is the value of the **Primary access key** field or the **Secondary access key** field on the Keys page. Either key can be used.
256+
1. If you can't apply the PowerShell DSC metaconfigurations remotely, copy the **metaconfigurations** folder to the machines that you are enabling. Then add code to call [Set-DscLocalConfigurationManager](/powershell/module/psdesiredstateconfiguration/set-dsclocalconfigurationmanager) locally on the machines.
257+
1. Using the Azure portal or cmdlets, verify that the machines appear as State Configuration nodes registered in your Azure Automation account.
295258

296-
For added security, you can regenerate the primary and secondary access keys of an Automation account at any time on the Keys page. Key regeneration prevents future node registrations from using previous keys.
259+
### Enable physical/virtual Linux machines
260+
261+
You can enable Linux servers running on-premises or in other cloud environments for State Configuration. The servers must have [outbound access to Azure](automation-dsc-overview.md#network-planning).
262+
263+
1. Make sure that the latest version of [PowerShell Desired State Configuration for Linux](https://github.com/Microsoft/PowerShell-DSC-for-Linux) is installed on the machines to enable for State Configuration.
264+
2. If the [PowerShell DSC Local Configuration Manager defaults](/powershell/dsc/managing-nodes/metaConfig4) match your use case, and you want to enable machines so that they both pull from and report to State Configuration:
265+
266+
- On each Linux machine to enable, use `Register.py` to enable the machine with the PowerShell DSC Local Configuration Manager defaults.
267+
268+
`/opt/microsoft/dsc/Scripts/Register.py <Automation account registration key> <Automation account registration URL>`
269+
270+
- To find the registration key and registration URL for your Automation account, see [Use DSC metaconfiguration to register hybrid machines](#use-dsc-metaconfiguration-to-register-hybrid-machines).
271+
272+
3. If the PowerShell DSC Local Configuration Manager (LCM) defaults don't match your use case, or you want to enable machines that only report to Azure Automation State Configuration, follow steps 4-7. Otherwise, proceed directly to step 7.
273+
274+
4. Follow the directions in [Generate DSC metaconfigurations](#generate-dsc-metaconfigurations) section to produce a folder containing the required DSC metaconfigurations.
275+
276+
5. Make sure that the latest version of [WMF 5](https://aka.ms/wmf5latest) is installed on the computer being used to enable your machines for State Configuration.
277+
278+
6. Add code as follows to apply the PowerShell DSC metaconfigurations remotely to the machines to enable.
279+
280+
```powershell
281+
$SecurePass = ConvertTo-SecureString -String '<root password>' -AsPlainText -Force
282+
$Cred = New-Object System.Management.Automation.PSCredential 'root', $SecurePass
283+
$Opt = New-CimSessionOption -UseSsl -SkipCACheck -SkipCNCheck -SkipRevocationCheck
284+
285+
# need a CimSession for each Linux machine to onboard
286+
$Session = New-CimSession -Credential $Cred -ComputerName <your Linux machine> -Port 5986 -Authentication basic -SessionOption $Opt
287+
288+
Set-DscLocalConfigurationManager -CimSession $Session -Path C:\Users\joe\Desktop\DscMetaConfigs
289+
```
290+
291+
7. If you can't apply the PowerShell DSC metaconfigurations remotely, copy the metaconfigurations corresponding to the remote machines from the folder described in step 4 to the Linux machines.
292+
293+
8. Add code to call `Set-DscLocalConfigurationManager.py` locally on each Linux machine to enable for State Configuration.
294+
295+
`/opt/microsoft/dsc/Scripts/SetDscLocalConfigurationManager.py -configurationmof <path to metaconfiguration file>`
296+
297+
9. Using the Azure portal or cmdlets, ensure that the machines to enable now show up as DSC nodes registered in your Azure Automation account.
297298
298299
## Re-register a node
299300

articles/virtual-machines/extensions/dsc-template.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ This article describes the Azure Resource Manager template for the [Desired Stat
2121
(DSC) extension handler](dsc-overview.md). Many of the examples use **RegistrationURL** (provided
2222
as a String) and **RegistrationKey** (provided as a
2323
[PSCredential](/dotnet/api/system.management.automation.pscredential) to onboard with Azure
24-
Automation. For details about obtaining those values, see [Onboarding machines for management by
25-
Azure Automation State Configuration - Secure
26-
registration](../../automation/automation-dsc-onboarding.md#enable-machines-securely-using-registration).
24+
Automation. For details about obtaining those values, see
25+
[Use DSC metaconfiguration to register hybrid machines](/automation/automation-dsc-onboarding.md#Use-DSC-metaconfiguration-to-register-hybrid-machines).
2726

2827
> [!NOTE]
2928
> You might encounter slightly different schema examples. The change in schema occurred in the October 2016 release. For details, see [Update from a previous format](#update-from-a-previous-format).

0 commit comments

Comments
 (0)