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).

Share
Published by
Anderson Patricio

Recent Posts

Cryptojacking: Don't let your system perform for someone else

In most cyberattacks, hackers want you to know you’ve been compromised. But in cryptojacking, hackers want you to live in…

14 hours ago

System feeling down? Architect your enterprise apps for high availability

Businesses want to improve uptime, and optimizing every part of their technology stack for high availability is a significant step…

16 hours ago

10 hacking stats every business leader and IT pro must know

Cybercrime is bad and getting worse. Yes, these 10 hacking stats will scare you, but knowing about them can help…

18 hours ago

Disaster recovery solutions in a cloud-centric world

Your data is precious — but it is also precarious. Finding a trustworthy and sustainable cloud disaster recovery service is…

20 hours ago

Forbes hit by Magecart payment card skimming attack

The cybercriminals behind the Magecart payment card skimming hacks are at it again, and this time the venerable publication Forbes…

2 days ago

Top 10 IT infrastructure certifications that can supercharge your career

Certifications can be a career-booster for IT pros. These IT infrastructure certifications can ensure your success in a hot and…

2 days ago