-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom ports not used for ingress in ACA #4232
Comments
Can you say what version of azd you are using and can you also run
in the apphost directory and paste the output here? |
The ingress is correct, that's the container port i.e.g the one you are bound to in the container itself. The "port" is what other containers use to talk to you, not what you are bound to. |
azd version 1.9.2 (commit c58b02f71710960aba28f81f3698e64cfdda9f96) Manifest looks pretty good: {
"resources": {
"application-insights": {
"type": "azure.bicep.v0",
"connectionString": "{application-insights.outputs.appInsightsConnectionString}",
"path": "application-insights.module.bicep",
"params": {
"logAnalyticsWorkspaceId": ""
}
},
"kafka": {
"type": "container.v0",
"connectionString": "{kafka.bindings.tcp.host}:{kafka.bindings.tcp.port}",
"image": "docker.io/confluentinc/confluent-local:7.6.1",
"env": {
"KAFKA_ADVERTISED_LISTENERS": "PLAINTEXT://localhost:29092,PLAINTEXT_HOST://localhost:9092"
},
"bindings": {
"tcp": {
"scheme": "tcp",
"protocol": "tcp",
"transport": "tcp",
"port": 6000,
"targetPort": 9092
}
}
},
"postgres": {
"type": "container.v0",
"connectionString": "Host={postgres.bindings.tcp.host};Port={postgres.bindings.tcp.port};Username=postgres;Password={postgres-password.value}",
"image": "docker.io/library/postgres:16.2",
"env": {
"POSTGRES_HOST_AUTH_METHOD": "scram-sha-256",
"POSTGRES_INITDB_ARGS": "--auth-host=scram-sha-256 --auth-local=scram-sha-256",
"POSTGRES_USER": "postgres",
"POSTGRES_PASSWORD": "{postgres-password.value}"
},
"bindings": {
"tcp": {
"scheme": "tcp",
"protocol": "tcp",
"transport": "tcp",
"port": 6001,
"targetPort": 5432
}
}
},
"ride-service": {
"type": "project.v0",
"path": "../Application.RideService/Application.RideService.csproj",
"env": {
"OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES": "true",
"OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES": "true",
"OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY": "in_memory",
"ASPNETCORE_FORWARDEDHEADERS_ENABLED": "true",
"APPLICATIONINSIGHTS_CONNECTION_STRING": "{application-insights.connectionString}",
"ConnectionStrings__postgres": "{postgres.connectionString}",
"ConnectionStrings__kafka": "{kafka.connectionString}"
},
"bindings": {
"http": {
"scheme": "http",
"protocol": "tcp",
"transport": "http"
},
"https": {
"scheme": "https",
"protocol": "tcp",
"transport": "http"
}
}
},
"postgres-password": {
"type": "parameter.v0",
"value": "{postgres-password.inputs.value}",
"inputs": {
"value": {
"type": "string",
"secret": true,
"default": {
"generate": {
"minLength": 22
}
}
}
}
}
}
} Looks like the problem is with the That immediately brings up another issue though. The KAFKA_ADVERTISED_LISTENERS environment variable is set to I guess I can override the env var in publish mode as a workaround? |
@vhvb1989 Looks like this is a problem. @amolenk can you file this one on https://github.com/Azure/azure-dev/issues. Also as a future debugging tip, run
This was recently fixed aspire/src/Aspire.Hosting.Kafka/KafkaBuilderExtensions.cs Lines 123 to 126 in 90cd4b5
Yes, you should be able to copy this logic and override it in the kafka container |
@davidfowl I'd expected the KAFKA_ADVERTISED_LISTENERS fix to be part of the 8.0.1 release, but it looks like it's not. Any idea when the fix will be released? |
The release after that. 8.0.1 doesn't have any of the features in main. We're still working out the scope and date for that release. For now, just copy the code above into your project as a workaround. |
I've got an AppHost project with custom ports for Kafka and Postgres:
This works well locally, but when I deploy to Azure Container Apps using
azd
the custom ports aren't taken into consideration.This is the ingress that's configured for the kafka container:
Meanwhile, the connection string secrets of the ride-service are set as follows:
The result is that the ride-service cannot reach the Kafka cluster.
The text was updated successfully, but these errors were encountered: