The goal of this project is to provide a reference example with sample code for developers interested in publishing transactable, Software as a-Service (SaaS) offers in Microsoft's commercial marketplace.
The sample code uses a .NET-based SDK published as a part of this project. The SDK provides a framework for excercising the commercial marketplace billing system, including the SaaS Fulfillment API (v2) and Marketplace Metering Service API. Leveraging the SDK, the sample code demonstrates how a typical SaaS platform interacts with the marketplace APIs in order to provision subscriptions for customers, enable logging, and manage commercial marketplace subscriptions.
The sample code and SDK in this project are for reference purposes only and are meant to complement the existing commercial marketplace documentation by demonstrating common API interactions required for publishing and managing SaaS application offers. The intent of this project is to accelerate the onboarding experience by providing code samples for developers. Although the sample code leverages the SDK, developers are encouraged to work with the SaaS Fulfillment API and Marketplace Metering Service API directly rather than rely on the SDK for production use.
Please note: this is not a Microsoft-supported Azure SDK project. Support for this project is community-based and contributions are welcome. Details on contributing can be found below.
Before using this sample code and SDK, please review the commercial marketplace documentation resources below to understand the important concepts, account setup, and offer configuration requirements for publishing SaaS SaaS application offers.
-
Commercial marketplace documentation. Getting started and top articles
-
SaaS applications in the commercial marketplace. Overview of the SaaS SaaS application business policies, plus step-by step offer creation and configuration requirements.
-
SaaS fulfillment API (v2). API details for SaaS SaaS application subscription creation and management.
-
Marketplace metering service API. API details for the Marketplace Metering Service which, when used in conjunction with the SaaS Fulfillment API, enables event-based billing.
-
SaaS fulfillment API FAQ. Frequently-asked questions about the SaaS Fulfillment APIs.
The documentation (docs) directory contains installation instructions to help understand, implement, and deploy the sample code and SDK components.
-
SDK: Software development kit. This refers to the SDK for the .NET language and incldues the Client and Data Access Libraries, as well as the Sample Web Applications used to excercise the SaaS Fulfillment API and Marketplace Metering Service API.
-
Client library. This refers to a library (and associated tools, documentation, and samples) that customers/developers use to ease creating commercial marketplace SaaS SaaS application offers.
-
Sample web application. This refers to source code that leverages the SDK and Client Libraries.
The source (src) directory offers the following components:
Project | Description | Directory Name |
---|---|---|
Transactable SaaS client library | Implements the SaaS Fulfillment API (v2), Marketplace Metering Service API, and the webhook that handles messages from the marketplace billing system. | SaaS.SDK.Client |
Customer portal - Sample web application | Demonstrates how to register, provision, and activate the marketplace subscription. Implemented using ASP.Net Core 3.1, the sample web application uses the SaaS client library and data access library to invoke and persist API interactions and provides an example user interface to demonstrate how a customer would manage their subscriptions and plans. | SaaS.SDK.CustomerProvisioning |
Publisher portal - Sample web application | Demonstrates how to generate usage events used in metered billing transactions, and how to emit these events to the Marketplace Metering Service API. | SaaS.SDK.PublisherSolution |
Client data access library | Demonstrates how to persist plans, marketplace subscriptions, and related transaction attributes when using the SaaS Fulfillment API (v2) and Marketplace Metering Service API. | SaaS.SDK.Client.DataAccess |
Services client library | Contains the services used by the Customer and Publisher portals, including the POCO classes to orchestrate calls to the marketplace APIs / database. | SaaS.SDK.Services |
Unit tests project | Helps validate and test the SDKs codebase. | SaaS.SDK.UnitTest |
The sample code and SDK in this repository run in the Publisher's environment as illustrated below. The metering SDK ( .NET class library ) and a sample web application to report usage events for subscriptions against those plans that support metering ( have the dimensions defined and enabled ) and correlate to SaaS Metering and SaaS Service blocks in the below image, respectively.
This SDK has been developed using the following technologies and versions:
- The sample code and SDK have been scanned for vulnerabilities and use secure configurations. Versions have been reviewed to ensure compatibility with the lastest security guidelines.
Ensure the following prerequisites are met before getting started:
- You must have an active Azure subscription for development and testing purposes. Create an Azure subscription here.
- You must have a Partner Center account enabled for use with the commercial marketplace. Create an account here.
- We recommend using an Integrated Development Environment (IDE): Visual Studio Code, Visual Studio 2019, etc...
- The SDK has been implemented using .NET Core 3.1.1
- For data persistence we are using Azure SQL Database and Entity Framework. However, feel free to use any data repository you are comfortable with.
- February 2020 - v1.0 Current Release. It includes the full implementation of the Fulfillment V2 and metering service APIs with web applications that demonstrate customer and publisher portals.
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.
Code contributed should follow the C# specifications and best practices as documented here.
This project is released under the MIT License.