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

Still getting spaces in queries #276

Closed zameer712 closed 1 year ago

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.

with: inlineScript: $RootFolderADO = "D:\a\repo-datafactory\repo-datafactory/ADOJSON" $RootFolderConfig = "D:\a\repo-datafactory\repo-datafactory/Configurations/datafactory.json"
Get-ChildItem $RootFolderADO Install-Module -Name Az.Resources -RequiredVersion 9.0.1 -Force Get-PSRepository 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 Get-Module -Name azure.datafactory.tools $SubscriptionName = 'datafactory' Set-AzContext -Subscription $SubscriptionName $ResourceGroupName = 'datafactory' $DataFactoryName = "datafactory" $Location = "westeurope"
Publish-AdfV2FromJson -RootFolder $RootFolderADO -ResourceGroupName $ResourceGroupName -DataFactoryName $DataFactoryName -Location $Location -Stag... azPSVersion: latest errorActionPreference: Stop failOnStandardError: false githubToken: ** env: AZURE_HTTP_USER_AGENT: AZUREPS_HOSTENVIRONMENT: Validating inputs Module Az latest installed from hostedAgentFolder Initializing Az Module "C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo -NoProfile -NonInteractive -Command Test-Path (Join-Path C:\Modules az) "C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo -NoProfile -NonInteractive -Command "try { $ErrorActionPreference = \"Stop\" $WarningPreference = \"SilentlyContinue\" $output = @{} $data = Get-Module -Name Az -ListAvailable
Sort-Object Version -Descending Select-Object -First 1 $output['AzVersion'] = $data.Version.ToString() $output['Success'] = \"true\" } catch { $output['Error'] = $_.exception.Message } return ConvertTo-Json $output" True { "AzVersion": "9.2.0", "Success": "true" } Initializing Az Module Complete Running Az PowerShell Script Mode LastWriteTime Length Name

d---- 1/16/2023 11:45 AM factory d---- 1/16/2023 11:45 AM integrationRuntime d---- 1/16/2023 11:45 AM linkedService d---- 1/16/2023 11:45 AM managedVirtualNetwork d---- 1/16/2023 11:45 AM pipeline d---- 1/16/2023 11:45 AM trigger -a--- 1/16/2023 11:45 AM 31 publish_config.json 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.

This is the way iam using please help** in fixing it

zameer712 commented 1 year ago

Guys any update on this please @NowinskiK :)

NowinskiK commented 1 year ago

Try the solution described in #265

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

Trisrobinson commented 1 year ago

Had the same issue too and the workarounds on #265 resolved it.

The issue we had was that by removing the white spaces the dependencies on deployment broke and we received the error - The document creation or update failed because of invalid reference ‘pipeline name without spaces’.

set azurePowerShellVersion property to 9.0.1 on the AzurePowerShell@4 task in the yaml. I also set Az.Resouces to 6.4.1 too.

NowinskiK commented 1 year ago

Is above solutions work for you, @zameer712 ?