我有一个 asp.net core 网站,我想使用 devops (VSTS) 管道将其部署到本地 IIS 服务器。
构建管道工作正常,但我在配置发布管道时遇到了问题。
流程如下:
我能够在浏览器会话中从目标服务器浏览到 devops 站点 ( https://companydomain.visualstudio.com )
我是否正确理解需要在每台目标服务器上安装代理?有什么想法为什么无法连接吗?我猜这是一些公司代理/防火墙问题,但我不知道如何访问任何诊断或日志。我本以为通过 443 访问 .visualstudio.com 就足够了?
我试图通过在任务中设置一些环境变量来自定义管道版本的输出。我找到了以下链接: https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands ?view=azure-devops&tabs=powershell
然而这似乎不起作用。我所做的只是创建一个具有单个任务(bash 或 PS)的管道,并通过任务的内联版本声明链接中指定的命令。
有人已经成功地使这些命令起作用了吗?我做错了什么和/或不完整吗?
有没有人有更好的方法来使用任务中的相关信息来自定义管道?例如,通过版本名称,或特定版本的描述和/或标签?
编辑:
Write-Host "##vso[task.setvariable variable=sauce;]crushed tomatoes"
Write-Host "##vso[task.setvariable variable=secretSauce;issecret=true]crushed tomatoes with garlic"
Write-Host "Non-secrets automatically mapped in, sauce is $env:SAUCE"
Write-Host "Secrets are not automatically mapped in, secretSauce is $env:SECRETSAUCE"
Write-Host "You can use macro replacement to get secrets, and they'll be masked in the log: $(secretSauce)"
Run Code Online (Sandbox Code Playgroud)
这是代码,复制并粘贴。现在我也尝试了该脚本,但它也不起作用。我使用托管的 Windows 代理。
azure azure-devops azure-pipelines azure-pipelines-release-pipeline
我正在使用天蓝色的构建和发布管道。据我了解,构建管道会生成可供发布管道使用的工件,并且部署可以组织成多个阶段,并提供部署/重新部署阶段的选项。
但是,我还注意到发布管道中可用的所有任务也可以在构建管道中使用。构建管道的文档还指出它可用于构建、测试和部署。那么使用发布管道到底有什么好处呢?
azure azure-devops azure-pipelines-build-task azure-pipelines azure-pipelines-release-pipeline
我在我的 DevOps 中为函数应用程序创建了一个发布管道。它具有测试部署阶段(手动触发)和产品部署触发器设置为“阶段后测试”。它还设置了部署前批准。手动触发释放(多个阶段)。测试已部署,但生产阶段只是排队。我也没有看到任何进行批准的选项。如何让产品也部署而不仅仅是排队?我错过了什么吗,请帮忙吗?截图会更有意义,附上 devops 的截图 -
产品部署前批准
产品排队的发布屏幕截图 -
azure-devops azure-pipelines-release-pipeline azure-function-app
当我尝试在 Azure Devops 中使用发布管道进行部署时,我遇到了锁定 DLL 文件的问题。
错误的截图是:
输出为文本:
2021-03-31T17:43:18.2626492Z ##[error]Error Code: ERROR_FILE_IN_USE
More Information: Web Deploy cannot modify the file 'Microsoft.Data.SqlClient.SNI.x64.dll' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.
Error count: 1.
Run Code Online (Sandbox Code Playgroud)
该问题似乎是由错误处置的 .NET 资源引起的。(例如:非托管 SqlConnection)无论如何,我无法更改源代码。
这是我的发布管道。
这是我的问题: …
azure locked-files azure-devops azure-pipelines-release-pipeline
实际的
部署时发布管道失败
预期的
部署不会失败
根本原因
文件“Microsoft.Data.SqlClient.SNI.x86.dll”被外部进程锁定,即使“使应用程序脱机标志”设置处于打开状态
解决方法
手动回收应用程序池并重新运行失败的部署。
当使用“recycleAppPool”应用“Action IIS Application Pool”设置时,尝试自动回收也失败。
信息
错误信息
Error Code: ERROR_FILE_IN_USE More Information: Web Deploy cannot modify the file 'Microsoft.Data.SqlClient.SNI.x86.dll' on the destination because it is locked by an external process.
In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt.
Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE. Error: The process cannot …Run Code Online (Sandbox Code Playgroud) yaml continuous-deployment azure-devops azure-pipelines-release-pipeline microsoft-data-sqlclient
我在我的 azure Devop 管道上遇到以下错误,它似乎与参数循环有关,但尽管以多种不同的方式编写脚本,我似乎无法摆脱它。YAML 验证器和我的 YAML linter 未检测到问题。
/azure-pipelines.yml (Line: 1, Col: 12): Unexpected value ''
下面是我的代码,它也使用了一个模板,我将把它包含在它下面。
azure-pipelines.yml
parameters:
steps:
- ${{ each project in parameters.projects }}:
- task: UsePythonVersion@0
displayName: 'Setting python version to 3.7'
inputs:
versionSpec: '3.7'
architecture: 'x64'
- script: |
pushd '$(System.DefaultWorkingDirectory)/${{ project }}'
pip install -r requirements.txt
displayName: 'Install prerequisites'
- task: ArchiveFiles@2
displayName: 'Archive files'
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/${{ project }}'
includeRootFolder: false
archiveFile: '$(System.DefaultWorkingDirectory)/${{ project }}.zip'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(System.DefaultWorkingDirectory)/${{ project }}.zip' …Run Code Online (Sandbox Code Playgroud) yaml azure pyyaml azure-pipelines-release-pipeline azure-pipelines-yaml
在azuredevops yaml管道中,我们可以嵌套forloop吗?或多个for循环。
我的要求是通过映射的变量值迭代管道,这应该跨环境完成。
例如:在我的 ADO 存储库中,每个应用程序有 10 个文件夹,每个应用程序中每个环境有 4 个不同的变量模板文件,即“vars-development.yaml、vars-staging.yaml、vars-prod.yaml、vars-dr” .yaml”
我需要的是在每个环境特定变量模板中,我需要有不同的警报规则输入(每个环境会有多个警报)。变量.development.yaml
variables:
alert1:
environment: development
subscription: 'mysubscription'
resourceGroup: myrg
AlertRuleName: myalertrule
query:myquery
timeWindowInMinutes: 1
severity: 1
operator: GreaterThanOrEqual
threshold: 20
alert2:
environment: development
subscription: 'mysubscription'
resourceGroup: myrg
AlertRuleName: myalertrule
query:myquery
timeWindowInMinutes: 1
severity: 1
operator: GreaterThanOrEqual
threshold: 20
autoMitigate: false
etc.............
alertn:
Run Code Online (Sandbox Code Playgroud)
azure-pipeline.yaml
name: $(Build.SourceBranchName)-$(Build.BuildId)
trigger: none
parameters:
- name: appname
type: string
values:
- app1
- app2
- app3
- app4
- app5
- app5
stages:
- template: …Run Code Online (Sandbox Code Playgroud) azure-pipelines azure-pipelines-release-pipeline azure-pipelines-yaml
在 Azure DevOPS 上,我收到以下错误:在以下阶段 UAT 上部署失败。尝试连接到服务器时发生未定义的错误。状态码0:错误。
为什么我会收到此错误?
我可以在 vsts 中的发布定义的代理阶段跳过工件下载吗?(不是在创建发布后。我可以在创建发布后执行此操作)。试图找到如何在发布定义中做到这一点。请帮忙
我需要将基于Excel的测试用例导入VSTS并将测试用例从VSTS导出到MS Excel.VSTS(非TFS)
excel visual-studio-2010 microsoft-test-manager azure-pipelines azure-pipelines-release-pipeline
我试图在PowerShell中设置变量,以便我可以在发布定义中的自定义条件中使用它们,因此我可以防止相位运行是将VSTS变量设置为false或0
azure-pipelines-release-pipeline ×12
azure-devops ×9
azure ×4
yaml ×2
excel ×1
locked-files ×1
powershell ×1
pyyaml ×1
tfs ×1