-
Notifications
You must be signed in to change notification settings - Fork 597
Add support for Keycloak deployment to ACA #8478
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
base: main
Are you sure you want to change the base?
Conversation
@dotnet-policy-service agree |
.WithHttpEndpoint(targetPort: ManagementInterfaceContainerPort, name: ManagementEndpointName) | ||
.WithHttpHealthCheck(endpointName: ManagementEndpointName, path: "/health/ready") | ||
.WithEnvironment(context => | ||
{ | ||
context.EnvironmentVariables[AdminEnvVarName] = resource.AdminReference; | ||
context.EnvironmentVariables[AdminPasswordEnvVarName] = resource.AdminPasswordParameter; | ||
context.EnvironmentVariables[HealthCheckEnvVarName] = "true"; | ||
if (port == HttpsContainerPort) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not following why this is the predicate for setting all the config to setup Keycloak for running behind a reverse proxy. My reading of this is that when the user specifies the port
to be 8443
, we configure the Keycloak container as if it's running behind a reverse proxy, but also enable non-HTTPS? How is it expected this will be used, i.e. what will the app host code look like?
Description
Per #6004, deploying a container provisioned via the Keycloak integration won't start in Azure Container Apps (ACA).
ACA will try to activate it, but it continuously fails.
The container reports this in the logs:
Key material not provided to setup HTTPS. Please configure your keys/certificates or start the server in development mode.
This PR includes a basic starting point for changes required to get Keycloak working in Azure Container Apps.
See my comment on #6004 showing what is necessary to get Keycloak working on ACA.
Currently, this only outputs the additional env vars if the passed port is 8443. Otherwise, it behaves as before for local dev scenarios. Open to making additional changes based on review and suggestions, but wanted to show bare minimum to get it working and be able to support ACA and SSL.
To opt-in to this configuration for deployment to ACA, users would simply specify port 8443 in the call to AddKeycloak like so:
OR
Another option would be an explicit Publish extension method similar to
PublishAsAzurePostgresFlexibleServer
onIResourceBuilder<KeycloakResource>
builder for more fine-grained control over these settings.Fixes #6004
Checklist
<remarks />
and<code />
elements on your triple slash comments?breaking-change
template):doc-idea
template):