Wednesday, September 29, 2021

Azure Batch Pool resizing failed - Allocation failed due to marketplace purchase eligibilty

Scenario: 

For Azure Batch users, when you tried to resize your Batch pool, but it failed with the error message of Allocation failed due to marketplace purchase eligibilty 

 

You can follow the below steps to check if it’s the same scenario with this blog. 

 

Troubleshooting: 

 

Step 1: Navigate to your Batch overview page, check the pool allocation mode 

 

hailey_ding_0-1632906800589.png

 

If you are using the User Subscription mode, you can go to step 2 and follow the instructions below.  

 

Otherwise, if the pool allocation mode is Batch Service mode, please contact Azure Support and open a technical support ticket, as this blog would only cover the scenario of the user subscription mode. 

 

Step 2: run PowerShell commands needed for the legal terms 

 

Usually, for Batch users (in user subscription mode), there are some legal terms of the image that users need to accept before the subscription can be used. If you haven’t done this before, you might encounter the error Allocation failed due to marketplace purchase eligibilty. 

 

There are two ways we can do to check and accept the terms: 

  • Run the PS command in Cloud Shell to check the current terms. An example below:

 

Get-AzMarketplaceTerms -Publisher 'microsoft-azure-batch' -Product 'ubuntu-server-container' -Name '20-04-lts' 

 

  • If the terms have not been accepted, you can also use the following PS command locally to accept them. An example below:

 

Get-AzMarketplaceTerms -Publisher 'microsoft-azure-batch' -Product 'ubuntu-server-container' -Name '20-04-lts' | Set-AzMarketplaceTerms -Accept 

 

 

Please notice: in the example above, you need to set the Publisher, Product(Offer) and Name(Sku) based on your pool setting. You can find the information in the Properties blade of the pool. 

hailey_ding_1-1632908203652.png

 

Posted at https://sl.advdat.com/3AVz1fs