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
Retrieve API access token using available client credentials as described in here
Use the fileUploadUrl and blob client SDK to upload the package. In this step, I have both tried to use
*.msixuploadand zip the*.msixuploadfile and upload the zip archive instead.Update the flight submission to specify the name of the package to use. In here I use a
PUTrequest 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
IngestionClient.GetClientCredentialAccessTokenfor some reason wouldn't work, so I have replaced that with my own implementationWhen adding a new package, instead of hard-coded
package.appxI've specified the name of the actual*.msixbundlepackages.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.