簡體   English   中英

自動發布數據工廠生成ARM模板

[英]Automated publish Data Factory generate ARM template

出於某種原因,NPM 包創建了一個“無效”的 arm 模板。 不是我所期望的。 arm 模板沒有管道數據集等。

這里可能是什么問題? 我的協作分支的根文件夾中有一個 publish_config 文件和 package.json 文件。 構建管道位於共享分支中,它從主分支觸發以發布到開發、測試和生產。

希望我能得到一些幫助。

包.json

{
    "scripts":{
        "build":"node node_modules/@microsoft/azure-data-factory-utilities/lib/index"
    },
    "dependencies":{
        "@microsoft/azure-data-factory-utilities":"^0.1.3"
    }
}

管道:

trigger:
#- master 
feature/npmv2 branch

pool:
  vmImage: 'ubuntu-latest'

steps:


- task: NodeTool@0
  inputs:
    versionSpec: '10.x'
  displayName: 'Install Node.js'

- task: Npm@1
  inputs:
    command: 'install'
    verbose: true
  displayName: 'Install npm package'



- task: Npm@1
  inputs:
    command: 'custom'
    customCommand: 'run build validate $(Build.Repository.LocalPath) /subscriptions/xxxxx/resourceGroups/xxxx/providers/Microsoft.DataFactory/factories/df-dev-0001'
  displayName: 'Validate'

# Validate and then generate the ARM template into the destination folder. Same as clicking "Publish" from UX
# The ARM template generated is not published to the ‘Live’ version of the factory. Deployment should be done using a CI/CD pipeline. 

- task: Npm@1
  inputs:
    command: 'custom'
    customCommand: 'run build export $(Build.Repository.LocalPath) /subscriptions/xxxxx/resourceGroups/xxxx/providers/Microsoft.DataFactory/factories/df-dev-0001 "ArmTemplate"'
  displayName: 'Validate and Generate ARM template'

# Publish the Artifact to be used as a source for a release pipeline

- task: PublishPipelineArtifact@1
  inputs:
    targetPath: '$(Build.Repository.LocalPath)/ArmTemplate'
    artifact: 'ArmTemplates'
    publishLocation: 'pipeline'

發布配置

{"publishBranch":"factory/adf_publish","includeFactoryTemplate":true}

運行run build export ...步驟的輸出是:

在此處輸入圖片說明

失敗者的文件夾結構:

在此處輸入圖片說明

成功的文件夾結構:

在此處輸入圖片說明

親切的問候,

迪基奇

日志表明您運行構建命令的文件夾中不存在所需的 ADF json 人工制品。

您的 npm build package.json 應該與您的 ADF json 工件位於同一文件夾中,您可以將其放在子文件夾中(例如構建)

您運行構建管道的分支似乎沒有最新的 ADF 代碼,或者代碼不在您的 yamp 腳本步驟 ( $(Build.Repository.LocalPath) : 源代碼的根目錄中)你的情況)

檢查您的分支策略,確保觸發構建過程的功能分支或代碼分支同時包含 ADF json 工件(代碼)和 npm package.json。

查看我關於如何正確設置開發環境以使用 ADF 實用程序的文章: http : //www.mutazag.com/blog/code/tutorial/adf-utils-for-publishing/

要從 build 子文件夾中使用 npm build 命令,您需要更改 yaml 文件中的導出和驗證步驟以引用正確的工作目錄,如下所示:

    - task: Npm@1
      inputs:
        command: 'custom'
        workingDir: '$(Build.Repository.LocalPath)/build' #replace with the package.json folder
        customCommand: 'run build export $(Build.Repository.LocalPath) "/subscriptions/xxxxxx/resourceGroups/xxxxx/providers/Microsoft.DataFactory/factories/df-dev-mutaz" "ArmTemplate"'
      displayName: 'Export and Generate ARM template'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM