IIS physical path changes after release is completed Azure DevOps - azure

My complete CICD pipeline is fine. But once the release is completed the test website is inaccessible reason why. In IIS under Basic settings the physical path changes automatically. After every release i have to manually set so iis serves where the contents of release are. Am i missing something in IIS configuration.
***The blacked out is the folder path. After every release it resets to C:\inetpub\wwwroot
Help please this is the only thing that frustrating me. Thanks in advance
Azure release set up webpage error IIS Physical path

After every release it resets to C:\inetpub\wwwroot
The root cause of this issue is the settings(Physical path) in the IIS web app manage task.
This task is used to configure the IIS website. If you set its value to %SystemDrive%\inetpub\wwwroot, it will reset the value to C:\inetpub\wwwroot every time you run release.
To solve this issue, you can change the physical path to the value you expect.
For example:
Here is the doc about IIS web app manage task.

Related

ADO Release IIS Web App Manage Task Physical Path as an expression

How do I specify the physical path as an expression with a variable like release-n when managing a virtual application in an ADO IIS Web App Manage task?
We're just getting started with ADO Releases to IIS servers. We have IIS Web App Manage and Deployment tasks working, but only to a static physical path on the server.
I would like to store the new releases in versioned directories, and have the virtual application updated to point to the version being deployed.
For example
Default Web Site
/card-poc <-- web application stored outside of wwwroot
/release-1
/release-2
...
/release-n <-- IIS virtual application physical path is pointed to here
So in an ADO Release IIS Web App Manage task, how do I specify the physical path as an expression with a variable like release-n?
I've tried d:\IIS_VDs\CARD-poc\Release-$(rev:r)\ to get the release name, but I get the error
The given path's format is not supported.
The expected outcome is that the directory would be created, the virtual application would be altered to point to the new directory, and then the subsequent IIS Web App Deploy task would copy the files to the new dir. The goal is to allow a server operator to roll back an application to a prior version without knowledge of or access to to ADO, Version Control, or really anything except the IIS server.
I tested $(rev:r) and got the same error as you. I think the problem is getting the value of the $(rev:r) variable. I try to Write-Host "$(rev:r)" in the powershell task, but the task cannot get the value of $(rev:r). According to this ticket , it seems $(rev:r) is a special variable format that only works in the Number field in the editor.
As workaround, you can try to use Release.ReleaseName predefined variable.
Release.ReleaseName : The name of the current release. Example: Release-47

Azure App Service not reflecting file changes from ftp

I am new to Azure and I have created a very simple App Service in Azure with everything default. Changed the App Service Plan to B1. I can browse the app service home page and see the default page. I then connect using FTP and try to change the default page, but it did not reflect changes.
I even downloaded publish profile and published a .net core 3.1 web api with defaults, I can see the files are deployed using FTP but the api is not present. I even deleted the default page but the home page still appears. It seems the ftp is not pointing to default location where files are being picked up by asp.net core.
You can refer my answer in this post. Then use kudu to check whether the time of the last update file via FTP is consistent with the release time. If the file is not updated, of course this update has no effect. Then we can check the FTP connection str.
But first, I suggest you to modify index.html or default interface function and update by kudu. Then check if the update file is effective. If success, I can sure you code is ok.
Second, check your FTP Connection str.
Step 1. Find Deployment Center->FTP, click FTP then you can see Dashboard, into Dashboard find FTPS Endpoint,Username and Password.
Step 2. Use FileZilla, connect it. You can see files in it.
Then you can try again. Under normal circumstances, there is no problem to update via FTP.If the problem is still not resolved, I suggest that you can deploy to local IIS for debugging.
I was facing same problem like, publish contain not displaying when visit website. then i change following settings and it worked.
I had the same issue updating files in FTP and the dlls weren't being updated as they were being used by the site. I had to stop the App Service first and then update the files. The changes then reflected when restarting it.

dnx holding locks on files IIS - unable to copy over

We have an ASPNet5 site (angular site and webapi service) running under IIS 8.5 successfully. The issue we have now run into is dnx holding locks on files that prevent us from re-deploying the site from our automated deployment server. The task is simply using robocopy to perform the task but I can reproduce with a simple copy as well. Essentially, the error is "process cannot access the file xxxx because it is being used". The files in question are mostly under the approot/packages dir.
The question is how to work around this. The main goal being able to re-deploy without having to bring down the site which seems impractical.
We are running on Win2012R2, IIS8.5 and clr rc1-update1.
Thanks for your help in advance.

Schema folder for IIS resetting its state

I am currently working in a Windows Server 2008 R2 enviroment with IIS and sharepoint installed.
I have installed Application Request Routing(ARR) onto the IIS server and it installs some xml files into "%windir%\system32\inetsrv\config\schema"
I have a UAT and DR environment and it seems that in the UAT environment it is working well but once in the DR, every few hours, the files in that folder will reset to its original state before ARR was installed.
Could anyone shed some light as to why such a problem would happen? Or maybe why does IIS reset its state at all?
[RESOLVED]
Seems like there was a scheduled task that deleted all .xml files on "%windir%\system32" but not all were deleted as there was different permission on it in "%windir%\system32\inetsrv\config\schema" and the scheduled task was unable to delete it.

MSDeploy not able to delete files

I've got a TFS build set up to build and deploy a web application. I'm passing in the MSDeploy parameters via the TFS build definition's MSBuild arguments. First time round this is working fine. When someone accesses the web app, one of the controls (Microsoft charting control) generates a couple of files in an empty directory I've added to the solution.
When I go to rebuild (or continuous integration is triggered) the next build will usually fail because it can't delete one of the generated files. When I try and manually delete the file it tells me that IIS worker process is using it and it can't be deleted.
Now to get the build building I'd have to manually restart IIS every time, which is not desirable with CI in mind. I've taken a look through Microsoft.Web.Publishing.Tasks.dll and there's nothing there to restart IIS using MSDeploy.
At the moment I'm thinking that adding stubs of the temporary files in the solution might be a resolution (maybe MSDeploy will be able to close the process if the file is a permanent part of the deployment) or I could do some unpleasantness with Exec in the solution file to get an IIS reset.
It's probably a long shot but has anyone come up against this and found a nice solution?
You could use MSBuild Extension Pack to stop the application pool automatically before deployment. There are several tasks in the MSBuild.ExtensionPack.Web namespace to manage IIS, such as stopping and starting an application pool, deleting an application, etc.

Resources