Open harouny opened 5 months ago
You can get the default domain in Bicep from properties.defaultDomain
in the environment. See this example: https://github.com/Azure/aca-landing-zone-accelerator/blob/f46047fa2e136621f7e8a13fd5e50b05274000ab/scenarios/aca-internal/bicep/modules/06-front-door/deploy.front-door.bicep#L81
You can also use the CONTAINER_APP_HOSTNAME
environment variable to get this value for the current app. There's also CONTAINER_APP_ENV_DNS_SUFFIX
if you just need the suffix without the app name. However, it doesn't look like NextAuth.js is able to read the value from a variable that's not named NEXTAUTH_URL
.
Each Container Apps environment has a unique generated default domain. One reason it's needed is to prevent subdomain takeovers.
I'm in the same boat. Container Apps seems to be built on Kubernetes, does it also allow variable expansion?
This would allow for NEXTAUTH_URL=$(CONTAINER_APP_HOSTNAME)
.
I'm in the same boat. Container Apps seems to be built on Kubernetes, does it also allow variable expansion?
This would allow for
NEXTAUTH_URL=$(CONTAINER_APP_HOSTNAME)
.
I did a quick test and the above did work.
azurecontainerapps.io
provided domain name to access the app instead of custom domains.NEXTAUTH_URL
which should match the host name the app uses. (more info)The problem is: Application URL is something like this: https://
<defined app name>
.jollyriver-592af9d6.<defined region>
.azurecontainerapps.ioWhere
jollyriver-592af9d6
is a generated string not defined by me, so I can't know it beforehand to set the environment variableNEXTAUTH_URL
as part of provisioning the whole container app.Question What is
jollyriver-592af9d6
and why it is needed?Feature request Can we control that string, for example pass it through when the Container App or Container App Environment is created?