-2

I need help debugging the deployment of a ASP.NET Core MVC application.

The deployment goes as follows: I push code (right now, just a fresh template project) from Visual Studio into an Azure DevOps Git repository.

Then the Azure DevOps Pipeline builds the project, and pushes it to my Octopus Deploy Server. The Octopus Server deploys the package to my IIS Server.

The process seems to work. I can get from A-B, and I can see the deployed site in IIS manager.

But the site does not work - I get a HTTP error 403.14 - forbidden.

I don't know what is wrong, but I have a feeling it has something to do with my build.

The zip file containing the build has a very deep folder structure, and consequently that structure is also present in the IIS server. I'm not saying that a deep folder structure is the problem it self, but rather that it does not seem like a "refined" package ready for deployment.

Here is a my Azure DevOps pipeline yml

trigger:
- master

pool:
  vmImage: 'windows-latest'

name: 1.$(Year:yy)$(DayOfYear)$(Rev:.r) #this effects BuildNumber

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'
  releaseNumber: '$(Build.Repository.Name).$(Build.buildNumber)'

steps:
- task: NuGetToolInstaller@1
  displayName: 'Use Nuget'

- task: NuGetCommand@2
  displayName: 'Nuget Restore'
  inputs:
    restoreSolution: '$(solution)'

- task: VSBuild@1
  displayName: 'Build Solution And Create Default Package'
  inputs:
    solution: '$(solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)/$(releaseNumber).zip"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

- task: OctopusPush@6
  displayName: 'Push package to Octopus'
  inputs:
    OctoConnectedServiceName: 'DarkHelmet-IIS Octopus Server'
    Space: 'Default'
    Packages: '$(build.artifactStagingDirectory)/$(releaseNumber).zip'
    Replace: 'false'

- task: OctopusCreateRelease@6
  displayName: 'Create Octopus Release'
  inputs:
    OctoConnectedServiceName: 'DarkHelmet-IIS Octopus Server'
    Space: 'Default'
    Project: 'ShoppingList'
    Channel: 'Default'
    ReleaseNumber: '$(releaseNumber)'

The pipeline runs with success.

In Octopus Deploy I only have one step added "Deploy to IIS" Octopus Deploy Step

In the IIS server you can see the deep folder I mentioned - it seems off, but not sure.

enter image description here

Can anyone give me a hint on where to look ?

Thanks :)

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Simon Bruun
  • 59
  • 1
  • 5
  • An ASP.NET Core web app should start with `dotnet publish`. Which guide did you follow? And you should find a better guide now. – Lex Li Aug 20 '23 at 18:49
  • I did not follow one particular guide - But thanks a lot, I'll looking into publishing. Thanks :D – Simon Bruun Aug 20 '23 at 19:11

0 Answers0