ResourcePurchaseValidationFailed
Azure Error: ResourcePurchaseValidationFailed. You have not accepted the legal terms on this subscription
Steps to guide you through accepting Azure images with marketplace terms from the Azure Cloud Shell and Azure CLI
Overview
Some VM images in Azure have additional terms and licenses that must be accepted before you can deploy the image programmatically.
Our webservice example uses an NGINX Bitnami VM image in Azure that includes a policy that must first be accepted. The NGINX image has the following properties defined in the Blueprint:
bitnami:
publisher: bitnami
product: nginxstack
sku: 1-9
When applying a blueprint containing a VM image that requires acceptance you receive the following error in the environment Job details.
Failed to create VirtualMachine ['webservice-tuono-webservice', 'webserver-2']:
Azure Error: ResourcePurchaseValidationFailed
Message: User failed validation to purchase resources.
Error message: 'You have not accepted the legal terms on this subscription: '33de00cd-d545-47cb-8939-193f9b5fafa4' for this plan.
Before the subscription can be used, you need to accept the legal terms of the image.
To read and accept legal terms,
use the Azure CLI commands described at https://go.microsoft.com/fwlink/?linkid=2110637
or the PowerShell commands available at https://go.microsoft.com/fwlink/?linkid=862451.
Offer details: publisher:'bitnami' offer = 'nginxstack', sku = '1-9', Correlation Id: '[GUID]'
Resolution
The resolution uses the NGINX specific image details but the steps are valid with any image. To obtain the details for your specific image you can view the Offer details in the Azure error message or visit this KB.
Azure Cloud Shell
Open the Azure Cloud Shell.
a. Select a subscription and create a storage account by clicking "Create storage"
b. Change the environment type to Powershell in the top left

You can view the marketplace terms with Get-AzMarketplaceterms.
Get-AzMarketplaceterms -Publisher "bitnami" -Product "nginxstack" -Name "1-9"
Publisher : bitnami
Product : nginxstack
Plan : 1-9
LicenseTextLink : https://storelegalterms.blob.core.windows.net/legalterms/3E5ED_legalterms_BITNAMI%253a24NGINXSTACK%253a241%253a2D9%253a24TUHRPTBFUGCFZ7MYDV5YYPIWHN26Z4EG25KVSJP4ICXU6QHBC6MM2RIWDMKPZN7GE5Z43UNM3JLUYIGL6PPEHFCDIYYYPZF
BXMWBNCA.txt
PrivacyPolicyLink : https://www.vmware.com/help/privacy.html
Signature : 3IN7ZRVLHE3SG7Z73BI2ONVDW5AW5CR4B5NT5ZBV2K4TVXGHRA5BDY4AXILK6YAM73WXM7VCK7ZCWZEJHVYRBUHSXSV7CZTJR63TL2I
Accepted : False
Signdate : 9/16/2020 6:34:46 PM
Accept the marketplace terms with Set-AzureRmMarketplaceTerms.
Get-AzMarketplaceterms -Publisher "bitnami" -Product "nginxstack" -Name "1-9" | Set-AzureRmMarketplaceTerms -Accept
Publisher : bitnami
Product : nginxstack
Plan : 1-9
LicenseTextLink : https://storelegalterms.blob.core.windows.net/legalterms/3E5ED_legalterms_BITNAMI%253a24NGINXSTACK%253a241%253a2D9%253a24TUHRPTBFUGCFZ7MYDV5YYPIWHN26Z4EG25KVSJP4ICXU6QHBC6MM2RIWDMKPZN7GE5Z43UNM3JLUYIGL6PPEHFCDIYYYPZF
BXMWBNCA.txt
PrivacyPolicyLink : https://www.vmware.com/help/privacy.html
Signature : VGEYP542NGALXFY6ZJQ7QZJJ3ORBQJI4E4PNOEJ3SR7DHNGKI5CKPKUFP7FERE63UYED42ODZMYI5B7LHT2CUXJ63NQVJQWIMZRVGDA
Accepted : True
Signdate : 9/16/2020 6:38:10 PM
You are now ready to apply your blueprint!
Azure CLI
Install the Azure CLI with your preferred method or you can issue azure cli commands in Azure Cloud Shell.
Sign into the the Azure CLI and follow provided login:
az login
You can view the marketplace terms with az vm image terms show.
az vm image terms show --publisher bitnami --offer nginxstack --plan 1-9
{
"accepted": false,
"id": "/subscriptions/33de00cd-d545-47cb-8939-193f9b5fafa4/providers/Microsoft.MarketplaceOrdering/offerTypes/VirtualMachine/publishers/bitnami/offers/nginxstack/plans/1-9/agreements/current",
"licenseTextLink": "https://storelegalterms.blob.core.windows.net/legalterms/3E5ED_legalterms_BITNAMI%253a24NGINXSTACK%253a241%253a2D9%253a24TUHRPTBFUGCFZ7MYDV5YYPIWHN26Z4EG25KVSJP4ICXU6QHBC6MM2RIWDMKPZN7GE5Z43UNM3JLUYIGL6PPEHFCDIYYYPZFBXMWBNCA.txt",
"name": "1-9",
"plan": "1-9",
"privacyPolicyLink": "https://www.vmware.com/help/privacy.html",
"product": "nginxstack",
"publisher": "bitnami",
"retrieveDatetime": "2020-09-17T00:52:11.8844569Z",
"signature": "IJHP7N6UEOBNKGU4K2V7NOLMZNQ637QWPG4B64GJWRUD44IBVUW72YYJMMIS3SPN5OPGDJJ57QU3PYD2T6VOXQYV5PKEHFCJVCYEX4Y",
"type": "Microsoft.MarketplaceOrdering/offertypes"
}
Accept the marketplace terms with az vm image terms accept.
az vm image terms accept --publisher bitnami --offer nginxstack --plan 1-9
{
"accepted": true,
"id": "/subscriptions/33de00cd-d545-47cb-8939-193f9b5fafa4/providers/Microsoft.MarketplaceOrdering/offerTypes/Microsoft.MarketplaceOrdering/offertypes/publishers/bitnami/offers/nginxstack/plans/1-9/agreements/current",
"licenseTextLink": "https://storelegalterms.blob.core.windows.net/legalterms/3E5ED_legalterms_BITNAMI%253a24NGINXSTACK%253a241%253a2D9%253a24TUHRPTBFUGCFZ7MYDV5YYPIWHN26Z4EG25KVSJP4ICXU6QHBC6MM2RIWDMKPZN7GE5Z43UNM3JLUYIGL6PPEHFCDIYYYPZFBXMWBNCA.txt",
"name": "1-9",
"plan": "1-9",
"privacyPolicyLink": "https://www.vmware.com/help/privacy.html",
"product": "nginxstack",
"publisher": "bitnami",
"retrieveDatetime": "2020-09-17T01:06:43.9982855Z",
"signature": "Z5KTJ3DQGURBBZ4YIIA34F7GDISKPRPEOPNE477BITMS552U5SLJIH5XNUZN37SETVD7W2JJ6XPJHUKRVAP3LFZ47W32UE5SO34C5PI",
"type": "Microsoft.MarketplaceOrdering/offertypes"
}
You are now ready to apply your blueprint!
Last updated
Was this helpful?