Skip to content

MarketplaceSubscriptionCannotBeCompleted #62

Description

IaC variant

Terraform (infra-terraform)

Azure region

eastus2, swedencentral

Claude model + family

claude-sonnet-* / claude-opus-*

Tool versions

azd version 1.34.1 (commit c573ef9848309fd7ae313418f577d7f1beabac4c) (stable)
az version
{
  "azure-cli": "2.89.1",
  "azure-cli-core": "2.89.1",
  "azure-cli-telemetry": "1.1.0",
  "extensions": {
    "resource-graph": "2.1.1"
  }
}
terraform version
Terraform v1.16.0
on linux_amd64

Steps to reproduce

  1. Manually create deployment
  2. Attempt to create another deployment for the same model (UI/IaC)
  3. Clear resources (UI/Iac/CLI)
  4. Run script

Expected behavior

Model Deployment is up and in Healthy state

Actual behavior + logs

home@debian:~/Downloads/claude/infra-terraform$ azd up

Provisioning and deploying (azd up)
Packaging overlaps with provisioning for faster execution.

Locating plan file...
Initializing the backend...

Successfully configured the backend "local"! Terraform will automatically
use this backend unless the backend configuration changes.

Initializing provider plugins...
- Finding hashicorp/azurerm versions matching ">= 4.55.0"...
- Finding azure/azapi versions matching ">= 2.0.0"...
- Finding hashicorp/random versions matching ">= 3.6.0"...
- Installing hashicorp/azurerm v5.5.0...
- Installed hashicorp/azurerm v5.5.0 (signed by HashiCorp)
- Installing azure/azapi v2.12.0...
- Installed azure/azapi v2.12.0 (signed by a HashiCorp partner, key ID 6F0B91BDE98478CF)
- Installing hashicorp/random v3.9.1...
- Installed hashicorp/random v3.9.1 (signed by HashiCorp)
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://developer.hashicorp.com/terraform/cli/plugins/signing

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

│ Warning: Deprecated flag: -state

│ Use the "path" attribute within the "local" backend to specify a file for state storage


Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # azapi_resource.claude_opus[0] will be created
  + resource "azapi_resource" "claude_opus" {
      + body                      = {
          + properties = {
              + model                = {
                  + format  = "Anthropic"
                  + name    = "claude-opus-4-8"
                  + version = "1"
                }
              + modelProviderData    = {
                  + countryCode      = "US"
                  + industry         = "technology"
                  + organizationName = "REDACTED"
                }
              + raiPolicyName        = "Microsoft.DefaultV2"
              + versionUpgradeOption = "OnceNewDefaultVersionAvailable"
            }
          + sku        = {
              + capacity = 40
              + name     = "GlobalStandard"
            }
        }
      + id                        = (known after apply)
      + ignore_body_changes       = (write-only attribute)
      + ignore_casing             = false
      + ignore_missing_property   = true
      + ignore_null_property      = false
      + name                      = (known after apply)
      + output                    = (known after apply)
      + parent_id                 = (known after apply)
      + response_export_values    = [
          + "name",
        ]
      + schema_validation_enabled = false
      + sensitive_body            = (write-only attribute)
      + type                      = "Microsoft.CognitiveServices/accounts/deployments@2025-10-01-preview"
    }

  # azapi_resource.foundry will be created
  + resource "azapi_resource" "foundry" {
      + body                      = {
          + kind       = "AIServices"
          + properties = {
              + allowProjectManagement = true
              + customSubDomainName    = (known after apply)
              + disableLocalAuth       = false
              + publicNetworkAccess    = "Enabled"
            }
          + sku        = {
              + name = "S0"
            }
        }
      + id                        = (known after apply)
      + ignore_body_changes       = (write-only attribute)
      + ignore_casing             = false
      + ignore_missing_property   = true
      + ignore_null_property      = false
      + location                  = "swedencentral"
      + name                      = (known after apply)
      + output                    = (known after apply)
      + parent_id                 = (known after apply)
      + response_export_values    = [
          + "name",
          + "identity.principalId",
        ]
      + schema_validation_enabled = true
      + sensitive_body            = (write-only attribute)
      + tags                      = {
          + "azd-env-name" = "rg-claude"
        }
      + type                      = "Microsoft.CognitiveServices/accounts@2025-10-01-preview"

      + identity {
          + principal_id = (known after apply)
          + tenant_id    = (known after apply)
          + type         = "SystemAssigned"
        }
    }

  # azapi_resource.project will be created
  + resource "azapi_resource" "project" {
      + body                      = {
          + properties = {}
        }
      + id                        = (known after apply)
      + ignore_body_changes       = (write-only attribute)
      + ignore_casing             = false
      + ignore_missing_property   = true
      + ignore_null_property      = false
      + location                  = "swedencentral"
      + name                      = (known after apply)
      + output                    = (known after apply)
      + parent_id                 = (known after apply)
      + response_export_values    = [
          + "name",
        ]
      + schema_validation_enabled = true
      + sensitive_body            = (write-only attribute)
      + tags                      = {
          + "azd-env-name" = "rg-claude"
        }
      + type                      = "Microsoft.CognitiveServices/accounts/projects@2025-10-01-preview"

      + identity {
          + principal_id = (known after apply)
          + tenant_id    = (known after apply)
          + type         = "SystemAssigned"
        }
    }

  # azurerm_resource_group.rg will be created
  + resource "azurerm_resource_group" "rg" {
      + id       = (known after apply)
      + location = "swedencentral"
      + name     = "rg-rg-claude"
      + tags     = {
          + "azd-env-name" = "rg-claude"
        }
    }

  # random_string.suffix will be created
  + resource "random_string" "suffix" {
      + id          = (known after apply)
      + length      = 8
      + lower       = true
      + min_lower   = 0
      + min_numeric = 0
      + min_special = 0
      + min_upper   = 0
      + number      = true
      + numeric     = true
      + result      = (known after apply)
      + special     = false
      + upper       = false
    }

Plan: 5 to add, 0 to change, 0 to destroy.

Changes to Outputs:
  + AZURE_LOCATION                = "swedencentral"
  + AZURE_RESOURCE_GROUP          = "rg-rg-claude"
  + CLAUDE_BASE_URL               = (known after apply)
  + CLAUDE_DEPLOYMENT_NAME        = (known after apply)
  + CLAUDE_HAIKU_DEPLOYMENT_NAME  = ""
  + CLAUDE_OPUS_DEPLOYMENT_NAME   = (known after apply)
  + CLAUDE_SONNET_DEPLOYMENT_NAME = ""
  + FOUNDRY_ACCOUNT_NAME          = (known after apply)
  + FOUNDRY_PROJECT_ENDPOINT      = (known after apply)

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Saved the plan to: /home/home/Downloads/claude/infra-terraform/.azure/rg-claude/infra/main.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "/home/home/Downloads/claude/infra-terraform/.azure/rg-claude/infra/main.tfplan"

│ Warning: Deprecated flag: -state

│ Use the "path" attribute within the "local" backend to specify a file for state storage

random_string.suffix: Creating...
random_string.suffix: Creation complete after 0s [id=nhszzeg8]
azurerm_resource_group.rg: Creating...
azurerm_resource_group.rg: Still creating... [00m10s elapsed]
azurerm_resource_group.rg: Still creating... [00m20s elapsed]
azurerm_resource_group.rg: Still creating... [00m30s elapsed]
azurerm_resource_group.rg: Creation complete after 31s [id=/subscriptions/REDACTED/resourceGroups/rg-rg-claude]
azapi_resource.foundry: Creating...
azapi_resource.foundry: Still creating... [00m10s elapsed]
azapi_resource.foundry: Creation complete after 12s [id=/subscriptions/REDACTED/resourceGroups/rg-rg-claude/providers/Microsoft.CognitiveServices/accounts/claude-foundry-nhszzeg8]
azapi_resource.project: Creating...
azapi_resource.project: Creation complete after 5s [id=/subscriptions/REDACTED/resourceGroups/rg-rg-claude/providers/Microsoft.CognitiveServices/accounts/claude-foundry-nhszzeg8/projects/claude-proj-nhszzeg8]
azapi_resource.claude_opus[0]: Creating...
azapi_resource.claude_opus[0]: Still creating... [00m10s elapsed]
azapi_resource.claude_opus[0]: Still creating... [00m20s elapsed]
azapi_resource.claude_opus[0]: Still creating... [00m30s elapsed]
azapi_resource.claude_opus[0]: Still creating... [00m40s elapsed]
azapi_resource.claude_opus[0]: Still creating... [00m50s elapsed]
azapi_resource.claude_opus[0]: Still creating... [01m00s elapsed]
azapi_resource.claude_opus[0]: Still creating... [01m10s elapsed]
azapi_resource.claude_opus[0]: Still creating... [01m20s elapsed]
azapi_resource.claude_opus[0]: Still creating... [01m30s elapsed]
azapi_resource.claude_opus[0]: Still creating... [01m40s elapsed]
azapi_resource.claude_opus[0]: Still creating... [01m50s elapsed]
azapi_resource.claude_opus[0]: Still creating... [02m00s elapsed]
azapi_resource.claude_opus[0]: Still creating... [02m10s elapsed]
azapi_resource.claude_opus[0]: Still creating... [02m20s elapsed]
azapi_resource.claude_opus[0]: Still creating... [02m30s elapsed]
azapi_resource.claude_opus[0]: Still creating... [02m40s elapsed]
azapi_resource.claude_opus[0]: Still creating... [02m50s elapsed]
azapi_resource.claude_opus[0]: Still creating... [03m00s elapsed]
azapi_resource.claude_opus[0]: Still creating... [03m10s elapsed]
azapi_resource.claude_opus[0]: Still creating... [03m20s elapsed]
azapi_resource.claude_opus[0]: Still creating... [03m30s elapsed]
azapi_resource.claude_opus[0]: Still creating... [03m40s elapsed]
azapi_resource.claude_opus[0]: Still creating... [03m50s elapsed]
azapi_resource.claude_opus[0]: Still creating... [04m00s elapsed]
azapi_resource.claude_opus[0]: Still creating... [04m10s elapsed]
azapi_resource.claude_opus[0]: Still creating... [04m20s elapsed]
azapi_resource.claude_opus[0]: Still creating... [04m30s elapsed]
azapi_resource.claude_opus[0]: Still creating... [04m40s elapsed]
azapi_resource.claude_opus[0]: Still creating... [04m50s elapsed]
azapi_resource.claude_opus[0]: Still creating... [05m00s elapsed]
azapi_resource.claude_opus[0]: Still creating... [05m10s elapsed]
azapi_resource.claude_opus[0]: Still creating... [05m20s elapsed]

