Search code examples
azuresendgridazure-powershellazure-cliazure-marketplace

Azure CLI: Accept SendGrid's legal terms


We are trying to automate deployment of our custom solution using Azure Cli and it is mainly successful except for one annoying issue: we cannot find the way to accept legal terms for SendGrid via Azure Cli.

We have no issues doing it via PowerShell:

Get-AzMarketplaceTerms -Publisher "Sendgrid" -Product "sendgrid_azure" -Name "free" | Set-AzMarketplaceTerms -Accept

But how do we do the same using Azure Cli? Can someone, please help with it? Is it even possible? The reason we want to use Azure CLI is because 99% of the deployment script is using it. We don't want to use PowerShell for the last 1% becase the user needs to authenticate to Azure PowerShell Module one more time unceccessarily.

This is what SendGrid Product looks like when we run this command:

Get-AzMarketplaceTerms -Publisher "Sendgrid" -Product "sendgrid_azure" -Name "free"

Result (which is great, we want to see this):

Publisher : Sendgrid Product : sendgrid_azure Plan
: free LicenseTextLink : https://storelegalterms.blob.core.windows.net/legalterms/3E5ED_legalterms_SENDGRID%253a24SENDGRID%253a5FAZURE%253a24FREE%253a24YETL367I3WKHD54DOKWY3WW3VV6IKDF32UCLUQA6JEV 4GAZY2JLEYCDJI64NPQ2OLUJMS5R2JHZOXC663I73AX45FCBR5CFAYEKUO2Y.txt PrivacyPolicyLink : http://sendgrid.com/privacy Signature : BZU4R7BG2MVWROB7QPWQ6OXCPG7ZYPLNRJXXQC2TU4MLWHMXXQCRQ2Y7BKWL4CIVYULXIGPNUSIISNDP6SVWZ7DFZ3EEX7NYJKOBVKY Accepted : True Signdate : 2019-04-08 1:00:06 AM

I have tried these Azure Cli commands:

az vm image list --all --publisher sendgrid --offer sendgrid_azure --sku free --query '[].urn'
az vm image list --all --publisher Sendgrid --offer sendgrid_azure --sku free --query '[].urn'
az vm image list --all --publisher SendGrid --offer sendgrid_azure --sku free --query '[].urn'

But this is what they return:

[]

When I try some other publishers,

az vm image list --all --publisher cisco --offer cisco-csr-1000v --sku 16_6 --query '[].urn'

then I see some items returned:

[ { "offer": "cisco-csr-1000v", "publisher": "cisco", "sku": "16_6", "urn": "cisco:cisco-csr-1000v:16_6:16.6.120170804", "version": "16.6.120170804" }, { "offer": "cisco-csr-1000v", "publisher": "cisco", "sku": "16_6", "urn": "cisco:cisco-csr-1000v:16_6:16.6.220171219", "version": "16.6.220171219" } ]

Any help will be greatly appreciated! How do we accept legal terms uzing Azure CLI?


Solution

  • az vm image accept-terms --publisher sendgrid --offer sendgrid_azure --plan free