-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support parameterization of arrays in CICD script
- Loading branch information
Showing
1 changed file
with
10 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 470 doesn't seem to be working -and I see that I was changed in the last commit. Seems to have some issue with the operators or something:
At D:\a\r1\a_main_branch\zzDeploymentScripts\PrePostDeploymentScript.ps1:470 char:74
Unexpected token '?' in expression or statement.
PowerShell exited with code '1'.
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just confirmed that by replacing lines 470 to 478 with the previous code it works again.
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are right. I'm running it using an Agent which I didn't install named "Hosted Windows 2019 with VS2019". Maybe that is hosting an old Powershell version. Thanks for the advice, I'll ask the DevOps teams to check the Powershell version in it.
Thanks!
Diego.
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using azure hosted agents with windows-latest. Attempted to use power shell core to run the PrePostDeploymentScript.ps1. Verified that we're on psversion 7.2.8, but now Get-AzDataFactoryV2Trigger isn't found. What are the steps for this to work in an azure hosted agent? thanks
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@feverfunk What task did you try? It worked fine on my pipeline by setting "Use PowerShell Core" optioin of AzurePowerShell@5 on Microsoft-hosted agent with window-latest image.
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how i've solved the issue:
Change the Agent Specification to ubuntu-latest
This fix may be regional. For West Eu it worked.
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shukino - Many thanks. We originally backed out the offending changes and it worked. Obviously we didn't look at the doc for AzurePowerShell@5. Thanks so much for your help!
to answer your question, we assumed (incorrectly) that AzurePowerShell@5 was limited to a version lower than version 7. So we tried using a powershell task with pwsh: true. Our team member who setup the original pipelines is no longer with us, so we had a learning curve to overcome.
thanks again!
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ my team is having the same issue with bool
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just cost me half a day debugging. 👎 How is it possible to have this reported for two weeks without any fix?
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @soma-ms,
When I was trying to understand the script, I noticed that the triggers from the Prod environment "Prd - Trigger Main - every 2 hours 0540 - 2040" are also stopped during pre-deployment handling, even if it is not currently running.
2023-02-02T07:25:51.6042857Z Stopping 1 triggers
2023-02-02T07:25:51.6057083Z
2023-02-02T07:25:51.6063827Z Stopping trigger Prd - Trigger Main - alle 2 Stunden 0540 - 2040
2023-02-02T07:25:53.3660300Z True
During post-deployment handling, however, the DEV trigger "Dev - Trigger Main - twice a week Mon and Thu 0900" from the template is started but not the previously stopped trigger from the Prod environment.
2023-02-02T07:26:53.7790200Z Starting 1 triggers
2023-02-02T07:26:53.7816906Z Starting trigger Dev - Trigger Main - twice a week Mo and Thu 0900
2023-02-02T07:26:55.6057564Z True
Is this how the PowerShell script is supposed to work or is this an error? From the description I had understood that after the deplovemt the trigger from the Prod environment remains active. This simplifies the use of different triggers from different environments.
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are using the latest version while faield for post depolyment. Any idea why the depth is configured / hardcoded as 10?
2023-02-06T02:46:01.9494897Z ##[error] Conversion from JSON failed with error: The reader's MaxDepth of 10 has been exceeded. Path 'properties.pipelines[0].parameters.cw_items[0].copyActivity.translator.mappings[0]', line 28, position 21. from Line: 680
2023-02-06T02:46:02.0744316Z ##[error]Conversion from JSON failed with error: The reader's MaxDepth of 10 has been exceeded. Path 'properties.pipelines[0].parameters.cw_items[0].copyActivity.translator.mappings[0]', line 28, position 21.
2023-02-06T02:46:02.1936014Z ##[error]PowerShell exited with code '1'.
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script won't stop the triggers that are not active in live mode. It only stops the active triggers and if scripts find trigger payload change. And in rare cases script might error out while comparing trigger payload and treats that as trigger change.
0c60517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overlooked that json can go beyond the depth of 10, update that to be configurable in latest script with default depth as 100.