Migrate an MSIX package to App Attach

Hello,

Microsoft released App Attach this year as the successor for MSIX App Attach. There is a good chance you are already using MSIX packages. For this reason Microsoft has released scripts to convert MSIX packages to App Attach.

In this blog post I’ll walk you through all the necessary steps, so let’s get started. You can find a complete document explaining all the steps here.

Prerequisites

Before we start we need to make sure that a couple of things are in place:

  • Host pool with valiadation environment with at least 1 MSIX package
  • An Azure account with Desktop Virtualization Contributor RBAC role
  • A local device with the latest Az PowerShell and Microsoft Graph PowerShell SDK

Now that we have gone through all the prerequsites, lets’s have a look at the different steps to take.

I’ve got a host pool with VLC and Greenshot as MSIX packages.

The first step is to download the migration PowerSchell script and unblock the file.

$url = "https://raw.githubusercontent.com/Azure/RDS-Templates/master/msix-app-attach/MigrationScript/Migrate-MsixPackagesToAppAttach.ps1"
$filename = $url.Split('/')[-1]

Invoke-WebRequest -Uri $url -OutFile $filename | Unblock-File

The next step is to import the necessary PowerShell modules that this script needs.

Import-Module Az.DesktopVirtualization
Import-Module Az.Accounts
Import-Module Az.Resources
Import-Module Microsoft.Graph.Authentication

After importing the PowerShell modules we need to authenticate with Azure and the Microsoft Graph using the following commands
Connect-AzAccount
Connect-MgGraph -Scopes "Group.Read.All"

Now that the IT admin is logged on, he wants a list of all the MSIX packages for a specific host pool.

$parameters = @{
    HostPoolName = 'vdpool-prd-jvn-avd-02'
    ResourceGroupName = 'rg-prd-jvn-avd-backplane-01'
}

Now to find a specific MSIX package we run the following command. With this command the IT admin uses the Name parameter to find the package.

$parameters = @{
    HostPoolName = 'vdpool-prd-jvn-avd-02'
    ResourceGroupName = 'rg-prd-jvn-avd-backplane-01'
}

$msixPackage = Get-AzWvdMsixPackage @parameters | ? Name -Match 'vdpool-prd-jvn-avd-02/VLC_1.0.0.0_x64__xdet0sefm6c82'
$hostPoolId = (Get-AzWvdHostPool @parameters).Id
$msixpackage

Now it’s time to migrate the selected application to an App Attach package. We use the following command for this.

$parameters = @{
    PermissionSource = 'RAG'
    HostPoolsForNewPackage = $hostPoolId
    PassThru = $true
}

$msixPackage | .\Migrate-MsixPackagesToAppAttach.ps1 @parameters

There we go, it’s very easy to migrate an MSIX package to App Attach. This method can make sure that the IT admin saves time to make all apps available as App Attach packages to the users.

I hope you find this blog post helpful and you can contact me in case you have any questions.

Leave a Reply

Your email address will not be published. Required fields are marked *