Azure / Azure/azure-cli

new command group: az marketplace terms

Open
#16,343 6 comments 0 reactions 2 assignees Assigned to @qwordy View on GitHub
act-observability-squad Compute feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

As [suggested](https://github.com/Azure/azure-cli/pull/10896#issuecomment-543454832) by @jiasli, it would be great to have a new command group `az marketplace terms` or just `az terms`. #10896 added `az vm image terms`.

## new commands
- az marketplace terms list
- az marketplace terms show --publisher {publisher} --offer {offer} --plan {plan}
- az marketplace terms accept --publisher {publisher} --offer {offer} --plan {plan}
- az marketplace terms cancel --publisher {publisher} --offer {offer} --plan {plan}

An alternative, would be to name it `sign` instead of `accept`, but `accept` was used for `az vm image terms` as well as PowerShell `Set-AzureRmMarketplaceTerms -Accept` and `Set-AzMarketplaceTerms -Accept`.

The [Marketplace Agreements REST API](https://docs.microsoft.com/en-us/rest/api/marketplaceordering/marketplaceagreements) exposes two resource types.

### providers/Microsoft.MarketplaceOrdering/offerTypes/virtualmachine/publishers/

The `az vm image terms` use these.

Create
PUT https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/offerTypes/virtualmachine/publishers/{publisherId}/offers/{offerId}/plans/{planId}/agreements/current?api-version=2015-06-01

Get
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/offerTypes/virtualmachine/publishers/{publisherId}/offers/{offerId}/plans/{planId}/agreements/current?api-version=2015-06-01

### providers/Microsoft.MarketplaceOrdering/agreements/

The `az marketplace terms` would use all of these.

Cancel
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/cancel?api-version=2015-06-01

Get Agreement
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}?api-version=2015-06-01

List
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements?api-version=2015-06-01

Sign
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/sign?api-version=2015-06-01

## Alternative
Without this implemented, `az rest` can be used. For example:
```
az rest --method get --uri /subscriptions/${subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/arista-networks/offers/veos-router/plans/eos-4_22_1fx?api-version=2015-06-01
```
Gets the active agreements for:
![image](https://user-images.githubusercontent.com/80104/102942617-b6db9c80-446a-11eb-962b-c04d9d4b2442.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.