g

    glamorous-waitress-51149

    1 month ago
    this is similar to my issue. is there a way to add to a container app’s env vars the url of the container app that is being created? You can get the url like so
    Url      = Output.Format($"https://{app.Configuration.Apply(x => x!.Ingress).Apply(x => x!.Fqdn)}");
    but obviously it’s cyclic dependency issue, you’re trying to add the url to the envvars but the url doesn’t exist yet
    e

    echoing-dinner-19531

    1 month ago
    Circular dependencies aren't really supported at the moment, there's some tricks to work around it explained in https://www.pulumi.com/blog/exploring-circular-dependencies/ but all a bit odd
    g

    glamorous-waitress-51149

    1 month ago
    Thanks
    f

    fast-vr-6049

    1 month ago
    A container apps specific workaround could be using a custom DNS address + SSL certificate. That way, you can set the DNS address as a pulumi config value, provision the custom address, and pass the already-known custom address into the container app's env vars
    g

    glamorous-waitress-51149

    1 month ago
    i found i could do this due , the envvar coming from MS
    public static Uri GetContainerAppAddress(string name, bool secure = true, int? port = null) {
            if (IsNullOrWhiteSpace(name))
                throw new ArgumentException("Container App name cannot be null or whitespace.", nameof(name));
    
            var suffix = Environment.GetEnvironmentVariable("CONTAINER_APP_ENV_DNS_SUFFIX");
            var host   = $"{name}{(suffix is not null ? $".{suffix}" : "")}";
            var url    = $"{(secure ? "https" : "http")}://{host}{(port is not null ? $":{port}" : "")}";
            
            return new Uri(url);
        }
    f

    fast-vr-6049

    1 month ago
    Good call!