标签: azure-pipelines

Azure DevOps Manage IIS 任务部署由于权限不足而失败,但帐户在本地管理员组中

使用托管 VS2017 代理成功构建后,我尝试使用本地托管代理部署本地托管代理,该代理是使用域帐户设置的,该帐户应具有足够的权限,因为它在本地管理组中。当我在别处挖掘这个问题时,一位用户使用重新安装了他们的代理NTATHORITY\SYSTEM并且它起作用了。

我真的不需要创建或停止\启动网站,只需部署最近的构建工件。
我应该检查哪些权限或应该使用其他任务?

在此处输入图片说明

019-04-06T21:03:10.3898646Z 错误(消息:配置错误 2019-04-06T21:03:10.3899503Z

2019-04-06T21:03:10.3899791Z 文件名:redirection.config 2019-04-06T21:03:10.3900026Z 2019-04-06T21:03:10.3900293Z 2019-04-04-03Z 行号:1000293Z 行号:0309:03 -04-06T21:03:10.3900852Z 说明:由于权限不足,无法读取配置文件 2019-04-06T21:03:10.3901076Z 2019-04-06T21:03:10.3901333Z。) 2019-04-06T21:03:10.8135484Z ##[错误]进程“appcmd.exe”以代码“5”退出。

iis azure-devops azure-pipelines

10
推荐指数
2
解决办法
3210
查看次数

Azure Pipelines - VSTest@2 生成的 CodeCoverage 在哪里?

我已经尝试了数百次,但仍然无法找到 VSTest 任务中生成的 codeCoverage 文件。

请参阅以下代码。

我只想将代码覆盖率报告发布到管道。

请帮助!

代码覆盖率文件在哪里?

或者,如果您不想浪费时间写一些答案,请给我一些链接。

非常感谢!

# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4

trigger:
  - master

jobs:
  - job: devbuild
    pool:
      name: 'Self Hosted VS2017'

    variables:
      solution: '**/*.sln'

    steps:
      - task: NuGetToolInstaller@0

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

      - task: VSBuild@1
        inputs:
          solution: '$(solution)'
          msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:Configuration=Debug /p:Platform="Any CPU" /p:OutDir=".\output\dev"'
          clean: true

      - task: VisualStudioTestPlatformInstaller@1
        inputs:
          packageFeedSelector: 'nugetOrg' …
Run Code Online (Sandbox Code Playgroud)

yaml code-coverage vstest azure-pipelines

10
推荐指数
3
解决办法
8127
查看次数

根据提交消息跳过阶段

我正在尝试将 Azure DevOps 设置为 在消息不以给定文本开头时跳过多阶段管道上的一个阶段。

示例文档来看,我认为这只是

  - stage: t1
    condition: not(startsWith(variables['Build.SourceVersionMessage'], '[maven-release-plugin]'))
    jobs:
      - job: ReleasePrepare
        displayName: Prepare release
        pool:
          vmImage: 'ubuntu-16.04'
        steps:
          - script: |
              env | sort
Run Code Online (Sandbox Code Playgroud)

然而,无论如何,这都会被执行。t1这是我希望任务不会根据提交消息运行的示例https://dev.azure.com/trajano/experiments/_build/results?buildId=110&view=results

的输出env表明消息已正确传入

在此输入图像描述

以防万一这是一个错误,我也在这里报告了https://developercommunity.visualstudio.com/content/problem/697290/startswith-buildsourceversionmessage-variable-not.html

azure-devops azure-pipelines multistage-pipeline

10
推荐指数
1
解决办法
3217
查看次数

实体框架迁移 Azure DevOps 发布管道

我正在尝试在 Azure DevOps Release Pipeline 上运行迁移。因为我想在每个版本上自动运行我的数据库脚本。我的发布管道没有源代码,我只是编译了 DLL。

当我在本地机器上执行此命令时,它运行成功。如何转换此命令以便我可以将它与 DLL 一起使用。

dotnet ef database update --project MyEntityFrameworkProject --context MyDbContext --startup-project MyStartupProject

entity-framework azure-devops azure-pipelines azure-pipelines-release-pipeline entity-framework-migrations

10
推荐指数
2
解决办法
9307
查看次数

响应状态代码不表示成功:azure-pipeline 上的任务“恢复”中的 401

我有以下错误:

\n\n
error : Unable to load the service index for source https://privateLibrary.com/private/_packaging/privateOrganitation/nuget/v3/index.json. [/home/vsts/work/1/s/Local.Proyect.Core/Local.Proyect.Core.csproj]\n       /usr/share/dotnet/sdk/3.0.101/NuGet.targets(123,5): \nerror :   Response status code does not indicate success: 401 (Unauthorized). [/home/vsts/work/1/s/Local.Proyect.Core/Local.Proyect.Core.csproj]\n
Run Code Online (Sandbox Code Playgroud)\n\n

我的 azure-pipeline.yml:

