Good evening,
I suspect that I have something setup incorrectly, but have not been able to pin it down. I have an IIS server with two sites set up on it. Site named Main points to E:\Main and is bound to ports 80 and 443. When I enter www.mydomain.com in the browser it brought up the default IISstart page. I have a second site named api bound to different ports. That is mapped to E:\Api. I have three existing Asp.Net Core 3.1 applications that are also on the Main site. So if I browse to www.mydomain.com/app1 it brings up the application and there is no issues.
I published two asp.net core 3.1 applications using Azure DevOps Server 2020 using the IIS Web Manage and IIS Web Deploy tools for each of them. They go to the respective folders correctly but I am constantly getting 404 errors and the Javascript cannot be found, so there is a loss of functionality. I tried first this, which publishes correctly but leads to the 404 errors:
steps:
- task: IISWebAppManagementOnMachineGroup@0
displayName: 'IIS Web Api Manage'
inputs:
EnableIIS: true
WebsiteName: Api
WebsitePhysicalPath: 'E:\Api'
CreateOrUpdateAppPoolForWebsite: true
AppPoolNameForWebsite: ApiAppPool
DotNetVersionForWebsite: 'No Managed Code'
I then tried this but this will not start either application, and fails on publish for appcmd.exe errors:
steps:
- task: IISWebAppManagementOnMachineGroup@0
displayName: 'IIS Web Api Manager'
inputs:
EnableIIS: true
IISDeploymentType: IISWebApplication
ParentWebsiteNameForApplication: Api
VirtualPathForApplication: /
PhysicalPathForApplication: 'E:\Api'
CreateOrUpdateAppPoolForApplication: true
AppPoolNameForApplication: ApiAppPool
DotNetVersionForApplication: 'No Managed Code'
enabled: false
error:
ERROR ( message:Cannot find SITE object with identifier "Api". )
##[error]Process 'appcmd.exe' exited with code '1168'.
The question is where am I going wrong?