在过去的 6 个月中,我一直在使用 Azure DevOps 中的管道进行发布,但今天我收到以下错误:
2019-09-25T14:24:38.4296875Z ##[section]Starting: Azure App Service Deploy: AS-ServiciosNegocio-API-UAT
2019-09-25T14:24:38.4419797Z ==============================================================================
2019-09-25T14:24:38.4419900Z Task : Azure App Service deploy
2019-09-25T14:24:38.4419986Z Description : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby
2019-09-25T14:24:38.4420053Z Version : 3.4.31
2019-09-25T14:24:38.4420117Z Author : Microsoft Corporation
2019-09-25T14:24:38.4420182Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-rm-web-app-deployment
2019-09-25T14:24:38.4420291Z ==============================================================================
2019-09-25T14:24:39.1630446Z Got connection details for Azure App Service:'AS-ServiciosNegocio-API-UAT'
2019-09-25T14:24:39.3091141Z ##[error]Error: Failed to get resource ID for resource type …
Run Code Online (Sandbox Code Playgroud) deployment access-token azure-web-app-service azure-devops azure-pipelines-release-pipeline
我正在尝试创建一个部署管道来将我的映像部署到 Kubernetes 集群。这个过程的第一步是基于 docker 文件创建一个镜像。我正在使用的 docker 文件是在我添加 docker 支持时从 Visual Studio 生成的,并在右键单击 docker 图像并选择创建它时成功创建了图像。当我配置 Azure Pipeline 时,创建 docker 映像会在尝试构建实际解决方案时失败。上一步获取了所有源文件,但随后在创建 docker 镜像时失败
[error]COPY failed: stat/var/lib/docker/tmp/docker-builder158012929/DockerTest/DockerTest.csproj:
no such file or directory
[error]/usr/bin/docker failed with return code: 1
Run Code Online (Sandbox Code Playgroud)
以下是Visual Studio生成的docker文件,azure管道阶段参考创建docker镜像。
FROM mcr.microsoft.com/dotnet/core/runtime:2.2-stretch-slim AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS
build
WORKDIR /src
COPY ["DockerTest/DockerTest.csproj", "DockerTest/"]
RUN dotnet restore "DockerTest/DockerTest.csproj"
COPY . .
WORKDIR "/src/DockerTest"
RUN dotnet build "DockerTest.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "DockerTest.csproj" -c Release -o …
Run Code Online (Sandbox Code Playgroud) 我有 2 个用 .net core 2.2 编写的 webAPI。这 2 个 web api 是由 web 作业触发的,它们是 .netcore 2.2 中的控制台应用程序。它们都是不同的项目,并且位于 Azure DevOps 中的不同存储库中。
我正在尝试使用 Azure DevOps 构建和发布管道将 Web Api 与 webjob 一起部署到 Azure 中的 2 个 Web 应用服务(例如:WebApi1 + Web job1 到 App service1 和 WebApi2 + Web job2 到 App service2)中。
我可以从 Azure 门户将 webjobs 手动添加到应用服务中,并且工作正常。但我想使用 Azure DevOps 管道部署它。
我尝试了不同的方法来使用应用服务中的 web api 发布 web 作业(控制台应用程序),例如尝试将其从 Azure DevOps 发布到 App_Data 文件夹。
我主要关注下面的博客。
但是当我尝试发布 webjob 时,它会覆盖 web api 代码(所有 4 个项目都有单独的构建/发布管道)。webjob 代码部署在 …
我正在尝试将系统变量从 azure devops 传递给 python 脚本。这是我目前在 Yaml 文件中的内容:
- script: pytest test/test_pipeline.py
--$(global_variable)
--junitxml=$(Build.StagingDirectory)/test_pipeline-results.xml
displayName: 'Testing Pipeline'
condition: always()
Run Code Online (Sandbox Code Playgroud)
我的脚本中需要的变量是$(global_variable)
. 该变量包含值$(Build.SourcesDirectory)
。它是全局变量。"unrecognised arguments"
当我运行作业时,我收到一条错误消息。
任何解决此问题的帮助都会有所帮助。
谢谢!
编辑:
完整日志:
`##[section]Starting: Testing Pipeline
==============================================================================
Task : Command line
Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version : 2.151.2
Author : Microsoft Corporation
Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
Script contents:
pytest test/test_pipeline.py --my_param="/home/vsts/work/1/s" --junitxml=/home/vsts/work/1/a/test_pipeline-results.xml
========================== Starting Command Output …
Run Code Online (Sandbox Code Playgroud) 使用任务dotnet build的构建管道开始失败,因为 Build Engine 版本最近从 16.4.0+ 更改为 16.5.0+。
nuget 包SpecFlow依赖于库TechTalk.SpecFlow。
异常看起来像:
C:\Users\VssAdministrator\.nuget\packages\specflow.tools.msbuild.generation\3.1.89\build\SpecFlow.Tools.MsBuild.Generation.targets(93,5): Error MSB4018: The "GenerateFeatureFileCodeBehindTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'TechTalk.SpecFlow, Version=3.1.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41'. The system cannot find the file specified.
Run Code Online (Sandbox Code Playgroud)
我所做的调查(没有帮助):
有任何想法吗?
使用托管标识的 Azure 资源管理器 - 在尝试添加服务连接时 - 因此我可以使用另一个 azure 云应用服务通过管道进行部署。
我在尝试时收到此错误:
Service connection field 'creationMode' is not expected in Azure Resource Manager connections using the Managed Service Identity authentication scheme. Parameter name: endpoint.Data[creationMode]
Run Code Online (Sandbox Code Playgroud)
我似乎无法弄清楚我能做些什么来避免出现此错误。
以前有人收到过这个。这是一个许可的事情吗?
欢迎任何想法。
azure-devops ×6
azure ×2
.net-core ×1
access-token ×1
asp.net ×1
azure-pipelines-release-pipeline ×1
deployment ×1
docker ×1
dockerfile ×1
python-3.x ×1
specflow ×1
yaml ×1