Marketplace Offer Terms are not Accepted
β·
β Error: failed to create Managed Application "tf-adam-fusion-pscd-EASTUS-PSCD" (Resource Group "tf-adam-fusion-pscd-EASTUS"):
managedapplications.ApplicationsClient#CreateOrUpdate: Failure sending request: StatusCode=400
-- Original Error: Code="ResourcePurchaseValidationFailed" Message="User failed validation to purchase resources.
Error message: 'You have not accepted the legal terms on this subscription: '81cefe76-78c0-4df5-a564-e900f1ae2ba0' 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.
Alternatively, deploying via the Azure portal provides a UI experience for reading and accepting the legal terms.
Offer details: publisher='purestoragemarketplaceadmin'
offer = 'pure_storage_cloud_dedicated_deployment',
sku = 'pscd_azure_6_6_x', Correlation Id: 'a13685de-a008-48a8-8ff8-ecfcfd00e043'.'"
β
β with pscd_array_azure.azure_pscd,
β on main.tf line 200, in resource "pscd_array_azure" "azure_pscd":
β 200: resource "pscd_array_azure" "azure_pscd" {
To resolve this, you can choose to accept the offer via Azure CLI or Azure PowerShell SDK.
CLI
az vm image terms accept [--offer] [--plan] [--publisher]
Example (Parameters from the error above):
az vm image terms accept --plan pscd_azure_6_6_x --offer "pure_storage_cloud_dedicated_product_deployment" --publisher "purestoragemarketplaceadmin"
PowerShell
Get-AzMarketplaceTerms -Publisher '<publisher name>'-Product '<product name>' -Name '<plan name>' | Set-AzMarketplaceTerms -Accept
Example (Parameters from the error above):
Get-AzMarketplaceTerms -Publisher 'purestoragemarketplaceadmin' -Product 'pure_storage_cloud_dedicated_product_deployment' -Name 'pscd_azure_6_6_x' | Set-AzMarketplaceTerms -Accept
Note: The parameter --plan pscd_azure_6_6_x will accept the latest Everpure Cloud Dedicated version from 6.6.x branch. If you would like to accept different version, please change the parameter accordingly (for example version 6.8.x, change the parameter to --plan pscd_azure_6_8_x).
Marketplace Plan already Exists
If you have already deployed the same version of Everpure Cloud Dedicated (ex: 6.4.2) in the same subscription. You might get the below error after applying the code.
azurerm_key_vault.pscd_key_vault: Creation complete after 2m34s [id=/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/
pscd-tf-poc-EASTUS/providers/Microsoft.KeyVault/vaults/CBS-5f131be82ec77ade]
β·
β Error: A resource with the ID "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MarketplaceOrdering/agreements/
purestoragemarketplaceadmin/offers/pure_storage_cloud_dedicated_deployment/plans/pscd_azure_6_4_2"
already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_marketplace_agreement" for more information.
β
β with azurerm_marketplace_agreement.plan,
β on main.tf line 27, in resource "azurerm_marketplace_agreement" "plan":
β 27: resource "azurerm_marketplace_agreement" "plan" {
β
To resolve this, you would need to import the plan to Terraform state
terraform import azurerm_marketplace_agreement.plan /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MarketplaceOrdering/agreements/purestoragemarketplaceadmin/offers/pure_storage_cloud_dedicated_deployment/plans/pscd_azure_6_4_2