microsoft / msstore-cli

Microsoft Store CLI
MIT License
76 stars 8 forks source link

msstore publish --flight fail in ci-cd , submission was created but upload fail #61

Closed YanVale closed 1 month ago

YanVale commented 1 month ago

When i run msstore command to publish in flight i receive follow error

"06:04:35 fail: MSStore.CLI.ProjectConfigurators.MauiProjectConfigurator[0] Retrieved a submission that was created in Partner Center. We can't upload the packages for submissions created in Partner Center. Please, delete it and try again."

command ci-cd : script: msstore publish -id XXXXXX -f XXXXXXXXXXXXXXX -v -i $(system.defaultworkingdirectory)\XXXX\bin\Release\net8.0-windows10.0.19041.0\win10-x64\AppPackages\

azchohfi commented 1 month ago

This is a weird, but known, behavior of the APIs. Whenever you create a submission on the portal it doesn't have an upload URL. This means that in order to use the APIs, and therefore the CLI, you need to create the submission through the APIs. That is usually not a problem for non-flighted submissions, but for flighted submissions, you usually would go to the portal and create the flight, expecting the CLI to simply create the flight submission, and then everything should (in theory,) be fine. That is not the case, since when you create the flight on the portal, creates an empty submission. That flight submission was, in fact, created through the portal, so it doesn't have an upload URL, and therefore we can't use it to upload the package. We can't delete it through the APIs, as that would make the flight contain no attached submission, which deletes the flight itself. Unfortunately, the only solution is to create the first flight submission through the APIs/CLI, not through the portal, and then further flight submissions should be fine. You can achieve that by using the "msstore flights create" command. You need the productId, a friendly name for the flight, and a group id, which you can get on the portal: https://partner.microsoft.com/dashboard/analytics/customers

YanVale commented 1 month ago

Thanks @azchohfi

Creating the flight by cli , now i can follow the process but now i receive a error about invalid package . I was creating a .msix package in befor step by "dotnet publish" so i put the path of droped package , in command line of msstore . I don't know if this process its wright , can you send a valid flow to send a valid flight package to store ?

AzureDevops ci error :

"https://manage.devcenter.microsoft.com/v1.0/my/applications/xxxxxxxx/flights /951dd6bf-cb7b-4f82-a6fd-e931dcd1ea96/submissions/1152921505698022939/status End processing HTTP request after 5251.3566ms - 200 Submission Status - CommitFailed ❗ Submission Errors
┌───────────────────────┬──────────────────────────────────────┐ │ Code │ Details │ ├───────────────────────┼──────────────────────────────────────┤ │ InvalidParameterValue │ Validation error: NoValidPackages - │ │ InvalidParameterValue │ Validation error: NoValidPackages - │ └───────────────────────┴──────────────────────────────────────┘ 12:56:38 info: MSStore.CLI.ProjectConfigurators.MauiProjectConfigurator[0] SalesUnsupportedWarning - The sales resource is no longer supported. To view or edit the sales data for this submission, use the Dev Center dashboard.

Submission has failed. Please check the Errors collection of the submissionResource response."

YanVale commented 1 month ago

I fixed it just moving the dropped files from previous build to default path of App Package "$(system.defaultworkingdirectory)\App Packages". Now Works Fine ! Thanks @azchohfi