3 instantiations of ParameterResource
Aspire.Hosting (2)
ParameterResourceBuilderExtensions.cs (2)
157var resource = new ParameterResource(name, callback, secret); 257var parameter = new ParameterResource(builder.Resource.Name, _ => "", secret: true);
Aspire.Hosting.Milvus.Tests (1)
MilvusPublicApiTests.cs (1)
147var apiKey = new ParameterResource("ApiKey", (pd) => "root:Milvus");
159 references to ParameterResource
Aspire.Hosting (29)
ApplicationModel\ParameterResource.cs (1)
16/// Initializes a new instance of <see cref="ParameterResource"/>.
ApplicationModel\ResourceWithConnectionStringSurrogate.cs (1)
6internal sealed class ResourceWithConnectionStringSurrogate(ParameterResource innerResource, string? environmentVariableName) : IResourceWithConnectionString
ContainerResourceBuilderExtensions.cs (7)
494/// Thrown when <see cref="ContainerResourceBuilderExtensions.WithBuildArg{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> is 499/// The <see cref="ContainerResourceBuilderExtensions.WithBuildArg{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> extension method 518public static IResourceBuilder<T> WithBuildArg<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> value) where T : ContainerResource 541/// Thrown when <see cref="ContainerResourceBuilderExtensions.WithBuildSecret{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> is 546/// The <see cref="ContainerResourceBuilderExtensions.WithBuildSecret{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> extension method 548/// variable-based secret being passed to the build process. The value of the environment variable is the value of the secret referenced by the <see cref="ParameterResource"/>. 565public static IResourceBuilder<T> WithBuildSecret<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> value) where T : ContainerResource
IDistributedApplicationBuilder.cs (3)
187/// <see cref="ParameterResource"/> in the application model. The return type of <see cref="ParameterResourceBuilderExtensions.AddConnectionString(IDistributedApplicationBuilder, string, string?)"/> 188/// is <see cref="IResourceBuilder{IResourceWithConnectionString}"/>. The <see cref="ParameterResource"/> type does not implement the <see cref="IResourceWithConnectionString"/>. 192/// parameter resource in a "surrogate" class which proxies access to the <see cref="ParameterResource"/> fields but implements <see cref="IResourceWithConnectionString"/>. The
ParameterResourceBuilderExtensions.cs (14)
25public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, [ResourceName] string name, bool secret = false) 45public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, [ResourceName] string name, string value, bool publishValueAsDefault = false, bool secret = false) 66public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, string name, Func<string> valueGetter, bool publishValueAsDefault = false, bool secret = false) 95public static IResourceBuilder<ParameterResource> AddParameterFromConfiguration(this IDistributedApplicationBuilder builder, string name, string configurationKey, bool secret = false) 122public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, [ResourceName] string name, ParameterDefault value, bool secret = false, bool persist = false) 149internal static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, 157var resource = new ParameterResource(name, callback, secret); 257var parameter = new ParameterResource(builder.Resource.Name, _ => "", secret: true); 276/// <returns>The created <see cref="ParameterResource"/>.</returns> 281public static ParameterResource CreateDefaultPasswordParameter( 306/// Creates a new <see cref="ParameterResource"/> that has a generated value using the <paramref name="parameterDefault"/>. 315/// <returns>The created <see cref="ParameterResource"/>.</returns> 316public static ParameterResource CreateGeneratedParameter( 322var parameterResource = new ParameterResource(name, defaultValue => GetParameterValue(builder.Configuration, name, defaultValue), secret)
Publishing\ManifestPublishingContext.cs (2)
115else if (resource is ParameterResource parameter) 209internal Task WriteParameterAsync(ParameterResource parameter)
ResourceBuilderExtensions.cs (1)
156public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> parameter) where T : IResourceWithEnvironment
Aspire.Hosting.Azure (6)
AzureBicepResourceExtensions.cs (2)
192public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> value) 206public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, ParameterResource value)
AzureProvisioningResource.cs (1)
84var isSecure = aspireParameter.Value is ParameterResource { Secret: true } || aspireParameter.Value is BicepSecretOutputReference;
AzureProvisioningResourceExtensions.cs (2)
63/// This is useful when assigning a <see cref="BicepValue"/> to the value of an Aspire <see cref="ParameterResource"/>. 67public static ProvisioningParameter AsProvisioningParameter(this IResourceBuilder<ParameterResource> parameterResourceBuilder, AzureResourceInfrastructure infrastructure, string? parameterName = null)
Provisioning\Provisioners\BicepProvisioner.cs (1)
515return value is ParameterResource { Default: not null };
Aspire.Hosting.Azure.AppContainers (11)
AzureContainerAppsInfrastructure.cs (1)
646if (value is ParameterResource param)
ContainerAppExtensions.cs (10)
26/// <para>The <see cref="ConfigureCustomDomain(ContainerApp, IResourceBuilder{ParameterResource}, IResourceBuilder{ParameterResource})"/> extension method 28/// <para>The <see cref="ConfigureCustomDomain(ContainerApp, IResourceBuilder{ParameterResource}, IResourceBuilder{ParameterResource})"/> method is used 31/// <para>The <see cref="ConfigureCustomDomain(ContainerApp, IResourceBuilder{ParameterResource}, IResourceBuilder{ParameterResource})"/> method takes 43/// passing them to the <see cref="ConfigureCustomDomain(ContainerApp, IResourceBuilder{ParameterResource}, IResourceBuilder{ParameterResource})"/> 58public static void ConfigureCustomDomain(this ContainerApp app, IResourceBuilder<ParameterResource> customDomain, IResourceBuilder<ParameterResource> certificateName)
Aspire.Hosting.Azure.PostgreSQL (6)
AzurePostgresExtensions.cs (4)
21var userParam = postgresResource.UserNameParameter ?? 282IResourceBuilder<ParameterResource>? userName = null, 283IResourceBuilder<ParameterResource>? password = null) 463private static ParameterResource CreateDefaultUserNameParameter<T>(IResourceBuilder<T> builder) where T : AzureBicepResource
AzurePostgresFlexibleServerResource.cs (2)
50internal ParameterResource? UserNameParameter { get; set; } 55internal ParameterResource? PasswordParameter { get; set; }
Aspire.Hosting.Elasticsearch (4)
ElasticsearchBuilderExtensions.cs (2)
48IResourceBuilder<ParameterResource>? password = null, 54var passwordParameter = password?.Resource ?? ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(builder, $"{name}-password");
ElasticsearchResource.cs (2)
27public ElasticsearchResource(string name, ParameterResource password) : base(name) 49public ParameterResource PasswordParameter { get; }
Aspire.Hosting.Elasticsearch.Tests (1)
ElasticsearchPublicApiTests.cs (1)
90ParameterResource password = null!;
Aspire.Hosting.Keycloak (7)
KeycloakResource.cs (4)
15public sealed class KeycloakResource(string name, ParameterResource? admin, ParameterResource adminPassword) 24public ParameterResource? AdminUserNameParameter { get; } = admin; 34public ParameterResource AdminPasswordParameter { get; } = ThrowIfNull(adminPassword);
KeycloakResourceBuilderExtensions.cs (3)
46IResourceBuilder<ParameterResource>? adminUsername = null, 47IResourceBuilder<ParameterResource>? adminPassword = null) 52var passwordParameter = adminPassword?.Resource ?? ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(builder, $"{name}-password");
Aspire.Hosting.Keycloak.Tests (3)
KeycloakPublicApiTests.cs (3)
19var action = () => new KeycloakResource(name, default(ParameterResource?), adminPassword.Resource); 29ParameterResource adminPassword = null!; 31var action = () => new KeycloakResource(name, default(ParameterResource?), adminPassword);
Aspire.Hosting.Milvus (5)
MilvusBuilderExtensions.cs (2)
44IResourceBuilder<ParameterResource>? apiKey = null, 49var apiKeyParameter = apiKey?.Resource ??
MilvusServerResource.cs (3)
19/// <param name="apiKey">A <see cref="ParameterResource"/> that contains the authentication apiKey/token</param> 20public MilvusServerResource(string name, ParameterResource apiKey) : base(name) 31public ParameterResource ApiKeyParameter { get; }
Aspire.Hosting.Milvus.Tests (3)
MilvusPublicApiTests.cs (3)
17IResourceBuilder<ParameterResource> apiKey = null!; 147var apiKey = new ParameterResource("ApiKey", (pd) => "root:Milvus"); 159ParameterResource apiKey = null!;
Aspire.Hosting.MongoDB (7)
MongoDBBuilderExtensions.cs (3)
51IResourceBuilder<ParameterResource>? userName = null, 52IResourceBuilder<ParameterResource>? password = null) 57var passwordParameter = password?.Resource ?? ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(builder, $"{name}-password", special: false);
MongoDBServerResource.cs (4)
25public MongoDBServerResource(string name, ParameterResource? userNameParameter, ParameterResource? passwordParameter) : this(name) 39public ParameterResource? PasswordParameter { get; } 44public ParameterResource? UserNameParameter { get; }
Aspire.Hosting.MySql (4)
MySqlBuilderExtensions.cs (2)
29public static IResourceBuilder<MySqlServerResource> AddMySql(this IDistributedApplicationBuilder builder, [ResourceName] string name, IResourceBuilder<ParameterResource>? password = null, int? port = null) 34var passwordParameter = password?.Resource ?? ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(builder, $"{name}-password");
MySqlServerResource.cs (2)
18public MySqlServerResource(string name, ParameterResource password) : base(name) 34public ParameterResource PasswordParameter { get; }
Aspire.Hosting.MySql.Tests (2)
MySqlPublicApiTests.cs (2)
149var password = ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(distributedApplicationBuilder, "password", special: false); 161ParameterResource password = null!;
Aspire.Hosting.Nats (7)
NatsBuilderExtensions.cs (3)
46IResourceBuilder<ParameterResource>? userName = null, 47IResourceBuilder<ParameterResource>? password = null) 52var passwordParameter = password?.Resource ?? ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(builder, $"{name}-password", special: false);
NatsServerResource.cs (4)
27public NatsServerResource(string name, ParameterResource? userName, ParameterResource? password) : this(name) 41public ParameterResource? UserNameParameter { get; set; } 51public ParameterResource? PasswordParameter { get; set; }
Aspire.Hosting.Oracle (4)
OracleDatabaseBuilderExtensions.cs (2)
28public static IResourceBuilder<OracleDatabaseServerResource> AddOracle(this IDistributedApplicationBuilder builder, [ResourceName] string name, IResourceBuilder<ParameterResource>? password = null, int? port = null) 30var passwordParameter = password?.Resource ?? ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(builder, $"{name}-password");
OracleDatabaseServerResource.cs (2)
18public OracleDatabaseServerResource(string name, ParameterResource password) : base(name) 34public ParameterResource PasswordParameter { get; }
Aspire.Hosting.Orleans (2)
OrleansServiceExtensions.cs (2)
53IResourceBuilder<ParameterResource> clusterId) 81IResourceBuilder<ParameterResource> serviceId)
Aspire.Hosting.PostgreSQL (7)
PostgresBuilderExtensions.cs (3)
42IResourceBuilder<ParameterResource>? userName = null, 43IResourceBuilder<ParameterResource>? password = null, 49var passwordParameter = password?.Resource ?? ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(builder, $"{name}-password");
PostgresServerResource.cs (4)
23public PostgresServerResource(string name, ParameterResource? userName, ParameterResource password) : base(ThrowIfNull(name)) 40public ParameterResource? UserNameParameter { get; set; } 50public ParameterResource PasswordParameter { get; set; }
Aspire.Hosting.PostgreSQL.Tests (5)
PostgrePublicApiTests.cs (5)
80var postgresParentResource = new PostgresServerResource("PostgresServer", default(ParameterResource?), parameterResource.Resource); 95var postgresParentResource = new PostgresServerResource("PostgresServer", default(ParameterResource?), parameterResource.Resource); 123var action = () => new PostgresServerResource(name, default(ParameterResource?), password.Resource); 133ParameterResource password = null!; 135var action = () => new PostgresServerResource(name, default(ParameterResource?), password);
Aspire.Hosting.Qdrant (5)
QdrantBuilderExtensions.cs (2)
40IResourceBuilder<ParameterResource>? apiKey = null, 47var apiKeyParameter = apiKey?.Resource ??
QdrantServerResource.cs (3)
18/// <param name="apiKey">A <see cref="ParameterResource"/> that contains the API Key</param> 19public QdrantServerResource(string name, ParameterResource apiKey) : base(name) 31public ParameterResource ApiKeyParameter { get; }
Aspire.Hosting.Qdrant.Tests (2)
QdrantPublicApiTests.cs (2)
104var apiKey = ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(distributedApplicationBuilder, key, special: false); 116ParameterResource apiKey = null!;
Aspire.Hosting.RabbitMQ (7)
RabbitMQBuilderExtensions.cs (3)
30IResourceBuilder<ParameterResource>? userName = null, 31IResourceBuilder<ParameterResource>? password = null, 38var passwordParameter = password?.Resource ?? ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(builder, $"{name}-password", special: false);
RabbitMQServerResource.cs (4)
21public RabbitMQServerResource(string name, ParameterResource? userName, ParameterResource password) : base(name) 38public ParameterResource? UserNameParameter { get; } 48public ParameterResource PasswordParameter { get; }
Aspire.Hosting.RabbitMQ.Tests (2)
RabbitMQPublicApiTests.cs (2)
99var password = ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(distributedApplicationBuilder, "password", special: false); 112ParameterResource password = null!;
Aspire.Hosting.SqlServer (4)
SqlServerBuilderExtensions.cs (2)
26public static IResourceBuilder<SqlServerServerResource> AddSqlServer(this IDistributedApplicationBuilder builder, [ResourceName] string name, IResourceBuilder<ParameterResource>? password = null, int? port = null) 32var passwordParameter = password?.Resource ?? ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(builder, $"{name}-password", minLower: 1, minUpper: 1, minNumeric: 1);
SqlServerServerResource.cs (2)
18public SqlServerServerResource(string name, ParameterResource password) : base(name) 34public ParameterResource PasswordParameter { get; }
Aspire.Hosting.SqlServer.Tests (6)
SqlServerPublicApiTests.cs (6)
116var password = ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(distributedApplicationBuilder, key, special: false); 131var password = ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(distributedApplicationBuilder, "password", special: false); 146var password = ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(distributedApplicationBuilder, "password", special: false); 161var password = ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(distributedApplicationBuilder, "password", special: false); 176var password = ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(distributedApplicationBuilder, "password", special: false); 191var password = ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(distributedApplicationBuilder, "password", special: false);
Aspire.Hosting.Tests (18)
AddParameterTests.cs (18)
28var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>()); 65var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>()); 112var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>()); 147var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>(), r => r.Name == "pass"); 151var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 197var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>(), r => r.Name == "pass"); 201var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 255var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>(), r => r.Name == "pass"); 259var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 310var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>(), r => r.Name == "val"); 314var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "val")).DefaultTimeout();
Aspire.Playground.Tests (2)
Infrastructure\DistributedApplicationExtensions.cs (2)
28var parameters = builder.Resources.OfType<ParameterResource>().Where(p => !p.IsConnectionString).ToList(); 29foreach (var parameter in parameters)