Skip to content

Latest commit

 

History

History
121 lines (73 loc) · 10.3 KB

File metadata and controls

121 lines (73 loc) · 10.3 KB

Microsoft Commercial Marketplace - Community Sample Code and SDK for SaaS Applications

.NET Core

Introduction

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 exercising 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.

Intended Use

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.

Installation

The documentation (docs) directory contains installation instructions to help understand, implement, and deploy the sample code and SDK components.

Video instructions: Additionally, there is a quick video on how to install the SaaS Accelerator with the installer script available through the Mastering the Marketplace Library.

Commercial Marketplace Documentation

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.

Monitoring

The following documents provide HOW-TOs setup Azure Monitoring and Alerting for the resources deployed by the SaaS Accelerator:

Terminology

  • SDK: Software development kit. This refers to the SDK for the .NET language and includes the Client and Data Access Libraries, as well as the Sample Web Applications used to exercises 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.

SaaS Accelerator Overview

Saas Diagram

Projects

The source (src) directory offers the following components:

Project Description Directory Name
Customer portal - Sample web application Demonstrates how to register, provision, and activate the marketplace subscription. Implemented using ASP.Net Core 6.0, the sample web application uses the Services 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 on client library / 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.

Use case

Production Environment Reference Architecture

How-To deploy SaaS Accelerator into a production environment? This document provides recommendations on how to deploy the SaaS Accelerator into a production environment.

Technology and Versions

This SDK has been developed using the following technologies and versions:

Security

  • The sample code and SDK have been scanned for vulnerabilities and use secure configurations. Versions have been reviewed to ensure compatibility with the latest security guidelines.

Prerequisites

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 / 2022, etc...
  • The SDK has been implemented using .NET 6
  • For data persistence we are using Azure SQL Database and Entity Framework. However, feel free to use any data repository you are comfortable with.

Releases

  • 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.

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.

Developers

Code contributed should follow the C# specifications and best practices as documented here.

License

This project is released under the MIT License.