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
Tags Powershell

Recent Posts

Making an IT investment in your SMB? This definitive guide is for you

Planning to make an IT investment in your small or medium-sized business? It is imperative that you spend your money…

2 days ago

Kubernetes service mesh market is a lot more than Istio

Adopting a service mesh is no longer a trend, it’s a necessity. A healthy sign of this is that Istio…

2 days ago

10 biggest 2018 data breaches — and what they mean for 2019

Ransomware and malware attacks hit big victims last year. This look at the biggest 2018 data breaches will keep us…

2 days ago

Xtreme Podcast: Is there still an ‘I’ in innovation?

In this week’s Xtreme Podcast: Where are the next tech innovations coming from? Also, business taglines can be funny; cyber…

2 days ago

New System Center 2019 focuses on datacenters, security, hybrid cloud

The brand-new Microsoft System Center 2019 allows users to deploy and manage Windows Server 2019 and is perfect for those…

3 days ago

Aluminum giant Norsk Hydro experiences serious ransomware attack

Aluminum producing giant Norsk Hydro is dealing with major disruptions in production and falling share price in the wake of…

3 days ago