\n\n
variables:\n  buildConfiguration: \'Release\'\n  localProyectName: \'Local.Proyect.Core\'\n  localProyectCoreDirectory: \'./Local.Proyect.Core\'\n\n\ntrigger:\n branches:\n   include:\n     - master\n\nsteps:\n- task: UseDotNet@2\n  inputs:\n    packageType: \'sdk\'\n- task: DotNetCoreCLI@2\n  displayName: \'dotnet restore\'\n  inputs:\n    command: restore\n    projects: \'**/$(localProyectName).csproj\'\n    feedsToUse: config\n    nugetConfigPath: $(localProyectCoreDirectory)/NuGet.Config\n    arguments: --force\n\n- task: DotNetCoreCLI@2\n  displayName: \'Build All\'\n  inputs:\n    projects: \'**/$(localProyectName).csproj\'\n    arguments: \'--no-restore --configuration $(buildConfiguration)\'\n\n- script: dotnet publish --configuration $(buildConfiguration) …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc asp.net-core azure-pipelines azure-artifacts

10
推荐指数
1
解决办法
5万
查看次数

如何在 azure devops YAML 管道中使用单个代理执行多个作业/阶段

我正在研究 Azure DevOps YAML 管道,我不确定我们是否可以在整个管道中使用单个代理。我有多个作业/阶段 - 构建、部署、部署后,并且希望将其分配给单个代理,因为它消耗相同的工件。有没有办法通过管道分配单个代理。

提前致谢。

tfs yaml azure azure-devops azure-pipelines

10
推荐指数
3
解决办法
2万
查看次数

相当于发布管道的 YAML 是什么?

我一直在研究 Azure DevOps,但我对一些事情感到困惑:微软似乎强烈建议使用 YAML 管道而不是经典管道;很公平,但他们需要替换 classi\xe2\x80\x8bc 管道中的所有功能。我如何用 YAML 管道替换“发布管道”功能?

\n

例如,使用经典的发布管道,我可以设置一个管道来部署到具有手动触发器的生产(请参阅“由用户手动”):

\n

https://learn.microsoft.com/en-us/azure/devops/pipelines/release/triggers?view=azure-devops#pull-request-triggers

\n

与此等效的 YAML 管道是什么?我显然不想要自动部署到生产的触发器 - 我总是希望严格手动启动该部署 - 但帮助文章似乎没有提供任何 YAML 替代方案。

\n

security deployment azure azure-devops azure-pipelines

10
推荐指数
1
解决办法
3555
查看次数

Azure Pipeline,无法提示,因为终端提示已被禁用

我正在尝试将管道设置为仅签出与项目相关的特定文件夹,以便减少签出时间。

我正在使用在许多其他问题上找到的以下代码,但我似乎无法让它工作。

- script: |
    cd $(Build.SourcesDirectory)

    git init
    git remote set-url origin $(Build.Repository.Uri)
    git config core.sparsecheckout true

    echo STARS/Source/ >> .git/info/sparse-checkout

    git pull origin $(Build.SourceBranch)
  displayName: 'Project Specific Checkout'
  env:
    SYSTEM_ACCESSTOKEN: $(System.AccessToken)

Run Code Online (Sandbox Code Playgroud)

我不断在日志中收到以下错误:

Reinitialized existing Git repository in C:/Agent001/_work/20/s/.git/
fatal: Cannot prompt because terminal prompts have been disabled.
fatal: could not read Password for 'https://organization@dev.azure.com/...': terminal prompts disabled
Run Code Online (Sandbox Code Playgroud)

我似乎无法弄清楚如何启用终端提示。

更新:

根据@Repcak 评论,我更新了代码,但仍然收到错误terminal prompts have been disabled

git cmd azure azure-pipelines

10
推荐指数
2
解决办法
3万
查看次数

跳过 Azure DevOps 中的管道阶段

问题

当触发下面的管道时,在Build 和 push之后不会运行Dev阶段。

在此输入图像描述

该管道由以开发为目标分支的 PR 触发。

管道.yaml

trigger:
  branches:
    include:
      - master
      - develop

pr:
  branches:
    include:
      - develop

stages:
  # Frontend tests: Triggered by opening new PRs to develop or updating pr to develop.
  - stage: FrontEndTests
    displayName: "Frontend tests"
    condition: eq( variables['Build.Reason'], 'PullRequest') #  Trigger stage only for PullRequests
    jobs:
      - template: /templates/pipelines/npm-unit-tests.yml@templates
        parameters:
          triggerType: ${{ variables.triggerType }}

  # Common build triggered by push to master or develop
  - stage: BuildPush
    displayName: "Build …
Run Code Online (Sandbox Code Playgroud)

azure docker azure-devops azure-pipelines

10
推荐指数
1
解决办法
1万
查看次数

“Azure Web 应用程序部署”与“部署 Azure 应用程序服务”

如果我们正在部署一个基本的WebApp / WebApi,那么 Microsoft 的这两个任务似乎执行相同的操作 - 部署到应用程序服务。

AzureWeb应用程序V1

AzureRmWebAppDeploymentV4

如何选择在新的 YAML 发布管道中使用哪一个?我只是想确保我使用的是最面向未来的版本 - 我有 25 个发布管道,除非有必要,否则不想重新执行它们。

帮助的编写方式很难通过比较功能来发现关键的“必备功能”。一些 Microsoft 在线示例同时使用这两种方法。两者在自述文件中仍被标记为“正在开发”,并且自上次签入以来均已使用超过 1 年。

azure-devops azure-pipelines

10
推荐指数
1
解决办法
6310
查看次数