Test a SaaS plan

This article explains how to test a software as a service (SaaS) offer in preview.

Here are some general guidelines to be aware of when you’re testing your offer.

  • If your SaaS offer supports metered billing using the commercial marketplace metering service, review and follow the testing best practices detailed in Marketplace metered billing APIs.
  • Review and follow the testing instructions in Implementing a webhook on the SaaS service to ensure your offer is successfully integrated with the APIs.
  • If the Offer validation step resulted in warnings, a View validation report link appears on the Offer overview page. Be sure to review the report and address the issues before you select the Go live button. Otherwise, certification will most likely fail and delay your offer from going Live.
  • If you need to make changes after previewing and testing the offer, you can edit and resubmit to publish a new preview. For more information, see Update an existing offer in the commercial marketplace.

Note

In this example we will use the SaaS Accelerator for the landing page.

Verify the purchase of a private test plan

Publishers can use Commercial Marketplace to verify the purchase of a test plan.

  1. Sign in to Partner Center.

  2. On the Home page, select the Insights tile.

    Illustrates the Insights tile on the Partner Center Home page.

  3. In the left menu, select Orders.

  4. In the upper-right, select the filter icon and filter by Offer Name. The Orders by offers widget shows the number of subscriptions that have been purchased. You should notice that the number of new orders have increased.

    Screenshot shows the Orders by offers widget.

    Note

    It can take up to 48 hours before offer orders appear in the report.

  5. In the left-nav, select Downloads.

  6. From the Report type list, select Orders.

  7. From the Select timeframe list, select 3 months.

  8. Under File Extension, select CSV.

  9. Select Generate.

    Screenshot of the Download Reports.

  10. Download the .CSV file and verify that the new subscription for your test plan is shown in the report.

Send metered usage Event

If your test plan is configured to send usage events, it is important to test the metered plan usage by sending metered events to Marketplace Metered API. This is an example of how to send metered usage events using a tool that can send HTTP requests to test your solution, for example:

When you test metered usage, we recommend that you send more than the number of usage events that are covered by the base fee and then verify that only the number of usage events that exceed the base fee are sent to Microsoft.

Send a request

Using an API tool that can send HTTP requests to test your solution, send a request body like the one shown in this example.

Request body example:

{
   "resourceId": <guid>, // unique identifier of the resource against which usage is emitted. 
   "quantity": 5.0, // how many units were consumed for the date and hour specified in     effectiveStartTime, must be greater than 0 or a double integer 
   "dimension": "dim1", // custom dimension identifier 
   "effectiveStartTime": "2018-12-01T08:30:14", // time in UTC when the usage event occurred, from now and until 24 hours back 
   "planId": "plan1", // id of the plan purchased for the offer 
}

Query parameters:

Parameter Comment
resourceId This will be your SaaS subscriptionId
quantity You can enter 1 for quantity as the test value
dimension Enter the name of the dimension defined in the metered plan
planId Enter the metered plan ID

View the response

You should receive a response like the one shown in this example.

Response payload example:

{
"usageEventId": <guid>, // unique identifier associated with the usage event in Microsoft records
"status": "Accepted" // this is the only value in case of single usage event 
"messageTime": "2020-01-12T13:19:35.3458658Z", // time in UTC this event was accepted
"resourceId": <guid>, // unique identifier of the resource against which usage is emitted. For SaaS it's the subscriptionId. 
"quantity": 5.0, // amount of emitted units as recorded by Microsoft "dimension": 
"dim1", // custom dimension identifier 
"effectiveStartTime": "2018-12-01T08:30:14", // time in UTC when the usage event occurred, as sent by the ISV
"planId": "plan1", // id of the plan purchased for the offer 
}

For more details about sending metered usage events, see Marketplace metered billing APIs.

Verify metered usage information

  1. On the Home page, select the Insights tile.

    Illustrates the Insights tile on the Partner Center Home page.

  2. In the left menu, select Usage.

  3. From the list at the top of the page, select Metered usage.

    Screenshot of the Usage dashboard.

  4. From the Offer alias list, select your offer name.

  5. From the Meter ID list, select a dimension (meter) Id you entered in the plan. The metered usage is shown in the Metered usage widget.

    Note

    You should only see the metered usage above the base fee.

Download report

Note

It can take up to 48 hours before offer orders appear in the report.

  1. In the left-nav, select Downloads.

  2. From the Report type list, select Usage.

  3. From the Select timeframe list, select 3 months.

  4. Under File Extension, select CSV.

  5. Select Generate.

    Screenshot of the Download Reports.

  6. Download the .CSV file and verify that the new subscription for your test plan is shown in the report.

When you complete your tests, you can do the following: