Azure Devops更改部署文件夹 [英] Azure Devops Change the Deploy Folder

查看:281
本文介绍了Azure Devops更改部署文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Azure Devops进行自动构建和构建.将asp.net core 3.1 Web应用程序部署到Azure App Service.

I am using Azure Devops for automatic build & deploy of asp.net core 3.1 web app to Azure App Service.

问题是它正在将应用程序部署到奇怪的文件夹中.它位于而不是wwwroot文件夹中 /home/site/wwwroot/Content/D_C/a/1/s/ExampleFolder/ExampleFolder2/ExampleFolder3/obj/Staging/netcoreapp3.1/PubTmp/Out 如果需要的话,应用程序服务可以在Linux上使用.

The problem is that it's deploying the app to strange folder. Instead of the wwwroot folder it is in /home/site/wwwroot/Content/D_C/a/1/s/ExampleFolder/ExampleFolder2/ExampleFolder3/obj/Staging/netcoreapp3.1/PubTmp/Out The app service is on Linux if it matters.

我如何才能将其修复/更改为位于主文件夹中?

How I can just fix/change it to be in the main folder?

推荐答案

您应与我们共享您的管道,否则,我们将无法告诉您必须更改/修复的内容.

You should share your Pipeline with us, otherwise, we can't tell you what you have to change/fix.

但是,这里有一个使用

However, here an example that uses the AzureWebApp@1 Task to deploy a .NET Core 3.1 application to an Azure Web App.

trigger:
  branches:
    include:
    - master

stages:
- stage: Build
  jobs:
  - job: 'BuildArtifact'
    pool:
      vmImage: 'ubuntu-latest'
    steps:

    - task: UseDotNet@2
      inputs:
        packageType: sdk
        version: 3.1.x

    - task: DotNetCoreCLI@2
      displayName: Build
      inputs:
        command: 'build'
        projects: PATH/TO/YOUR/Project.csproj
        arguments: --output $(System.DefaultWorkingDirectory)/publish_output --configuration Release

    - task: ArchiveFiles@2
      displayName: 'Archive files'
      inputs:
        rootFolderOrFile: '$(System.DefaultWorkingDirectory)/publish_output'
        includeRootFolder: false
        archiveType: zip
        archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
        replaceExistingArchive: true

    - publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
      artifact: drop

- stage: Deploy
  dependsOn: Build
  condition: succeeded()
  jobs:
  - deployment: 'Deploy'
    pool:
      vmImage: 'ubuntu-latest'
    environment: Development
    strategy:
      runOnce:
        deploy:
          steps:
          - task: AzureWebApp@1
            displayName: Azure Web App Deploy
            inputs:
              azureSubscription: YourAzureSubscription
              appName: YourAppName
              package: $(Pipeline.Workspace)/drop/$(Build.BuildId).zip
              appType: webAppLinux

这篇关于Azure Devops更改部署文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