Azure-Player / azure.datafactory.devops

Azure DevOps Deployment Tasks for Azure Data Factory objects
MIT License
39 stars 21 forks source link

Az-accounts version issue on hosted Microsoft DevOps Agent #119

Closed BeneHa closed 1 year ago

BeneHa commented 1 year ago

Hi Kamil,

we are using your package in Azure DevOps on hosted agents and since the new year deployments do not work any more with this error message:

##[error]This module requires Az.Accounts version 2.10.4.
An earlier version of Az.Accounts is imported in the current PowerShell session.
Please open a new session before importing this module.
This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system.
Please see https://aka.ms/azps-version-error for troubleshooting information.

The pipeline itself is very basic:

pool:
  vmImage: windows-2022

stages:
- stage: Publish_nonprod
  jobs:
  - deployment: Deploy_ADF_NONPROD
    strategy:
      runOnce:
        deploy:
          steps:
          - checkout: self
            persistCredentials: true
          - task: BuildADFTask@1
            inputs:
              DataFactoryCodePath: '.......'
              Action: 'Build'
          - task: PublishADFTask@1
            inputs:
              azureSubscription: '......'
              ResourceGroupName: '.....'
              DataFactoryName: '.....'
              DataFactoryCodePath: '.....'
              Location: 'westeurope'
              DeleteNotInSource: true
              CreateNewInstance: false
              PublishMethod: 'AzResource'
            displayName: 'Publish nonprod ADF'

I tried using windows-2019 and windows-2022 as agents and creating a Powershell script before the task installing Az or Az-accounts versions or uninstalling them but nothing worked so far. I also did no see a requirement for Az.Accounts 2.10.4 anywhere in the code of this package.

I am still not sure if the issue is more with our setup or with the package itself. Can you let us know what the issue is or how we can avoid it?

Thanks and best regards Benedikt

NowinskiK commented 1 year ago

The whole thread will be continued here: https://github.com/Azure-Player/azure.datafactory.devops/issues/118