GithubHelp home page GithubHelp logo

microsoft / packageuploader Goto Github PK

View Code? Open in Web Editor NEW
25.0 7.0 9.0 816 KB

This is a wrapper for game developers to use to upload into partner center via API's.

License: MIT License

C# 99.30% PowerShell 0.70%

packageuploader's Introduction

Package Uploader

This article describes how to automate uploading of packages to Partner Center by using the Package Uploader tool.

You can download the latest version of the Package Uploader tool on GitHub https://github.com/microsoft/PackageUploader.

This article covers the following:

Introduction

Package Uploader is a .NET 6.0-based cross-platform application and library that enables game developers to interact programmatically with Partner Center.

Package Uploader has a command-line tool and a dynamic linked library (DLL) that you can integrate into your build pipelines or other development workflows.

The initial 1.0 release of Package Uploader provides the following functionality.

  • Retrieves metadata about a particular product
  • Uploads a new Xbox XVC, UWP, or MSIXVC package
  • Removes existing or previous packages
  • Imports packages from one branch to another
  • Publishes packages to a sandbox

Prerequisites

Programmatic manipulation of packages for a particular product requires the following:

  • The product must already exist in Partner Center. The tool currently doesn't support product creation.
  • The branch for the target upload must already exist in Partner Center. The tool currently doesn't support branch creation.
  • The target product must have been previously fully published to a sandbox before the Package Uploader can be used. A full publishing includes all modules like properties, store listing, pricing and availabilities, and packages.
  • Access to create Azure application registrations in the Azure Active Directory (Azure AD) tenant connected to the target Partner Center account.
  • You only need a valid certificate if you plan on setting up certificate-based authorization.
  • The Package Uploader executable.

Service creation and authentication

Create an Azure AD application for authentication

  1. Sign in to your company's Azure portal and select Azure Active Directory.
    NOTE: Ensure that this is the same Azure AD that's linked to your Partner Center account.
  2. Select App registrations.
  3. Select New registration.
  4. Enter a name for the application.
  5. From the list of supported account types, select Single tenant.
  6. Leave Redirect URI blank. It isn't required for this application.
  7. Select Register.
  8. Make note of the following information for your new application.
    • Application (client) ID
    • Directory (tenant) ID

You’ll use the Client ID and Directory ID that you’ve generated and noted for the remaining sections in this article.

For more information, see Quickstart: Register an app in the Microsoft identity platform.

Setup authorization

The tool currently supports either app secrets or certificates. Perform one of the following procedures to setup authorization.

Create a secret key

  1. Select Certificates & secrets.
  2. In the Client secrets section, select New client secret.
  3. Enter a description of the secret, and then specify a duration. When you're done, select Add.
  4. After adding the client secret, the value of the secret key is displayed.
    NOTE: Copy this value because you won't be able to retrieve the secret key later.

Register a certificate

  1. Select Certificates & secrets.
  2. Select Upload certificate.
  3. Navigate to the certificate you want to use and select it for uploading.
  4. After the certificate has uploaded you should see it in the table of certificates, showing its start date and expiry date..
    NOTE: Copy the thumbprint because you will use it later.

Grant the newly created service permission to the game product

  1. Sign into Partner Center as a user with Manager level account permissions.
  2. Select Settings (gear icon) in the top right, and then select Account Settings.
  3. In the left pane select User Management and then select Azure AD Applications.
  4. Select Add Azure AD Application, then click Add Azure AD Application again in the pop up that appears. Select the Azure application you created in the previous steps and then select Next.
    NOTE: If your application doesn’t appear, ensure that you created it in the same tenant that’s linked to Partner Center.
  5. On the top tab, select Customize permissions.
  6. Find the product that you want to programmatically upload builds to. Grant your Azure application the Read/Write permission under Publishing. For more information, see Add an Azure AD tenant to your account.

Get the Package Uploader

To use the Package Uploader, you can download the latest executable from the Releases page.
NOTE: No need to install the .NET Runtime to run the tool since it is included inside the binary.

