Azure devops 在VSTS生成中为Azure Bot服务/Azure功能解决方案设置生成管道
我有一个Azure机器人服务解决方案,它位于我的VSTS Git存储库中 我正在visual studio中使用Task Runner在本地计算机上编译、运行和调试代码 类似地,我想在我的VSTS构建管道中构建和编译代码,就像我们如何使用Visual Studio模板为.Net应用程序构建代码一样 我对有C#脚本文件的机器人服务项目非常陌生 我看到msdn文档都提到了持续集成,它将直接链接到我的Git repo分支。每当我提交代码时,它都会自动推送到我的Azure Bot服务,在这里,我想确保在推送到Azure Bot服务之前,我提交的代码应该经过编译。为此,我想设置一个构建管道 有人知道如何为这种有C#脚本文件的项目设置构建管道吗 更新: 在我的本地PC中,我安装了Azure功能CLI工具和visual studio的命令任务运行程序扩展。我按照下面的链接启用本地调试 运行debughost.cmd文件的任务运行程序,该文件位于我的Bot服务代码中,它包含以下代码Azure devops 在VSTS生成中为Azure Bot服务/Azure功能解决方案设置生成管道,azure-devops,azure-functions,azure-pipelines,azure-pipelines-build-task,azure-bot-service,Azure Devops,Azure Functions,Azure Pipelines,Azure Pipelines Build Task,Azure Bot Service,我有一个Azure机器人服务解决方案,它位于我的VSTS Git存储库中 我正在visual studio中使用Task Runner在本地计算机上编译、运行和调试代码 类似地,我想在我的VSTS构建管道中构建和编译代码,就像我们如何使用Visual Studio模板为.Net应用程序构建代码一样 我对有C#脚本文件的机器人服务项目非常陌生 我看到msdn文档都提到了持续集成,它将直接链接到我的Git repo分支。每当我提交代码时,它都会自动推送到我的Azure Bot服务,在这里,我想确
@echo off
set size=0
call func settings list -data > %temp%\settings-list
call :filesize %temp%\settings-list
if NOT %size% == 0 goto show
@echo ----------------------------------------------------------------------
@echo To fetch your bot service settings run the following command:
@echo func azure functionapp fetch-app-settings [YOUR_BOT_SERVICE_NAME]
@echo func azure functionapp fetch-app-settings AthenaDevbvpn6xsu2tz6i
@echo ----------------------------------------------------------------------
goto start
:show
type %temp%\settings-list
erase %temp%\settings-list
:start
@func host start -p 3978
goto :eof
:filesize
set size=%~z1
exit /b 0
任务运行程序中的输出为
对于Azure Bot服务,请在VSTS中设置与存储库主分支的持续集成,对于VSTS中的存储库,您可以创建一个新分支,例如Dev,然后使用Dev分支并合并到主分支。之后,代码将更新到azure 简单步骤:
目前没有任何现成的任务来编译CSX文件。以下是我可以为您的场景考虑的变通方法,但这并不完美:
##Run Azure Func command to compile csx file
$compile = Start-Process 'func' -passthru -WorkingDirectory '.' -ArgumentList 'host start -p 3739' -RedirectStandardOutput 'output.txt'
##You need to set the sleep time base on the build time of your project
Start-Sleep -s 20
Stop-Process $compile -Force
Stop-Process -Name 'Func'
##Get the output from Func and check if there is error in the output
$boutput = Get-Content 'output.txt'
Write-Host 'Azure Function CLI Log:'
Write-Host '*****************************************************************************************************************************'
$boutput
Write-Host '*****************************************************************************************************************************'
$reg = "Function.compilation.error"
foreach($line in $boutput){
if($line -match $reg)
{
##Fail the task if function compilation error exist
Write-Host '##vso[task.logissue type=error]Error occur during function compilation'
Exit 1
}
}
Write-Host 'Function compilation success!'
如果编译失败,您将得到以下结果:
如何在本地编译项目?例如咕噜声、咕噜声等。@starain MSFT我已经更新了我的问题,提供了更多关于我如何在本地调试的信息。您能告诉我如何在生成步骤中调试吗?我做了一个测试,生成过程将保持在run debughost.cmd(命令行步骤)中,并且无法完成,您不能调试它。@starain MSFT是否有其他方法在VSTS生成中生成此类项目?如果您有任何有帮助的示例。@narendramacha生成用于生成代码,并将生成输出发布到某个位置进行测试或部署。为什么要从VSTS构建中调试它?是的,我目前正在以类似的方式进行调试。但是你的剧本比我的好。谢谢