Unable to run next task in Azure DevOPs after starting appium server - azure

After starting the appium server in azure devops, it cant execute the next task. I want after starting the server, next task will be executed.

Related

Package deployment using ZIP Deploy failed with Azure DevOps Pipeline

I am trying to deploy an application to windows based App Service in Azure using Azure DevOps Pipeline. For the first time, I don't see any issues and deployment got successful. But the next time, it got failed. I am getting the below error.
Failed to deploy web package to App Service.
To debug further please check Kudu stack trace URL : https://$XYZ-dev:***#XYZ-dev.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace
Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
When I go to the App Service in Azure Portal and from Deployment Center if I disconnect and trigger the pipeline, it get successful. But again next time it got failed.
Please anyone let us know the fix for this issue.
Thanks.

Integrating Local Jenkins Setup with Azure Dev OPS

I wanted to know if there is any good documentation available for the below scenario
I have a jenkins master running on my laptop
This jenkins master have several jobs which executes locally
I now want to call these jobs from Azure Dev Ops. Meaning a Devops job from Azure cloud should trigger a build on my local Jenkins setup
I saw several videos but I am finding it difficult to get around it.
Is there any easier way by just making use of a plugin to connect and executing the job?
I did saw some Udemy videos but then those involve a lot of setting to be done and does expose your system to outside vulnarabilities as firewalls and router settings are played on with.
Any help would be appreciated. Thanks!
You can enable Trigger builds remotely for your jenkins jobs, and then use a script task in the azure devops pipeline to trigger your jenkins pipeline. See below steps:
1, Firstly you need to create a self-hosted agent on your local jenkins server machine. Since the jenkins server is running locally, you need a local agent to communicate with your local jenkins server. Follow the steps here to create your local hosted agent.
2, Enable Trigger builds remotely on Jenkins
Go the the Build Triggers Tab of your jenkins pipeline configure page--> Then check Trigger builds remotely--> Specify a Token (will be used in the URL)
3, Define a secret variable to host your jenkins password in azure devops pipeline:
4, Add a bash task in your azure devops pipeline to run the below curl command:
#token must be the same with the token you entered in above step
curl -u $(username):$(password) http://localhost:8080/job/myproject/build?token=anytoken
See this thread trigger jenkins job via curl command remotely for more information.
5, Targeting your self-hosted agent pool to run your azure devops pipeline on self-hosted agent.
Then your local jenkin jobs will be triggered by the azure devops jobs.
Update:
You can also use Jenkins queue job task to queue a jenkin job in azure devops pipeline. See below steps:
1, Create a API Token in your Jenkin server.
Go your jenkin account configure page. To create a API token.
2, Add Jenkins queue job task in azure devops pipeline.
3, Click the Manage link to create a jenkins service connection--> In the newly opened page-->Create Service connection-->Select Jenkins--> Next
Enter the required information as below screenshot. Note: username is your user account for jenkin server, the Password is the API Token You generated in above step.
4, Configure your Jenkin queue job task as below

How to Start/Stop IIS on the target Windows server before deployment in Azure Devops Pipeline

I created the step in Azure Devops to Start and Stop IIS Website but it is failing with below error message:
**2020-05-23T10:28:04.7393424Z ##[section]Starting: Start
2020-05-23T10:28:04.7659676Z
2020-05-23T10:28:06.5436980Z ##[command]"C:\Windows\system32\inetsrv\appcmd.exe" start site /site.name:"taxrpt-deva"
2020-05-23T10:28:06.6132349Z ERROR ( message:The W3SVC service is not available - try starting the service first. )
2020-05-23T10:28:06.7434786Z ##[error]Process 'appcmd.exe' exited with code '50'.
2020-05-23T10:28:06.7680874Z ##[section]Finishing: Start
**
Azure IIS Web App Manage Screen Shot
How to Start/Stop IIS on the target Windows server before deployment in Azure Devops Pipeline
According to the image you provided, you are using the Deprecated task IIS Web App manage:
To resolve this issue, please try to use the task WinRM - IIS Web App Management.
Hope this helps.
As per the first line of question, you want to stop the IIS website infact rather than IIS.
The simplest way is to create a blank file 'App_Offline.htm' in the deployment directory. Official reference link.
I assume that as you want to stop the IIS/webapp you should have access of the deployment directory. This approach should work even if your azure devops Agent is running on other network machine. This file will shutdown your application and after deploying the build artifacts you may run powershell command task to delete that file from the shared directory like shown in the sample:

Post Deployment Script in Azure Web App for Containers

Is it possible to run a post-deploy script inside a container in Azure Web App for Containers(not the "regular" Web App with Kudu).
I have an ARM template that creates some resources, including a Web App for Containers where I use a Dockerhub image. I want to run a post-deployment script inside the container(a database migration script if that matters("bundle exec rake db:migrate" specifically)).
I can put the command into the Startup File in the Container Settings in the Azure Portal. That runs the command successfully, but it doesn't start up the container normally. So, I have to remove the Startup File migration command after it completes and then restart the Web App for it to start up normally. This is not optimal, neither is running the migration command on every startup/restart and then starting up the webserver.
This type of post-deploy script option is available in Heroku's template deployments, using the scripts object and the postdeploy key in it. See https://devcenter.heroku.com/articles/app-json-schema#scripts.
Does such a post-deploy script option exist for Azure Web App for Containers?
If not, is there a simpler/better way to run the migrate command than what I'm currently doing?

Is necessary to restart node in every deploy to Azure Web App?

I build and deployed a Vue/nuxt web app to Azure Web App by configuring Azure DevOps build and release pipelines.
The app runs on top of node and Express configuration. I start the app on the server by typing: npm run start on Kudu's CMD. Then the start script is set in the package.json file to launch the command: node server/index.js.
On the other hand, the build pipeline is configured to trigger a new build of the app (npm run build) when a new commit occurs and then the release pipeline catches the output and deploys it to Azure by Zip Deploy mechanism ("Azure App Service deploy" task).
So far I found not in the need to restart neither the Azure Web App nor the node process to update the app. In some ocassion I did found some strange error behaviour I solved by killing the process and restarting all over again.
In an official and proper way manner should I do this every time a new build is released? And how can I do it? I can gues on how to restart node via post deployment actions but what about killing the process? I must kill otherwise the new process port number will collide with the running one.
As I know there exists some circumstances under which an application deployment might result in a restart.
See Deployment vs. runtime issues, App Service deploys files to the wwwroot folder. It never directly restarts your app.
So i think it's necessary when your changes in code do not start to work in your application, but if it works well when sometimes the restart occurs, you don't need to do the restart manually. Also, if you want to restart the app service, you can try Azure App Service Manage Task or restart it in Azure web portal.

Resources