使用托管标识的 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)
我似乎无法弄清楚我能做些什么来避免出现此错误。
以前有人收到过这个。这是一个许可的事情吗?
欢迎任何想法。
我试图允许管道将架构更改发布到本地 SQL Server 2017 实例,但我想分两步完成:
我知道可以通过设置发布到 SQL Azure来实现deploymentAction: 'Script'deploymentAction: 'Publish'
有没有办法以类似的方式发布到本地 SQL Server?我已经尝试过SqlDacpacDeploymentOnMachineGroup任务,但似乎不可能通过此任务分两步完成
我想在分支触发器和计划触发器的构建管道中运行不同的作业。
branch trigger => run job 1
scheduled trigger => run job 2
有什么方法可以区分触发器吗?这样我就会根据这种不同的条件来运行我的工作。
我的思考过程
我正在考虑在计划触发期间设置变量,因此我可以在工作条件评估中使用该变量。但我无法设置变量。
# Sample azure-build-pipeline.yml file
variables:
# by default the variable is false
isScheduledTrigger: false
trigger:
- develop
- master
schedules:
- cron: "0 0 * * *"
displayName: Daily midnight build
branches:
include:
- develop
always: true
# somewhere here i want to set the isScheduledTrigger variable to TRUE
jobs:
- job: Branch trigger job
condition: or(eq(variables['Build.SourceBranchName'], 'develop'),eq(variables['Build.SourceBranchName'], 'master'))
steps:
# Multiple …Run Code Online (Sandbox Code Playgroud) azure azure-devops azure-pipelines-build-task azure-pipelines azure-pipelines-yaml
我有一个 VS 2019 解决方案,其中包含三个已签入 Git 存储库的 .Net Core 3.x Web Api 项目。
我通过针对我的 Azure AKS 集群的向导在 Azure DevOps 中创建了一个构建管道。
创建了以下管道 YAML 文件。
运行此管道时,当它尝试复制 Web API 项目文件(如下面的日志中所述)时,我收到以下异常。
Step 6/38 : COPY ["BoundedContexts/BC1/API/NextWare.AppBuilder.BC1.API.csproj", "BoundedContexts/BC1/API/"]
COPY failed: stat /var/lib/docker/tmp/docker-builder568816228/BoundedContexts/BC1/API/NextWare.AppBuilder.BC1.API.csproj: no such file or directory
Run Code Online (Sandbox Code Playgroud)
该文件位于存储库中,可通过 Azure DevOps 中的存储库查看器查看
这是 Azure DevOps 管道中失败的 docker 文件...
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["BoundedContexts/BC1/API/NextWare.AppBuilder.BC1.API.csproj", "BoundedContexts/BC1/API/"]
COPY ["Infrastructure/NextWare.Infrastructure.EventStore/NextWare.Infrastructure.EventStore.csproj", "Infrastructure/NextWare.Infrastructure.EventStore/"]
COPY ["Infrastructure/NextWare.Infrastructure/NextWare.Infrastructure.csproj", "Infrastructure/NextWare.Infrastructure/"]
COPY ["Infrastructure/NextWare.Infrastructure.EventBus/NextWare.Infrastructure.EventBus.csproj", "Infrastructure/NextWare.Infrastructure.EventBus/"]
COPY ["Infrastructure/NextWare.Infrastructure.EventBus.RabbitMQ/NextWare.Infrastructure.EventBus.RabbitMQ.csproj", "Infrastructure/NextWare.Infrastructure.EventBus.RabbitMQ/"] …Run Code Online (Sandbox Code Playgroud) continuous-integration azure-devops azure-pipelines azure-aks
我在 Azure DevOps 中为我的 Function App 设置了一个构建管道,它利用了 nuget 缓存,从而利用了 package.lock.json 文件。但是,我不断遇到包验证哈希问题,例如:
Package content hash validation failed for Microsoft.Extensions.DependencyInjection.2.2.0. Expected: ASF77AJjnyi9hL7IJU1KCAvnCTgI3JEwkU+D4gnKd53nFIYpibVjR6SW8tdTkkuZ+QkmIx2rPvKdTMNVPfVU9A== Actual: MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==
Package content hash validation failed for Microsoft.Extensions.DependencyInjection.Abstractions.2.2.0. Expected: 2xMk9LHz1EY+7gVG0lG4qBvkUiVjg8QNPqd2HYmEP5+PL7Ayo96EhBieAhd++Gx4yM+xN8kNqmhZdFMBHeG0HQ== Actual: f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==
Package content hash validation failed for runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0. Expected: c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw== Actual: LdIvj7Bi2jiaNTqY/ezZGVXHe1KI5fjLSI026O1TjVzsmdgTP/zTF+f3nwHCjwttyhsPBEiswv0PekimPWZwWg==
Package content hash validation failed for runtime.native.System.IO.Compression.4.3.0. Expected: INBPonS5QPEgn7naufQFXJEp3zX6L4bwHgJ/ZH78aBTpeNfQMtf7C6VrAFhlq2xxWBveIOWyFzQjJ8XzHMhdOQ== Actual: b+V9JC/Ii3sR659flBeaBJww111425tgjcDS1k+hqV4sGh9FALRDBvJnDtQ895gAzpPTUOFDHdqaZ2Et7BpZMg==
Package content hash validation failed for runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple.4.3.0. Expected: kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ== Actual: Kh9W4agE0r/hK8AX1LvyQI2NrKHBL8pO0gRoDTdDb0LL6Ta1Z2OtFx3lOaAE0ZpCUc/dt9Wzs3rA7a3IsKdOVA==
Package content hash validation failed for runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0. Expected: ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ== Actual: JGc0pAWRE8lB4Ucygk2pYSKbUPLlAIq6Bczf5/WF2D/VKJEPtYlVUMxk8fbl1zRfTWzSHi+VcFZlaPlWiNxeKg==
Package content hash …Run Code Online (Sandbox Code Playgroud) 我尝试在每天晚上安排的 Azure 管道中执行以下 2 个步骤:
在密钥库中创建证书的第一步对我来说效果很好:
# import the self-signed certificate ccg-self-signed-cert into the Keyvault
- task: AzurePowerShell@5
inputs:
azureSubscription: '${{ parameters.ArmConnection }}'
ScriptType: 'InlineScript'
azurePowerShellVersion: '3.1.0'
Inline: |
$Pwd = ConvertTo-SecureString -String 'MyPassword' -Force -AsPlainText
$Base64 = 'MIIKqQ____3000_CHARS_HERE______1ICAgfQ=='
$Cert = Import-AzKeyVaultCertificate -VaultName $(KeyVaultName) -Name my-self-signed-cert -CertificateString $Base64 -Password $Pwd
echo "##vso[task.setvariable variable=Thumbprint;isOutput=true]$Cert.Thumbprint"
Run Code Online (Sandbox Code Playgroud)
我想我按行设置了管道变量echo(不太确定,如何验证......)
但是,如何在下一个管道任务中将保存证书指纹值的管道变量传递给 ARM 模板?
# deploy SF cluster by ARM template and use the SF Cluster …Run Code Online (Sandbox Code Playgroud) azure azure-resource-manager azure-service-fabric azure-keyvault azure-pipelines
我正在尝试从当前构建管道和分支下载给定标签的最新可用工件,但出现以下错误。
##[error]No builds currently exist in the pipeline definition supplied.
Run Code Online (Sandbox Code Playgroud)
这是一个用于自动化测试的 3 阶段管道,具有构建、部署和运行测试阶段。在运行测试阶段,我尝试下载构建阶段中最新可用的工件,这可能是本次运行,也可能是较早的运行。
如果我保留标签选项,它将尝试从上次可用的运行中获取它,但当时可能尚未创建此工件,因此我使用标签来尝试过滤它。
- task: DownloadPipelineArtifact@2
displayName: 'Download Latest DLLs'
inputs:
source: 'specific'
project: $(System.TeamProjectId)
pipeline: $(System.DefinitionId)
runVersion: 'latestFromBranch'
runBranch: $(Build.SourceBranch)
tags: 'myBuildTag'
allowPartiallySucceededBuilds: true
artifact: myArtifactName
patterns: '**/IntegrationTests/**/*'
path: '$(Agent.TempDirectory)\myArtifactName'
continueOnError: true
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激
azure-devops azure-pipelines azure-pipelines-tasks azure-pipelines-yaml
我有一个 devops yaml 管道,它运行 DotNetCoreCLI@2 任务来恢复、构建和测试。
如果一个或多个测试失败,我希望管道继续并发布为 DevOps 版本做好准备的输出。
最初,如果测试失败,整个管道执行将报告“构建失败”。在构建管道 yaml 的顶部添加以下内容后:
jobs:
- job: Build
continueOnError: true
Run Code Online (Sandbox Code Playgroud)
我现在得到“构建部分成功”。
但是,当我检查管道执行摘要页面时,我发现有 0 个工件:
即使测试失败,如何使管道发布?
为了完整起见,完整的 yaml 如下
stages:
- stage: Build
jobs:
- job: Build
continueOnError: true
pool:
name: Hosted Windows 2019 with VS2019
demands:
- msbuild
- visualstudio
variables:
solution: '**/*.sln'
projects: '**/Interfaces.Avaloq.Presentation.AzureFunctions.csproj'
unitTestProjects: '**/*Testing.Unit*/*.csproj'
integrationTestProjects: '**/*Testing.Integration*/*.csproj'
buildPlatform: 'Any CPU'
buildConfiguration: 'Debug'
steps:
- script: |
- task: DotNetCoreCLI@2
displayName: Restore Functions
inputs:
command: restore
projects: '$(projects)'
feedsToUse: config
nugetConfigPath: …Run Code Online (Sandbox Code Playgroud) yaml .net-core azure-devops azure-pipelines azure-pipelines-yaml
我对 Azure DevOps 还比较陌生。我在 Windows 2016 服务器上安装了 Azure DevOps Server 2019。我使用经典编辑器创建了一个 Azure 管道。我的代理作业有四个步骤:安装节点、“npm install”、“dotnet Restore”和“ng test”。当我运行构建时,出现以下错误:
No agent found in pool Default which satisfies the specified demands:
Agent.Version -gtVersion 2.115.0
Run Code Online (Sandbox Code Playgroud)
我查看了其他 StackOverflow 帖子并在服务器上安装了 Visual Studio 2019 来尝试解决该问题。仍然遇到同样的错误。我需要在管道中添加一些东西吗?
最近,在我们的一些部署中,关于如何自动化功能应用程序和 Web 应用程序的应用程序设置,内部存在一些混乱,并且检查周围似乎有大量令人眼花缭乱的选项,看起来它们在做大致相同的事情,但在不同的地方脚步。
我们的开发人员通常有一个提交到存储库的 appsettings.json 文件,对于他们的测试来说可能看起来像这样......
{
"Logging": {
"LogLevel": {
"Default": "Information",
}
},
"Values": {
"ThingToPointTo": "http://localhost",
}
}
Run Code Online (Sandbox Code Playgroud)
当我们将其带到其他环境(例如 PROD)时,我们将ThingToPointTo更改为“https://productservice”之类的内容
我们一直在使用 Azure DevOps YAML 管道以这种方式部署和更改 AppSettings...
- task: AzureFunctionApp@1
inputs:
azureSubscription: 'OurAzureSubServiceConnection'
appType: functionApp
appName: $(azfuncappname)
package: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
AppSettings: '-Values:ThingToPointTo "https://productionservice"'
Run Code Online (Sandbox Code Playgroud)
我的问题有两个
Values :ThingToPointTo是否正确枚举到正确的设置,或者应该只是ThingToPointTo(省略Values:)?
这是这样做的方法吗?我注意到您可以在部署之前使用 JSON 转换步骤来更改实际文件,并且还有一个名为“Azure 应用服务设置”的任务可以在部署后使用它来执行此操作?
关于这个主题的文章有很多,但似乎没有一篇适合。
提前致谢!
azure azure-web-app-service azure-devops azure-pipelines azure-function-app
azure-pipelines ×10
azure-devops ×9
azure ×5
.net-core ×1
azure-aks ×1
c# ×1
nuget ×1
sql-server ×1
yaml ×1