microsoft/aspire · error
ManagedClusterProperties.IngressProfile not found via…
Error message
ManagedClusterProperties.IngressProfile not found via reflection. The Azure.Provisioning surface may have changed; review AksPreviewIngressProfileInjector.
What it means
After obtaining the internal ManagedClusterProperties instance, the injector reflects for its IngressProfile property; if GetProperty("IngressProfile", Public|NonPublic|Instance) finds nothing, this error is thrown. It guards the reflection contract that ManagedClusterProperties owns an IngressProfile complex object, which is the target construct on which the preview gatewayAPI/applicationLoadBalancer Bicep entries are defined.
Solutions
- Pin Azure.Provisioning.ContainerService to 1.0.0-beta.6 in Directory.Packages.props until upstream exposes ManagedClusterIngressProfile publicly
- If the new version exposes IngressProfile (or GatewayApi/ApplicationLoadBalancer) as public typed properties, replace the reflection injector with the standard public-subclass extension pattern and delete the reflection code
- If the property was renamed in the installed version, update the GetProperty("IngressProfile", ...) lookup in GetIngressProfileInstance to the new member name
- Clear NuGet caches and restore to rule out a stale assembly, then confirm with dotnet list package --include-transitive that only one Azure.Provisioning.ContainerService version is bound
- Track microsoft/aspire#17060 and Azure/azure-sdk-for-net#59225 for the proper upstream fix
Example fix
// before
var ipProp = clusterProps.GetType().GetProperty("IngressProfile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
?? throw new InvalidOperationException("...IngressProfile not found...");
// after (if upstream made it public with a new typed accessor)
var ingressProfile = ((ContainerServiceManagedCluster)aks).IngressProfile
?? throw new InvalidOperationException("IngressProfile unavailable in this Azure.Provisioning version."); Defensive patterns
Strategy: fallback
Validate before calling
var ipProp = typeof(object).Assembly
.GetTypes().Where(t => t.FullName == "Azure.Provisioning.ContainerService.ManagedClusterProperties")
.Select(t => t.GetProperty("IngressProfile", BindingFlags.Public | BindingFlags.NonPublic | Instance))
.FirstOrDefault();
if (ipProp is null)
{
throw new InvalidOperationException("ManagedClusterProperties.IngressProfile is unavailable; pin Azure.Provisioning.ContainerService 1.0.0-beta.6 or use the typed public API.");
} Try / catch
try
{
AksPreviewIngressProfileInjector.Inject(aks, gatewayApi, applicationLoadBalancer);
}
catch (InvalidOperationException ex) when (ex.Message.Contains("IngressProfile not found"))
{
throw new InvalidOperationException($"Installed Azure.Provisioning.ContainerService no longer exposes ManagedClusterProperties.IngressProfile; preview AKS ingress features cannot be injected. Pinned version required.", ex);
} Prevention
- Pin Azure.Provisioning.ContainerService to 1.0.0-beta.6 until ManagedClusterIngressProfile is public
- Review azure-sdk-for-net ContainerService breaking-change notes before every package upgrade
- Keep the reflection member names ('Properties', 'IngressProfile') in one small, tested place so drift fixes are single-line
- Add a unit test asserting the reflection lookups resolve so package drift is caught in CI
- Migrate to the typed public API as soon as aspire#17060 / Azure#59225 land upstream
When it happens
Trigger: AksPreviewIngressProfileInjector.Inject is called with gatewayApi or applicationLoadBalancer enabled, and the installed Azure.Provisioning.ContainerService version renamed, removed, or restructured the IngressProfile property on ManagedClusterProperties (e.g. moved it or split it into separate typed properties).
Common situations: Upgrading Azure.Provisioning.ContainerService beyond the beta Aspire pinned; a transitive package bump in azure-sdk-for-net betas; running an older/newer Aspire build against a newer provisioning package where the ingress model was reshaped.
Related errors
- ContainerServiceManagedCluster.Properties not found via…
- ProvisionableConstruct.DefineProperty
- ContainerServiceManagedCluster.Properties returned null.
- Expected IngressProfile to be a…
- ManagedClusterProperties.IngressProfile was null even after…
AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16).
Data as JSON: /api/errors/78c8463bf4b652f0.
Report an issue: GitHub.
Appendix: source
Thrown at src/Aspire.Hosting.Azure.Kubernetes/AksPreviewIngressProfileInjector.cs:172
enabled.Assign(true);
}
}
private static object GetIngressProfileInstance(ContainerServiceManagedCluster aks)
{
// ContainerServiceManagedCluster.Properties is internal and exposes the
// ManagedClusterProperties complex object that owns IngressProfile (also internal).
var clusterPropsProp = typeof(ContainerServiceManagedCluster).GetProperty(
"Properties",
BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
?? throw new InvalidOperationException("ContainerServiceManagedCluster.Properties not found via reflection. The Azure.Provisioning surface may have changed; review AksPreviewIngressProfileInjector.");
var clusterProps = clusterPropsProp.GetValue(aks)
?? throw new InvalidOperationException("ContainerServiceManagedCluster.Properties returned null.");
var ipProp = clusterProps.GetType().GetProperty(
"IngressProfile",
BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
?? throw new InvalidOperationException("ManagedClusterProperties.IngressProfile not found via reflection. The Azure.Provisioning surface may have changed; review AksPreviewIngressProfileInjector.");
var ipInstance = ipProp.GetValue(clusterProps)
?? throw new InvalidOperationException("ManagedClusterProperties.IngressProfile was null even after assigning IngressWebAppRouting; the Azure.Provisioning lazy-initialization behavior may have changed.");
if (ipInstance.GetType().FullName != IngressProfileTypeFullName)
{
throw new InvalidOperationException($"Expected IngressProfile to be a {IngressProfileTypeFullName} but found {ipInstance.GetType().FullName}.");
}
return ipInstance;
}
}
View on GitHub (pinned to 25830f84bd)