Alternatively, you can also build it.

  1. Download .NET 6 SDK or the latest version.
  2. Open a powershell prompt, and then browse to the folder where you downloaded the Package Uploader.
  3. Browse to the src folder and then run ./publish.win-x64.ps1.
  4. When it's built, PackageUploader.exe is in the src\PackageUploader.Application\bin\Release\net6.0\win-x64\publish directory.

Run the Package Uploader

Running the package uploader requires three arguments.

Argument Description
Operation Name The operation represents the action that you want to perform. It should match the name of the configuration file that you pass when running the tool.
Configuration file The configuration file contains all the information that's required to perform the intended action. It specifies your product information, file locations, and the tenant authorized to complete the action. Copy a template from the templates folder and fill in the required fields to ensure you have all the data necessary.
Client secret This is the alphanumeric value that you previously generated, which is required to authenticate with Partner Center and your product.

Available operations

Operation Description
GetProduct Gets metadata for the product. This is useful for getting the productId, BigId, product name that's used in all configuration files. And a list of the BranchFriendlyNames and FlightNames of the product.
GetPackages Gets a list of the packages in a branch or flight.
UploadUwpPackage Uploads a UWP game package.
UploadXvcPackage Uploads a XVC game package and assets, including EKB, SubVal, and layout files.
RemovePackages Removes game packages and assets from a branch. We recommend keeping only your 10 most recent packages to ensure optimal performance.
ImportPackages Imports all game packages from a branch to a destination branch. This enables you to copy your previously uploaded and published packages from one branch to another.
PublishPackages Publishes all game packages from a branch or flight to a destination sandbox or flight. You can set specific availability times in the configuration file.

For more information on operation parameters, see Operations.

Available parameters

Parameter Description
-c, --ConfigFile (REQUIRED) The location of the configuration file
-f, --ConfigFileFormat <Ini|Json|Xml> The format of the configuration file (default: Json)
-s, --ClientSecret The client secret of the Azure AD application (only for AppSecret)
-a, --Authentication <AppCert|AppSecret|Browser|Default> The authentication method (default: AppSecret)
-v, --Verbose Log verbose messages, such as HTTP calls
-d, --Data Do not log on console and only return data (only for Get operations)
-l, --LogFile The location of the log file
-?, -h, --help Show Help and usage information

Putting it all together

  1. Open PowerShell by using the Start menu.
  2. Browse to the root of your wrapper directory, and then run the following command:
    .\PackageUploader.exe <OperationName> -c <ConfigFile> -s <ClientSecret>

Example GetProduct operation

