microsoft-foundry / microsoft-foundry/foundry-samples
Failed to Create the resource. Provisioning state: Failed
Nobody has claimed this yet.
- Dominant language
- Bicep
- Stars
- 445
- Forks
- 494
- Avg merge
- 11h 35m
- Merged PRs (30d)
- 38
Description
Hi,
I tried using infra code in here and I am facing below error. Let me know if fix is available.
Region = "eastus"
name = asvc-{random_value}
vnet ip ranges = 172.16.0.0/21
API version = 2025-04-01-preview, 2025-07-01-preview, 2025-06-01
aiservice.tf
resource "azapi_resource" "ai_foundry" {
type = "Microsoft.CognitiveServices/accounts@${local.api_version}"
name = "aisvc-${local.prefix}"
parent_id = azurerm_resource_group.main.id
location = azurerm_resource_group.main.location
schema_validation_enabled = false
body = {
kind = "AIServices"
sku = {
name = "S0"
}
identity = {
type = "SystemAssigned"
}
properties = {
disableLocalAuth = false
allowProjectManagement = true
customSubDomainName = "aisvc-${local.prefix}"
publicNetworkAccess = "Disabled"
networkAcls = {
defaultAction = "Allow"
}
networkInjections = [
{
scenario = "agent"
subnetArmId = azurerm_subnet.subnet_agent.id
useMicrosoftManagedNetwork = false
}
]
}
}
}
Error log
--------------------------------------------------------------------------------
│ RESPONSE 200: 200 OK
│ ERROR CODE: OperationError
│ --------------------------------------------------------------------------------
│ {
│ "id": "/subscriptions/<SUBSCRIPTION_ID>/providers/Microsoft.CognitiveServices/locations/eastus/operationResults/be941a5a-5c06-4e4e-bc43-b574029a9967",
│ "name": "be941a5a-5c06-4e4e-bc43-b574029a9967",
│ "status": "Failed",
│ "startTime": "2025-09-12T08:25:25Z",
│ "endTime": "2025-09-12T08:29:21Z",
│ "error": {
│ "code": "OperationError",
│ "message": "Failed to Create the resource. Provisioning state: Failed",
│ "details": [
│ {
│ "code": "ResourceProviderError",
│ "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\": \"InternalServerError\"\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, Dictionary`2 headers, ResourceIdentityInArm resourceIdentity, String primaryUserAssignedIdentity, String internalId, KeyVaultProperties keyVaultProperties, String subscriptionId, String resourceGroupName, String workspaceName, List`1 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 223"
│ }
│ ]
│ }
│ }
│ --------------------------------------------------------------------------------
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with samples/microsoft/infrastructure-setup-terraform/15b-private-network-standard-agent-setup-byovnet and inspect aiservice.tf, using the reported eastus region, API versions, and network settings. Reproduce the deployment and compare the provisioning operation log, including the Aml RP virtual workspace failure. Done means the sample creates the resource successfully or the issue documents a confirmed provider limitation and workaround.
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