│ Error: Failed to create/update resource

│   with azapi_resource.claude_opus[0],
│   on main.tf line 184, in resource "azapi_resource" "claude_opus":
│  184: resource "azapi_resource" "claude_opus" {

│ creating/updating Resource: (ResourceId
│ "/subscriptions/REDACTED/resourceGroups/rg-rg-claude/providers/Microsoft.CognitiveServices/accounts/claude-foundry-nhszzeg8/deployments/claude-opus-4-8-nhszze" / Api Version
│ "2025-10-01-preview"): GET
│ https://management.azure.com/subscriptions/REDACTED/providers/Microsoft.CognitiveServices/locations/swedencentral/operationResults/REDACTED
│ --------------------------------------------------------------------------------
│ RESPONSE 200: 200 OK
│ ERROR CODE: MarketplaceSubscriptionCannotBeCompleted
│ --------------------------------------------------------------------------------
│ {
│   "id": "/subscriptions/REDACTED/providers/Microsoft.CognitiveServices/locations/swedencentral/operationResults/REDACTED",
│   "name": "REDACTED",
│   "status": "Failed",
│   "startTime": "2026-09-17T13:26:23Z",
│   "endTime": "2026-09-17T13:31:30Z",
│   "percentComplete": 0.0,
│   "error": {
│     "code": "MarketplaceSubscriptionCannotBeCompleted",
│     "message": "Unable to create a model deployment for model claude-opus-4-8. If the error persists, please contact HIT (Human Intelligence Team) via this link: https://go.microsoft.com/fwlink/?linkid=2101400&clcid=0x409 and request to allowlist the Azure subscription."
│   }
│ }
│ --------------------------------------------------------------------------------



ERROR: deployment failed: step "provision" failed: deploying layer provision: error deploying infrastructure: template Deploy failed:  , err:failed running terraform apply:  (exit code: 1)
TraceID: REDACTED

Confirmations

  • I checked existing issues and didn't find a duplicate.
  • I redacted all subscription / tenant / object IDs and any secrets from logs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions