Outline the issue here:
When I try to install VM from Azure Marketplace via Azure CLI 2.0 I get the error message:
At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details. {
"error": {
"code": "ResourcePurchaseValidationFailed",
"message": "User failed validation to purchase resources. Error message: 'Legal terms have not been accepted for this item on this subscription. To accept legal terms, please go to the Azure portal (http://go.microsoft.com/fwlink/?LinkId=534873) and configure programmatic deployment for the Marketplace item or create it there for the first time'"
}
} Correlation ID: 5d540903-63f7-4d79-8626-92ae748f6d2e
In order to overcome it I have to login to portal.azure.com and configure programmatic deployment there. After that I can create VM with no problem.
I wonder if it's possible to configure programmatic deployment via Azure CLI in order not switch from CLI to portal and back again?
thanks!
Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here:
apt-get
CLI Version: What version of the CLI and modules are installed? (Use az --version
)
Answer here:
root@ALEXEY-HP:~# az --version
azure-cli (2.0.6)
acr (2.0.4)
acs (2.0.6)
appservice (0.1.6)
batch (2.0.4)
cdn (0.0.2)
cloud (2.0.2)
cognitiveservices (0.1.2)
command-modules-nspkg (2.0.0)
component (2.0.4)
configure (2.0.6)
core (2.0.6)
cosmosdb (0.1.6)
dla (0.0.6)
dls (0.0.6)
feedback (2.0.2)
find (0.2.2)
interactive (0.3.2)
iot (0.1.5)
keyvault (2.0.4)
lab (0.0.4)
monitor (0.0.4)
network (2.0.6)
nspkg (3.0.0)
profile (2.0.4)
rdbms (0.0.1)
redis (0.2.3)
resource (2.0.6)
role (2.0.4)
sf (1.0.1)
sql (2.0.3)
storage (2.0.6)
vm (2.0.6)
Python (Linux) 3.6.1 (default, May 18 2017, 14:59:59)
[GCC 4.8.4]
Python location '/opt/az/bin/python3'
OS Version: What OS and version are you using?
Answer here:
D:>ver
Microsoft Windows [Version 10.0.14393]
64-bit
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here:
cmd.exe, Bash on Windows
I believe @yugangw-msft has looked into this and would be best able to answer your question.
ok, I'm waiting for the answer
User failed validation to purchase resources. Error message: 'Legal terms have not been accepted for this item on this subscription. To accept legal terms, please go to the Azure portal (http://go.microsoft.com/fwlink/?LinkId=534873) and configure programmatic deployment for the Marketplace item or create it there for the first time'
It is about legal terms, and related billing information, with the vendor for this market place image. The only way to get it cleared up is creating the VM through portal. The error is pretty clear that you only need to do it once, after that you can use CLI w/o issues.
So, by design, that you can't skip this step through CLI
ok, thanks for that - the problem is I have to use another tool (portal) even though I was going to use only CLI.
I'm pretty sure clicks on portal somehow can be transformed to CLI command which can be scripted well.
I ran into this today. Thought would follow note here incase anyone comes looking.
My finding is, in order to enable "programmatic deployment" of marketplace apps, you have to FIRST go through the creation/"purchase" process in the Azure Portal interface. You can then freely delete the created item and from then create using ARM templates.
Also, this applies PER SUBSCRIPTION! I had to do this on several subscriptions.
@iyerusad I tried it but didn't work, any other option.
vvish5 use az cli to identify the actual image you want first and then search for the image & then enable it via the console after you find it in marketplace. There should be a hyperlink text on the bottom asking you to "enable programmatic stuff". It's a one time deal.
It didn't work for me at first because I enabled the wrong image. It has to be an exact match.
You do not have to create it manually first contrary to what someone else said above, the keyword is message is OR.
and configure programmatic deployment for the Marketplace item or create it there for the first time'
There should be a way to accept this from an ARM template, API, CLI, PowerShell or at subscription create time. The legal terms seems like a silly argument. The whole point of automation is so that you don't have to do these manual steps.
@derekbekoe @JasonRShaver - Since this involves legal terms, is a better solution to document this issue clearly and then provide information on how to resolve it?
The only way to get it cleared up is creating the VM through portal.
How come these legal terms are not available through the Azure CLI? @yugangw-msft
//CC: @mayurid @lmazuel
We need to on-board MarketplaceOrdering to Python-SDK first. CLI work is trivial once the SDK is ready.
We can schedule the work in the first sprint in Jan 2018
@yugangw-msft https://github.com/Azure/azure-sdk-for-python/pull/1653
As a work around I created a bash script calling the REST API using curl https://github.com/rafaelgodinho/ARM-REST-API-CURL/blob/master/AcceptAzureMarketplaceTerms.sh
As an fyi for others - I found that there is an issue when the plan name contains a hyphen. The powershell and rest api calls seem to work fine, however the actual cli-based template deployment still fails with the 'Marketplace purchase eligibility' error. I did not have this issue for a plan name which did not have a hyphen.
@hglkrijger, CLI uses template deployment instead of compute apis to provision VM. Could you please run `az vm create --debug --validate ...' and check out the template(in green font from the output). If the plan name doesn't match the command line argument value you typed in, please share with me at yugangw at microsoft dot com.
(EDIT: I had a bit misunderstanding when I made the comment above, but please check out the request payload to see the plan value sent on the wire. I hope to understand the root cuase)
I am fixing this issue. The command flow will look like
urn = $(az vm image list --all --publisher kemptech --offer vlm-azure --sku basic-byol --query '[0].urn')
az vm image accept-term --urn $urn
az vm create -g rg -n vm1 --image $urn
We are seeing the same issue when trying to create a Sendgrid Account from an ARM template. Is there an equivalent cli command that relates to Sendgrid's acceptance of Legal Terms ? For now, we need to deploy a dummy account prior, delete it and then launch the ARMs.
Don't know what the Sendgrid looks like, but if it is a marketplace item with publisher, offer, etc associated, you can still use az vm image accept-term
to accept it.
+1, it's fixed now, pls. have a look at quick start guide:
https://postgrespro.com/products/postgrespro/azure/enterprise#azureconnect
https://postgrespro.com/products/postgrespro/azure/enterprise#vmcreate
@yugangw-msft @alexeyshishkin01 - Sendgrid is a 3rd party email service and not a VM image hosted on Marketplace, thus I'm not sure how this applies to my query. There is no "Sendgrid" publisher within the "vm image list-publishers" list.
$ az vm image list-publishers --location northeurope --query "[?starts_with(name,'Sendgrid')].{Name:name}"
[]
Any other ideas ?
we managed to solve the issue, based on @rafaelgodinho awesome script.
For future readers - can confirm this works for sendgrid with the following command:
az vm image accept-terms --publisher sendgrid --offer sendgrid_azure --plan free
Note: the publisher/offer/plan are case-sensitive, so make sure that they match exactly the values in your ARM template
Most helpful comment
There should be a way to accept this from an ARM template, API, CLI, PowerShell or at subscription create time. The legal terms seems like a silly argument. The whole point of automation is so that you don't have to do these manual steps.