File: EnvironmentVariable.cs
Web Access
Project: src\src\Aspire.Hosting.Azure.Sql\Aspire.Hosting.Azure.Sql.csproj (Aspire.Hosting.Azure.Sql)
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
// Used to define environment variables in Bicep on a deployment script until it's available in the CDK -->
// This code was copied from https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/Models/ContainerAppEnvironmentVariable.cs
// https://github.com/Azure/azure-sdk-for-net/issues/49283 -->
 
// <auto-generated/>
 
#nullable enable
 
using Azure.Provisioning.Primitives;
using System;
 
namespace Azure.Provisioning.AppContainers;
 
/// <summary>
/// Environment variable.
/// </summary>
sealed class EnvironmentVariable : ProvisionableConstruct
{
    /// <summary>
    /// Environment variable name.
    /// </summary>
    public BicepValue<string> Name
    {
        get { Initialize(); return _name!; }
        set { Initialize(); _name!.Assign(value); }
    }
    private BicepValue<string>? _name;
 
    /// <summary>
    /// Non-secret environment variable value.
    /// </summary>
    public BicepValue<string> Value
    {
        get { Initialize(); return _value!; }
        set { Initialize(); _value!.Assign(value); }
    }
    private BicepValue<string>? _value;
 
    /// <summary>
    /// Name of the secret from which to pull the environment
    /// variable value.
    /// </summary>
    public BicepValue<string> SecretRef
    {
        get { Initialize(); return _secretRef!; }
        set { Initialize(); _secretRef!.Assign(value); }
    }
    private BicepValue<string>? _secretRef;
 
    /// <summary>
    /// Creates a new EnvironmentVariable.
    /// </summary>
    public EnvironmentVariable()
    {
    }
 
    /// <summary>
    /// Define all the provisionable properties of
    /// EnvironmentVariable.
    /// </summary>
    protected override void DefineProvisionableProperties()
    {
        base.DefineProvisionableProperties();
        _name = DefineProperty<string>("Name", ["name"]);
        _value = DefineProperty<string>("Value", ["value"]);
        _secretRef = DefineProperty<string>("SecretRef", ["secretRef"]);
    }
}