Azure / azure-quickstart-templates

Azure Quickstart Templates
https://aka.ms/azqst
MIT License
14.07k stars 16.13k forks source link

Issue accepting Marketplace offer on the command line #13375

Open cdanvergara opened 1 year ago

cdanvergara commented 1 year ago

Hi

I have a PR open to upload the following template that I created to deploy Palo Alto VM-Series in High-Availability.

https://github.com/cdanvergara/azure-quickstart-templates/tree/paloalto/101-paloalto-nva-ha

The Best Practice Analysis completes successfully, but the deployment is failing with the following error message:

https://dev.azure.com/azurequickstarts/azure-quickstart-templates/_build/results?buildId=128285&view=logs&j=275f1d19-1bd8-5591-b06b-07d489ea915a&t=326f581a-4b46-5a6e-a0f1-758ebdd2feec&l=38

Error: Code=BadRequest; Message=Offer with PublisherId: 'paloaltonetworks', OfferId: 'vmseries-flex' cannot be purchased due to validation errors. For more information see details. Correlation Id: '673a40d2-59fe-4c40-93e7-23bda34b9dd0' You have not accepted the legal terms on this subscription: '0cec7090-2e08-4498-9337-eb96ade50821' for this plan. Before the subscription can be used, you need to accept the legal terms of the image. To read and accept legal terms, use the Azure CLI commands described at https://go.microsoft.com/fwlink/?linkid=2110637 or the PowerShell commands available at https://go.microsoft.com/fwlink/?linkid=862451. Alternatively, deploying via the Azure portal provides a UI experience for reading and accepting the legal terms. Offer details: publisher='paloaltonetworks' offer = 'vmseries-flex', sku = 'byol', Correlation Id: '673a40d2-59fe-4c40-93e7-23bda34b9dd0'.[{"You have not accepted the legal terms on this subscription: '0cec7090-2e08-4498-9337-eb96ade50821' for this plan. Before the subscription can be used, you need to accept the legal terms of the image. To read and accept legal terms, use the Azure CLI commands described at https://go.microsoft.com/fwlink/?linkid=2110637 or the PowerShell commands available at https://go.microsoft.com/fwlink/?linkid=862451. Alternatively, deploying via the Azure portal provides a UI experience for reading and accepting the legal terms. Offer details: publisher='paloaltonetworks' offer = 'vmseries-flex', sku = 'byol', Correlation Id: '673a40d2-59fe-4c40-93e7-23bda34b9dd0'.":"StoreApi"}]

If the template is deployed from the Azure portal Interface it works fine, the issue is that the pipeline tries to do it from the command line. In which case the following command needs to be executed to accept the offer from the Marketplace.

Get-AzureRmMarketplaceTerms -Publisher "paloaltonetworks" -Product "vmseries-flex" -Name "byol" | Set-AzureRmMarketplaceTerms -Accept

Is there way to run this command as part of the validation pipeline? otherwise can the test be executed on the Azure Portal?.

Thanks!

Cris

cdanvergara commented 1 year ago

#13346