Skip to content

The Microsoft commercial marketplace SaaS offer billing SDK enables Partners and Startups to build the requirements for the implementation of transactable SaaS offers for both the AppSource and Azure Marketplaces.

License

microsoft/commercial-marketplace-client-java

Repository files navigation

Build and Test

Readme

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 opencode@microsoft.com with any additional questions or comments.

Azure Commercial Marketplace SaaS Client SDK for Java

This repository is for active development of the Azure Commercial Marketplace SaaS Client SDK for Java. For consumers of the SDK we recommend visiting our versioned developer docs.

Prerequisites

Java 11 or later is required to use this library. Preferentially use Azul Java SDK.

Setup the following:

  1. You must have access to the Partner Center Commercial Marketplace page. You can setup a Partner account by visiting the partner page and selecting "Become a partner". Once you do that, enroll in the Commercial Marketplace.
  2. You must have at least one SaaS offer published to the Preview stage. Instructions here or follow the hands-on labs that are part of the Mastering the Marketplace - Saas Accelerator Series.
  3. You must have at least one subscription to the SaaS offer.

Getting started

For samples of how to use the methods, look to the test code.

The tests assume the presence of the following environment variables. These variables allow the tests to login on your behalf.

  • AAD_TENANT_ID: Same ID as is used on the Technical Configuration page for your SaaS offer.
  • AAD_APP_CLIENT_ID: Same ID as is used on the Technical Configuration page for your SaaS offer.
  • AAD_APP_CLIENT_SECRET: A secret associated with the AAD_APP_CLIENT_ID used on the Technical Configuration page for your SaaS offer.
  • AAD_APP_CERT: A base64-encoded version of a certificate which also contains a private key. This certificate is used to authenticate the AAD_APP_CLIENT_ID. You can do the conversion in a bash shell with the command line with "base64 <certificate.pfx> -w 0". Websites also exist, such as Base64.Guru.
  • AAD_APP_CERT_SECRET: Password for the certificate.

You can make sure these are set by using the template variables.conf.template and creating a copy of that file as variables.conf. Once copied, fill in the proper values.

To create the certificate using OpenSSL, these lines work great:

openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout privateKey.key -out certificate.pem
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.pem

Note: If you are running the command in Windows, run the second command as the following so the prompt for creating the certificate password appears:

winpty openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.pem

You can run the tests from the command line by executing a build from the root of the repository:

. ./variables.conf
mvn test --file sdk/pom.xml

Client

Microsoft release Java packages follow the Azure SDK Design Guidelines for Java and share a number of core features such as HTTP retries, logging, transport protocols, authentication protocols, etc., so that once you learn how to use these features in one client library, you will know how to use them in other client libraries. You can learn about these shared features here.

NOTE: If you need to ensure your code is ready for production use one of the stable, non-preview libraries.

Need help?

  • For tutorials, samples, quick starts and other documentation, review the test code.
  • File an issue via Github Issues.

Navigating the repository

Master branch

The master branch has the most recent code with new features and bug fixes. It does not represent latest released GA SDK.

Release branches (Release tagging)

For each package we release there will be a unique git tag created that contains the name and the version of the package to mark the commit of the code that produced the package. This tag will be used for servicing via hotfix branches as well as debugging the code for a particular preview or stable release version. Format of the release tags are <package-name>_<package-version>. For more information please see our branching strategy.

Contributing

For details on contributing to this repository, see the contributing guide.

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, view Microsoft's CLA.

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., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories 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 opencode@microsoft.com with any additional questions or comments.

Additional Helpful Links for Contributors

Many people all over the world have helped make this project better. You'll want to check out:

Reporting security issues and security bugs

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

License

Azure Marketplace SDK for Java is licensed under the MIT license.

Impressions

About

The Microsoft commercial marketplace SaaS offer billing SDK enables Partners and Startups to build the requirements for the implementation of transactable SaaS offers for both the AppSource and Azure Marketplaces.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published