简体   繁体   English

你如何指示 Azure DevOps 将你的 output 放在目标应用服务上的特定位置?

[英]How do you direct Azure DevOps to place your output in a specific location on the target App Service?

I'm trying to create a WebApi that will also work as a Service Worker.我正在尝试创建一个也可以作为 Service Worker 工作的 WebApi。 There are several examples on the web, but the issue I keep running into is the deployment either works as a WebApi, or a ServiceWorker, but not both. web 上有几个示例,但我一直遇到的问题是部署要么作为 WebApi,要么作为 ServiceWorker,但不能同时作为两者。

As nearly as I can figure out what's wrong, it appears that the WebApi needs to be deployed into the directory: app_data\Jobs\Continuous\WorkerService.就我所能弄清楚的问题而言,WebApi 似乎需要部署到目录中:app_data\Jobs\Continuous\WorkerService。 However, I can't seem to coerce the Azure App Service deployment to drop the files in this directory.但是,我似乎无法强制 Azure App Service 部署将文件放到该目录中。 This is what I have so far:这是我到目前为止所拥有的:

The pipeline:管道:

trigger:
- master

pool:
  vmImage: windows-latest

variables:
  solution: '**/*.sln'
  buildPlatform: Any CPU
  buildConfiguration: Release

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  inputs:
    restoreSolution: $(solution)

- task: DotNetCoreCLI@2
  displayName: Build Solution
  inputs:
    command: build

- task: DotNetCoreCLI@2
  displayName: Publish Artifact
  inputs:
    command: 'publish'
    publishWebProjects: no
    arguments: --configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)\app_data\Jobs\Continuous\WorkerService

- task: PublishBuildArtifacts@1
  displayName: Upload Artifacts

and the Release:和发布:

steps:
- task: AzureRmWebAppDeployment@4
  displayName: 'Azure App Service Deploy: thetarex-worker-service'
  inputs:
    azureSubscription: 'Theta Rex Subscription'
    WebAppName: 'thetarex-worker-service'

When I run this, I get all my files in wwwroot - no directory structure is preserved.当我运行它时,我得到了 wwwroot 中的所有文件——没有保留目录结构。 The WebApi part works, but no worker services run and no WebJob is created. WebApi 部分工作,但没有工作人员服务运行,也没有创建 WebJob。

In App Service configuration - Path mapping, create Virtual Application with Physical Path targeting site\wwwroot\App_Data\Jobs\Continuous\WorkerService and setting pipeline like this:在 App Service 配置 - 路径映射中,创建具有物理路径目标 site\wwwroot\App_Data\Jobs\Continuous\WorkerService 的虚拟应用程序,并像这样设置管道:

steps:
- task: AzureRmWebAppDeployment@4
  displayName: 'Azure App Service Deploy: thetarex-worker-service'
  inputs:
    azureSubscription: 'Theta Rex Subscription'
    WebAppName: 'thetarex-worker-service'
    VirtualApplication: your_virtual_application

This should get all your files into Physical path you configured with Virtual Application.这应该将您的所有文件放入您使用虚拟应用程序配置的物理路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure Devops 中的通用服务连接 - Generic Service Connection in Azure Devops 如何使用应用程序 ID(服务主体)的令牌向 Azure Devops 进行身份验证? - How to authenticate to Azure Devops by using token of an Application ID(service principal)? 您如何查看上传到 AWS 管理控制台的文件夹? - How do you view your folders uploaded to AWS Management Console? 如何从 Azure 管道中的 Azure 应用服务获取价值 - How to get value from Azure App Service from Azure pipeline Azure DevOps 管道中的 AzureCLI 任务找不到脚本的位置 - AzureCLI task in Azure DevOps pipeline cannot find the location of scripts 在 Azure devops 中检查多个项目时如何构建正确的项目 - How do I build the right project when checking multiple projects in Azure devops 你如何调试 Azure Java SDK CosmosClient SSL 握手? - How do you debug the Azure Java SDK CosmosClient SSL handshake? 在 Azure web 应用程序中,如何创建包含两个日期/时间之间的每个 URL 命中的报告? - How do you create a report with every URL hit between two date/time's in an Azure web app? 如何删除孤立的 DevOps 服务连接? - How to delete an orphaned Devops Service Connection? 我如何知道我的 Azure 应用服务正在运行的 IIS 和 Windows 是什么版本 - How do I tell what version of IIS and Windows my Azure App Service is running on
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM