Easy fix for ‘Marketplace Purchase Eligibility Failed’ when deploying ARM Templates

Let me tell you a story: I was deploying an ARM Template from Checkpoint. When starting the testing process, I got this following error:

11:00:46 – Template deployment returned the following errors:

11:00:46 – 11:00:44 AM – Error: Code=MarketplacePurchaseEligibilityFailed; Message=Marketplace purchase eligibility check returned errors. See inner errors for details.

11:00:46 – 11:00:44 AM – Error: Code=BadRequest; Message=Offer with PublisherId: checkpoint, OfferId: check-point-vsec-r80 cannot be purchased due to validation errors. See details for more information.[{“Legal terms have not been accepted for this item on this subscription. To accept legal terms using PowerShell, please use Get-AzureRmMarketplaceTerms and Set-AzureRmMarketplaceTerms API (https://go.microsoft.com/fwlink/?linkid=862451) or deploy via the Azure portal to accept the terms”:”StoreApi”}]

ARM templatesThe solution is simple. Use the Set-AzureRmMarketPlaceTerms to allow the image that we are trying to deploy through ARM Templates to be accepted. That PowerShell cmdlet requires three pieces of information, which are Publisher Name, Offer and SKU.

In order to find out the name of the publisher, we can use the following cmdlet. (Make sure to update the cmdlet to reflect the region that you are working on, and use a string to find the Publisher. We are using like, which helps a lot.)

Get-AzureRMVMImagePublisher -Location <AzureRegion> | ? { $_.PublisherName -like “checkpoint” }

Now, that we know the name of the Publisher we can go a little bit deeper and find the offer associated to that publisher. We can use the following cmdlet below to retrieve all offers coming from the specified vendor.

Get-AzureRmVMImageOffer -Location EastUS -PublisherName checkpoint

The third cmdlet is to find out all VM images available for that given vendor and offer. The following cmdlet below will help us out to list all options available.

Get-AzureRmVMImageSku -location EastUS -PublisherName checkpoint -Offer check-point-vsec-r80

Finally, we have all the information required to accept the terms and be able to deploy that specific Azure Marketplace image using our ARM Template.

Get-AzureRmMarketplaceTerms -Publisher "checkpoint" -Product "check-point-vsec-r80" -Name "sg-byol" | Set-AzureRmMarketplaceTerms -Accept

As you can see, this is one error you can fix rather easily!

Featured image: Shutterstock

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top