NOTE: When using a certificate you need to include a few more values in the aadAuthInfo section. certificateStore represents the certificate location in the store on the machine. For information on other supported values, see StoreName Enum (System.Security.Cryptography.X509Certificates.
certificateLocation can be set to LocalMachine or CurrentUser.

Example GetProduct configuration file using certificate authorization

{
  "operationName": "GetProduct",

  "bigId": "9FAKEBIGID",

  "aadAuthInfo": {
    "clientId": "00000000-0000-0000-000000000000",
    "tenantId": "00000000-0000-0000-000000000000",
    "certificateThumbprint": "lotsofnumbersandlettersinahexformat8A334EE",
    "certificateStore": "Root", 
    "certificateLocation": "LocalMachine"
  }
}

Example running GetProduct operation

.\PackageUploader.exe GetProduct -c .\GetProduct.json -s superlongsecretalphannumericstring

Example GetProduct operation output

Product: {
  "productId":"00000000000000000000",
  "bigId":"9FAKEBIGID",
  "productName":" Test product (Hidden)",
  "branchFriendlyNames": ["Main", "Branch1", "Branch2", "Branch3"],
  "flightNames": ["Flight 1", "Flight 2", "Flight 3"]
}

Example UploadXvcPackage operation

Example UploadXvcPackage configuration file using certificate authentication

NOTE: When using a certificate you need to include a few more values in the aadAuthInfo section. certificateStore represents the certificate location in the store on the machine. For information on other supported values, see StoreName Enum (System.Security.Cryptography.X509Certificates.
certificateLocation can be set to LocalMachine or CurrentUser.

{
  "operationName": "UploadXvcPackage",

  "productId": "",
  "bigId": "9FAKEBIGID ",

  "branchFriendlyName": "Main",
  "flightName": "",

  "marketGroupName": "default",
  
  "deltaUpload": false,

  "packageFilePath": "C:\\Users\\someone\\Desktop\\StubPackage\\Builds\\TestPublisher.SomeDemoProductName_0.9.1.0_x64__fjtqkg6rpm1hy.msixvc",
  "gameAssets": {
    "ekbFilePath": "C:\\Users\\someone\\Desktop\\StubPackage\\Builds\\ TestPublisher.SomeDemoProductName_0.9.1.0_x64__fjtqkg6rpm1hy_Full_33ec8436-5a0e-4f0d-b1ce-3f29c3955039.ekb",
    "subValFilePath": "C:\\Users\\someone\\Desktop\\StubPackage\\Builds\\Validator_ TestPublisher.SomeDemoProductName_0.9.1.0_x64__fjtqkg6rpm1hy.xml",
    "symbolsFilePath": "",
    "discLayoutFilePath": ""
  },
  "minutesToWaitForProcessing": 60,

  "availabilityDate": {
    "isEnabled": false,
    "effectiveDate": ""
  },

  "aadAuthInfo": {
    "clientId": "00000000-0000-0000-000000000000", 
    "tenantId": "00000000-0000-0000-000000000000",
    "certificateThumbprint": "lotsofnumbersandlettersinahexformat8A334EE",
    "certificateStore": "Root", 
    "certificateLocation": "LocalMachine"
  },  
  "uploadConfig": {
    "httpTimeoutMs": 5000,
    "httpUploadTimeoutMs": 300000,
    "maxParallelism": 24,
    "defaultConnectionLimit": -1,
    "expect100Continue": false,
    "useNagleAlgorithm": false
  }
} 

Example running UploadXvcPackage operation

.\PackageUploader.exe UploadXvcPackage -c .\UploadXvcPackage.json -s superlongsecretalphannumericstring

Example UploadXvcPackage operation output

2021-10-22 17:11:36.965 info: PackageUploader.Application.Operations.UploadXvcPackageOperation[0] Starting UploadXvcPackage operation.
2021-10-22 17:11:42.387 info: PackageUploader.ClientApi.Client.Ingestion.IngestionHttpClient[0] Package id: 11931042-2f6c-4ccb-8c53-fccbe6760d67
2021-10-22 17:11:43.553 info: PackageUploader.ClientApi.Client.Xfus.XfusUploader[0] XFUS Asset Initialized. Will upload TestPublisher.SomeDemoProductName_0.9.1.0_x64__fjtqkg6rpm1hy.msixvc at size of 10.12MB.
2021-10-22 17:11:43.553 info: PackageUploader.ClientApi.Client.Xfus.XfusUploader[0] Upload 0% complete.
2021-10-22 17:11:45.889 info: PackageUploader.ClientApi.Client.Xfus.XfusUploader[0] Upload 33% complete.
2021-10-22 17:11:46.129 info: PackageUploader.ClientApi.Client.Xfus.XfusUploader[0] Upload 67% complete.
2021-10-22 17:11:46.813 info: PackageUploader.ClientApi.Client.Xfus.XfusUploader[0] Upload 100% complete.
2021-10-22 17:11:47.901 info: PackageUploader.ClientApi.Client.Xfus.XfusUploader[0] TestPublisher.SomeDemoProductName_0.9.1.0_x64__fjtqkg6rpm1hy.msixvc Upload complete in: (HH:MM:SS) 00:00:05.
2021-10-22 17:11:50.874 info: PackageUploader.ClientApi.PackageUploaderService[0] Package is uploaded and is in processing.
2021-10-22 17:11:57.015 info: PackageUploader.ClientApi.PackageUploaderService[0] Will wait 60 minute(s) for package processing, checking every 1 minute(s).
2021-10-22 17:11:57.015 info: PackageUploader.ClientApi.PackageUploaderService[0] Package processed.
2021-10-22 17:12:00.024 info: PackageUploader.ClientApi.Client.Xfus.XfusUploader[0] XFUS Asset Initialized. Will upload TestPublisher.SomeDemoProductName_0.9.1.0_x64__fjtqkg6rpm1hy_Full_33ec8436-5a0e-4f0d-b1ce-3f29c3955039.ekb at size of 467B.
2021-10-22 17:12:00.024 info: PackageUploader.ClientApi.Client.Xfus.XfusUploader[0] Upload 0% complete.
2021-10-22 17:12:00.757 info: PackageUploader.ClientApi.Client.Xfus.XfusUploader[0] Upload 100% complete.
2021-10-22 17:12:01.964 info: PackageUploader.ClientApi.Client.Xfus.XfusUploader[0] TestPublisher.SomeDemoProductName_0.9.1.0_x64__fjtqkg6rpm1hy_Full_33ec8436-5a0e-4f0d-b1ce-3f29c3955039.ekb Upload complete in: (HH:MM:SS) 00:00:02.
2021-10-22 17:12:03.978 warn: PackageUploader.ClientApi.PackageUploaderService[0] No SymbolsZip asset file path provided, will continue to upload Package on its own.
2021-10-22 17:12:06.524 info: PackageUploader.ClientApi.Client.Xfus.XfusUploader[0] XFUS Asset Initialized. Will upload Validator_ TestPublisher.SomeDemoProductName_0.9.1.0_x64__fjtqkg6rpm1hy.xml at size of 6.9KB.
2021-10-22 17:12:06.524 info: PackageUploader.ClientApi.Client.Xfus.XfusUploader[0] Upload 0% complete.
2021-10-22 17:12:07.264 info: PackageUploader.ClientApi.Client.Xfus.XfusUploader[0] Upload 100% complete.
2021-10-22 17:12:08.377 info: PackageUploader.ClientApi.Client.Xfus.XfusUploader[0] Validator_TestPublisher.SomeDemoProductName_0.9.1.0_x64__fjtqkg6rpm1hy.xml Upload complete in: (HH:MM:SS) 00:00:02.
2021-10-22 17:12:09.872 warn: PackageUploader.ClientApi.PackageUploaderService[0] No DiscLayoutFile asset file path provided, will continue to upload Package on its own.
2021-10-22 17:12:09.872 info: PackageUploader.Application.Operations.UploadXvcPackageOperation[0] Uploaded package with id: 11931042-2f6c-4ccb-8c53-fccbe6760d67
2021-10-22 17:12:13.811 info: PackageUploader.Application.Operations.UploadXvcPackageOperation[0] Availability date set
2021-10-22 17:12:13.812 info: PackageUploader.Application.Operations.UploadXvcPackageOperation[0] PackageUploader has finished running.

Example PublishPackages operation

Example PublishPackages configuration file

{
  "operationName": "PublishPackages",

  "productId": "",
  "bigId": "9FAKEBIGID",

  "flightName": "",
  
  "branchFriendlyName": "Main",
  "destinationSandboxName": "QXNKBL.1",

  "minutesToWaitForPublishing": 60,
  
  "publishConfiguration": {
    "releaseTime": "",
    "isManualPublish" : false,
    "certificationNotes": "No Notes for CERT at this time"
  },

  "aadAuthInfo": {
    "clientId": "00000000-0000-0000-000000000000", 
    "tenantId": "00000000-0000-0000-000000000000"
  }
} 

Example running PublishPackages operation

.\PackageUploader.exe PublishPackages -c .\PublishPackages.json -s superlongsecretalphannumericstring
Example PublishPackages operation output
2021-10-22 17:28:47.315 info: PackageUploader.Application.Operations.PublishPackagesOperation[0] Starting PublishPackages operation.
2021-10-22 17:29:03.399 info: PackageUploader.ClientApi.PackageUploaderService[0] Package still in publishing, waiting another 1 minute. Will wait a further 60 minute(s) after this.
2021-10-22 17:30:04.375 info: PackageUploader.ClientApi.PackageUploaderService[0] Package still in publishing, waiting another 1 minute. Will wait a further 59 minute(s) after this.
2021-10-22 17:31:05.698 info: PackageUploader.ClientApi.PackageUploaderService[0] Package still in publishing, waiting another 1 minute. Will wait a further 58 minute(s) after this.
2021-10-22 17:32:07.109 info: PackageUploader.ClientApi.PackageUploaderService[0] Package still in publishing, waiting another 1 minute. Will wait a further 57 minute(s) after this.
2021-10-22 17:33:08.008 info: PackageUploader.ClientApi.PackageUploaderService[0] Package still in publishing, waiting another 1 minute. Will wait a further 56 minute(s) after this.
2021-10-22 17:34:08.661 info: PackageUploader.ClientApi.PackageUploaderService[0] Package still in publishing, waiting another 1 minute. Will wait a further 55 minute(s) after this.
2021-10-22 17:35:09.339 info: PackageUploader.ClientApi.PackageUploaderService[0] Package still in publishing, waiting another 1 minute. Will wait a further 54 minute(s) after this.
2021-10-22 17:36:10.341 info: PackageUploader.ClientApi.PackageUploaderService[0] Package still in publishing, waiting another 1 minute. Will wait a further 53 minute(s) after this.
2021-10-22 17:37:11.342 info: PackageUploader.ClientApi.PackageUploaderService[0] Package still in publishing, waiting another 1 minute. Will wait a further 52 minute(s) after this.
2021-10-22 17:38:11.981 info: PackageUploader.ClientApi.PackageUploaderService[0] Package still in publishing, waiting another 1 minute. Will wait a further 51 minute(s) after this.
2021-10-22 17:39:14.187 info: PackageUploader.ClientApi.PackageUploaderService[0] Game published.
2021-10-22 17:39:14.188 info: PackageUploader.Application.Operations.PublishPackagesOperation[0] PackageUploader has finished running.

Troubleshooting

In some cases, Package Uploader might not work as you intended. Here's a list of some of the most common errors that users have encountered while using Package Uploader, and their possible solutions. A best practice for debugging is to open the folder where the tool runs from and your configuration files are saved. Open the specific configuration file that you've selected to ensure you're not using the blank template.

NOTE: A schema is available for validating configuration files in Visual Studio or any tool of your choice. The schema is located at https://product-ingestion-int.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30.

  • Exception: System.Net.Http.HttpRequestException: Response status code does not indicate success: 401
    You haven't correctly setup your application authentication. Ensure that you've added your application to the Azure AD Applications section with the appropriate access.

  • Invalid client secret is provided.
    Check the format of your client secret because it doesn't match the values specified for your ClientId and TenetId.

  • Product with BigId 'SomeBigID' not found
    Ensure that you've entered your BigID or StoreId correctly.

  • 'OperationName' with the error: 'OperationName field is not GetProduct.'
    You've specified an unsupported operation. Check the list of supported operations and ensure you've entered the operation correctly.

  • Check to make sure you have the correct tenant ID and are signing into the correct cloud.
    Either your ClientId or TenantId are incorrect in your configuration file. Ensure that you're using the correct configuration file and that the IDs are correct.

  • Unhandled exception: System.FormatException: Could not parse the JSON file. ---> System.Text.Json.JsonReaderException: 'U' is an invalid escapable character within a JSON string. The string should be correctly escaped
    You must escape all backslashes and parentheses in JSON with a backslash, for example: C:\\.

  • Failed to publish.
    Ensure your destination branch or sandbox already exists. If not, initialize it via the Partner Center portal and try again

  • Failed to publish. - You can only have one MSIXVC package per market group.
    You have uploaded two packages to the same branch. Use the Partner Center portal to delete all extra packages for the given market group.

Q & A

Q: Can I use one Azure app name for multiple products?
A: No. We're currently working with the Partner Center team to make this possible. For now, each product you upload requires the creation of a unique Azure AD application.

Q: Are delta uploads supported?
A: Yes! For XVC and MSIXVC packages, delta upload will work the same as uploading direct in to Partner Center. Consult your DAM for how this works with your product and packages. UWP unfortunately is not supported and will not be in the future either.

Q: Can I upload multiple packages for the same product at the same time?
A: No. You'll need to upload packages one at a time.

Q: Can I source my builds off another machine?
A: No. At this time the tool only supports local file uploads and publishing.

Q: Can I use the Package Uploader to automate and update other parts of Partner Center besides uploads?
A: No. This isn't currently available. The scope was only uploads and publishing. The API teams are currently working to expand this to automate other parts of Partner Center.

Q: If I want to change how the wrapper works who do I reach out to?
A: It's completely open source. You can change the wrapper as you want. Use, adjust, and contribute on GitHub!

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

packageuploader's People

Contributors

alberto-baron avatar aspateri avatar dependabot[bot] avatar lawhelpt avatar microsoftopensource avatar seann-murdock avatar toekneeparkms avatar v-redwards avatar xbox4all avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

packageuploader's Issues

Update schema to proper camelCase.

We are looking into hosting the schema for package uploader in the schema service where the other api schemas are stored and found a couple of instances of casing that doesn't match schema service guidelines. We should update these and make sure the tool can handle both cases (since we've already released with incorrect casing)

Fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "GetProduct". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/properties/operationName/oneOf/0/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "UploadUwpPackage". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/properties/operationName/oneOf/1/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "UploadXvcPackage". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/properties/operationName/oneOf/2/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "RemovePackages". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/properties/operationName/oneOf/3/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "ImportPackages". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/properties/operationName/oneOf/4/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "PublishPackages". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/properties/operationName/oneOf/5/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "UploadUwpPackage". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/allOf/0/if/properties/operationName/oneOf/0/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "UploadXvcPackage". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/allOf/0/if/properties/operationName/oneOf/1/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "RemovePackages". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/allOf/0/if/properties/operationName/oneOf/2/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "ImportPackages". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/allOf/0/if/properties/operationName/oneOf/3/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "PublishPackages". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/allOf/0/if/properties/operationName/oneOf/4/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "UploadUwpPackage". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/allOf/1/if/properties/operationName/oneOf/0/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "UploadXvcPackage". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/allOf/1/if/properties/operationName/oneOf/1/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "UploadXvcPackage". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/allOf/2/if/properties/operationName/oneOf/0/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "UploadUwpPackage". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/allOf/3/if/properties/operationName/oneOf/0/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "RemovePackages". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/allOf/4/if/properties/operationName/oneOf/0/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "PublishPackages". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/allOf/5/if/properties/operationName/oneOf/0/const
fail: Microsoft.ProductIngestion.Schema.Validate.Program[1]
Invalid const value "ImportPackages". All const values must be null or contain a non-empty, non-whitespace string, and be camelCase @ https://product-ingestion.azureedge.net/schema/package-uploader-operation-configuration/2021-11-30#/allOf/6/if/properties/operationName/oneOf/0/const

Report back to user on Validation Items (and fail if severity error)

After a package uploads, validation is passed over it and a collection of validation items are returned by the API. Currently we do not deeply inspect them.

This results in a case where we can successfully upload a package and receive a 200 OK that is technically correct. However going any further and submitting in Partner Center will not be possible since some validation items will need looking at.

We get these back in the API so we should be able to inspect them on the client and return non-zero or throw so that the user is aware.

Example:

info: PackageUploader.Application.Operations.PublishPackagesOperation[0] Starting PublishPackages operation.
info: PackageUploader.ClientApi.PackageUploaderService[0] Failed to publish.
fail: PackageUploader.Application.Operations.PublishPackagesOperation[0] You must provide a package that supports each selected device family. Note that targeting the Xbox device family requires a neutral or x64 package: Desktop
fail: PackageUploader.Application.Operations.PublishPackagesOperation[0] You must fix all package validation errors before submitting.
info: PackageUploader.Application.Operations.PublishPackagesOperation[0] PackageUploader has finished running.
Process exited with code 0

Package deleting

Can I delete a package uploaded before by this tool?
I'm working on an auto-upload and publish script. The PackageUploader requires an existing branch, which means if I use the same branch, I have to delete the outdated package manually. This is inconvenient and goes against the purpose of our auto-uploading script.

Azure.Identity 1.6.1 has "at least one vulnerability with high severity"

Hi. The new version of VS (17.7.7) now reports nuget packages with security vulnerabilities, and it alerted me to the PackageUploader's use of Azure.Identity, as per the title ^.

Simply updating it to the latest version will likely be enough, but I'm not fully setup with PU yet, so I can't fully test it.

No Permission labeled "Read/Write" in Azure AD Application settings in Partner Center

I believe that the instructions in your Readme.md need an update due to changes in Partner Center.

I followed the instructions to set up the Package Uploader script, and it's failing after the script runs with a 401 error. The packages (and supporting files) are successfully uploading to Partner Center though, so it's unclear exactly what's failing. The error message led me to believe that there's a permission issue with the Azure AD Application setup in Partner Center, so I recreated that user to check permissions. Unfortunately, it seems like the permission labels are changed in Partner Center, since there's no Read/Write label, as described in the Readme.md.

image

I've tried it with everything in the Publishing tab set to Read/Write, as well as a few of the sub options flipped to Read/Write (Packages, Store Submissions, and Properties), but I get the 401 error every time.

The error is below Exception: System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 You haven't correctly setup your application authentication. Ensure that you've added your application to the Azure AD Applications section with the appropriate access.

Azure now Entra. Plus docs unclear about adding permissions

Followed README to the letter.
Continually got "404" for a product Id I'm staring at.

Tried to go into PartnerCenter to see if changing permissions would affect anything.
Now locked into having to update "Reply URL" and "App ID URI" - neither of which should be applicable, but not able to due to requirement.

All other pre-requisites are satisfied.

Additionally: not clear if the 404 error is result of some misconfiguration (have confirmed App has access to "Publishing" for the product), or something else?

AAD Manifest parameters

Specifically "signInAudience" (aka: Supported account type) seems to matter for the AAD application being used for authentication.
"PersonalMicrosoftAccount" seems to give issues and does not let the AAD app be used for package uploader.
If we change "signInAudience" to be "AzureADMyOrg" things will probably work, but are there are other manifest attributes that will need to change as well in order to support this and not cause any problems?

We noticed that in the manifest an app with "signInAudience":"PersonalMicrosoftAccount", it has "accessTokenAcceptedVersion": 2 but this restriction isn't there for an app with "signInAudience":"AzureADMyOrg" (null value for that key). From reading various available documentation like these:
[https://learn.microsoft.com/en-us/azure/active-directory/develop/supported-accounts-validation]

[https://learn.microsoft.com/en-us/azure/active-directory/develop/access-tokens#token-formats]

...it seems that the supported account type changes features available and Azure AD apps use version 1.0 tokens if I'm not mistaken. So part of what we're wondering is if this is why the client secret token is accepted for "signInAudience":"AzureADMyOrg" but rejected for "signInAudience":"PersonalMicrosoftAccount".

UploadXvcPackage throws HttpRequestException

UploadXvcPackage operation has started throwing the following exception.

fail: PackageUploader.ClientApi.Client.Ingestion.IngestionHttpClient[0] Exception: System.Net.Http.HttpRequestException: Response status code does not indicate success: 301 (Moved Permanently).    at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()    at PackageUploader.ClientApi.Client.Ingestion.Client.HttpRestClient.GetAsync[T](String subUrl, CancellationToken ct) in D:\PartnerCenter\GameStoreBroker\src\PackageUploader.ClientApi\Client\Ingestion\Client\HttpRestClient.cs:line 53

fail: PackageUploader.Application.Operations.UploadXvcPackageOperation[0] Response status code does not indicate success: 301 (Moved Permanently).

Upload operation has worked correctly in our deployment pipe month ago with the same setup. Tested with v1.7.5.

Handle Server Exceptions

If a server exception isn't retriable and falls out of the XFUS upload loop, we need to handle it gracefully.

removePackages command deletes all the packages in branchFriendlyName, even if the packageFileName does not match

Hello!

Thank you for the tool!

I've encountered the issue where we are a having two regional builds in the Test branch. One build is for Japan and the other one is for the rest of the world. These packages are having different names.
When I'm running the removePackages command, I'm passing the name of the worldwide package, but the tool removes Japanese package as well, although that package name is different. My expectations were that only the packages with a specific name will be removed and not all the packages in the branch.

Can someone please elaborate on that?

"packageFileName": "{{ required - it will delete packages with this file name (wildcards * and ? supported) }}",

Product Branches

I can't see a way to get a list of branches for a certain product - is this currently possible or, if not, are there any plans to add this functionality?

Cheers,
Andy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.