Azure-Player / azure.datafactory.devops

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

Support Powershell Core #64

Closed BenoityipMSFT closed 2 years ago

BenoityipMSFT commented 2 years ago

Is your feature request related to a problem? Please describe. My client does not want to install the old Powershell in the build machine. Only Powershell Core is installed

Describe the solution you'd like A check box in the component to support Powershell Core

Describe alternatives you've considered I am planning to call adf tools powershell script directly in the Powershell Task in Release pipeline, but not sure if it works

Additional context Add any other context or screenshots about the feature request here.

jikuja commented 2 years ago

Only Powershell Core is installed

Works on my Mac and on MS Hosted Azure DevOps Linux build agents. More information is probably needed.

NowinskiK commented 2 years ago

Many times I use PS 7.1.x and it works perfectly. @BenoityipMSFT, what exactly problem do you experience?

BenoityipMSFT commented 2 years ago

My apology, this issue should be posted in "Publish Data Factory" in here

The error I am getting is "Could not find the modules: 'Az.Accounts' with Version: ''. If the module was recently installed, retry after restarting the Azure Pipelines task agent."

I have asked the client to install Latest Az, but his response is "The non-powershell Core version in the build machine will contain the older AZ. Projects that need the newer AZ are asked to use Powershell Core." He is reluctant to install latest Az on non-powershell Core, because it might break the build in existing software, so he is asking me to redirect the code to use latest Powershell Core.

so I am asking whether a way in the module to see whether we can redirect the module to use Powershell Core in the "Publish ADF" module? Screenshot is attached image

image

jikuja commented 2 years ago

Currently, there are no workarounds/option to make PowerShell-based tasks to support PowerShell core, and the situation is not going to get fixed. ref: https://github.com/microsoft/azure-pipelines-task-lib/issues/314

It is possible to write task entrypoint with typescript but then there would be two entrypoints to maintain unless migrating from PowerShell entrypoint to typescript only.

The workaround I used for Linux-based runners: Just use AzurePowershell task, install the tool and then run CmdLet to test or deploy JSONs.

NowinskiK commented 2 years ago

Related to #24 TBH, I'm not really keen to invest my private time to develop some workaround just because Microsoft won't invest their resources to resolve this for many people, customers, community.