Azure Automation PowerShell Error "Assembly with same name is already loaded"
Kazanskyi, Oleg
51
Reputation points
Hello,
I have a script that runs locally but I can't make it run on Azure Automation cloud.
This script records data to the Azure blob and the error is related to the Az module that is the default in Azure Automation.
Here are the error messages:
The 'Connect-AzAccount' command was found in the module 'Az.Accounts', but the module could not be loaded due to the following error:
| [Assembly with same name is already loaded] For more information, run 'Import-Module Az.Accounts'
The term 'New-AzStorageContext' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling
| of the name, or if a path was included, verify that the path is correct and try again.
The term 'Get-AzStorageContainer' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the
| spelling of the name, or if a path was included, verify that the path is correct and try again.
I believe that it's related to the fact there are two Az modules installed.
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,366 questions
Windows for business Windows Server User experience PowerShell
Sign in to answer