下面脚本的任务名称有什么错误:
我正在编写YAML脚本,用于通过Azure DevOps CI/CD管道从本地PostgreSQL数据库复制到Azure PostgreSQL DB示例,但得到语法错误
编码:
pool:
vmImage: ubuntu-latest
stages:
- stage: CopyData
jobs:
- job: CopyDataJob
displayName: 'Copy Data from Local PostgreSQL to Azure PostgreSQL'
steps:
- task: PostgreSQLScript@0
displayName: 'Export Data from Local PostgreSQL'
inputs:
connectionType: 'PostgreSQL'
postgresqlFile: 'location.sql'
postgresqlConnectionString: 'DATABASE_URL=postgres://{testuser2408}:{testuser2408!}@{localhost}:{5432}/{postgres}'
failOnScriptError: true
- task: CopyFiles@2
displayName: 'Copy Exported Data to Artifact Staging Directory'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: 'path/to/exported_data/*.csv'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
1条答案
按热度按时间cyvaqqii1#
发生此错误的原因是没有可用的任务PostgreSQL Script@0任务。
要部署到Azure PostgreSQL Server,Microsoft建议利用AzureCLI@2 task