简体   繁体   中英

Any cli support for Azure data factory's publish process to export ARM templates?

We have setup ADF with Azure DevOps git integration. Our CD pipeline is triggered when there are new ARM templates pushed to adf_publish branch.

Current process on our pipeline is, once a PR is approved it is merged to collaboration branch (Master). Once this is done, we go to the portal and manually click on ADF's publish button to generate the ARM templates in adf_publish branch. I am unable to automate this end to end due to us having to manually Publish the changes.

Ideally I am looking at automating the publishing part. Once the PR is approved our pipeline should be able to execute the publishing process automatically. I have been unable to find a way to automate the publishing part.

So the question is, is there a way to execute ADF publishing process via AZ or PoweShell CLI or some other way? Suggestions welcome. Thanks

Any cli support for Azure data factory's publish process to export ARM templates?

There is a same issue on the github about this issue, and Nowinski provided a brand new PowerShell open-source module to publish the whole Azure Data Factory code from master branch:

Publish from Azure DevOps

variables:
  ResourceGroupName: 'rg-devops-factory'
  DataFactoryName: 'SQLPlayerDemo'
steps:
- powershell: |
   Install-Module Az.DataFactory -MinimumVersion "1.7.0" -Force
   Install-Module -Name "azure.datafactory.tools" -Force
   Import-Module -Name "azure.datafactory.tools" -Force
  displayName: 'PowerShell Script'
steps:
- task: AzurePowerShell@4
  displayName: 'Azure PowerShell script: InlineScript'
  inputs:
    azureSubscription: 'Subscription'
    ScriptType: InlineScript
    Inline: |
     Publish-AdfV2FromJson -RootFolder "$(System.DefaultWorkingDirectory)/_ArtifactName_/" -ResourceGroupName "$(ResourceGroupName)" -DataFactoryName "$(DataFactoryName)" -Location "$(Location)" -Stage "$(Release.EnvironmentName)"

    FailOnStandardError: true
    azurePowerShellVersion: LatestVersion```

Besides, we could try to use code repository with ADF not by Exporting of ARM Template.

Please check this document Deployment of Azure Data Factory with Azure DevOps for some more details.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM