Tech

Azure cloudshell error “unexpected status 400 (400 Bad Request) with error: ResourcePurchaseValidationFailed: User failed validation to purchase resources. Error message: ‘You have not accepted the legal terms on this subscription”

unexpected status 400 (400 Bad Request) with error: ResourcePurchaseValidationFailed: User failed validation to purchase resources. Error message: 'You have not accepted the legal terms on this subscription

Resolving the “ResourcePurchaseValidationFailed” Error in Azure

Overview

During resource deployment in Azure, you may encounter the following error message:

Unexpected status <span class="hljs-number">400</span> (<span class="hljs-number">400</span> Bad Request) <span class="hljs-keyword">with</span> <span class="hljs-keyword">error</span>:
<span class="hljs-symbol">ResourcePurchaseValidationFailed:</span> User failed validation <span class="hljs-keyword">to</span> purchase resources.
<span class="hljs-keyword">Error</span> message: <span class="hljs-comment">'You have not accepted the legal terms on this subscription.'</span>

This error typically occurs when the Azure subscription has not yet accepted the legal terms associated with a Marketplace image—for example, when deploying a virtual machine (VM) image such as the Zscaler Cloud Connector or any other third-party Marketplace offering.

Azure requires you to explicitly accept the publisher’s legal terms before you can deploy or purchase the corresponding Marketplace resource under your subscription.


Cause

Each Marketplace image in Azure is governed by specific legal terms defined by the publisher.
When you attempt to deploy a resource using an image whose terms have not yet been accepted, Azure blocks the operation for compliance reasons, resulting in the ResourcePurchaseValidationFailed error.


Resolution

To resolve this issue, you must accept the legal terms for the image before proceeding with deployment.
You can do this through the Azure Portal, Azure CLI, or PowerShell.

Option 1: Using Azure CLI

Run the following command to accept the Marketplace image terms:

az vm image terms accept --urn &lt;publisher&gt;:&lt;offer&gt;:&lt;sku&gt;:&lt;version&gt;

Replace the placeholders with the appropriate values for your image.
For example, to accept terms for the Zscaler Cloud Connector image:

az vm image terms accept --publisher vendor123456789 --offer zia_cloud_connector --plan zs_ser_gen1_cc_01

Once the terms have been accepted, retry your deployment.


Verification

To verify that the terms were successfully accepted, run:

az vm image terms show --urn &lt;publisher&gt;:&lt;offer&gt;:&lt;sku&gt;:&lt;version&gt;

If accepted, the output will confirm that the

accepted

property is set to

true

.


Summary

If you encounter the

ResourcePurchaseValidationFailed

error with the message “You have not accepted the legal terms on this subscription”, it means the Marketplace image terms must be accepted for your subscription. Accepting these terms—using either the Azure CLI, PowerShell, or Portal—resolves the issue and allows the deployment to proceed successfully.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button