Managing Marketplace Agreements with Azure CLI (with examples)
Introduction
Azure CLI (Command-Line Interface) is a powerful tool that allows you to manage various aspects of your Azure resources from the command line. One of the features of Azure CLI is the ability to manage marketplace agreements using the az term
command.
This article will explore two different use cases of the az term
command: printing marketplace terms and accepting marketplace terms. We will provide code examples for each use case, along with a motivation for using the example, an explanation of the command arguments, and an example output.
Use Case 1: Print Marketplace Terms
To print the marketplace terms for a specific product, plan, and publisher, you can use the az term show
command. Here is an example of how to use this command:
az term show --product "product_identifier" --plan "plan_identifier" --publisher "publisher_identifier"
Motivation
Printing marketplace terms can be useful for reviewing the terms and conditions before accepting them. It allows you to have a clear understanding of the agreement associated with a particular product, plan, and publisher.
Explanation
--product
: Specifies the identifier of the product for which you want to print the marketplace terms.--plan
: Specifies the identifier of the plan for the product.--publisher
: Specifies the identifier of the publisher.
Example Output
{
"agreementLink": "https://marketplace.azure.com/en-us/legalterm/...",
"accepted": false,
"planDisplayName": "Standard",
"productId": "product_identifier",
"planId": "plan_identifier",
"publisherId": "publisher_identifier"
}
The example output includes the agreement link, which you can visit to review the terms and conditions. It also indicates whether the terms have been accepted (false
in this case), along with the display name, product ID, plan ID, and publisher ID.
Use Case 2: Accept Marketplace Terms
To accept the marketplace terms for a specific product, plan, and publisher, you can use the az term accept
command. Here is an example of how to use this command:
az term accept --product "product_identifier" --plan "plan_identifier" --publisher "publisher_identifier"
Motivation
Accepting marketplace terms is necessary before deploying certain marketplace products. By accepting the terms, you confirm that you agree to the terms and conditions set by the publisher.
Explanation
The arguments for the az term accept
command are the same as the az term show
command (explained in the previous section).
Example Output
{
"accepted": true,
"planId": "plan_identifier",
"publisherId": "publisher_identifier"
}
The example output indicates that the marketplace terms have been accepted (true
in this case), along with the plan ID and publisher ID.
Conclusion
The az term
command in Azure CLI provides a convenient way to manage marketplace agreements. In this article, we explored two use cases: printing marketplace terms and accepting marketplace terms. These use cases are valuable for reviewing and accepting the terms and conditions associated with marketplace products. By using the example code provided, you can easily incorporate these features into your Azure CLI workflow.