microsoft/semantic-kernel · error · KernelException
The address '{address}' for the '{operation.Name}' gRPC oper
Error message
The address '{address}' for the '{operation.Name}' gRPC operation is not a valid absolute URI. What it means
Thrown after the address is non-empty but `Uri.TryCreate(address, UriKind.Absolute, ...)` fails, meaning the string is not a syntactically valid absolute URI. Relative paths, scheme-less strings, or malformed URLs all trigger this.
Source
Thrown at dotnet/src/Functions/Functions.Grpc/GrpcOperationRunner.cs:179
string? address;
if (this._addressOverride is not null)
{
address = this._addressOverride.AbsoluteUri;
}
else
{
address = operation.Address;
}
if (string.IsNullOrEmpty(address))
{
throw new KernelException($"No address provided for the '{operation.Name}' gRPC operation.");
}
if (!Uri.TryCreate(address, UriKind.Absolute, out var addressUri))
{
throw new KernelException($"The address '{address}' for the '{operation.Name}' gRPC operation is not a valid absolute URI.");
}
// Validate scheme
if (!this._allowedSchemes.Contains(addressUri.Scheme, StringComparer.OrdinalIgnoreCase))
{
throw new KernelException($"The URI scheme '{addressUri.Scheme}' is not allowed for the '{operation.Name}' gRPC operation. Allowed schemes: {string.Join(", ", this._allowedSchemes)}.");
}
// Validate against allowed addresses
if (this._allowedAddresses is { Count: > 0 })
{
bool isAllowed = false;
foreach (var allowedAddress in this._allowedAddresses)
{
string allowedUri = allowedAddress.AbsoluteUri;
if (addressUri.AbsoluteUri.StartsWith(allowedUri, StringComparison.OrdinalIgnoreCase))
{View on GitHub (pinned to c028a0c7dc)
Solutions
- Prefix the address with a scheme, e.g. `https://localhost:5001`.
- Trim whitespace and validate with Uri.TryCreate yourself before registering.
- Use a Uri instance for AddressOverride rather than a raw string.
Example fix
// before address = "localhost:5001"; // after address = "https://localhost:5001";
Defensive patterns
Strategy: validation
Validate before calling
if (!Uri.TryCreate(address, UriKind.Absolute, out _))
throw new InvalidOperationException($"Address is not an absolute URI: {address}"); Prevention
- Prefer passing Uri objects for AddressOverride.
- Always include the scheme in address strings.
When it happens
Trigger: Address string like `localhost:5001`, `//service`, `/api`, or containing illegal characters that cannot be parsed as an absolute Uri.
Common situations: Omitting the scheme (`https://`); a typo; a templated placeholder that was never substituted; trailing/leading whitespace.
Related errors
- No address provided for the '{operation.Name}' gRPC operatio
- The URI scheme '{addressUri.Scheme}' is not allowed for the
- The address '{address}' is not allowed for the '{operation.N
- No .proto document for the specified path - {filePath} is fo
- No '{GrpcOperation.PayloadArgumentName}' argument representi
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/2b76f4560e39c0b2.
Report an issue: GitHub.