124 references to AzureSandboxContainerDeployment
Aspire.Hosting.Azure.Sandboxes (14)
AzureSandboxCleanupResource.cs (3)
18Annotations.Add(new PipelineConfigurationAnnotation(AzureSandboxContainerDeployment.ConfigureStaleCleanupDestroyOrdering)); 42AzureSandboxContainerDeployment.CreateStaleCleanupPipelineStep( 44AzureSandboxContainerDeployment.GetActiveStateSectionNames(context.PipelineContext.Model))
AzureSandboxEndpointPropertyValueProvider.cs (6)
17private readonly AzureSandboxContainerDeployment.SandboxEndpoint? _sandboxEndpoint; 64.AcquireSectionAsync(AzureSandboxContainerDeployment.GetStateSectionName(_resource), cancellationToken) 155private static AzureSandboxContainerDeployment.SandboxEndpoint ResolveSandboxEndpoint(AzureSandboxContainerResource resource, EndpointReference endpointReference) 157var endpoints = AzureSandboxContainerDeployment.ResolveSandboxEndpoints(resource); 160AzureSandboxContainerDeployment.SandboxEndpoint? fallbackEndpoint = null; 190return AzureSandboxContainerDeployment.ResolveSandboxTargetPort(resource.TargetResource, resolvedEndpoint);
AzureSandboxGroupResource.cs (5)
171var scope = AzureSandboxContainerDeployment.CreateDataPlaneScope(this); 253AzureSandboxContainerDeployment.ValidateSandboxCompatibility(resource); 271sandboxContainer.Annotations.Add(new PipelineStepAnnotation(_ => AzureSandboxContainerDeployment.CreatePipelineSteps(sandboxContainer))); 274await AzureSandboxContainerDeployment.ConfigureDeployOrderingAsync(context, sandboxContainer).ConfigureAwait(false); 275AzureSandboxContainerDeployment.ConfigureDestroyOrdering(context, sandboxContainer);
Aspire.Hosting.Azure.Tests (110)
AzureSandboxesTests.cs (110)
141var scope = AzureSandboxContainerDeployment.CreateDataPlaneScope(sandboxGroup.Resource); 592var acrIdentity = await AzureSandboxContainerDeployment.ResolveImagePullManagedIdentityClientIdAsync( 596var publicIdentity = await AzureSandboxContainerDeployment.ResolveImagePullManagedIdentityClientIdAsync( 700Assert.False(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 712Assert.False(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 724Assert.False(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 736Assert.False(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 748Assert.True(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 763AzureSandboxContainerDeployment.CreateLabelSelector("owner-1", "frontend-sandbox-container")); 774AzureSandboxContainerDeployment.CreateSandboxUrlSummary(currentUrl, retainedUrl)); 777AzureSandboxContainerDeployment.CreateSandboxUrlSummary(currentUrl, currentUrl)); 780AzureSandboxContainerDeployment.CreateSandboxUrlSummary(currentUrl, retainedUrl: null)); 795Assert.True(AzureSandboxContainerDeployment.HasRemoteDeploymentState(ownerOnlyState)); 796Assert.False(AzureSandboxContainerDeployment.HasRemoteDeploymentState(emptyState)); 814AzureSandboxContainerDeployment.ValidateDeploymentScope( 819AzureSandboxContainerDeployment.ValidateDeploymentScope( 835var firstAppHostIdentity = AzureSandboxContainerDeployment.GetStableAppHostIdentity(firstPolyglotBuilder.Configuration); 836var secondAppHostIdentity = AzureSandboxContainerDeployment.GetStableAppHostIdentity(secondPolyglotBuilder.Configuration); 837var owner = AzureSandboxContainerDeployment.CreateStableOwnerId(firstAppHostIdentity, "Production", scope, "frontend-sandbox-container"); 838var freshRunOwner = AzureSandboxContainerDeployment.CreateStableOwnerId(firstAppHostIdentity.ToLowerInvariant(), "production", scope, "frontend-sandbox-container"); 839var otherEnvironmentOwner = AzureSandboxContainerDeployment.CreateStableOwnerId(firstAppHostIdentity, "Staging", scope, "frontend-sandbox-container"); 840var otherAppOwner = AzureSandboxContainerDeployment.CreateStableOwnerId(secondAppHostIdentity, "Production", scope, "frontend-sandbox-container"); 841var otherScopeOwner = AzureSandboxContainerDeployment.CreateStableOwnerId( 852Assert.True(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 877var pendingOwnerIds = AzureSandboxContainerDeployment.GetPendingOwnerCleanupIds( 890var legacyOwner = AzureSandboxContainerDeployment.CreateLegacyStableOwnerId( 894var productionOwner = AzureSandboxContainerDeployment.CreateStableOwnerId( 899var stagingOwner = AzureSandboxContainerDeployment.CreateStableOwnerId( 914var broadCleanupOwners = AzureSandboxContainerDeployment.GetPendingOwnerCleanupIds( 918var directCleanupState = AzureSandboxContainerDeployment.CreatePendingLegacyDeploymentCleanup( 936AzureSandboxContainerDeployment.GetStableAppHostIdentity(builder.Configuration)); 947new AzureSandboxContainerDeployment.SandboxEndpoint( 964var egressPolicy = AzureSandboxContainerDeployment.CreateEgressPolicy( 966var fingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 980Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 983Assert.False(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 984var updatedImageFingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 989Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, updatedImageFingerprint, hasRuntimeEnvironmentConfiguration: false)); 991Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 994Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 997var anonymousFingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 1004Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, anonymousFingerprint, hasRuntimeEnvironmentConfiguration: false)); 1006Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: true)); 1008Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 1010Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange( 1016Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 1019var updatedIdentityFingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 1030Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, updatedIdentityFingerprint, hasRuntimeEnvironmentConfiguration: false)); 1032var updatedEgressFingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 1036AzureSandboxContainerDeployment.CreateEgressPolicy(["other.example.com"])); 1037Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, updatedEgressFingerprint, hasRuntimeEnvironmentConfiguration: false)); 1060AzureSandboxContainerDeployment.DeleteSandboxAsync( 1098AzureSandboxContainerDeployment.DeleteExistingDeploymentAsync( 1136AzureSandboxContainerDeployment.DeleteExistingDeploymentAsync( 1171var existingScope = AzureSandboxContainerDeployment.CreateDataPlaneScope(sandboxGroup.Resource); 1198AzureSandboxContainerDeployment.DestroyAsync(stepContext, sandboxResource)); 1211var exception = AzureSandboxContainerDeployment.CreateDiskImageFailureException( 1245await AzureSandboxContainerDeployment.DeleteRemoteDeploymentsByResourceLabelAsync( 1702var reference = await AzureSandboxContainerDeployment.ResolveContainerImageReferenceForDiskImageAsync( 1976Auth = AzureSandboxContainerDeployment.CreatePortAuthConfig(anonymous: false), 2022var resources = AzureSandboxContainerDeployment.CreateSandboxResources(sandboxContainer); 2027var lifecycle = AzureSandboxContainerDeployment.CreateLifecyclePolicy(sandboxContainer); 2039var egress = AzureSandboxContainerDeployment.CreateEgressPolicy( 2064var endpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2100Assert.Null(AzureSandboxContainerDeployment.CreateLifecyclePolicy(defaultSandbox)); 2102AzureSandboxContainerDeployment.CreateLifecyclePolicy(disabledSandbox)); 2106AzureSandboxContainerDeployment.CreateLifecyclePolicy(enabledSandbox)); 2188var endpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2211Assert.True(AzureSandboxContainerDeployment.TryResolveEndpointReferenceValue(api.GetEndpoint("http"), sandboxGroup.Resource, out var urlExpression)); 2216Assert.True(AzureSandboxContainerDeployment.TryResolveEndpointReferenceValue(api.GetEndpoint("http").Property(EndpointProperty.TargetPort), sandboxGroup.Resource, out var targetPortExpression)); 2250var exception = Assert.Throws<InvalidOperationException>(() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2289var exception = Assert.Throws<NotSupportedException>(() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2313var exception = Assert.Throws<NotSupportedException>(() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2404var sandboxEndpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2540var sandboxEndpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2543var resources = AzureSandboxContainerDeployment.CreateSandboxResources(sandboxContainer); 2601return AzureSandboxContainerDeployment.CreateSandboxResources(sandboxContainer); 2662Assert.Empty(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2676var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync(stepContext, project); 2700var endpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2727() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2748() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2782var endpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2801AzureSandboxContainerDeployment.GetStateSectionName(deploymentTarget), 2811Assert.True(AzureSandboxContainerDeployment.TryResolveEndpointReferenceValue( 2815Assert.True(AzureSandboxContainerDeployment.TryResolveEndpointReferenceValue( 2819Assert.Equal("https://frontend.example.test", (await AzureSandboxContainerDeployment.ResolveValueWithEgressHostsAsync(stepContext, project, httpUrlExpression)).Value); 2820Assert.Equal("https://frontend.example.test", (await AzureSandboxContainerDeployment.ResolveValueWithEgressHostsAsync(stepContext, project, httpsUrlExpression)).Value); 2847Assert.Empty(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(frontendTarget)); 2848Assert.Empty(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(backendTarget)); 2871var sandboxEndpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2888var steps = AzureSandboxContainerDeployment.CreatePipelineSteps(sandboxContainer).ToList(); 2905await AzureSandboxContainerDeployment.ConfigureDeployOrderingAsync(context, sandboxContainer); 2934AzureSandboxContainerDeployment.GetStateSectionName(apiSandbox), 2958var value = await AzureSandboxContainerDeployment.ResolveValueWithEgressHostsAsync(stepContext, web.Resource, endpointExpression); 2959var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync(stepContext, web.Resource); 2994var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync( 2997var egressPolicy = AzureSandboxContainerDeployment.CreateEgressPolicy(environment.EgressHosts); 3031var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync( 3186var (entrypoint, command) = await AzureSandboxContainerDeployment.ResolveModeledCommandAsync( 3192Assert.True(AzureSandboxContainerDeployment.HasModeledCommandConfiguration(project.Resource)); 3196Assert.True(AzureSandboxContainerDeployment.HasModeledCommandConfiguration(container.Resource)); 3220AzureSandboxContainerDeployment.GetStateSectionName(apiSandbox), 3241var command = await AzureSandboxContainerDeployment.ResolveModeledCommandAsync(stepContext, worker.Resource); 3242var egressPolicy = AzureSandboxContainerDeployment.CreateEgressPolicy(command.EgressHosts); 3274var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync( 3277var egressPolicy = AzureSandboxContainerDeployment.CreateEgressPolicy(environment.EgressHosts); 3292var firstLease = await AzureSandboxContainerDeployment.AcquireDeploymentLeaseAsync( 3300var secondLeaseTask = AzureSandboxContainerDeployment.AcquireDeploymentLeaseAsync( 3377AzureSandboxContainerDeployment.CreateWithResponseLossCleanupAsync(