microsoft-foundry / microsoft-foundry/foundry-samples

"Failed to Create the resource. Provisioning state: Failed"

Open
#333 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Bicep
Stars
445
Forks
494
Avg merge
11h 35m
Merged PRs (30d)
38

Description

I'm trying to create AI Foundry, using Terraform azapi provider:-
resource "azapi_resource" "foundry" {
type = "Microsoft.CognitiveServices/accounts@2025-04-01-preview"
name = local.resource_name
parent_id = data.azurerm_resource_group.rg.id
location = var.azure_region
tags = merge({ Name = "${local.resource_name}" }, var.tags)
schema_validation_enabled = false
body = {
kind = "AIServices"
sku = {
name = var.sku
}
identity = {
type = "SystemAssigned"
}
properties = {
disableLocalAuth = var.disable_local_auth
allowProjectManagement = true
publicNetworkAccess = var.public_network_access
restrictOutboundNetworkAccess = var.restrict_outbound_network_access
customSubDomainName = local.resource_name
networkAcls = var.network_acls == null ? null : {
bypass = var.network_acls.bypass
defaultAction = var.network_acls.defaultAction
ipRules = [
for ip_rule in lookup(var.network_acls, "ip_rules", []) : {
value = ip_rule.value
}
]
virtualNetworkRules = [
for vnet_rule in lookup(var.network_acls, "virtual_network_rules", []) : {
id = vnet_rule.id
ignoreMissingVnetServiceEndpoint = lookup(vnet_rule, "ignore_missing_vnet_service_endpoint", false)
state = lookup(vnet_rule, "state", "Succeeded")
}
]
}
networkInjections = var.network_injection == null ? null : [
{
scenario = var.network_injection.scenario
subnetArmId = var.network_injection.subnet_arm_id
useMicrosoftManagedNetwork = var.network_injection.use_microsoft
}
]
}
}
provider = azapi.azapi
}

But when trying to deploy, we are facing multiple failures; twice it has succeeded. But today onwards, facing the 404 error, and these
"message": "Failed to create Aml RP virtual workspace due to System.Exception: Failed async operation {\n "status": "Failed",\n "error": {\n "code": "InternalServerError",\n "message": "Object reference not set to an instance of an object."\n }\n}\n at Microsoft.CognitiveServices.ResourceProvider.AmlRp.AsyncOperationHelper.PollUntilCompleteAsync[T](TraceContext traceContext, HttpResponseMessage response, HttpClient httpClient, Int32 timeoutInMin, CancellationToken cancellationToken) in /__w/1/s/src/Common/ResourceProvider/AmlRp/AsyncOperationHelper.cs:line 117\n at Microsoft.CognitiveServices.ResourceProvider.AmlRp.AmlRpClient.PutAmlRpVirtualHubAsync(TraceContext traceContext, Dictionary2 headers, ResourceIdentityInArm resourceIdentity, String primaryUserAssignedIdentity, String internalId, KeyVaultProperties keyVaultProperties, String subscriptionId, String resourceGroupName, String workspaceName, List1 networkInjections, PublicNetworkAccessType publicNetworkAccessType, CancellationToken cancellationToken) in /__w/1/s/src/Common/ResourceProvider/AmlRp/AmlRpClient.cs:line 119\n at Microsoft.CognitiveServices.ResourceProvider.AmlRp.AmlRpService.PutAmlRpWorkspaceAsync(TraceContext traceContext, ResourceRequestContext requestContext, WorkerMessageRequestContext workerMessageRequestContext, IResourceEntity insertedResourceEntity, CancellationToken cancellationToken) in /__w/1/s/src/Common/ResourceProvider/AmlRp/AmlRpService.cs:line 124\n at Microsoft.CognitiveServices.ResourceProvider.Worker.MessageProcessor.ProcessInternalAsync(TraceContext traceContext, RpWorkerQueueMessage message, CancellationToken cancellationToken) in /__w/1/s/src/ResourceProvider/Rp.WorkerRole/AccountProvisioning/MessageProcessor.cs:line 225"

I'm using the Class B subnet, with required .app delegation everything, once worked with same rg deployment now its not working with any type cross rg or same rg, guys can you please provide any fix ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the azapi_resource block using Microsoft.CognitiveServices/accounts@2025-04-01-preview and reproduce the deployment with the shown network injection and Class B subnet settings. Review the provisioning response and the AmlRp virtual workspace failure details; done means identifying a reliable configuration or deployment path that creates the AI Foundry resource successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, terraform
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.