I want to deploy an ASP.NET Core Web API project as an IIS sub-application under an existing website using the task WinRM - IIS Web App Deployment with TFS version 15.117.26714.0.
My issue is how to update the path and application name of the project to be deployed so that it can be a sub-application under an existing website. For example, "Default Web Site/sampleapp".
I think I need to update the web.config file that is created after publishing an ASP.NET Core Web API. However, I am not sure how I can do this in an automated fashion using the TFS task WinRM - IIS Web App Deployment task.
Below are my attempts;
Attempt 1
I have attempted to use the Override Parameters section to override the variable "IIS Web Application Name". However, I get an error that says the following;
##[error]Deployment on one or more machines failed. System.Exception: Error: Source does not support parameter called 'IIS Web Application Name'. Must be one of ().Error count: 1.
I believe this is because this task is aiming at ASP.NET projects which include a SetParameters.xml file. However, an ASP.NET Core project does not.
Attempt 2
I have also researched into using the appsettings.json file but this seems to be more for app configuration and not host configuration.
Attempt 3
I've also researched the possibility of a hostconfiguration.json file as suggested by Shaun here; Which values does WebHost read from appsettings.json. However, I don't want to change the source code and I would prefer to use TFS directly.
Attempt 4
Finally, I also don't think I can use publish profiles for this task as that requires the publishing process to be done via Visual Studio or the command line.
So, how do I deploy an ASP.NET Core Web API project as an IIS sub-application under an existing website using the TFS task WinRM - IIS Web App Deployment?
Below are screenshots of the TFS WinRM - IIS Web App Deployment and WinRM - IIS Web App Management tasks for reference.