You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/automation/az-modules.md
+14-7Lines changed: 14 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,24 +9,31 @@ ms.topic: conceptual
9
9
10
10
# Az module support in Azure Automation
11
11
12
-
Azure Automation supports the use of [Azure PowerShell Az module](/powershell/azure/new-azureps-module-az?view=azps-1.1.0) in your runbooks. The rollup Az module is not imported automatically in any new or existing Automation accounts.
12
+
Azure Automation supports the use of the [Azure PowerShell Az module](/powershell/azure/new-azureps-module-az?view=azps-1.1.0) in your runbooks. The rollup Az module is not imported automatically in any new or existing Automation accounts.
13
13
14
14
## Considerations
15
15
16
-
There are many things to take into consideration when using the rollup Az module in Azure Automation. Runbooks and modules can be used by higher-level solutions in your Automation account. Editing runbooks or upgrading modules can potentially cause issues with your runbooks. You should test all runbooks and solutions carefully in a separate Automation account before importing new Az modules. Any modifications to modules can negatively affect the [Start/Stop](automation-solution-vm-management.md) solution. We don't recommend altering modules and runbooks in Automation accounts that contain any solutions. This behavior isn't specific to the Az modules. It should be taken into consideration when introducing any changes to your Automation account.
16
+
There are several things to take into consideration when using the Az modules in Azure Automation:
17
17
18
-
Importing an Az module in your Automation account doesn't automatically import the module in the PowerShell session that the runbooks use. Modules are imported into the PowerShell session in the following situations:
18
+
* Higher-level solutions in your Automation account can use runbooks and modules. Therefore, editing runbooks or upgrading modules can potentially cause issues with your solutions. You should test all runbooks and solutions carefully in a separate Automation account before importing new Az modules.
19
19
20
-
* When a runbook invokes a cmdlet from a module
21
-
* When a runbook imports the module explicitly with the `Import-Module` cmdlet
22
-
* When a runbook imports another module depending on the module
20
+
* Any modifications to modules can negatively affect the [Start/Stop](automation-solution-vm-management.md) solution.
21
+
22
+
* Importing an Az module in your Automation account doesn't automatically import the module in the PowerShell session that runbooks use. Modules are imported into the PowerShell session in the following situations:
23
+
24
+
* When a runbook invokes a cmdlet from a module
25
+
* When a runbook imports the module explicitly with the `Import-Module` cmdlet
26
+
* When a runbook imports another module depending on the module
27
+
28
+
> [!NOTE]
29
+
> We don't recommend altering modules and runbooks in Automation accounts that contain any solutions. This provision isn't specific to the Az modules. It should be taken into consideration when introducing any changes to your Automation account.
23
30
24
31
> [!IMPORTANT]
25
32
> Make sure that runbooks in an Automation account import either Az modules or [AzureRM](https://www.powershellgallery.com/packages/AzureRM/6.13.1) modules, but not both, into a PowerShell session. If a runbook imports Az modules before AzureRM modules, the runbook completes. However, an error referencing the [Get_SerializationSettings](troubleshoot/runbooks.md#get-serializationsettings) cmdlet shows up in the job streams and cmdlets might not execute properly. If the runbook imports AzureRM modules before Az modules, the runbook also completes. In this case, though, you receive an error in the job streams stating that both Az and AzureRM can't be imported in the same session or used in the same runbook.
26
33
27
34
## Migrating to Az modules
28
35
29
-
It's recommended that you test a migration to Az modules in a test Automation account. Once you create this account, you can use the instructions in this section to work with the modules.
36
+
We recommend that you test a migration to Az modules in a test Automation account. Once you create the account, you can use the instructions in this section to work with the modules.
30
37
31
38
### Stop and unschedule all runbooks that use AzureRM modules
description: This article provides information troubleshooting Azure Automation Hybrid Runbook Workers
3
+
description: This article provides information for troubleshooting Azure Automation Hybrid Runbook Workers.
4
4
services: automation
5
5
ms.service: automation
6
6
ms.subservice:
@@ -125,7 +125,9 @@ The worker's initial registration phase fails and you receive the following erro
125
125
#### Cause
126
126
127
127
The following are possible causes:
128
+
128
129
* There's a mistyped workspace ID or workspace key (primary) in the agent's settings.
130
+
129
131
* The Hybrid Runbook Worker can't download the configuration, causing an account linking error. When Azure enables solutions, it supports only certain regions for linking a Log Analytics workspace and an Automation account. It's also possible that an incorrect date and/or time is set on the computer. If the time is +/-15 minutes from the current time, onboarding fails.
130
132
131
133
#### Resolution
@@ -137,7 +139,7 @@ To verify if the agent's workspace ID or workspace key has been mistyped, see [A
137
139
138
140
Your Log Analytics workspace and Automation account must be in a linked region. For a list of supported regions, see [Azure Automation and Log Analytics workspace mappings](../how-to/region-mappings.md).
139
141
140
-
You might also need to update the date andor time zone of your computer. If you select a custom time range, make sure that the range is in UTC, which can differ from your local time zone.
142
+
You might also need to update the date and/or time zone of your computer. If you select a custom time range, make sure that the range is in UTC, which can differ from your local time zone.
141
143
142
144
## Linux
143
145
@@ -215,6 +217,35 @@ Logs are stored locally on each hybrid worker at **C:\ProgramData\Microsoft\Syst
215
217
216
218
Hybrid workers send [Runbook output and messages](../automation-runbook-output-and-messages.md) to Azure Automation in the same way that runbook jobs running in the cloud send output and messages. You can enable the Verbose and Progress streams just as you do for runbooks.
217
219
220
+
### <aname="no-orchestrator-sandbox-connect-O365"></a>Scenario: Orchestrator.Sandbox.exe can't connect to Office 365 through proxy
221
+
222
+
#### Issue
223
+
224
+
A script running on a Windows Hybrid Runbook Worker can't connect as expected to Office 365 on an Orchestrator sandbox. The script is using [Connect-MsolService](https://docs.microsoft.com/powershell/module/msonline/connect-msolservice?view=azureadps-1.0) for connection.
225
+
226
+
If you adjust **Orchestrator.Sandbox.exe.config** to set the proxy and the bypass list, the sandbox still doesn't connect properly. A **Powershell_ise.exe.config** file with the same same proxy and bypass list settings seems to work as you expect. Service Management Automation (SMA) logs and PowerShell logs don't provide any information regarding proxy.
227
+
228
+
#### Cause
229
+
230
+
The connection to the Active Directory Federation Services (ADFS) on the server can't bypass the proxy. Remember that a PowerShell sandbox runs as the logged user. However, an Orchestrator sandbox is heavily customized and might ignore the **Orchestrator.Sandbox.exe.config** file settings. It has special code for handling machine or MMA proxy settings, but not for handling other custom proxy settings.
231
+
232
+
#### Resolution
233
+
234
+
You can resolve the issue for the Orchestrator sandbox by migrating your script to use the Azure AD modules instead of the MSOnline module for PowerShell cmdlets. See [Migrating from Orchestrator to Azure Automation (Beta)](https://docs.microsoft.com/azure/automation/automation-orchestrator-migration).
235
+
236
+
If you want to continue to use the MSOnline module cmdlets, change your script to use [Invoke-Command](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/invoke-command?view=powershell-7). Specify values for the `ComputerName` and `Credential` parameters.
This code change starts an entirely new PowerShell session under the context of the specified credentials. It should enable the traffic to flow through a proxy server that is authenticating the active user.
245
+
246
+
>[!NOTE]
247
+
>This solution makes it unnecessary to manipulate the sandbox configuration file. Even if you succeed in making the configuration file work with your script, the file gets wiped out each time the Hybrid Runbook Worker agent is updated.
248
+
218
249
### <aname="corrupt-cache"></a>Scenario: Hybrid Runbook Worker not reporting
0 commit comments