I have an Azure Release Pipeline with an Azure Powershell Task inline script that fails. I am running a self hosted build agent. The Powershell command works fine when I execute it locally from Windows Powershell. The task is attempting to start a DataFactory SSIS Integration Runtime:
Start-AzDataFactoryV2IntegrationRuntime -ResourceGroupName "MyResourceGroup"
-DataFactoryName "my-data-factory"
-Name "myIntegrationRuntime1"
-Force
Firstly I get a warning:
WARNING: AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.
And then the error:
The 'Start-AzDataFactoryV2IntegrationRuntime' command was found in the module 'Az.DataFactory', but the module could not be loaded. For more information, run 'Import-Module Az.DataFactory'.
When I look at the installed modules, I see both AzureRM and Az are installed, and although I run the command Import-Module Az.DataFactory
I do not see it in the list of installed modules.