0

在通过 yaml 文件构建和部署 dacpac时,我收到了使用搜索模式“D:\a\1\s***.sln”找不到解决方案的错误。我的 yaml 文件如下。

trigger:
- master

pool:
  name: Azure Pipelines
  vmImage: 'vs2017-win2016'
  
jobs:
- deployment: BuildAndDeploy
  displayName: Build And Deploy Dacpac
  environment: 'DEV'
  strategy:
    runOnce:
      deploy:
        steps:
        - task: VSBuild@1
          displayName: 'Build solution **\*.sln'

        - task: CopyFiles@2
          displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
          inputs:
            SourceFolder: '$(agent.builddirectory)'
            TargetFolder: '$(build.artifactstagingdirectory)'

        - task: AzureKeyVault@1
          displayName: 'Azure Key Vault: kv-agaurav-poc'
          inputs:
            azureSubscription: 'Visual Studio Enterprise-abonnement (b5970491-02a8-4fd0-b9b4-73a6e63a273a)'
            KeyVaultName: 'kv-agaurav-poc'
            RunAsPreJob: true

        - task: SqlAzureDacpacDeployment@1
          displayName: 'Azure SQL DacpacTask'
          inputs:
            azureSubscription: 'Visual Studio Enterprise-abonnement (b5970491-02a8-4fd0-b9b4-73a6e63a273a)'
            ServerName: 'fastbin-server.database.windows.net'
            DatabaseName: 'fastbin-db'
            SqlUsername: agaurav
            SqlPassword: '$(sqlpassword)'
            DacpacFile: 'D:\a\1\a\s\bin\Debug\fastbin-db.dacpac'

需要注意的一点是,如果我有环境之外的步骤任务,它就可以工作。

所以,我的问题是如何让 yaml 文件在任何环境标签中找到解决方案(在这种情况下是环境:'DEV')。

4

1 回答 1

4

deployment默认情况下,作业不会检查您的代码。- checkout: self在尝试构建解决方案之前,您需要先添加下载代码。

于 2020-10-12T12:44:28.377 回答