AzureBicepResourceExtensions.WithEnvironment Method

Definition

Overloads

WithEnvironment<T>(IResourceBuilder<T>, String, BicepOutputReference)

Adds an environment variable to the resource with the value of the output from the bicep template.

WithEnvironment<T>(IResourceBuilder<T>, String, BicepSecretOutputReference)

Adds an environment variable to the resource with the value of the secret output from the bicep template.

WithEnvironment<T>(IResourceBuilder<T>, String, BicepOutputReference)

Source:
AzureBicepResourceExtensions.cs
Source:
AzureBicepResourceExtensions.cs
Source:
AzureBicepResourceExtensions.cs

Adds an environment variable to the resource with the value of the output from the bicep template.

C#
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithEnvironment<T>(this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, string name, Aspire.Hosting.Azure.BicepOutputReference bicepOutputReference) where T : Aspire.Hosting.ApplicationModel.IResourceWithEnvironment;

Type Parameters

T

The resource type.

Parameters

builder
IResourceBuilder<T>

The resource builder.

name
String

The name of the environment variable.

bicepOutputReference
BicepOutputReference

The reference to the bicep output.

Returns

An IResourceBuilder<T>.

Applies to

.NET Aspire 9.1.0 et autres versions
Produit Versions
.NET Aspire 8.0.0, 9.0.0, 9.1.0

WithEnvironment<T>(IResourceBuilder<T>, String, BicepSecretOutputReference)

Source:
AzureBicepResourceExtensions.cs
Source:
AzureBicepResourceExtensions.cs
Source:
AzureBicepResourceExtensions.cs

Adds an environment variable to the resource with the value of the secret output from the bicep template.

C#
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithEnvironment<T>(this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, string name, Aspire.Hosting.Azure.BicepSecretOutputReference bicepOutputReference) where T : Aspire.Hosting.ApplicationModel.IResourceWithEnvironment;

Type Parameters

T

The resource type.

Parameters

builder
IResourceBuilder<T>

The resource builder.

name
String

The name of the environment variable.

bicepOutputReference
BicepSecretOutputReference

The reference to the bicep output.

Returns

An IResourceBuilder<T>.

Applies to

.NET Aspire 9.1.0 et autres versions
Produit Versions
.NET Aspire 8.0.0, 9.0.0, 9.1.0