126 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)
18private readonly AzureSandboxContainerDeployment.SandboxEndpoint? _sandboxEndpoint; 65.AcquireSectionAsync(AzureSandboxContainerDeployment.GetStateSectionName(_resource), cancellationToken) 158private static AzureSandboxContainerDeployment.SandboxEndpoint ResolveSandboxEndpoint(AzureSandboxContainerResource resource, EndpointReference endpointReference) 160var endpoints = AzureSandboxContainerDeployment.ResolveSandboxEndpoints(resource); 163AzureSandboxContainerDeployment.SandboxEndpoint? fallbackEndpoint = null; 193return 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 (112)
AzureSandboxesTests.cs (112)
46var state = await manager.AcquireSectionAsync(AzureSandboxContainerDeployment.GetStateSectionName(target), default); 54Assert.True(AzureSandboxContainerDeployment.TryResolveEndpointReferenceValue( 174var scope = AzureSandboxContainerDeployment.CreateDataPlaneScope(sandboxGroup.Resource); 625var acrIdentity = await AzureSandboxContainerDeployment.ResolveImagePullManagedIdentityClientIdAsync( 629var publicIdentity = await AzureSandboxContainerDeployment.ResolveImagePullManagedIdentityClientIdAsync( 733Assert.False(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 745Assert.False(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 757Assert.False(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 769Assert.False(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 781Assert.True(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 796AzureSandboxContainerDeployment.CreateLabelSelector("owner-1", "frontend-sandbox-container")); 807AzureSandboxContainerDeployment.CreateSandboxUrlSummary(currentUrl, retainedUrl)); 810AzureSandboxContainerDeployment.CreateSandboxUrlSummary(currentUrl, currentUrl)); 813AzureSandboxContainerDeployment.CreateSandboxUrlSummary(currentUrl, retainedUrl: null)); 828Assert.True(AzureSandboxContainerDeployment.HasRemoteDeploymentState(ownerOnlyState)); 829Assert.False(AzureSandboxContainerDeployment.HasRemoteDeploymentState(emptyState)); 847AzureSandboxContainerDeployment.ValidateDeploymentScope( 852AzureSandboxContainerDeployment.ValidateDeploymentScope( 868var firstAppHostIdentity = AzureSandboxContainerDeployment.GetStableAppHostIdentity(firstPolyglotBuilder.Configuration); 869var secondAppHostIdentity = AzureSandboxContainerDeployment.GetStableAppHostIdentity(secondPolyglotBuilder.Configuration); 870var owner = AzureSandboxContainerDeployment.CreateStableOwnerId(firstAppHostIdentity, "Production", scope, "frontend-sandbox-container"); 871var freshRunOwner = AzureSandboxContainerDeployment.CreateStableOwnerId(firstAppHostIdentity.ToLowerInvariant(), "production", scope, "frontend-sandbox-container"); 872var otherEnvironmentOwner = AzureSandboxContainerDeployment.CreateStableOwnerId(firstAppHostIdentity, "Staging", scope, "frontend-sandbox-container"); 873var otherAppOwner = AzureSandboxContainerDeployment.CreateStableOwnerId(secondAppHostIdentity, "Production", scope, "frontend-sandbox-container"); 874var otherScopeOwner = AzureSandboxContainerDeployment.CreateStableOwnerId( 885Assert.True(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 910var pendingOwnerIds = AzureSandboxContainerDeployment.GetPendingOwnerCleanupIds( 923var legacyOwner = AzureSandboxContainerDeployment.CreateLegacyStableOwnerId( 927var productionOwner = AzureSandboxContainerDeployment.CreateStableOwnerId( 932var stagingOwner = AzureSandboxContainerDeployment.CreateStableOwnerId( 947var broadCleanupOwners = AzureSandboxContainerDeployment.GetPendingOwnerCleanupIds( 951var directCleanupState = AzureSandboxContainerDeployment.CreatePendingLegacyDeploymentCleanup( 969AzureSandboxContainerDeployment.GetStableAppHostIdentity(builder.Configuration)); 980new AzureSandboxContainerDeployment.SandboxEndpoint( 997var egressPolicy = AzureSandboxContainerDeployment.CreateEgressPolicy( 999var fingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 1013Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 1016Assert.False(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 1017var updatedImageFingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 1022Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, updatedImageFingerprint, hasRuntimeEnvironmentConfiguration: false)); 1024Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 1027Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 1030var anonymousFingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 1037Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, anonymousFingerprint, hasRuntimeEnvironmentConfiguration: false)); 1039Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: true)); 1041Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 1043Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange( 1049Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 1052var updatedIdentityFingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 1063Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, updatedIdentityFingerprint, hasRuntimeEnvironmentConfiguration: false)); 1065var updatedEgressFingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 1069AzureSandboxContainerDeployment.CreateEgressPolicy(["other.example.com"])); 1070Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, updatedEgressFingerprint, hasRuntimeEnvironmentConfiguration: false)); 1093AzureSandboxContainerDeployment.DeleteSandboxAsync( 1131AzureSandboxContainerDeployment.DeleteExistingDeploymentAsync( 1169AzureSandboxContainerDeployment.DeleteExistingDeploymentAsync( 1204var existingScope = AzureSandboxContainerDeployment.CreateDataPlaneScope(sandboxGroup.Resource); 1231AzureSandboxContainerDeployment.DestroyAsync(stepContext, sandboxResource)); 1244var exception = AzureSandboxContainerDeployment.CreateDiskImageFailureException( 1278await AzureSandboxContainerDeployment.DeleteRemoteDeploymentsByResourceLabelAsync( 1751var reference = await AzureSandboxContainerDeployment.ResolveContainerImageReferenceForDiskImageAsync( 2025Auth = AzureSandboxContainerDeployment.CreatePortAuthConfig(anonymous: false), 2071var resources = AzureSandboxContainerDeployment.CreateSandboxResources(sandboxContainer); 2076var lifecycle = AzureSandboxContainerDeployment.CreateLifecyclePolicy(sandboxContainer); 2088var egress = AzureSandboxContainerDeployment.CreateEgressPolicy( 2113var endpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2149Assert.Null(AzureSandboxContainerDeployment.CreateLifecyclePolicy(defaultSandbox)); 2151AzureSandboxContainerDeployment.CreateLifecyclePolicy(disabledSandbox)); 2155AzureSandboxContainerDeployment.CreateLifecyclePolicy(enabledSandbox)); 2237var endpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2260Assert.True(AzureSandboxContainerDeployment.TryResolveEndpointReferenceValue(api.GetEndpoint("http"), sandboxGroup.Resource, out var urlExpression)); 2265Assert.True(AzureSandboxContainerDeployment.TryResolveEndpointReferenceValue(api.GetEndpoint("http").Property(EndpointProperty.TargetPort), sandboxGroup.Resource, out var targetPortExpression)); 2299var exception = Assert.Throws<InvalidOperationException>(() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2338var exception = Assert.Throws<NotSupportedException>(() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2362var exception = Assert.Throws<NotSupportedException>(() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2453var sandboxEndpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2589var sandboxEndpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2592var resources = AzureSandboxContainerDeployment.CreateSandboxResources(sandboxContainer); 2650return AzureSandboxContainerDeployment.CreateSandboxResources(sandboxContainer); 2711Assert.Empty(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2725var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync(stepContext, project); 2749var endpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2776() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2797() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2831var endpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2850AzureSandboxContainerDeployment.GetStateSectionName(deploymentTarget), 2860Assert.True(AzureSandboxContainerDeployment.TryResolveEndpointReferenceValue( 2864Assert.True(AzureSandboxContainerDeployment.TryResolveEndpointReferenceValue( 2868Assert.Equal("https://frontend.example.test", (await AzureSandboxContainerDeployment.ResolveValueWithEgressHostsAsync(stepContext, project, httpUrlExpression)).Value); 2869Assert.Equal("https://frontend.example.test", (await AzureSandboxContainerDeployment.ResolveValueWithEgressHostsAsync(stepContext, project, httpsUrlExpression)).Value); 2896Assert.Empty(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(frontendTarget)); 2897Assert.Empty(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(backendTarget)); 2920var sandboxEndpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2937var steps = AzureSandboxContainerDeployment.CreatePipelineSteps(sandboxContainer).ToList(); 2954await AzureSandboxContainerDeployment.ConfigureDeployOrderingAsync(context, sandboxContainer); 2983AzureSandboxContainerDeployment.GetStateSectionName(apiSandbox), 3007var value = await AzureSandboxContainerDeployment.ResolveValueWithEgressHostsAsync(stepContext, web.Resource, endpointExpression); 3008var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync(stepContext, web.Resource); 3043var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync( 3046var egressPolicy = AzureSandboxContainerDeployment.CreateEgressPolicy(environment.EgressHosts); 3080var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync( 3235var (entrypoint, command) = await AzureSandboxContainerDeployment.ResolveModeledCommandAsync( 3241Assert.True(AzureSandboxContainerDeployment.HasModeledCommandConfiguration(project.Resource)); 3245Assert.True(AzureSandboxContainerDeployment.HasModeledCommandConfiguration(container.Resource)); 3269AzureSandboxContainerDeployment.GetStateSectionName(apiSandbox), 3290var command = await AzureSandboxContainerDeployment.ResolveModeledCommandAsync(stepContext, worker.Resource); 3291var egressPolicy = AzureSandboxContainerDeployment.CreateEgressPolicy(command.EgressHosts); 3323var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync( 3326var egressPolicy = AzureSandboxContainerDeployment.CreateEgressPolicy(environment.EgressHosts); 3341var firstLease = await AzureSandboxContainerDeployment.AcquireDeploymentLeaseAsync( 3349var secondLeaseTask = AzureSandboxContainerDeployment.AcquireDeploymentLeaseAsync( 3426AzureSandboxContainerDeployment.CreateWithResponseLossCleanupAsync(