Service.AddEnvironmentalVariable(String, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds an environmental variable to the service's environment dictionary. If the specified value is null, it assigns an empty string as the value.
public Aspire.Hosting.Docker.Resources.ComposeNodes.Service AddEnvironmentalVariable(string key, string? value);
member this.AddEnvironmentalVariable : string * string -> Aspire.Hosting.Docker.Resources.ComposeNodes.Service
Public Function AddEnvironmentalVariable (key As String, value As String) As Service
Parameters
- key
- String
The key for the environmental variable.
- value
- String
The value of the environmental variable. If null, an empty string will be used.
Returns
The updated Service instance with the added environmental variable.