Background info: I have set up Azure to automatically deploy code from develop branch (on Github) to dev-webapp when code is pushed to develop branch. When code is pushed to master branch, Azure deploys code from master branch to test-webapp and pre prod-deployment slot.
In Azure I'm using New Relic Appservice to monitor these apps. It works. What I want now is to notify New Relic when code is deployed to a webapp.
Quote New Relic:
To notify New Relic of a deployment, you can POST to https://api.newrelic.com/deployments.xml and add the API key as a header
To notify New Relic when code is deployed to dev and test, I could set up webhook in GitHub to run when code is pushed to develop-branch and master-branch. I have tested this, and it works. I feel like it is not optimal since the notification comes from Github, and not from Azure which is where the deployment actually takes place.
I also want to notify New Relic when the pre-prod deploymentslot is swapped with prod.
Is it possible? And what could be the best way to do this?
Maybe webjobs could be the soulution? This should be a webjob that only runs once after webapp is deployed and deployment-slot is swapped (for prod). I cannot find any information about setting up such job.
use powershell to swap slots and call new relic uri
https://azure.microsoft.com/en-us/documentation/articles/web-sites-staged-publishing/
I'm sorry I don't know New Relic but perhaps there is some similar solution as in application insights (why don't switch?), where you can specify version to be send:
http://blogs.msdn.com/b/visualstudioalm/archive/2015/01/07/application-insights-support-for-multiple-environments-stamps-and-app-versions.aspx (part: Version to Version comparisons)
Related
I have create an ASP.NET Core web app in Azure.
I have followed this documentation:
https://learn.microsoft.com/fr-fr/azure/app-service/quickstart-dotnetcore?pivots=platform-linux
Everything works, but I have create a new develop branch. Each time i push something in the branch, the deployment script is fired. Fortunately, it only deploys master branch on production. So if i have no merged files on master, it deploys the same files. But it might cut the website during a few seconds.
Is there a way to avoid the deployment when i am pushing something on develop branch ?
Thanks
I'm working on an API in core3.1. We have a build pipeline that builds and unit tests any change for any branch. And release pipelines for development and master branches. These deploy to designated app services in Azure.
Now we would like a release pipeline for feature branches. So what we want is a pipeline that can dynamically created app-services per feature branch and deploy to that app service. And preferably dynamically delete the app-service when the branch is deleted.
Just to clarify, the proces how we would like it:
a developer creates feature branch and pushes it >
the build pipeline builds it >
an app service gets created automatically >
stuff gets deployed to that app service >
developers work on the branch and changes get build and deployed to the app service like normal >
at some later point a developer deletes branch >
app service gets deleted automaticcaly
Is there any way to accomplish this? Maybe there is a standard way?
Feature branches are located in a subfolder, e.g. "feat/feature-branch-name".
I'm fairly new to Azure and DevOps.
Any help is appriciated. Thanks in advance.
You should follow the practice of Infrastructure as Code (IaC) and use ARM templates in your pipeline to create/update/delete your Azure resources. You can also use the built-in tasks available in Azure DevOps to deploy your ARM templates.
I'm trying Azure App Services. I've set up a build pipeline in Azure DevOps which builds and pushes my image to Docker Hub and then publishes docker-compose.yml as an artifact.
My release pipeline takes the docker-compose.yml and feeds it to the "Azure Web App for Container" task which succeeds. But the bot goes down and doesn't get back up after the deployment unless I access http://<myappname>.azurewebsites.net, then it starts and is of the latest pushed version. So everything seems to work, except the "restart" or docker-compose up.
I've been reading that I want to add a WebJob to my app service, but since I am using a Linux host I cannot seem to configure this. I've tried adding a curl task after deployment, but this probably executes too early.
Any ideas on how I would get to solve this last piece of the puzzle to have a simple CI/CD environment?
Currently there is zero out of the box support for hosting WebJobs in a Linux hosted app service. I've heard there's a hacky way of doing it (I'll have to find the post) but since it's not supported out of the gate, there's no guarantee it'll work.
I am trying to create a deployment plan for my web application in Azure which can support 2 environments (Dev/Staging). Basically, I want the code checked in by developers to be deployed to the Dev machine end of the day. And then the latest Dev changes to be merged with staging branch and if no merge conflict happened a new publish goes to staging machine. Can anyone help me where to start and what feature in azure i can use to server this?
You could use Azure Devops to trigger scheduled builds (at the end of the day) to perform the routine you are describing. you could also use releases and trigger them automatically from the builds that happen on a schedule.
You would also need to deploy vsts agents on the machines or allow for vsts agents to somehow talk to the machines to upload code to them
I have setup continuous deployment of a standard web api project to an API App on Azure. The new version is deployed to the staging slot and then swapped with production at the end of the release task. I can see that (by going to App Service Editor in azure portal) the dll file versions reflect the latest changes. But when I access the APIs (from a webapp or postman) on this Azure app the result does not reflect the published changes. The only way I can force the new changes is either restarting the API app or stopping and starting the app service.
Am I missing anything in using continuous integration with API app on Azure?
I have solved this by adding a new task available in VSO release which restarts the staging slot before swapping with production. This makes sure that the new changes are part of the IIS process.