How to configure azure-pipeline.yml for asp.net core 2.2 ?
-
Hello, I have the feeling this question can become a discussions because there is a lot of parameters that can be change and I don't know what to do. I'm trying to setup a azure pipeline. I already did this in the past but with template and not for a .NET Core web application. It was easy because I could use a template. For some reason, here, I could not chose any template. The Azure Pipeline tool directly ask me to edit a yml file. Maybe because my repository is a local DevOps repository? I have no idea. I followed this tutorial: https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/dotnet-core?view=azure-devops and created this yml file: ``` # ASP.NET Core # Build and test ASP.NET Core projects targeting .NET Core. # Add steps that run tests, create a NuGet package, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core trigger: - master pool: vmImage: 'Ubuntu-16.04' variables: buildConfiguration: 'Release' steps: # - script: dotnet build --configuration $(buildConfiguration) # displayName: 'dotnet build $(buildConfiguration)' \- task: DotNetCoreInstaller@0 inputs: version: '2.2.202' # replace this value with the version that you need for your project \- script: dotnet restore \- task: DotNetCoreCLI@2 displayName: Build inputs: command: build projects: '**/*.csproj' arguments: '--configuration Release' # Update this to match your need # do this after you've built your app, near the end of your pipeline in most cases # for example, you do this before you deploy to an Azure web app on Windows \- task: DotNetCoreCLI@2 inputs: command: publish publishWebProjects: True arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)' zipAfterPublish: True # - task: PublishBuildArtifacts@1 # inputs: # ArtifactName: 'drop' ``` Here is my result: All is success except ``` ##[section]Starting: DotNetCoreCLI ============================================================================== Task : .NET Core Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command. For package commands, supports NuGet.org and authenticated feeds like Package Management and MyGet. Version : 2.150.1 Author : Microsoft Corporation Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194) =========================================
-
Hello, I have the feeling this question can become a discussions because there is a lot of parameters that can be change and I don't know what to do. I'm trying to setup a azure pipeline. I already did this in the past but with template and not for a .NET Core web application. It was easy because I could use a template. For some reason, here, I could not chose any template. The Azure Pipeline tool directly ask me to edit a yml file. Maybe because my repository is a local DevOps repository? I have no idea. I followed this tutorial: https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/dotnet-core?view=azure-devops and created this yml file: ``` # ASP.NET Core # Build and test ASP.NET Core projects targeting .NET Core. # Add steps that run tests, create a NuGet package, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core trigger: - master pool: vmImage: 'Ubuntu-16.04' variables: buildConfiguration: 'Release' steps: # - script: dotnet build --configuration $(buildConfiguration) # displayName: 'dotnet build $(buildConfiguration)' \- task: DotNetCoreInstaller@0 inputs: version: '2.2.202' # replace this value with the version that you need for your project \- script: dotnet restore \- task: DotNetCoreCLI@2 displayName: Build inputs: command: build projects: '**/*.csproj' arguments: '--configuration Release' # Update this to match your need # do this after you've built your app, near the end of your pipeline in most cases # for example, you do this before you deploy to an Azure web app on Windows \- task: DotNetCoreCLI@2 inputs: command: publish publishWebProjects: True arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)' zipAfterPublish: True # - task: PublishBuildArtifacts@1 # inputs: # ArtifactName: 'drop' ``` Here is my result: All is success except ``` ##[section]Starting: DotNetCoreCLI ============================================================================== Task : .NET Core Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command. For package commands, supports NuGet.org and authenticated feeds like Package Management and MyGet. Version : 2.150.1 Author : Microsoft Corporation Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194) =========================================
Never met an asp.net project that didn't have a web.config file ... somewhere.
Quote:
The web.config file configures the ASP.NET Core Module.
[Host ASP.NET Core on Windows with IIS | Microsoft Docs](https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.2)
"(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal
-
Never met an asp.net project that didn't have a web.config file ... somewhere.
Quote:
The web.config file configures the ASP.NET Core Module.
[Host ASP.NET Core on Windows with IIS | Microsoft Docs](https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.2)
"(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal
So why the publish tell me the config file is missing when I want to publish on my azure web app? Publish I can do manually with no error. Arrrgggg Microsoft please help. You example are wrong.
-
So why the publish tell me the config file is missing when I want to publish on my azure web app? Publish I can do manually with no error. Arrrgggg Microsoft please help. You example are wrong.