2 writes to Resource
Aspire.Hosting (2)
ApplicationModel\EndpointReference.cs (2)
124
Resource
= owner;
139
Resource
= owner;
42 references to Resource
Aspire.Hosting (10)
ApplicationModel\EndpointReference.cs (5)
18
internal EndpointAnnotation EndpointAnnotation => GetEndpointAnnotation() ?? throw new InvalidOperationException($"The endpoint `{EndpointName}` is not defined for the resource `{
Resource
.Name}`.");
25
IEnumerable<object> IValueWithReferences.References => [
Resource
];
62
string Binding(string prop) => $"{{{
Resource
.Name}.bindings.{EndpointName}.{prop}}}";
107
?? throw new InvalidOperationException($"The endpoint `{EndpointName}` is not allocated for the resource `{
Resource
.Name}`.");
110
_endpointAnnotation ??=
Resource
.Annotations.OfType<EndpointAnnotation>().SingleOrDefault(a => StringComparers.EndpointAnnotationName.Equals(a.Name, EndpointName));
ApplicationModel\ExpressionResolver.cs (1)
15
var target = endpointReference.
Resource
.GetRootResource();
ResourceBuilderExtensions.cs (4)
151
builder.WithReferenceRelationship(endpointReference.
Resource
);
574
ApplyEndpoints(builder, endpointReference.
Resource
, endpointReference.EndpointName);
1923
commandName ??= $"{endpoint.
Resource
.Name}-{endpoint.EndpointName}-http-{commandOptions.Method.Method.ToLowerInvariant()}-{path}";
1935
if (resourceEvent.Resource == endpoint.
Resource
)
Aspire.Hosting.Azure (1)
AzureBicepResourceExtensions.cs (1)
306
builder.WithReferenceRelationship(value.
Resource
);
Aspire.Hosting.Azure.AppContainers (4)
BaseContainerAppContext.cs (4)
216
var context = ep.
Resource
== resource
218
: _containerAppEnvironmentContext.GetContainerAppContext(ep.
Resource
);
268
var context = epExpr.Endpoint.
Resource
== resource
270
: _containerAppEnvironmentContext.GetContainerAppContext(epExpr.Endpoint.
Resource
);
Aspire.Hosting.Azure.AppService (2)
AzureAppServiceWebsiteContext.cs (2)
118
var context = environmentContext.GetAppServiceContext(ep.
Resource
);
155
var context = environmentContext.GetAppServiceContext(epExpr.Endpoint.
Resource
);
Aspire.Hosting.Azure.EventHubs (2)
AzureEventHubsExtensions.cs (2)
267
context.EnvironmentVariables.Add("BLOB_SERVER", $"{blobEndpoint.
Resource
.Name}:{blobEndpoint.TargetPort}");
268
context.EnvironmentVariables.Add("METADATA_SERVER", $"{tableEndpoint.
Resource
.Name}:{tableEndpoint.TargetPort}");
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusExtensions.cs (1)
387
context.EnvironmentVariables.Add("SQL_SERVER", $"{sqlEndpoint.
Resource
.Name}:{sqlEndpoint.TargetPort}");
Aspire.Hosting.DevTunnels (9)
DevTunnelResource.cs (1)
69
TunnelEndpoint = new(targetEndpoint.
Resource
, TunnelEndpointAnnotation);
DevTunnelResourceBuilderExtensions.cs (8)
170
portLogger.LogInformation("Created/updated dev tunnel port '{Port}' on tunnel '{Tunnel}' targeting endpoint '{Endpoint}' on resource '{TargetResource}'", portResource.TargetEndpoint.Port, portResource.DevTunnel.TunnelId, portResource.TargetEndpoint.EndpointName, portResource.TargetEndpoint.
Resource
.Name);
323
foreach (var port in tunnelResource.Resource.Ports.Where(p => p.TargetEndpoint.
Resource
== targetResource.Resource))
342
var targetResource = targetEndpoint.
Resource
;
347
throw new ArgumentException($"Target endpoint '{targetEndpoint.EndpointName}' on resource '{targetEndpoint.
Resource
.Name}' has already been added to dev tunnel '{tunnel.Name}'.", nameof(targetEndpoint));
350
if (targetEndpoint.
Resource
.Annotations.OfType<EndpointAnnotation>()
483
portLogger.LogError("Cannot tunnel endpoint '{Endpoint}' with host '{Host}' on resource '{Resource}' because it is not a localhost endpoint.", portResource.TargetEndpoint.EndpointName, portResource.TargetEndpoint.Host, portResource.TargetEndpoint.
Resource
.Name);
484
portResource.TargetEndpointAllocatedTcs.SetException(new DistributedApplicationException($"Cannot tunnel endpoint '{portResource.TargetEndpoint.EndpointName}' with host '{portResource.TargetEndpoint.Host}' on resource '{portResource.TargetEndpoint.
Resource
.Name}' because it is not a localhost endpoint."));
542
portLogger.LogInformation("Forwarding from {PortUrl} to {TargetUrl} ({TargetResourceName}/{TargetEndpointName})", tunnelPortStatus.PortUri.ToString().TrimEnd('/'), portResource.TargetEndpoint.Url, portResource.TargetEndpoint.
Resource
.Name, portResource.TargetEndpoint.EndpointName);
Aspire.Hosting.Docker (2)
DockerComposeServiceResourceExtensions.cs (2)
22
var referencedResource = resource.Parent.ResourceMapping[ep.
Resource
];
50
var referencedResource = resource.Parent.ResourceMapping[epExpr.Endpoint.
Resource
];
Aspire.Hosting.Kafka (2)
KafkaBuilderExtensions.cs (2)
140
? ReferenceExpression.Create($"{endpoint.
Resource
.Name}:{endpoint.Property(EndpointProperty.TargetPort)}")
143
context.EnvironmentVariables.Add($"KAFKA_CLUSTERS_{index}_NAME", endpoint.
Resource
.Name);
Aspire.Hosting.Kubernetes (4)
KubernetesResource.cs (4)
368
var referencedResource = ep.
Resource
== this
370
: await context.CreateKubernetesResourceAsync(ep.
Resource
, executionContext, default).ConfigureAwait(false);
398
var referencedResource = epExpr.Endpoint.
Resource
== this
400
: await context.CreateKubernetesResourceAsync(epExpr.Endpoint.
Resource
, executionContext, default).ConfigureAwait(false);
Aspire.Hosting.MySql (2)
MySqlBuilderExtensions.cs (2)
254
context.EnvironmentVariables.Add("PMA_HOST", $"{endpoint.
Resource
.Name}:{endpoint.TargetPort}");
394
writer.WriteLine($"$cfg['Servers'][$i]['host'] = '{endpoint.
Resource
.Name}:{endpoint.TargetPort}';");
Aspire.Hosting.PostgreSQL (1)
PostgresBuilderExtensions.cs (1)
547
writer.WriteString("Host", endpoint.
Resource
.Name);
Aspire.Hosting.Yarp (2)
ConfigurationBuilder\YarpCluster.cs (2)
27
: this(endpoint.
Resource
.Name, $"{endpoint.Scheme}://_{endpoint.EndpointName}.{endpoint.
Resource
.Name}")