release pipeline
5 TopicsAccess pipeline variables in Azure Release for classic python task
I have a Python script that has url, token, location, and version as environment variables. I trigger it using the classic Python task. I declared these variables inside the pipeline variables section, and inside the code, I did the following: import os os.environ['url'] os.environ['token'] but I get keyerror: 'url' I came across this https://stackoverflow.com/questions/73609993/azure-release-pipeline-environment-variables-on-python-script, which creates a variable group and passes the environment variables as arguments. But this step follows inline script based execution.6.2KViews0likes2CommentsExporting Json from Release Pipeline (Classic View) Agent Pool Information Missing
Hi All, I recently setup a rather dynamic release pipeline for our environment, I would like to export the release pipeline's json file and import it again and point it to a different artifact (build pipeline) So far everything works well, but when exporting the json file it seems like it does not export the Agent Pool config, it keeps the agentSpecification as "ubuntu-20.04" "deployPhases": [ { "deploymentInput": { "parallelExecution": { "parallelExecutionType": 0 }, "agentSpecification": { "identifier": "ubuntu-20.04" }, "skipArtifactsDownload": false, "artifactsDownloadInput": { "downloadInputs": [ { "alias": "", "artifactType": "Build", "artifactDownloadMode": "Skip", "artifactItems": [] } ] }, "queueId": 189, "demands": [], "enableAccessToken": true, "timeoutInMinutes": 0, "jobCancelTimeoutInMinutes": 1, "condition": "succeeded()", "overrideInputs": {} In turn, when I re-import this json file I have to go to the "Agent Job" tab and select the Agent Pool as "Azure Pipelines", and again select the Agent Specification as "ubuntu-20.4" Can someone please assist with the name/value so that i can update the exported json with the Azure Pipelines agentPool, I want to use this json file as a release pipeline template for a line of applications we have. What I have tried (purely thumb sucking the entry as: "agentPool": { "name": "Azure Pipelines", "poolType": "automation" }, "agentSpecification": { "identifier": "ubuntu-20.04" }, But the unfortunately did not work, the file imported fine but the value was not populated in the Agent job view. Best Regards.5KViews0likes0CommentsServer stops after the restart bash script pipeline task is finished
Hey Everyone, We are using bash script task to restart tomcat server after deployment is done. But the server is immediately stopped when this task is finished. We tried sleeping longer to let the script finish, but even after sleep time server just stops. We are unable to restart server after deployment. We also tried nohup and & to run the restart script in background, but no help. Can someone please help us, as this has halted our release1.3KViews0likes1CommentHow can we backup application and database during deployment in azure release pipeline?
Hi All, I am pretty much new to devops world and currently evaluating devops pipelines to automate deployments in our organisation. After doing some R&D, we are able setup build and release pipelines to deploy asp.net website to Azure VM - IIS deployment. But unable to figure out how to backup both application folder and database before deploying, to rollback to previous stage in case of any issues. Can anyone share your knowledge on this ? Thank you.1.1KViews0likes0CommentsRun powershell script on Devops with paramter
We have created below script which is exporting send port details from binding file post deployment and then comparing the send port name from a csv lookup sheet we are exporting a new csv file having some interface details. so the script is working fine when we are running on the server but we are trying to run the same script in azure Devops pipeline mentioned the script path and argument then it failing with below error. Script running fine in server: $finalBinding = [xml](Get-Content 'D:\agent\BIZTALK_DEPLOY1\r17\a/_BOS.DMS.Parts.Master/drop/Binding.xml') $finalBinding.BindingInfo.SendPortCollection.SendPort.Name | out-file "C:\Script\test.csv" import-csv "C:\Script\test.csv" -Header SendPort | sort SendPort | export-csv "C:\Script\output.csv" -NoTypeInformation Remove-Item –path "C:\Script\test.csv" $BindingData = Import-Csv -Path "C:\Script\output.csv" $LookupData = Import-Csv -Path "C:\Script\Interfacedetails.csv" $UserOutput = @() ForEach ($name in $BindingData) { $userMatch = $LookupData | where {$_.SendPort -eq $name.SendPort} If($userMatch) { $UserOutput += New-Object PsObject -Property @{InterfaceName=$userMatch.InterfaceName;ApplicationTo=$userMatch.ApplicationTo;ApplicationFrom =$userMatch.ApplicationFrom;InterfaceID=$userMatch.InterfaceID;DataObject=$userMatch.DataObject} } } $UserOutput | export-csv "C:\Script\FILE.csv" -NoTypeInformation Import-CSV C:\Script\FILE.csv | Select-Object InterfaceName, InterfaceID, DataObject, ApplicationFrom, ApplicationTo | Export-CSV C:\Script\ExportedCSV\Final.csv -NoTypeInformation Remove-Item –path "C:\Script\FILE.csv" Remove-Item –path "C:\Script\output.csv" Running the same script with Argument: $finalBinding = [xml](Get-Content –path $bindingpath) $finalBinding.BindingInfo.SendPortCollection.SendPort.Name | out-file "C:\Script\test.csv" import-csv "C:\Script\test.csv" -Header SendPort | sort SendPort | export-csv "C:\Script\output.csv" -NoTypeInformation Remove-Item –path "C:\Script\test.csv" $BindingData = Import-Csv -Path "C:\Script\output.csv" $LookupData = Import-Csv -Path "C:\Script\Interfacedetails.csv" $UserOutput = @() ForEach ($name in $BindingData) { $userMatch = $LookupData | where {$_.SendPort -eq $name.SendPort} If($userMatch) { $UserOutput += New-Object PsObject -Property @{InterfaceName=$userMatch.InterfaceName;ApplicationTo=$userMatch.ApplicationTo;ApplicationFrom =$userMatch.ApplicationFrom;InterfaceID=$userMatch.InterfaceID;DataObject=$userMatch.DataObject} } } $UserOutput | export-csv "C:\Script\FILE.csv" -NoTypeInformation Import-CSV C:\Script\FILE.csv | Select-Object InterfaceName, InterfaceID, DataObject, ApplicationFrom, ApplicationTo | Export-CSV C:\Script\ExportedCSV\Final.csv -NoTypeInformation Remove-Item –path "C:\Script\FILE.csv" Remove-Item –path "C:\Script\output.csv" I have declared the variable for $bindingpath = $(System.DefaultWorkingDirectory)/_BOS.DMS.Parts.Master/drop/Binding.xml But its failing with below error: Formatted command: . 'C:\Script\powershellscript.ps1' System.DefaultWorkingDirectory/_BOS.DMS.Parts.Master/drop/Binding.xml 2022-07-05T11:09:43.7113613Z ========================== Starting Command Output =========================== 2022-07-05T11:09:43.7250585Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\agent\BIZTALK_DEPLOY1_temp\9b6ede3b-af5a-4813-9fc9-9d343c347be2.ps1'" 2022-07-05T11:09:44.0505059Z At C:\Script\powershellscript.ps1:24 char:15 2022-07-05T11:09:44.0505593Z + Remove-Item –path C:\Script\output.csv 2022-07-05T11:09:44.0505849Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~ 2022-07-05T11:09:44.0506103Z The string is missing the terminator: ". 2022-07-05T11:09:44.0506460Z + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException 2022-07-05T11:09:44.0507271Z + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString please help me to resolve the issue.949Views0likes1Comment