1 write to TargetResource
Aspire.Hosting.Azure.Sandboxes (1)
AzureSandboxContainerResource.cs (1)
21
TargetResource
= targetResource;
38 references to TargetResource
Aspire.Hosting.Azure.Sandboxes (36)
AzureSandboxContainerDeployment.cs (29)
69
Description = $"Deploys compute resource '{resource.
TargetResource
.Name}' to ACA sandbox '{resource.Name}'.",
146
var pushSteps = context.GetSteps(resource.
TargetResource
, WellKnownPipelineTags.PushContainerImage);
157
var dependencies = await resource.
TargetResource
.GetResourceDependenciesAsync(
170
$"Azure sandbox resource '{resource.
TargetResource
.Name}' in sandbox group '{resource.Parent.Name}' references resource '{dependency.Name}' in sandbox group '{producer.Parent.Name}', but cross-group sandbox references are not supported. Deploy both resources to the same sandbox group.");
181
$"Azure sandbox resources '{resource.
TargetResource
.Name}' and '{producer.
TargetResource
.Name}' have a circular deployment dependency.");
241
var targetResource = resource.
TargetResource
;
501
context.Summary.Add(resource.
TargetResource
.Name, new MarkdownString(CreateSandboxUrlSummary(publicUrl, retainedUrl)));
505
context.Summary.Add(resource.
TargetResource
.Name, new MarkdownString($"Sandbox `{sandboxId}`"));
573
["aspire-source"] = resource.
TargetResource
.Name,
580
var options = GetAzureSandboxContainerOptions(resource.
TargetResource
);
807
var options = GetAzureSandboxContainerOptions(resource.
TargetResource
);
974
if (resource.
TargetResource
.RequiresImageBuildAndPush())
976
var containerImageReference = new ContainerImageReference(resource.
TargetResource
);
978
.GetValueAsync(new ValueProviderContext { ExecutionContext = context.ExecutionContext, Caller = resource.
TargetResource
}, context.CancellationToken)
980
?? throw new InvalidOperationException($"Could not resolve the pushed container image for resource '{resource.
TargetResource
.Name}'.");
983
if (resource.
TargetResource
.TryGetContainerImageName(out var imageName))
988
throw new NotSupportedException($"Resource '{resource.
TargetResource
.Name}' cannot be deployed to Azure sandbox group '{resource.Parent.Name}' because it does not produce or reference a container image.");
1477
var options = GetAzureSandboxContainerOptions(resource.
TargetResource
);
1482
var resolvedEndpoints = resource.
TargetResource
.ResolveEndpoints();
1491
if (resource.
TargetResource
is ProjectResource &&
1498
$"Endpoint '{resolvedEndpoint.Endpoint.Name}' on project resource '{resource.
TargetResource
.Name}' is exposed through Azure sandbox ingress, which terminates TLS and forwards plaintext HTTP. " +
1502
var targetPort = ResolveSandboxTargetPort(resource.
TargetResource
, resolvedEndpoint);
1506
throw new InvalidOperationException($"Endpoint '{resolvedEndpoint.Endpoint.Name}' on resource '{resource.
TargetResource
.Name}' does not have a target port. Configure a target port before deploying it to an Azure sandbox.");
1509
var protocol = ResolveSandboxPortProtocol(resource.
TargetResource
, resolvedEndpoint.Endpoint);
1525
throw new NotSupportedException($"Endpoint '{resolvedEndpoint.Endpoint.Name}' on resource '{resource.
TargetResource
.Name}' shares target port {resolvedTargetPort} with endpoint '{existingEndpoint.Name}' but uses a different transport. Azure sandbox ports support a single HTTP protocol per target port.");
1532
throw new NotSupportedException($"Endpoint '{resolvedEndpoint.Endpoint.Name}' on resource '{resource.
TargetResource
.Name}' shares target port {resolvedTargetPort} with endpoint '{existingEndpoint.Name}' but configures a different anonymous-access policy. Azure sandbox ports support a single access policy per target port.");
1550
throw new InvalidOperationException($"Resource '{resource.
TargetResource
.Name}' has Azure sandbox endpoint options for endpoint(s) that are not exposed by EndpointAnnotation: {string.Join(", ", unmatchedEndpointOptions)}.");
2103
stateSection.Data["SourceResourceName"] ??= resource.
TargetResource
.Name;
AzureSandboxEndpointPropertyValueProvider.cs (7)
35
throw new InvalidOperationException($"Endpoint '{endpointReferenceExpression.Endpoint.EndpointName}' on resource '{resource.
TargetResource
.Name}' does not have a target port.");
101
throw new InvalidOperationException($"Azure sandbox deployment state for resource '{_resource.
TargetResource
.Name}' endpoint '{_endpointReferenceExpression.Endpoint.EndpointName}' contains invalid URL '{url}'.");
118
new($"Azure sandbox endpoint '{_endpointReferenceExpression.Endpoint.EndpointName}' on resource '{_resource.
TargetResource
.Name}' does not have a deployed URL yet. Runtime sandbox URLs cannot be used as first-pass Azure provisioning values; deploy the producing sandbox before resolving this reference.");
124
throw new InvalidOperationException($"Endpoint '{_endpointReferenceExpression.Endpoint.EndpointName}' on resource '{_resource.
TargetResource
.Name}' is not exposed by the Azure sandbox deployment target.");
184
throw new InvalidOperationException($"Endpoint '{endpointName}' on resource '{resource.
TargetResource
.Name}' is not exposed by the Azure sandbox deployment target. Configure it as an external HTTP endpoint before referencing its sandbox URL.");
189
foreach (var resolvedEndpoint in resource.
TargetResource
.ResolveEndpoints())
193
return AzureSandboxContainerDeployment.ResolveSandboxTargetPort(resource.
TargetResource
, resolvedEndpoint);
Aspire.Hosting.Azure.Tests (2)
AzureSandboxesTests.cs (2)
2402
Assert.Same(computeResource, sandboxContainer.
TargetResource
);
2797
Assert.Same(computeResource, sandboxContainer.
TargetResource
);