We currently have a legacy asp.net WebForms application that we deploy to AWS using Azure DevOps. The primary task is IIS Web App Deploy.
Everything is working well, except that deployments take the site offline albeit for a few minutes. During this time a holding page is displayed. I would like to remove the need to take the site offline. Ideally I would like the following flow:
deploy the code to a folder. Initial thought is to name this folder by datetime (yyMMddHHmmss)
once deployed update the physical path of the site to point to the new folder
I don't think I will be able to use the IIS Web App Deploy task to do this... It appears to use the Website Name to determine the target folder.
My questions are:
where is the best place to set the output folder name, during build or deployment?
once the folder has been created, how can I deploy to it?
Mark
Related
I have a .NET solution that contains several projects. I want to set up a deployment pipeline in Azure DevOps but I'm not sure how to do this. I want to have 1 pipeline that deploys the following projects:
Main web app -> needs to go to Azure Web Apps
Portal web app -> also needs to go to Azure Web Apps
Database -> needs to be deployed to SQL Azure Database
How do I set this up? I selected the default 'Azure App Service Deploy' template, but in the deployment task I cannot select which project I want to deploy. The package refers to $(build.artifactstagingdirectory)/**/*.zip, but this is a zip file that contains the artifacts for both my web projects (and the database DACPAC is missing here).
that's many questions in one, but I'd generally separate build\release pipelines for each application (that way you have more control) and you dont have the problem of how to select proper zip file. I'm pretty sure you cant even select a part of zip file (since you now have a single zip file with several solutions), so your approach is not going to work.
as for how to set this up: your build should build 1 project exactly and pack\upload it. and then your release will target that artifact and everything will work just fine.
First things first. Copy the build artefacts into 3 different packages. Say,
Artefacts1: For Web Apps
Artefacts2: For Portal Apps
Artefacts3: For DACPAC files
In this case you will have 3 copy files task copying and 3 publish build artefacts task to publish it to Azure DevOps. In the release pipeline, add 3 agent jobs to perform
Deploy to Web App
Deploy to Portal App
Database DACPAC Deploy
You can refer this to have similar pipeline.
Actually i deploy my asp project using Plesk. My project in testing phase so the client ask for some changes in project. The changes are related to a particular page but after changes i deploy all publish files of my project, which is so time consuming task. Is there is any way to deploy only the particular page from my project.
Thanks....
#Shahid bro, a possible solution can be to use FTP client to upload individual files.
when publishing to the Azure web site from visual studio site size 400MB I see in the azure portal that my site is almost 800MB...
I search all sub folders and I realize that inside the obj\Release\Package there is "PackageTmp" which contain the all site with all my folders (some of them big files for download).
The question is why asp.net need the site twice ?
can i simply remove the obj folder with ftp app and the site will be ok ?
I Need more size it's not fair to scale becuase of that...
When you deploy from Visual Studio, you are using msdeploy. Normally, that should not be copying obj\Release\Package to the Azure Web App.
To check what's in your Azure Web App, it's best to use Kudu Console. In there, go to your D:\home\site\wwwroot folder, and check what files are there. Are you really seeing an obj\Release\Package folder in there (i.e. D:\home\site\wwwroot\obj\Release\Package`)?
If that's not where you see it, please provide more details:
what version of VS?
what type of app are you deploying (e.g. is it an MVC app)?
are you deploying debug or retails?
I have an ASP.NET WebForms application which I would like to publish to a Web Deploy package and deploy using the deploy.cmd script generated as part of the Web Deploy package. This basically works fine but I have one problem.
My application generates image files which are stored in a temporary directory as part of the web site (basically a subdirectory of the IIS site's physical location called temp). However, whenever I deploy my site using the deploy.cmd script, this directoty is deleted. Instead, I would like the deploy script to make sure the directory is present and that the IIS user has access to it. Is this possible to do with Web Deploy out of the box?
For a long time I have been performing dated deploys to our IIS servers, basically this means that each deploy gets its own dated folder within the web site folder (c:\sites\my-site\20140824-1236 for example). I then redirect the web app to the new deployment folder.
This gives us a quick role back capability if things go pear shaped.
The problem is that we are looking at moving deployment over to the new web deploy techniques, while we have been using the new techniques within QA and UAT for a while - the standard behaviour is to simply replace the files at the location defined within the IIS web site.
Before I go and start looking at remote PowerShell to re-configure IIS before executing the web deploy.. does anyone know how I can achieve this using standard web deploy.. maybe with msbuild extensions or something?
How about using the automatic backup capabilities in Web Deploy v3?
http://www.iis.net/learn/publish/using-web-deploy/web-deploy-automatic-backups