Console test app

Applies To

  • Partner Center
  • Partner Center operated by 21Vianet
  • Partner Center for Microsoft Cloud Germany
  • Partner Center for Microsoft Cloud for US Government

The console test app is provided in C# and Java, it provides sample codes for all of the scenarios supported by the Partner Center APIs. You can also use it for testing.

Get the code

.NET

Download the sample code

Before you build the application, update the values in the App.config file to reflect the Azure AD authentication information you created in Partner Center authentication. Specifically, you should use your integration sandbox account settings during early development or for testing in production.

Under ScenarioSettings in the App.config file, you can set parameters that will be automatically passed into the scenarios that you run.

To modify the list of scenarios that are run, comment out lines in IPartnerScenario[] mainScenarios or in an individual Get Scenarios method found in the Program.cs file.

Java

Download the sample code

Before you build the application, update the values in the SamplesConfigurations.json file to reflect the Azure AD authentication information you created in Partner Center authentication. Specifically, you should use your integration sandbox account settings during early development or for testing in production.

Under ScenarioSettings in the SamplesConfiguration.json file, you can set parameters that will be automatically passed into the scenarios that you run.

To modify the list of scenarios that are run, comment out lines in IPartnerScenario[] mainScenarios or in an individual Get Scenarios method found in the Program.java file.

What to change

Setting category Settings to change

PartnerServiceSettings

Do not change:

  • PartnerServiceApiEndpoint
  • AuthenticationAuthorityEndpoint
  • GraphEndpoint
  • CommonDomain
All of these settings are necessary for the sample API calls to properly function.

UserAuthentication

Required to change:

  • ApplicationId: Your Azure Active Directory application ID, used for login.
  • UserName: Your active directory user name.
  • Password: Your active directory password.

Do not change:

  • ResourceUrl
  • RedirectUrl

AppAuthentication

Required to change:

  • ApplicationId: Your active directory application ID, used for application login.
  • ApplicationSecret: Your active directory application secret, used for application login.
  • Domain: Your active directory domain on which the application is hosted.

ScenarioSettings

Do not change:

  • CustomerDomainSuffix: The domain suffix used when creating a new customer.

Optional. If left blank, information will need to be inputted when running a scenario where it is necessary:

  • CustomerIdToDelete: The ID of the customer used for deletion.
  • DefaultCustomerId: The customer ID to use in customer-related scenarios.
  • DefaultInvoiceID: The invoice ID to use in invoice scenarios.
  • PartnerMpnId: The partner MPN ID to use in indirect partner scenarios.
  • DefaultServiceRequestId: The service request ID to use in service request scenarios.
  • DefaultSupportTopicID: The support topic ID to use in service request scenarios.
  • DefaultOfferID: The offer ID to use in offer scenarios.
  • DefaultOrderID: The order ID to use in order scenarios.
  • DefaultSubscriptionID: The subscription ID to use in subscription scenarios.

Optional to change:

  • CustomerPageSize
  • InvoicePageSize
  • ServiceRequestPageSize
  • DefaultOfferPageSize
  • SubscriptionPageSize
All of these settings specify the amount of entries per page when retrieving paged content.