Search code examples
uwpappxmsix

Can't update UWP package flight submission through API


I am trying to automate UWP package submission through the Package flight management API. I have followed this example and the steps I am taking are the following

  1. Retrieve API access token using available client credentials as described in here
  2. Create or fetch flight give the flight name
  3. Create or fetch the submission within the given flight
  4. Use the fileUploadUrl and blob client SDK to upload the package. In this step, I have both tried to use *.msixupload and zip the *.msixupload file and upload the zip archive instead.
  5. Update the flight submission to specify the name of the package to use. In here I use a PUT request with the following body.
{
  "flightPackages": [
    {
      "fileName": "MY_APP.msixupload",
      "fileStatus": "PendingUpload",
      "minimumDirectXVersion": "None",
      "minimumSystemRam": "None"
    }
  ]
}

I have also tried to specify MY_APP.msixbundle which is a file inside *.msixupload package. 7. Commit the flight submission

After taking all of these steps, the commit fails with the following error

"errors": [
            {
                "code": "InvalidParameterValue",
                "details": "File 'MY_APP_0.63.0.0_x86_x64_arm_bundle.msixbundle' not found in archive."
            }
        ],

I think the problem is in the way I upload the package and the file type I use. In the example I have mentioned, you will find that in the step of blob upload they actually upload a zip archive with the following comment:

// Upload the zip archive with all new files to the SAS URL returned with the submission.

And further, when they update the flight submission, they use the following object

new
{
   fileStatus = "PendingUpload",
   fileName = "package.appx",
}

The first unobvious thing that I couldn't find anywhere is what kind of ZIP archive does the API expect? What should be the structure? What kind of files can I put into the archive?

The second issue is that *.appx is no longer the package format that's used by UWP, instead, it's *.msix. So, what is the thing that I am doing wrong?

Here you can find the full code.


Update 1

After playing a lot with my code and trying to understand what's wrong with it, I decided to copy the code from the official Microsoft sample guide and updated my repo with the sample code with slight modifications

  1. IngestionClient.GetClientCredentialAccessToken for some reason wouldn't work, so I have replaced that with my own implementation
  2. When adding a new package, instead of hard-coded package.appx I've specified the name of the actual *.msixbundle
packages.Add(new
{
    fileStatus = "PendingUpload",
    fileName = Path.GetFileName(bundlePath),
});

In here the bundlePath is the physical path to *.msixbundle

After doing this, I ran the sample like it is. Unfortunately the effect is the same - even though I upload the *.msixbundle to the fileUploadUrl of the flight submission, for some reason partner center won't detect that package and everything will remain the same.

It's so frustrating realizing that even the official samples don't work. At the moment I am totally stuck.


Solution

  • I know this question is rather old, but maybe it helps someone with the same problem.

    • The msixupload package must be packed into a ZIP file. The ZIP file is the one to be uploaded to Azure Blob Storage.

    • The error message here indicates that Partner Center is looking for .msixbundle, yet you uppload .msixupload package. I am pretty sure once a flight is updated with msixbundle, you need to continue shipping bundles on that flight. Try to run your code on a newly created flight with no packages. If that also doesn't work, generate .msixbundle and try to upload that (packaged in a ZIP).