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"}]

The 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

Anderson Patricio

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides of the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange, CISSP and several other certifications. Anderson contributes to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at Techgenix.com, MSExchange.org, ITPROCentral.com and Anderson Patricio.org (Portuguese).

Published by
Anderson Patricio
Tags Powershell

Recent Posts

Review: Identity verification solution Specops Secure Service Desk

Specops Secure Service Desk is an innovative solution for positively identifying a user who calls…

14 hours ago

Apple Silicon: What it means for the world of personal computing

Apple is moving away from Intel processors to use its own Apple Silicon processors to…

17 hours ago

RAID 0 vs. RAID 1: When to use each level and why

Two of the most popular RAID levels for improving performance are RAID 0 and RAID…

20 hours ago

Got cybersecurity tools? Good. Got too many? That may be a problem

Strength in numbers may not apply to cybersecurity tools. In fact, using too many tools…

2 days ago

Getting started with System Center Operations Manager

System Center Operations Manager can monitor your IT resources, but the tool is only as…

2 days ago

Microsoft 365 administration: Creating DNS records for email security

Microsoft 365 administration has many facets, but none is more important than configuring email. Here’s…

2 days ago