1 write to TargetResource
Aspire.Hosting.Azure.Sandboxes (1)
AzureSandboxContainerResource.cs (1)
19
TargetResource
= targetResource;
38 references to TargetResource
Aspire.Hosting.Azure.Sandboxes (36)
AzureSandboxContainerDeployment.cs (29)
68
Description = $"Deploys compute resource '{resource.
TargetResource
.Name}' to ACA sandbox '{resource.Name}'.",
145
var pushSteps = context.GetSteps(resource.
TargetResource
, WellKnownPipelineTags.PushContainerImage);
156
var dependencies = await resource.
TargetResource
.GetResourceDependenciesAsync(
169
$"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.");
180
$"Azure sandbox resources '{resource.
TargetResource
.Name}' and '{producer.
TargetResource
.Name}' have a circular deployment dependency.");
240
var targetResource = resource.
TargetResource
;
500
context.Summary.Add(resource.
TargetResource
.Name, new MarkdownString(CreateSandboxUrlSummary(publicUrl, retainedUrl)));
504
context.Summary.Add(resource.
TargetResource
.Name, new MarkdownString($"Sandbox `{sandboxId}`"));
572
["aspire-source"] = resource.
TargetResource
.Name,
579
var options = GetAzureSandboxContainerOptions(resource.
TargetResource
);
806
var options = GetAzureSandboxContainerOptions(resource.
TargetResource
);
973
if (resource.
TargetResource
.RequiresImageBuildAndPush())
975
var containerImageReference = new ContainerImageReference(resource.
TargetResource
);
977
.GetValueAsync(new ValueProviderContext { ExecutionContext = context.ExecutionContext, Caller = resource.
TargetResource
}, context.CancellationToken)
979
?? throw new InvalidOperationException($"Could not resolve the pushed container image for resource '{resource.
TargetResource
.Name}'.");
982
if (resource.
TargetResource
.TryGetContainerImageName(out var imageName))
987
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.");
1476
var options = GetAzureSandboxContainerOptions(resource.
TargetResource
);
1481
var resolvedEndpoints = resource.
TargetResource
.ResolveEndpoints();
1490
if (resource.
TargetResource
is IDotnetProgramResource &&
1497
$"Endpoint '{resolvedEndpoint.Endpoint.Name}' on project resource '{resource.
TargetResource
.Name}' is exposed through Azure sandbox ingress, which terminates TLS and forwards plaintext HTTP. " +
1501
var targetPort = ResolveSandboxTargetPort(resource.
TargetResource
, resolvedEndpoint);
1505
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.");
1508
var protocol = ResolveSandboxPortProtocol(resource.
TargetResource
, resolvedEndpoint.Endpoint);
1524
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.");
1531
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.");
1549
throw new InvalidOperationException($"Resource '{resource.
TargetResource
.Name}' has Azure sandbox endpoint options for endpoint(s) that are not exposed by EndpointAnnotation: {string.Join(", ", unmatchedEndpointOptions)}.");
2102
stateSection.Data["SourceResourceName"] ??= resource.
TargetResource
.Name;
AzureSandboxEndpointPropertyValueProvider.cs (7)
34
throw new InvalidOperationException($"Endpoint '{endpointReferenceExpression.Endpoint.EndpointName}' on resource '{resource.
TargetResource
.Name}' does not have a target port.");
100
throw new InvalidOperationException($"Azure sandbox deployment state for resource '{_resource.
TargetResource
.Name}' endpoint '{_endpointReferenceExpression.Endpoint.EndpointName}' contains invalid URL '{url}'.");
117
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.");
123
throw new InvalidOperationException($"Endpoint '{_endpointReferenceExpression.Endpoint.EndpointName}' on resource '{_resource.
TargetResource
.Name}' is not exposed by the Azure sandbox deployment target.");
183
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.");
188
foreach (var resolvedEndpoint in resource.
TargetResource
.ResolveEndpoints())
192
return AzureSandboxContainerDeployment.ResolveSandboxTargetPort(resource.
TargetResource
, resolvedEndpoint);
Aspire.Hosting.Azure.Tests (2)
AzureSandboxesTests.cs (2)
2403
Assert.Same(computeResource, sandboxContainer.
TargetResource
);
2872
Assert.Same(computeResource, sandboxContainer.
TargetResource
);