{"record":{"id":"07f22f00a0cc082f","repo":"microsoft/aspire","slug":"toolbox-name-did-not-resolve-to-an-absolute-https-endpoint","errorCode":null,"errorMessage":"Toolbox '{Name}' did not resolve to an absolute HTTPS endpoint.","messagePattern":"Toolbox '(.+?)' 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":421,"sourceCode":"\n            await notificationService.PublishUpdateAsync(this, snapshot => snapshot with\n            {\n                State = new(KnownResourceStates.FailedToStart, KnownResourceStateStyles.Error)\n            }).ConfigureAwait(false);\n        }\n    }\n\n    private async Task WaitForToolDiscoveryAsync(\n        PipelineStepContext context,\n        string reconciledVersion,\n        CancellationToken cancellationToken)\n    {\n        var endpointValue = await GetVersionUriExpression(reconciledVersion)\n            .GetValueAsync(cancellationToken).ConfigureAwait(false);\n        if (!Uri.TryCreate(endpointValue, UriKind.Absolute, out var endpoint) ||\n            endpoint.Scheme != Uri.UriSchemeHttps)\n        {\n            throw new InvalidOperationException(\n                $\"Toolbox '{Name}' did not resolve to an absolute HTTPS endpoint.\");\n        }\n\n        var credential = context.Services.GetRequiredService<ITokenCredentialProvider>().TokenCredential;\n        var accessToken = await credential.GetTokenAsync(\n            new TokenRequestContext([AuthorizationScopeValue]),\n            cancellationToken).ConfigureAwait(false);\n        var requiredToolNames = _tools\n            .Where(tool => tool is not FoundryToolboxMcpToolDefinition)\n            .Select(tool => tool.Name)\n            .ToArray();\n        var requiredMcpServerLabels = _tools\n            .OfType<FoundryToolboxMcpToolDefinition>()\n            .Select(tool => tool.ServerLabel)\n            .ToArray();\n        var client = context.Services.GetRequiredService<IHttpClientFactory>().CreateClient();\n        await new FoundryToolboxReadinessProbe(client).WaitForToolsAsync(\n            endpoint,","sourceCodeStart":403,"sourceCodeEnd":439,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Foundry/Toolbox/FoundryToolboxResource.cs#L403-L439","documentation":"During run-mode deployment verification, WaitForToolDiscoveryAsync resolves the toolbox version's URI expression and requires an absolute HTTPS URL to call the tool-discovery API. If the resolved endpoint value is null, relative, or non-https, discovery cannot proceed and it throws.","triggerScenarios":"DeployForRunModeAsync waiting for tool discovery when GetVersionUriExpression(...).GetValueAsync returns a value that fails Uri.TryCreate with UriKind.Absolute or whose scheme is not https — typically because the toolbox endpoint output hasn't been produced or points at an http address.","commonSituations":"The Foundry project endpoint misconfigured (http instead of https) so the derived toolbox URI inherits the wrong scheme; deployment outputs not yet propagated when run-mode verification starts; a proxy/emulator URL that is not absolute https.","solutions":["Ensure the Foundry project/endpoint is an absolute HTTPS URL so the derived toolbox URI is https.","Confirm the deployment step that produces the toolbox version URI completed successfully before run mode.","Inspect the resolved endpoint expression value in the dashboard/logs and correct the source endpoint.","If using a local emulator, expose it over https or target the real Foundry service."],"exampleFix":"// before\n.WithEndpoint(new EndpointReference(emu, \"http\")); // produces http:// toolbox URI\n// after\n.WithEndpoint(new EndpointReference(emu, \"https\")); // absolute https toolbox URI","handlingStrategy":"validation","validationCode":"var v = await versionUriExpression.GetValueAsync(ct);\nif (!Uri.TryCreate(v, UriKind.Absolute, out var uri) || uri.Scheme != \"https\") throw new InvalidOperationException($\"Toolbox endpoint must be absolute HTTPS, got: {v}\");","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\")) { /* inspect the resolved version URI and fix the source endpoint */ }","preventionTips":["Keep the upstream Foundry project endpoint https so derived toolbox URIs inherit the right scheme.","Ensure the deploy step that emits the toolbox version URI completes before run-mode verification.","Log resolved endpoint expressions when debugging run mode."],"tags":["endpoint","https","url","tool-discovery","foundry"],"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"}