@@ -7,7 +7,7 @@ ms.custom: devx-track-azurepowershell
7
7
---
8
8
# Azure Automation state configuration to machine configuration migration planning
9
9
10
- [ !INCLUDE [ Machine config rename banner] ( ../includes/banner.md )]
10
+ [ !INCLUDE [ Machine configuration rename banner] ( ../includes/banner.md )]
11
11
12
12
Machine configuration is the latest implementation of functionality that has been provided by Azure
13
13
Automation State Configuration (also known as Azure Automation Desired State Configuration, or
@@ -28,8 +28,8 @@ Before you begin, it's a good idea to read the conceptual overview information a
28
28
29
29
## Understand migration
30
30
31
- The best approach to migration is to redeploy content first, and then migrate machines. The
32
- expected steps for migration are outlined .
31
+ The best approach to migration is to redeploy content first, and then migrate machines. This
32
+ section outlines the expected steps for migration.
33
33
34
34
1 . Export configurations from Azure Automation
35
35
1 . Discover module requirements and load them in your environment
@@ -45,29 +45,28 @@ older versions of DSC in [Windows][02] and [Linux][03]. The implementations are
45
45
there's no conflict detection.
46
46
47
47
Machine configuration doesn't require publishing modules or configurations in to a service, or
48
- compiling in a service. Instead, content is developed and tested using purpose-built tooling and
49
- published anywhere the machine can reach over HTTPS (typically Azure Blob Storage).
48
+ compiling in a service. Instead, you develop and test content using purpose-built tooling and
49
+ publish the content anywhere the machine can reach over HTTPS (typically Azure Blob Storage).
50
50
51
- If you decide the right plan for your migration is to have machines in both services for some
52
- period of time, while that could be confusing to manage, there are no technical barriers. The two
53
- services are independent.
51
+ If you decide to have machines in both services for some period of time, there are no technical
52
+ barriers. The two services are independent.
54
53
55
54
## Export content from Azure Automation
56
55
57
- Start by discovering and exporting content from Azure Automation State Configuration in to a
56
+ Start by discovering and exporting content from Azure Automation State Configuration into a
58
57
development environment where you create, test, and publish content packages for machine
59
58
configuration.
60
59
61
60
### Configurations
62
61
63
- Only configuration scripts can be exported from Azure Automation. It isn't possible to export Node
64
- configurations, or compiled MOF files. If you published MOF files directly in to the Automation
62
+ You can only export configuration scripts from Azure Automation. It isn't possible to export node
63
+ configurations, or compiled MOF files. If you published MOF files directly into the Automation
65
64
Account and no longer have access to the original file, you must recompile from your private
66
- configuration scripts, or possibly re-author the configuration if the original can't be found .
65
+ configuration scripts. If you can't find the original configuration, you must re-author it .
67
66
68
67
To export configuration scripts from Azure Automation, first identify the Azure Automation account
69
- that contains the configurations and the name of the Resource Group where the Automation Account is
70
- deployed .
68
+ that has the configurations and the name of the Resource Group the Automation Account is deployed
69
+ in .
71
70
72
71
Install the PowerShell module ** Az.Automation** .
73
72
@@ -96,8 +95,8 @@ LastModifiedBy :
96
95
Tags : {}
97
96
```
98
97
99
- Discover the configurations in your Automation Account. The output contains one entry per
100
- configuration. If you have many, store the information as a variable so it's easier to work with.
98
+ Discover the configurations in your Automation Account. The output has one entry per configuration.
99
+ If you have many, store the information as a variable so it's easier to work with.
101
100
102
101
``` azurepowershell-interactive
103
102
$getParams = @{
@@ -146,9 +145,9 @@ UnixMode User Group LastWriteTime Size N
146
145
147
146
After you've discovered your accounts and the number of configurations, you might wish to export
148
147
all configurations to a local folder on your machine. To automate this process, pipe the output of
149
- each command above to the next.
148
+ each command in the earlier examples to the next command .
150
149
151
- The example exports 5 configurations. The output pattern is the only indication of success.
150
+ The example exports 5 configurations. The output pattern is the only indicator of success.
152
151
153
152
``` azurepowershell-interactive
154
153
Get-AzAutomationAccount |
@@ -168,14 +167,14 @@ UnixMode User Group LastWriteTime Size N
168
167
169
168
#### Consider decomposing complex configuration files
170
169
171
- Machine configuration can manage multiple configurations per machine. Many configurations written
172
- for Azure Automation State Configuration assumed the limitation of managing a single configuration
173
- per machine. To take advantage of the expanded capabilities offered by machine configuration, large
174
- configuration files can be divided into many smaller configurations where each handles a specific
175
- scenario.
170
+ Machine configuration can manage more than one configuration per machine. Many configurations
171
+ written for Azure Automation State Configuration assumed the limitation of managing a single
172
+ configuration per machine. To take advantage of the expanded capabilities offered by machine
173
+ configuration, you can divide large configuration files into many smaller configurations where each
174
+ handles a specific scenario.
176
175
177
176
There is no orchestration in machine configuration to control the order of how configurations are
178
- sorted, so keep steps in a configuration together in one package if they are required to happen
177
+ sorted. Keep steps in a configuration together in one package if they're required to happen
179
178
sequentially.
180
179
181
180
### Modules
@@ -188,14 +187,14 @@ migration, use PowerShell to query Azure Automation for the name and version of
188
187
If you are using modules that are custom authored and only exist in your private development
189
188
environment, it isn't possible to export them from Azure Automation.
190
189
191
- If a custom module is required for a configuration and is in the account, but you can't find it in
192
- your environment , you won't be able to compile the configuration, which means you won't be able to
190
+ If you can't find a custom module in your environment that's required for a configuration and in
191
+ the account , you won't be able to compile the configuration. This means you won't be able to
193
192
migrate the configuration.
194
193
195
194
#### List modules imported in Azure Automation
196
195
197
- To retrieve a list of all modules that are installed in your automation account, use the
198
- ` Get-AzAutomationModule ` command. The property ** IsGlobal** tells you if the module is built in to
196
+ To retrieve a list of all modules installed in your automation account, use the
197
+ ` Get-AzAutomationModule ` command. The property ** IsGlobal** tells you if the module is built into
199
198
Azure Automation always, or if it was published to the account.
200
199
201
200
For example, to create a list of all modules published to any of your accounts.
@@ -207,8 +206,8 @@ Get-AzAutomationAccount |
207
206
```
208
207
209
208
You can also use the PowerShell Gallery as an aid in finding details about modules that are
210
- publicly available. For example, the list of modules that are built in to new Automation Accounts,
211
- and that contain DSC resources, is produced by the following example .
209
+ publicly available. The following example lists the modules that are built into new Automation
210
+ Accounts and contain DSC resources.
212
211
213
212
``` azurepowershell-interactive
214
213
Get-AzAutomationAccount |
@@ -219,6 +218,7 @@ Get-AzAutomationAccount |
219
218
Select-Object -Property Name, Version -Unique |
220
219
Format-Table -AutoSize
221
220
```
221
+
222
222
``` Output
223
223
Name Version
224
224
---- -------
@@ -231,17 +231,17 @@ xPowerShellExecutionPolicy 3.1.0.0
231
231
xRemoteDesktopAdmin 1.1.0.0
232
232
```
233
233
234
- #### Download modules from PowerShell Gallery or PowerShellGet repository
234
+ #### Download modules from PowerShell Gallery or a PowerShellGet repository
235
235
236
236
If the modules were imported from the PowerShell Gallery, you can pipe the output from
237
237
` Find-Module ` directly to ` Install-Module ` . Piping the output across commands provides a solution
238
238
to load a developer environment with all modules currently in an Automation Account that are
239
239
available publicly in the PowerShell Gallery.
240
240
241
- The same approach could be used to pull modules from a custom NuGet feed, if the feed is registered
242
- in your local environment as a [ PowerShellGet repository] [ 04 ] .
241
+ You can use the same approach to pull modules from a custom NuGet feed if you have registered the
242
+ feed in your local environment as a [ PowerShellGet repository] [ 04 ] .
243
243
244
- The ` Find-Module ` command in the example doesn't suppress errors, meaning any modules not found in
244
+ The ` Find-Module ` command in this example doesn't suppress errors, meaning any modules not found in
245
245
the gallery return an error message.
246
246
247
247
``` azurepowershell-interactive
@@ -257,15 +257,15 @@ Get-AzAutomationAccount |
257
257
258
258
If you've exported configuration scripts from Azure Automation, you can also review the contents
259
259
for details about which modules are required to compile each configuration to a MOF file. This
260
- approach would only be needed if you find configurations in your Automation Accounts where the
261
- modules have been removed. The configurations would no longer be useful for machines, but they
262
- might still be in the account.
260
+ approach is only needed if you find configurations in your Automation Accounts where the modules
261
+ have been removed. The configurations would no longer be useful for machines, but they might still
262
+ be in the account.
263
263
264
264
Towards the top of each file, look for a line that includes ` Import-DscResource ` . This command is
265
- only applicable inside a configuration, and is used to load modules at the time of compilation.
265
+ only applicable inside a configuration, and it's used to load modules at the time of compilation.
266
266
267
- For example, the ` WindowsIISServerConfig ` configuration in the PowerShell Gallery
268
- contains the lines in this example.
267
+ For example, the ` WindowsIISServerConfig ` configuration in the PowerShell Gallery has the lines in
268
+ this example.
269
269
270
270
``` powershell
271
271
configuration WindowsIISServerConfig
@@ -280,24 +280,24 @@ module **PSDesiredStateConfiguration**.
280
280
281
281
### Test content in Azure machine configuration
282
282
283
- The best way to evaluate whether your content from Azure Automation State Configuration can be used
284
- with machine configuration is to follow the step-by-step tutorial in the page
283
+ To evaluate whether you can use your content from Azure Automation State Configuration with machine
284
+ configuration, follow the step-by-step tutorial in the page
285
285
[ How to create custom machine configuration package artifacts] [ 05 ] .
286
286
287
287
When you reach the step [ Author a configuration] [ 06 ] , the configuration script that generates a MOF
288
288
file should be one of the scripts you exported from Azure Automation State Configuration. You must
289
289
have the required PowerShell modules installed in your environment before you can compile the
290
290
configuration to a MOF file and create a machine configuration package.
291
291
292
- #### What if a module does not work with machine configuration?
292
+ #### What if a module doesn't work with machine configuration?
293
293
294
- Some modules might encounter compatibility issues with machine configuration. The most common
294
+ Some modules might have compatibility issues with machine configuration. The most common
295
295
problems are related to .NET framework vs .NET core. Detailed technical information is available on
296
296
the page, [ Differences between Windows PowerShell 5.1 and PowerShell 7.x] [ 07 ] .
297
297
298
298
One option to resolve compatibility issues is to run commands in Windows PowerShell from within a
299
- module that is imported in PowerShell 7, by running ` powershell.exe ` . You can review a sample
300
- module that uses this technique in the Azure-Policy repo where it is used to audit the state of
299
+ module that's imported in PowerShell 7, by running ` powershell.exe ` . You can review a sample module
300
+ that uses this technique in the Azure-Policy repository where it's used to audit the state of
301
301
[ Windows DSC Configuration] [ 08 ] .
302
302
303
303
The example also illustrates a small proof of concept.
@@ -349,7 +349,7 @@ Azure Automation State Configuration.
349
349
350
350
Machines outside of Azure [ can be registered to Azure Automation State Configuration] [ 13 ] , but they
351
351
don't have a machine resource in Azure. The connection to Azure Automation is handled by the Local
352
- Configuration Manager (LCM) service inside the machine and the record of the node is managed as a
352
+ Configuration Manager (LCM) service inside the machine. The record of the node is managed as a
353
353
resource in the Azure Automation provider type.
354
354
355
355
Before removing a machine from Azure Automation State Configuration, onboard each node as an
@@ -371,8 +371,8 @@ Details about known issues are provided in this section.
371
371
372
372
### Exporting configurations results in "\\ " character in file name
373
373
374
- When using PowerShell on macOS and Linux, you encounter issues dealing with the file names output
375
- by ` Export-AzAutomationDSCConfiguration ` .
374
+ When using PowerShell on macOS and Linux, you may have issues dealing with the file names output by
375
+ ` Export-AzAutomationDSCConfiguration ` .
376
376
377
377
As a workaround, a module has been published to the PowerShell Gallery named
378
378
[ AADSCConfigContent] [ 16 ] . The module has only one command, which exports the content of a
@@ -382,7 +382,7 @@ configuration stored in Azure Automation by making a REST request to the service
382
382
383
383
- [ Create a package artifact] [ 05 ] for machine configuration.
384
384
- [ Test the package artifact] [ 17 ] from your development environment.
385
- - [ Publish the package artifact] [ 18 ] so it is accessible to your machines.
385
+ - [ Publish the package artifact] [ 18 ] so it's accessible to your machines.
386
386
- Use the ** GuestConfiguration** module to [ create an Azure Policy definition] [ 19 ] for at-scale
387
387
management of your environment.
388
388
- [ Assign your custom policy definition] [ 20 ] using Azure portal.
0 commit comments