Azure-Player / azure.datafactory.tools

Tools for deploying Data Factory (v2) in Microsoft Azure
https://azureplayer.net/adftools
MIT License
209 stars 69 forks source link

Tool removing all spaces from code #265

Closed sauravrout closed 1 year ago

sauravrout commented 1 year ago

Is there any recent change which removes all whitespaces from ADF code. Things were fine till last week, this week's deployment is removing all whitespace characters. Here is how our code looks in git. (Check line number 20)

image

And this is how it got deployed.

image

Not only this, but every code that has a space, now has deployed without space. Below is my deployment script.

Publish-AdfV2FromJson -RootFolder "$(System.DefaultWorkingDirectory)/xxx_Azure_UAT/datafactory" -ResourceGroupName "XXX-uat-rg" -DataFactoryName "XXX-uat-adf" -Location "centralus" -Stage "uat" -Option $opt

unboiled commented 1 year ago

This is also affecting me, all spaces have disappeared in the target.

daandes commented 1 year ago

This is also effecting us, is it possible to specify a version as parameter in the Install-Module powershell command?

unboiled commented 1 year ago

You can use for example:

Install-Module "azure.datafactory.tools" -RequiredVersion 0.101.0 -force

Viguro79 commented 1 year ago

@daandes @unboiled @sauravrout Same issue here with an older custom version of azure.datafactory.tools (based on 0.97). In our case, it appears than the last version of the pswh module Az.Resources was responsible of this issue. (Right, we use the default AzResource publish method). Version 6.5.0 published 3 days ago > KO We forced the installation of the previous version (6.4.1) in our code and everything is now working as expected. pwsh -Command Install-Module Az.Resources -RequiredVersion "6.4.1" -Force

unboiled commented 1 year ago

@Viguro79 Yes this is it, setting Az.Resources to an older version solves the problems for now! Thanks!

NowinskiK commented 1 year ago

@Viguro79 that's very good spot. Thanks for helping the community and sharing the knowledge here.

kush316 commented 1 year ago

It fixed after using AZ.Resources 6.4.1

image
danielmadison84 commented 1 year ago

Please reopen this issue! Many people experiencing it with az_9.2.0 module in Powershell as of January 12 2023. My team found a temporary resolution, switching ubuntu-latest to ubuntu-18.04 in your YML file lets you use az_9.0.1 previous version that does not have this issue.

galilio-hub commented 1 year ago

Facing the same issue as of January 13 2023. I found a workaround instead of switching the agent which is to set "preferredAzurePowerShellVersion: '9.0.1'" in the AzurePowerShell task. Thanks a lot @danielmadison84 for the suggestion!

zameer712 commented 1 year ago

**> Facing the same issue as of January 13 2023. I found a workaround instead of switching the agent which is to set "preferredAzurePowerShellVersion: '9.0.1'" in the AzurePowerShell task. Thanks a lot @danielmadison84 for the suggestion!

@galilio-hub / @Viguro79 please help with command you are using to set in powershell , Iam trying this way but its not working @NowinskiK please help

Install-Package: No match was found for the specified search criteria and module name 'Az.Resources'. Try Get-PSRepository to see all available registered module repositories.

      pwsh -Command Install-Module Az.Resources -RequiredVersion "9.0.1" -Force
      Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
      Install-Module -Name Az.DataFactory -Repository PSGallery -Force  
      Install-Module -Name azure.datafactory.tools -Repository PSGallery -Force
      Import-Module -Name azure.datafactory.tools
      Update-Module -Name azure.datafactory.tools

Install-Package: The following commands are already available on this Publish-AdfV2FromJson -RootFolder $RootFolderADO -ResourceGroupName $ResourceGroupName -DataFactoryName $DataFactoryName -Location $Location -Stage $RootFolderConfig
azPSVersion: "latest"

This is the way iam using please help**

Viguro79 commented 1 year ago

Simply use this pwsh command in order to fix the Az.Resources version before calling the azure.datafactory.tools : Install-Module Az.Resources -RequiredVersion "6.4.1" -Force

danielmadison84 commented 1 year ago

Simply use this pwsh command in order to fix the Az.Resources version before calling the azure.datafactory.tools : Install-Module Az.Resources -RequiredVersion "6.4.1" -Force

Can this be done in an Azure hosted deployment agent?

tloy1966 commented 1 year ago

Not sure this 9.3.0 version fix this issue:

Az.Resources Fixed issue introduced in previous fix for 'Set-AzPolicySetDefinition' InternalServerError when the initiative is too large [https://github.com/Azure/azure-powershell/issues/20238], which will remove space in value.

Reference: https://github.com/Azure/azure-powershell/releases/tag/v9.3.0-January2023

kiru87 commented 1 year ago

Did 9.3.0 version resolved the issue?