azure-devopsazure-pipelines-yamlmsix

Creating an .appinstaller in Azure Devops


The Goal I have a WPF application that is to be updated from a sFTP server. Azure Devops is being used as the CI/CD and pushed out to the sFTP server.

Question I wish to build a .appinstaller from what I gather when creating a .appinstaller for msix you require to have a public facing URI. I do not wish to do so i want it to be stored on the sFTP server and then downloaded it from there then installed locally.

Any tips?

This is a partial yaml file used to build

  - task: MsixPackaging@1
    inputs:
      outputPath: '$(Build.ArtifactStagingDirectory)/$(Build.BuildNumber).msix'
      solution: 'app.sln'
      clean: true
      generateBundle: true
      buildConfiguration: 'release'
      msbuildLocation: 'C:\Download'
      buildForX86: false
      updateAppVersion: false
      appPackageDistributionMode: 'SideloadOnly'
      msbuildLocationMethod: 'version'
      msbuildVersion: 'latest'
      msbuildArchitecture: 'x64'

  - task: AppInstallerFile@1
    displayName: 'Create AppInstaller'
    inputs:
      package: '$(Build.ArtifactStagingDirectory)/$(Build.BuildNumber).msix'
      outputPath: '$(Build.ArtifactStagingDirectory)/$(Build.BuildNumber).appinstaller'
      uri: '\\PC\Download'
      mainItemUri: '\\PC\Download'
      showPromptWhenUpdating: true
      updateBlocksActivation: true

Solution

  • Since you are using sftp server, then the port related to SSH on that server should be already turned on.

    You can use SSH protocol to handle the file you want to upload/push.

    You need first create a SSH service connection in DevOps project settings.

    And then push the file based on the task CopyFilesOverSSH@0:

    trigger:
    - none
    pool: VMAS #This is the agent pool on my side, you can set up your own agent pool.
      # vmImage: ubuntu-latest
    steps:
    #Put your logic here.
    - task: CopyFilesOverSSH@0
      inputs:
        sshEndpoint: 'SSH_To_Remote_VM'
        contents: 'test.appinstaller'
        readyTimeout: '20000'
    

    It works fine on my side:

    enter image description here

    Also you can use the task SSH@0 to run scripts on remote machine.