Redigera

Dela via


MSIX Packaging Extension

The MSIX Packaging Extension is an Azure DevOps extension which helps build, package and sign Windows apps using the MSIX package format.

CI/CD workflows have become an integral part of the development process to improve efficiency and quality while reducing cost and time to market. Microsoft's CI/CD solution Azure DevOps Pipelines is widely adopted and popular, but the current process of integrating build and deployment workflows for apps that need to be packaged as MSIX into Azure Pipelines is tedious, specifically for people that are not Azure Pipelines or MSIX experts. This Azure DevOps extension offers a straightforward and intuitive solution making it easier to automate build and deployment process for apps being packaged as MSIX, and for apps with existing CI/CD workflows to move to MSIX without disrupting their build and deployment mechanisms.

The MSIX Packaging Extension contains the following tasks that you can use to custom build your pipeline according to your requirements:

  1. MSIX build and package - to build and package Windows apps using the MSIX package format
  2. MSIX package signing - to sign MSIX packages using a trusted certificate
  3. App installer file for MSIX - to create or update a .appinstaller file for MSIX apps
  4. Create package for MSIX app attach - to create a VHDX package for MSIX app attach

Install the extension

Browse the Azure DevOps Marketplace and look for the extension name MSIX Packaging Extension.

Browse the marketplace

Create a Pipeline

Create a new pipeline for your Azure DevOps project.

select pipeline

New pipeline

Select the option to Use the classic editor to create a pipeline without YAML.

Use the classic editor

Select your version control system and provide your repository and default branch details.

Configure source vcs

When asked to Select a template, click start with an Empty job.

Start with an empty job

Change your Agent Specification selection to windows-2019 since the MSIX extension runs only on a Windows agent.

Agent specification windows

You should see Agent job 1 by default in your pipeline. Click on the plus symbol to Add a task to Agent job 1.

Search for MSIX in the Add tasks search bar and you should see the tasks mentioned before in the MSIX Packaging Extension. You can custom build your pipeline by adding the tasks you need according to your requirements. But we will demonstrate how to configure all four tasks on this page.ADO Extension Image1

MSIX build and package

Note: If you are trying to build a packaged app using this task, you will need to include the Windows Application Packaging Project, because the task needs the Package.appxmanifest file. The task will not add it automatically for you.

Here's an example that shows how to configure the build and package task in the yaml file:

steps:
- task: MSIX.msix-ci-automation-task-dev.msix-packaging.MsixPackaging@1
  displayName: 'MSIX build and package'
  inputs:
    outputPath: '$(Build.ArtifactStagingDirectory)\MyApp.msix'
    solution: MyUWPApp.sln
    buildPlatform: x64
    updateAppVersion: true
    manifestFile: MyUWPApp/Package.appxmanifest
    appVersion: 2.0.0.0
    appPackageDistributionMode: SideloadOnly
    msbuildArchitecture: x64

MSIX package signing

The signing task allows signing using a certificate. The certificate can come from the Secure Files library , or be encoded as a string as if fetched with the Azure Key Vault task.

Here's an example that shows how to configure the package signing task in the yaml file:

steps:
- task: MSIX.msix-ci-automation-task-dev.msix-signing.MsixSigning@1
  displayName: 'Sign MSIX package'
  inputs:
    certificateType: base64
    encodedCertificate: '$(kvtestcert)'

App installer file for MSIX

Here's an example that shows how to configure the AppInstaller file task in the yaml file:

steps:
- task: MSIX.msix-ci-automation-task-dev.app-installer-file.AppInstallerFile@1
  displayName: 'Create App Installer file'
  inputs:
    package: '$(Build.ArtifactStagingDirectory)\MyApp.msix'
    outputPath: '$(Build.ArtifactStagingDirectory)\MyApp.appinstaller'
    uri: 'https://myuwpapp-demo.azurewebsites.net/MyApp.appinstaller'
    mainItemUri: 'https://myuwpapp-demo.azurewebsites.net/MyApp.msix'
    showPromptWhenUpdating: true
    updateBlocksActivation: true

Create package for MSIX app attach

Here's an example that shows how to configure the task to create a VHDX file for app attach in the yaml file:

steps:
- task: MSIX.msix-ci-automation-task-dev.msix-app-attach.MsixAppAttach@1
  displayName: 'Create package for MSIX app attach'
  inputs:
    package: '$(Build.ArtifactStagingDirectory)\MyApp.msix'
    vhdxOutputPath: '$(Build.ArtifactStagingDirectory)\MyApp.vhdx'

Publish MSIX app attach package to AVD

Here's an example that shows how to configure the avd app attach task in the yaml file:

steps:
- task: MSIX.msix-ci-automation-task-dev.avd-app-attach-publish.AVDAppAttachPublish@0
  displayName: 'Publish MSIX app attach package to AVD'
  inputs:
    vhdxPath: '$(Build.ArtifactStagingDirectory)/App.vhdx' 
    connectedServiceNameARM: 'ed1db943-1e1c-4eac-8683-ead2abc281b5' 
    resourceGroupName: 'appattach-test-rg' 
    storageAccount: 'appattachteststorage' 
    fileShare: 'appattach-test-fs' 
    hostPool: 'appattach-hostpool' 
    workSpace: 'appattach-test-ws' 
    applicationGroup: 'appattach-test-ag-rail' 

Ways to provide Feedback

We would love to hear your feedback on the MSIX Packaging Extension. Reach out to us via the following channels:

  • Review the extension on Azure DevOps Marketplace
  • MSIX Tech Community
  • GitHub open source project - The source code for this extension is a part of the MSIX SDK open source project, which welcomes contributions and suggestions.