Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When provisioning VMs which require legal terms to be accepted, provide an option to accept that. #1283

Closed
JonTheNiceGuy opened this issue May 23, 2018 · 11 comments · Fixed by #4305

Comments

@JonTheNiceGuy
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

When provisioning a FortiGate BYOL 6.0.0 machine using a template (I can supply the template, if required), I received the following 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 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'

It would be convenient to indicate that the legal terms have been accepted on this item. There is a potential work-around which is to run this command first: az vm image accept-terms --urn ${azurerm_virtual_machine.fw01.storage_image_reference.publisher}:${azurerm_virtual_machine.fw01.storage_image_reference.offer}:${azurerm_virtual_machine.fw01.storage_image_reference.sku}:${azurerm_virtual_machine.fw01.storage_image_reference.version} however, this can't be specified as a depends_on action as a null_resource.*.local-exec command, as there is a cycle here which prevents it from running.

New or Affected Resource(s)

  • azurerm_virtual_machine or azurerm_image

Potential Terraform Configuration

https://gist.github.com/JonTheNiceGuy/4f009c4e92f11dee42e4b5abba3e972e

References

@tombuildsstuff
Copy link
Contributor

hey @JonTheNiceGuy

Thanks for opening this issue :)

Taking a brief look into this - support for this is available in the Go SDK and there's an example API call available in this Swagger example.

It's possible this could make sense as a separate resource (since it could also belong on the VMSS resource) - but it may make sense as an independent resource (this needs some experimentation to determine if it makes sense on the VM/VMSS resources or as an independent resource [since it's not possible to revoke licence acceptance, this may not make sense]).

Thanks!

@tombuildsstuff tombuildsstuff modified the milestones: Soon, 1.6.0, Future May 23, 2018
@tombuildsstuff
Copy link
Contributor

Talking some more about this internally the other day - our initial suggestion is this is a separate resource; but we need to experiment to see if licence revocation is possible as outlined above.

@khushil
Copy link

khushil commented Jun 14, 2018

Ran into this while trying to create BYOL on PaloAlto's as well.

@TechyMatt
Copy link
Contributor

@tombuildsstuff through powershell it is possible to reject marketplace items after you've accepted them https://docs.microsoft.com/en-us/powershell/module/azurerm.marketplaceordering/set-azurermmarketplaceterms?view=azurermps-6.2.0

@acobaugh
Copy link

I added a reaction to the OP, but also wanted to state that are use case is also accepting the BYOL t&c with the PaloAlto images. Would be really good if we could eliminate this one manual step.

@bostrowski13
Copy link

Just found out this issue the hard way. Be really nice to see some action on this.

@tombuildsstuff tombuildsstuff changed the title When privisioning VMs which require legal terms to be accepted, provide an option to accept that. When provisioning VMs which require legal terms to be accepted, provide an option to accept that. Oct 10, 2018
@tombuildsstuff tombuildsstuff modified the milestones: Future, Being Sorted Oct 25, 2018
@katbyte katbyte modified the milestones: Being Sorted, 1.20.0 Oct 25, 2018
@tombuildsstuff tombuildsstuff modified the milestones: 1.20.0, 2.0.0 Nov 16, 2018
@dikadali-MSFT
Copy link

@tombuildsstuff through powershell it is possible to reject marketplace items after you've accepted them https://docs.microsoft.com/en-us/powershell/module/azurerm.marketplaceordering/set-azurermmarketplaceterms?view=azurermps-6.2.0

quick PowerShell command to fix this error
Set-AzureRmMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-science-vm" -Name "windows2016" -Terms $agreementTerms -Accept | Set-AzureRmMarketplaceTerms -Accept

@richeney
Copy link
Contributor

Example az cli command to accept marketplace terms for a Cisco CSR:

for urn in $(az vm image list --all --publisher cisco --offer cisco-csr-1000v --sku 16_6 --query '[].urn' --output tsv)
do az vm image accept-terms --urn $urn
done

Could be useful in a local-exec as a workaround?

@tombuildsstuff
Copy link
Contributor

This'll be fixed via #4305

@ghost
Copy link

ghost commented Sep 18, 2019

This has been released in version 1.34.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.34.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Oct 13, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Oct 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants