{"record":{"id":"e5f95ed8ada572a9","repo":"microsoft/aspire","slug":"foundry-project-parent-name-did-not-resolve-to-an-absolute","errorCode":null,"errorMessage":"Foundry project '{Parent.Name}' did not resolve to an absolute HTTPS endpoint.","messagePattern":"Foundry project '(.+?)' did not resolve to an absolute HTTPS endpoint\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Foundry/Toolbox/FoundryToolboxResource.cs","lineNumber":270,"sourceCode":"\n        var definition = await CreateDeploymentDefinitionAsync(cancellationToken).ConfigureAwait(false);\n        var result = await new FoundryToolboxReconciler(administration)\n            .ReconcileAsync(definition, Version, cancellationToken).ConfigureAwait(false);\n        DeployedVersion.Set(result.Version);\n\n        return result;\n    }\n\n    private async Task<IFoundryToolboxAdministration> CreateAdministrationAsync(\n        PipelineStepContext context,\n        Action<string> logRetry,\n        CancellationToken cancellationToken)\n    {\n        var projectEndpoint = await Parent.Endpoint.GetValueAsync(cancellationToken).ConfigureAwait(false);\n        if (!Uri.TryCreate(projectEndpoint, UriKind.Absolute, out var endpoint) ||\n            endpoint.Scheme != Uri.UriSchemeHttps)\n        {\n            throw new InvalidOperationException(\n                $\"Foundry project '{Parent.Name}' did not resolve to an absolute HTTPS endpoint.\");\n        }\n\n        endpoint = new Uri(endpoint.GetLeftPart(UriPartial.Path).TrimEnd('/'));\n\n        var administration = context.Services.GetService<IFoundryToolboxAdministration>();\n        if (administration is null)\n        {\n            var credential = context.Services.GetRequiredService<ITokenCredentialProvider>().TokenCredential;\n            var clientOptions = new AIProjectClientOptions();\n            clientOptions.AddPolicy(new FoundryToolboxFeaturesPolicy(), PipelinePosition.PerCall);\n            var projectClient = new AIProjectClient(endpoint, credential, clientOptions);\n            administration = new AzureFoundryToolboxAdministration(\n                projectClient.AgentAdministrationClient.GetAgentToolboxes(),\n                logRetry);\n        }\n\n        return administration;","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Foundry/Toolbox/FoundryToolboxResource.cs#L252-L288","documentation":"When building the toolbox administration client, the resource resolves its parent Foundry project's Endpoint reference and requires an absolute HTTPS URI (the Foundry API is HTTPS-only). If the endpoint reference has not resolved, is relative, or is not https, administration cannot be constructed and it throws.","triggerScenarios":"CreateAdministrationAsync reading Parent.Endpoint.GetValueAsync and getting null/empty, a relative URL, or an http:// URL — e.g., the project resource has no HTTPS endpoint defined, or the endpoint expression hasn't been evaluated yet at deploy time.","commonSituations":"The Foundry project was configured with only an http endpoint reference; the endpoint reference points at a resource that hasn't produced a value (missing connection string/endpoint configuration); a custom emulator URL using http instead of https.","solutions":["Ensure the Foundry project resource exposes an absolute HTTPS endpoint (check its endpoint/connection configuration).","Verify the referenced endpoint resource actually runs and publishes its endpoint before the toolbox deploys.","If using a custom/local endpoint, switch it to https or use the real Foundry project endpoint.","Check the project's Endpoint reference in the AppHost — it must be set, not null."],"exampleFix":"// before\nvar project = builder.AddAzureFoundryProject(\"foundry\").WithEndpoint(\"http://localhost:8080\");\n// after\nvar project = builder.AddAzureFoundryProject(\"foundry\").WithEndpoint(\"https://my-project.services.ai.azure.com\");","handlingStrategy":"validation","validationCode":"var ep = projectEndpointValue;\nif (ep is null || !Uri.TryCreate(ep, UriKind.Absolute, out var uri) || uri.Scheme != \"https\") throw new InvalidOperationException($\"Project endpoint must be absolute HTTPS, got: {ep}\");","typeGuard":"static bool IsAbsoluteHttps(string? value) => Uri.TryCreate(value, UriKind.Absolute, out var u) && u.Scheme == Uri.UriSchemeHttps;","tryCatchPattern":"catch (InvalidOperationException ex) when (ex.Message.Contains(\"did not resolve to an absolute HTTPS endpoint\")) { /* fix the project endpoint configuration */ }","preventionTips":["Always configure Foundry project resources with an https endpoint reference.","Verify endpoint references resolve before deploy-time operations.","Never point Foundry resources at http:// local addresses."],"tags":["endpoint","https","configuration","foundry","azure"],"backgroundTag":"invalid-url-format","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}