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)
19private readonly AzureSandboxContainerDeployment.SandboxEndpoint? _sandboxEndpoint; 66.AcquireSectionAsync(AzureSandboxContainerDeployment.GetStateSectionName(_resource), cancellationToken) 157private static AzureSandboxContainerDeployment.SandboxEndpoint ResolveSandboxEndpoint(AzureSandboxContainerResource resource, EndpointReference endpointReference) 159var endpoints = AzureSandboxContainerDeployment.ResolveSandboxEndpoints(resource); 162AzureSandboxContainerDeployment.SandboxEndpoint? fallbackEndpoint = null; 192return 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)
143var scope = AzureSandboxContainerDeployment.CreateDataPlaneScope(sandboxGroup.Resource); 594var acrIdentity = await AzureSandboxContainerDeployment.ResolveImagePullManagedIdentityClientIdAsync( 598var publicIdentity = await AzureSandboxContainerDeployment.ResolveImagePullManagedIdentityClientIdAsync( 702Assert.False(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 714Assert.False(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 726Assert.False(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 738Assert.False(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 750Assert.True(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 765AzureSandboxContainerDeployment.CreateLabelSelector("owner-1", "frontend-sandbox-container")); 776AzureSandboxContainerDeployment.CreateSandboxUrlSummary(currentUrl, retainedUrl)); 779AzureSandboxContainerDeployment.CreateSandboxUrlSummary(currentUrl, currentUrl)); 782AzureSandboxContainerDeployment.CreateSandboxUrlSummary(currentUrl, retainedUrl: null)); 797Assert.True(AzureSandboxContainerDeployment.HasRemoteDeploymentState(ownerOnlyState)); 798Assert.False(AzureSandboxContainerDeployment.HasRemoteDeploymentState(emptyState)); 816AzureSandboxContainerDeployment.ValidateDeploymentScope( 821AzureSandboxContainerDeployment.ValidateDeploymentScope( 837var firstAppHostIdentity = AzureSandboxContainerDeployment.GetStableAppHostIdentity(firstPolyglotBuilder.Configuration); 838var secondAppHostIdentity = AzureSandboxContainerDeployment.GetStableAppHostIdentity(secondPolyglotBuilder.Configuration); 839var owner = AzureSandboxContainerDeployment.CreateStableOwnerId(firstAppHostIdentity, "Production", scope, "frontend-sandbox-container"); 840var freshRunOwner = AzureSandboxContainerDeployment.CreateStableOwnerId(firstAppHostIdentity.ToLowerInvariant(), "production", scope, "frontend-sandbox-container"); 841var otherEnvironmentOwner = AzureSandboxContainerDeployment.CreateStableOwnerId(firstAppHostIdentity, "Staging", scope, "frontend-sandbox-container"); 842var otherAppOwner = AzureSandboxContainerDeployment.CreateStableOwnerId(secondAppHostIdentity, "Production", scope, "frontend-sandbox-container"); 843var otherScopeOwner = AzureSandboxContainerDeployment.CreateStableOwnerId( 854Assert.True(AzureSandboxContainerDeployment.ShouldDeleteLabeledDeployment( 879var pendingOwnerIds = AzureSandboxContainerDeployment.GetPendingOwnerCleanupIds( 892var legacyOwner = AzureSandboxContainerDeployment.CreateLegacyStableOwnerId( 896var productionOwner = AzureSandboxContainerDeployment.CreateStableOwnerId( 901var stagingOwner = AzureSandboxContainerDeployment.CreateStableOwnerId( 916var broadCleanupOwners = AzureSandboxContainerDeployment.GetPendingOwnerCleanupIds( 920var directCleanupState = AzureSandboxContainerDeployment.CreatePendingLegacyDeploymentCleanup( 938AzureSandboxContainerDeployment.GetStableAppHostIdentity(builder.Configuration)); 949new AzureSandboxContainerDeployment.SandboxEndpoint( 966var egressPolicy = AzureSandboxContainerDeployment.CreateEgressPolicy( 968var fingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 982Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 985Assert.False(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 986var updatedImageFingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 991Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, updatedImageFingerprint, hasRuntimeEnvironmentConfiguration: false)); 993Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 996Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 999var anonymousFingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 1006Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, anonymousFingerprint, hasRuntimeEnvironmentConfiguration: false)); 1008Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: true)); 1010Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 1012Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange( 1018Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, fingerprint, hasRuntimeEnvironmentConfiguration: false)); 1021var updatedIdentityFingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 1032Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, updatedIdentityFingerprint, hasRuntimeEnvironmentConfiguration: false)); 1034var updatedEgressFingerprint = AzureSandboxContainerDeployment.CreateDeploymentSecurityFingerprint( 1038AzureSandboxContainerDeployment.CreateEgressPolicy(["other.example.com"])); 1039Assert.True(AzureSandboxContainerDeployment.HasSecurityRelevantEndpointChange(previousState, updatedEgressFingerprint, hasRuntimeEnvironmentConfiguration: false)); 1062AzureSandboxContainerDeployment.DeleteSandboxAsync( 1100AzureSandboxContainerDeployment.DeleteExistingDeploymentAsync( 1138AzureSandboxContainerDeployment.DeleteExistingDeploymentAsync( 1173var existingScope = AzureSandboxContainerDeployment.CreateDataPlaneScope(sandboxGroup.Resource); 1200AzureSandboxContainerDeployment.DestroyAsync(stepContext, sandboxResource)); 1213var exception = AzureSandboxContainerDeployment.CreateDiskImageFailureException( 1247await AzureSandboxContainerDeployment.DeleteRemoteDeploymentsByResourceLabelAsync( 1704var reference = await AzureSandboxContainerDeployment.ResolveContainerImageReferenceForDiskImageAsync( 1978Auth = AzureSandboxContainerDeployment.CreatePortAuthConfig(anonymous: false), 2024var resources = AzureSandboxContainerDeployment.CreateSandboxResources(sandboxContainer); 2029var lifecycle = AzureSandboxContainerDeployment.CreateLifecyclePolicy(sandboxContainer); 2041var egress = AzureSandboxContainerDeployment.CreateEgressPolicy( 2066var endpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2102Assert.Null(AzureSandboxContainerDeployment.CreateLifecyclePolicy(defaultSandbox)); 2104AzureSandboxContainerDeployment.CreateLifecyclePolicy(disabledSandbox)); 2108AzureSandboxContainerDeployment.CreateLifecyclePolicy(enabledSandbox)); 2190var endpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2213Assert.True(AzureSandboxContainerDeployment.TryResolveEndpointReferenceValue(api.GetEndpoint("http"), sandboxGroup.Resource, out var urlExpression)); 2218Assert.True(AzureSandboxContainerDeployment.TryResolveEndpointReferenceValue(api.GetEndpoint("http").Property(EndpointProperty.TargetPort), sandboxGroup.Resource, out var targetPortExpression)); 2252var exception = Assert.Throws<InvalidOperationException>(() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2291var exception = Assert.Throws<NotSupportedException>(() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2315var exception = Assert.Throws<NotSupportedException>(() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2406var sandboxEndpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2542var sandboxEndpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2545var resources = AzureSandboxContainerDeployment.CreateSandboxResources(sandboxContainer); 2603return AzureSandboxContainerDeployment.CreateSandboxResources(sandboxContainer); 2664Assert.Empty(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2678var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync(stepContext, project); 2702var endpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2729() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2750() => AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2784var endpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(deploymentTarget)); 2803AzureSandboxContainerDeployment.GetStateSectionName(deploymentTarget), 2813Assert.True(AzureSandboxContainerDeployment.TryResolveEndpointReferenceValue( 2817Assert.True(AzureSandboxContainerDeployment.TryResolveEndpointReferenceValue( 2821Assert.Equal("https://frontend.example.test", (await AzureSandboxContainerDeployment.ResolveValueWithEgressHostsAsync(stepContext, project, httpUrlExpression)).Value); 2822Assert.Equal("https://frontend.example.test", (await AzureSandboxContainerDeployment.ResolveValueWithEgressHostsAsync(stepContext, project, httpsUrlExpression)).Value); 2849Assert.Empty(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(frontendTarget)); 2850Assert.Empty(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(backendTarget)); 2873var sandboxEndpoint = Assert.Single(AzureSandboxContainerDeployment.ResolveSandboxEndpoints(sandboxContainer)); 2890var steps = AzureSandboxContainerDeployment.CreatePipelineSteps(sandboxContainer).ToList(); 2907await AzureSandboxContainerDeployment.ConfigureDeployOrderingAsync(context, sandboxContainer); 2936AzureSandboxContainerDeployment.GetStateSectionName(apiSandbox), 2960var value = await AzureSandboxContainerDeployment.ResolveValueWithEgressHostsAsync(stepContext, web.Resource, endpointExpression); 2961var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync(stepContext, web.Resource); 2996var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync( 2999var egressPolicy = AzureSandboxContainerDeployment.CreateEgressPolicy(environment.EgressHosts); 3033var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync( 3188var (entrypoint, command) = await AzureSandboxContainerDeployment.ResolveModeledCommandAsync( 3194Assert.True(AzureSandboxContainerDeployment.HasModeledCommandConfiguration(project.Resource)); 3198Assert.True(AzureSandboxContainerDeployment.HasModeledCommandConfiguration(container.Resource)); 3222AzureSandboxContainerDeployment.GetStateSectionName(apiSandbox), 3243var command = await AzureSandboxContainerDeployment.ResolveModeledCommandAsync(stepContext, worker.Resource); 3244var egressPolicy = AzureSandboxContainerDeployment.CreateEgressPolicy(command.EgressHosts); 3276var environment = await AzureSandboxContainerDeployment.ResolveEnvironmentVariablesAsync( 3279var egressPolicy = AzureSandboxContainerDeployment.CreateEgressPolicy(environment.EgressHosts); 3294var firstLease = await AzureSandboxContainerDeployment.AcquireDeploymentLeaseAsync( 3302var secondLeaseTask = AzureSandboxContainerDeployment.AcquireDeploymentLeaseAsync( 3379AzureSandboxContainerDeployment.CreateWithResponseLossCleanupAsync(