question

KiddAlan-1052 avatar image
0 Votes"
KiddAlan-1052 asked KiddAlan-1052 edited

YAML for deployment of Standard Logic App Single-Tenant using Zip deploy

I have a standard single-tenant logic app which deploys correctly from VSCode to Azure.

I am trying to create a pipeline to deploy it from Azure DevOps using a zip deploy.

This pipeline runs successfully but there are no workflows in the logic app after it runs.

 # Deploy Standard Logic App
        
     trigger:
     - master
        
     pool:
       vmImage: 'windows-latest'
        
     variables:
       buildPlatform: 'Any CPU'
       buildConfiguration: 'Release'
        
     steps:
     - script: cd
     - script: dir
        
     - task: ArchiveFiles@2
       inputs:
         rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
         includeRootFolder: true
         archiveType: 'zip'
         archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
         replaceExistingArchive: true
     - task: AzureFunctionApp@1
       displayName: 'Deploy logic app workflows'
       inputs:
          azureSubscription: 'subscription1'
          appType: 'workflowapp'
          appName: 'vscode-logic-std'
          package: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
          deploymentMethod: 'zipDeploy'


When I look at the number of files and folders it has zipped it is way too high. I think it is zipping the wrong directory.

 Found 1 files
 Archiving file: s
 D:\a\_tasks\ArchiveFiles_d8b84976-e99a-4b86-b885-4849694435b0\2.201.1\7zip\7z.exe a -tzip -mx=5 D:\a\1\a\118.zip @D:\a\_temp\bvf4hc6qzk8
    
 7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
    
 Scanning the drive:
 68 folders, 91 files, 52766 bytes (52 KiB)
    
 Creating archive: D:\a\1\a\118.zip
    
 Add new data to archive: 68 folders, 91 files, 52766 bytes (52 KiB)
    
    
 Files read from disk: 91
 Archive size: 59142 bytes (58 KiB)
 Everything is Ok
 Finishing: ArchiveFiles

Can you please advise what needs to be corrected in the YAML pipeline?

Thanks






azure-logic-apps
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The dir command in the pipeline shows this:

 Script contents: shell
 dir
 ========================== Starting Command Output ===========================
 "C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\6997a3cc-d915-4558-9782-4c20aff8ed3a.cmd""
  Volume in drive D is Temp
  Volume Serial Number is 0CA0-52BA
    
  Directory of D:\a\1\s
    
 03/30/2022  04:14 AM    <DIR>          .
 03/30/2022  04:14 AM    <DIR>          ..
 03/30/2022  04:14 AM                71 .funcignore
 03/30/2022  04:14 AM    <DIR>          .vscode
 03/30/2022  04:14 AM    <DIR>          Artifacts
 03/30/2022  04:14 AM               751 azure-pipelines.yml
 03/30/2022  04:14 AM               153 host.json
 03/30/2022  04:14 AM    <DIR>          looping-json
 03/30/2022  04:14 AM    <DIR>          std-json-json
 03/30/2022  04:14 AM    <DIR>          std-xml-json
 03/30/2022  04:14 AM    <DIR>          workflow-designtime
                3 File(s)            975 bytes
                8 Dir(s)  14,925,639,680 bytes free
 Finishing: CmdLine
0 Votes 0 ·

1 Answer

KiddAlan-1052 avatar image
0 Votes"
KiddAlan-1052 answered KiddAlan-1052 edited

I got it working:

 # Deploy Standard Logic App
    
 trigger:
 - master
    
 pool:
   vmImage: 'windows-latest'
    
 variables:
   buildPlatform: 'Any CPU'
   buildConfiguration: 'Release'
    
 jobs:
 - job: logic_app_build
   displayName: 'Build and publish logic app'
   steps:
   - task: CopyFiles@2
     displayName: 'Create project folder'
     inputs:
       SourceFolder: '$(System.DefaultWorkingDirectory)'
       Contents: |
         **
       TargetFolder: 'project_output'
    
   - task: ArchiveFiles@2
     displayName: 'Create project zip'
     inputs:
       rootFolderOrFile: '$(System.DefaultWorkingDirectory)/project_output'
       includeRootFolder: false
       archiveType: 'zip'
       archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
       replaceExistingArchive: true
    
   - task: AzureFunctionApp@1
     displayName: 'Deploy logic app workflows'
     inputs:
       azureSubscription: 'subscription1'
       appType: 'workflowapp'
       appName: 'vscode-logic-std'
       package: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
       deploymentMethod: 'zipDeploy'
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.