-
Notifications
You must be signed in to change notification settings - Fork 162
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
containerApp evn var collections #922
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,12 @@ type ContainerAppConfig = | |
ImageRegistryCredentials : ImageRegistryAuthentication list | ||
Containers : ContainerConfig list | ||
Dependencies : Set<ResourceId> } | ||
|
||
member this.ResourceId = containerApps.resourceId this.Name | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think line 51 is correct actually, wondering if I should fix that too. I'm thinking it should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you are right, it's the managed environment, so this is a lurking bug. |
||
member this.LatestRevisionFqdn = | ||
ArmExpression | ||
.reference(containerApps, this.ResourceId) | ||
.Map(sprintf "%s.latestRevisionFqdn") | ||
|
||
type ContainerEnvironmentConfig = | ||
{ Name : ResourceName | ||
InternalLoadBalancerState : FeatureFlag | ||
|
@@ -280,6 +285,11 @@ type ContainerAppBuilder () = | |
EnvironmentVariables = state.EnvironmentVariables.Add (EnvVar.create key.Value key.Value) | ||
} | ||
|
||
/// Adds an application secrets to the Azure Container App. | ||
[<CustomOperation "add_secret_parameters">] | ||
member __.AddSecretParameters (state:ContainerAppConfig, keys:#seq<_>) = | ||
keys |> Seq.fold (fun s k -> __.AddSecretParameter(s,k)) state | ||
|
||
/// Adds an application secret to the Azure Container App. | ||
[<CustomOperation "add_secret_expression">] | ||
member _.AddSecretExpression (state:ContainerAppConfig, key, expression) = | ||
|
@@ -293,13 +303,24 @@ type ContainerAppBuilder () = | |
| None -> state.Dependencies | ||
} | ||
|
||
/// Adds an application secrets to the Azure Container App. | ||
[<CustomOperation "add_secret_expressions">] | ||
member __.AddSecretExpressions (state:ContainerAppConfig, xs: #seq<_>) = | ||
xs |> Seq.fold (fun s (k,e) -> __.AddSecretExpression(s,k,e)) state | ||
|
||
|
||
/// Adds a public environment variable to the Azure Container App environment variables. | ||
[<CustomOperation "add_env_variable">] | ||
member _.AddEnvironmentVariable (state:ContainerAppConfig, name, value) = | ||
{ state with | ||
EnvironmentVariables = state.EnvironmentVariables.Add (EnvVar.create name value) | ||
} | ||
|
||
/// Adds a public environment variables to the Azure Container App environment variables. | ||
[<CustomOperation "add_env_variables">] | ||
member __.AddEnvironmentVariables (state:ContainerAppConfig, vars:#seq<_>) = | ||
vars |> Seq.fold (fun s (k,v) -> __.AddEnvironmentVariable(s,k,v)) state | ||
|
||
[<CustomOperation "add_simple_container">] | ||
member this.AddSimpleContainer (state:ContainerAppConfig, dockerImage, dockerVersion) = | ||
let container = | ||
|
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 take it we just need this for now until this bug is fixed, right?
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 think so, yes. Although the string concatenation approach should just work, once the underlying ARM provider is fixed I would prefer to revert to the original expression-based approach.
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.
Sounds good, and given we do t have to change the DSL, this will just keep working when they fix the bug. LGTM.