13 implementations of Name
Aspire.Hosting (1)
Aspire.Hosting.Azure.EventHubs (1)
Aspire.Hosting.Azure.PostgreSQL (1)
Aspire.Hosting.Azure.Redis (1)
Aspire.Hosting.Azure.Storage (1)
Aspire.Hosting.CodeGeneration.Python.Tests (2)
Aspire.Hosting.Tests (4)
Aspire.Hosting.Yarp.Tests (2)
1186 references to Name
Aspire.Hosting (354)
ApplicationModel\RequiredCommandValidator.cs (5)
58throw new InvalidOperationException($"Required command on resource '{resource.Name}' cannot be null or empty.");
71_logger.LogWarning("Resource '{ResourceName}' may fail to start: {Message}", resource.Name, state.ErrorMessage);
78_logger.LogDebug("Required command '{Command}' for resource '{ResourceName}' already validated, resolved to '{ResolvedPath}'.", command, resource.Name, state.ResolvedPath);
118_logger.LogWarning("{Message}", string.Format(CultureInfo.CurrentCulture, MessageStrings.ResourceMayFailToStart, resource.Name, message));
147_logger.LogDebug("Required command '{Command}' for resource '{ResourceName}' resolved to '{ResolvedPath}'.", command, resource.Name, resolved);
ApplicationModel\ResourceExtensions.cs (19)
668logger.LogInformation("Waiting for value from resource '{ResourceName}'", providerResource.Name);
672logger.LogInformation("Waiting for value for environment variable value '{Name}' from resource '{ResourceName}'", key, providerResource.Name);
677logger.LogInformation("Waiting for value for connection string from resource '{ResourceName}'", cs.Name);
684endpointReference.Resource.Name,
1090var computeEnvironmentNames = string.Join(", ", annotations.Select(a => a.ComputeEnvironment?.Name));
1091throw new InvalidOperationException($"Resource '{resource.Name}' has multiple compute environments - '{computeEnvironmentNames}'. Please specify a single compute environment using 'WithComputeEnvironment'.");
1126throw new InvalidOperationException($"A circular lifetime reference was detected for resource '{resource.Name}'.");
1137: throw new InvalidOperationException($"Resource '{resource.Name}' has a resource persistence mode but no source resource."),
1187throw new InvalidOperationException($"A circular lifetime reference was detected for resource '{resource.Name}'.");
1199throw new InvalidOperationException($"Resource '{resource.Name}' has a parent process persistence mode but no parent process identity.");
1203: throw new InvalidOperationException($"Resource '{resource.Name}' has a resource persistence mode but no source resource.");
1266throw new InvalidOperationException($"Resource '{resource.Name}' has no resolved names.");
1270throw new InvalidOperationException($"Resource '{resource.Name}' has multiple resolved names: {string.Join(", ", names)}.");
1283return resource.GetReplicaCount() > 1 ? resourceId : resource.Name;
1317return [resource.Name];
1334RemoteImageName = resource.Name.ToLowerInvariant(),
1394var registryNames = string.Join(", ", registryTargetAnnotations.Select(a => a.Registry is IResource res ? res.Name : a.Registry.ToString()));
1396$"Resource '{resource.Name}' has multiple container registries available - '{registryNames}'. " +
1400throw new InvalidOperationException($"Resource '{resource.Name}' does not have a container registry reference.");
ApplicationModel\ResourceNotificationService.cs (21)
161dependency.Name,
171dependency.Name,
252if (appModel is not null && !appModel.Resources.Any(r => string.Equals(r.Name, resourceName, StringComparisons.ResourceName)))
336resourceLogger.LogInformation("Waiting for resource '{ResourceName}' to complete.", dependency.Name);
340var displayName = names.Length > 1 ? names[i] : dependency.Name;
357dependency.Name,
371throw new DistributedApplicationException($"Resource '{resource.Name}' stopped waiting for dependency resource '{displayName}' because it failed to start.");
384$"Resource '{resource.Name}' stopped waiting for dependency resource '{displayName}' because it entered the '{snapshot.State.Text}' state with exit code '{snapshot.ExitCode}', expected '{exitCode}'."
405resourceLogger.LogInformation("Waiting for resource '{ResourceName}' to enter the '{State}' state.", dependency.Name, KnownResourceStates.Running);
412var displayName = names.Length > 1 ? names[i] : dependency.Name;
421dependency.Name,
437throw new DistributedApplicationException($"Resource '{resource.Name}' stopped waiting for dependency resource '{displayName}' because it failed to start.");
450$"Resource '{resource.Name}' stopped waiting for dependency resource '{displayName}' because it entered the '{snapshot.State.Text}' state prematurely."
614$"Resource '{resource.Name}' failed to wait for dependencies before the operation was cancelled.",
615resource.Name);
713if (!string.Equals(resourceName, resourceEvent.Resource.Name, StringComparisons.ResourceName))
772foreach (var matchingResource in _resourceNotificationStates.Where(s => string.Equals(s.Value.Resource.Name, resourceId, StringComparisons.ResourceName)))
912_logger.LogTrace("Resource {ResourceName}/{ResourceId} update skipped because the snapshot is unchanged.", resource.Name, resourceId);
933_logger.LogDebug("Resource {ResourceName}/{ResourceId} changed state: {PreviousState} -> {NewState}", resource.Name, resourceId, previousStateText, newStateText);
938_logger.LogDebug("Resource {ResourceName}/{ResourceId} changed state: {NewState}", resource.Name, resourceId, newStateText);
962resource.Name,
Backchannel\AuxiliaryBackchannelRpcTarget.cs (11)
440var resource = appModel.Resources.FirstOrDefault(r => string.Equals(r.Name, request.ResourceName, StringComparisons.ResourceName));
606resource.Name,
612ResourceName = resource.Name,
613DisplayName = resource.Name,
808var matchingResource = appModel.Resources.SingleOrDefault(resource => string.Equals(resource.Name, requestedResourceName, StringComparisons.ResourceName));
829resolvedMatches[0].ResolvedResourceNames.Length == 1 ? resolvedMatches[0].Resource.Name : requestedResourceName,
844? matchingResource.Resource.Name
853|| (ResourceName is not null && string.Equals(resourceEvent.Resource.Name, ResourceName, StringComparisons.ResourceName));
1210DisplayName = resource.Name,
1810.FirstOrDefault(r => string.Equals(r.Name, resourceName, StringComparisons.ResourceName));
2011if (string.Equals(resource.Name, resourceName, StringComparisons.ResourceName))
Dcp\DcpExecutor.cs (15)
680_logger.LogWarning("Encountered the same service-endpoint combination more than once for {EndpointName} on resource {ResourceName} when creating default endpoint services. This should never happen.", endpoint.Name, sp.ModelResource.Name);
709svc.Annotate(CustomResource.ResourceNameAnnotation, sp.ModelResource.Name);
848_logger.LogDebug("Using persisted public port {Port} for proxyless endpoint '{EndpointName}' on persistent resource '{ResourceName}'.", persistedPort, endpoint.Name, resource.Name);
853_logger.LogDebug("Allocated public port {Port} for proxyless endpoint '{EndpointName}' on resource '{ResourceName}'.", publicPort, endpoint.Name, resource.Name);
860_logger.LogWarning("Failed to persist public port {Port} for proxyless endpoint '{EndpointName}' on persistent resource '{ResourceName}'. Enable user secrets, set a fixed public port, or configure the endpoint to use a proxy to avoid recreating the persistent resource each run.", publicPort, endpoint.Name, resource.Name);
902_logger.LogDebug("Ignoring invalid persisted public port value '{Port}' for proxyless endpoint '{EndpointName}' on persistent resource '{ResourceName}'.", configuredPort, endpoint.Name, resource.Name);
910return $"Resources:{resource.Name}:{endpoint.Name}:port";
1056resourceLogger.LogError(ex, "Failed to create resource {ResourceName}", modelResource.Name);
1098resourceLogger.LogError(ex, "Failed to create resource {ResourceName}", er.ModelResource.Name);
1121throw new DistributedApplicationException($"Couldn't find required {nameof(DcpInstancesAnnotation)} annotation on resource {resource.Name}.");
1132throw new DistributedApplicationException($"Couldn't find required instance ID for index {instanceIndex} on resource {resource.Name}.");
1305_logger.LogError(ex, "Failed to start resource {ResourceName}", resourceReference.ModelResource.Name);
1411_connectionStringsAdvertised.Remove(resource.Name);
1419if (!_endpointsAdvertised.Add(resource.Name))
1439if (!_connectionStringsAdvertised.Add(resource.Name))
Health\ResourceHealthCheckService.cs (13)
31var resourceName = resourceEvent.Resource.Name;
127logger.LogDebug("Resource '{ResourceName}' has no health checks to monitor.", resource.Name);
134logger.LogDebug("Resource '{ResourceName}' health checks to monitor: {HeathCheckKeys}", resource.Name, string.Join(", ", registrationKeysToCheck));
173logger.LogTrace("Health report status for '{ResourceName}' is {HealthReportStatus}.", resource.Name, report.Status);
193logger.LogTrace("Health reports for '{ResourceName}' have changed.", resource.Name);
216resource.Name
228logger.LogTrace("Resource '{ResourceName}' health check monitoring loop starting delay of {DelayInterval}.", resource.Name, delayInterval);
257logger.LogDebug("Resource '{ResourceName}' is ready.", resource.Name);
264logger.LogDebug("Publishing ResourceReadyEvent for '{ResourceName}'.", resource.Name);
269logger.LogDebug("Waiting for ResourceReadyEvent for '{ResourceName}'.", resource.Name);
274logger.LogDebug("ResourceReadyEvent for '{ResourceName}' completed.", resource.Name);
276logger.LogDebug("Publishing the result of ResourceReadyEvent for '{ResourceName}'.", resource.Name);
333_resourceName = initialEvent.Resource.Name;
Orchestrator\ApplicationOrchestrator.cs (21)
100_logger.LogWarning(ex, "Failed to resolve connection property {ConnectionPropertyName} for resource {ResourceName}.", property.Key, resourceWithConnectionString.Name);
154@event.Resource.Name,
324_logger.LogTrace("Setting primary launch profile endpoint to '{EndpointName}' for resource '{ResourceName}'.", endpoint.Name, resource.Name);
390Url = $"{allocatedEndpoint.UriScheme}://{resource.Name.ToLowerInvariant()}-{subdomainSuffix}.dev.localhost:{allocatedEndpoint.Port}",
416_logger.LogTrace("Added URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, endpoint.Name, resource.Name);
423_logger.LogTrace("Added additional URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", additionalUrl.Url, endpoint.Name, resource.Name);
437_logger.LogTrace("Added static URL '{Url}' for resource '{ResourceName}'.", staticUrl.Url, resource.Name);
450_logger.LogTrace("Running {CallbackCount} URL callbacks for resource '{ResourceName}'.", callbacks.Count(), resource.Name);
461_logger.LogTrace("Invoking URL callback '{CallbackIndex}' for resource '{ResourceName}'.", index, resource.Name);
466_logger.LogTrace("{UrlCount} URLs after callback '{CallbackIndex}' for resource '{ResourceName}'.", urlsCallbackContext.Urls.Count, index, resource.Name);
472_logger.LogTrace("{UrlCount} URLs after calling '{CallbackIndex}' callback(s) for resource '{ResourceName}'.", urls.Count, index, resource.Name);
492_logger.LogTrace("Applying path '{Path}' from URL '{Url}' for primary launch profile endpoint '{EndpointName}' to other launch profile endpoints for resource '{ResourceName}'.", primaryPath, primaryUrl.Url, primaryLaunchProfileEndpoint.Name, resource.Name);
502_logger.LogTrace("Updating URL '{Url}' with path '{Path}' for launch profile endpoint '{EndpointName}' for resource '{ResourceName}'.", url.Url, primaryPath, url.Endpoint.EndpointName, resource.Name);
508_logger.LogTrace("Updated URL to '{Url}' for launch profile endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, url.Endpoint.EndpointName, resource.Name);
517_logger.LogTrace("URL '{Url}' for primary launch profile endpoint '{EndpointName}' for resource '{ResourceName}' does not have a path to apply to other launch profile endpoints.", primaryUrl.Url, primaryLaunchProfileEndpoint.Name, resource.Name);
525_logger.LogTrace("Could not find URL for primary launch profile endpoint '{EndpointName}' for resource '{ResourceName}'.", primaryLaunchProfileEndpoint.Name, resource.Name);
533_logger.LogTrace("Converting relative endpoint URLs to absolute URLs for resource '{ResourceName}'.", resource.Name);
544_logger.LogTrace("Converted relative URL to absolute URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, endpoint.EndpointName, resource.Name);
558_logger.LogTrace("Added URL annotation '{Url}' to resource '{ResourceName}'.", url.Url, resource.Name);
563_logger.LogTrace("Added total of {UrlCount} URLs to resource '{ResourceName}'", count, resource.Name);
569resourceLogger.LogError(ex, "An error occurred while processing URLs for resource '{ResourceName}': {Message}", resource.Name, ex.Message);
Pipelines\DistributedApplicationPipeline.cs (12)
210$"Resource '{resource.Name}' has Destination set to Archive but OutputPath is not configured. " +
236var registryNames = string.Join(", ", registryTargetAnnotations.Select(a => a.Registry is IResource res ? res.Name : a.Registry.ToString()));
238$"Resource '{resource.Name}' requires image push but has multiple container registries available - '{registryNames}'. " +
246$"Resource '{resource.Name}' requires image push but no container registry is available. " +
361var resourceNames = string.Join("', '", unboundResources.Select(resource => resource.Name));
362var environmentNames = string.Join("', '", computeEnvironments.Select(environment => environment.Name));
390if (!string.Equals(resource.Name, annotation.Source.Name, StringComparison.OrdinalIgnoreCase))
392consumedBuildOnlyContainerNames.Add(annotation.Source.Name);
398.Where(resource => !consumedBuildOnlyContainerNames.Contains(resource.Name))
403var resourceNames = string.Join("', '", unconsumedBuildOnlyContainers.Select(resource => resource.Name));
1196sb.AppendLine(CultureInfo.InvariantCulture, $" Resource: {step.Resource.Name} ({step.Resource.GetType().Name})");
Publishing\ResourceContainerImageManager.cs (17)
280LocalImageName = resource.Name,
357resource.Name);
385logger.LogInformation("Building container image for resource {ResourceName}", resource.Name);
408throw new InvalidOperationException($"The container image name for resource '{resource.Name}' could not be determined.");
420throw new NotSupportedException($"The resource '{resource.Name}' of type '{resource.GetType().Name}' is not supported.");
436logger.LogInformation("Building container image for resource {ResourceName}", resource.Name);
442$"Resource '{resource.Name}' has Destination set to Archive but OutputPath is not configured. " +
459logger.LogInformation("Building image: {ResourceName}", resource.Name);
501logger.LogInformation("Building image for {ResourceName} completed", resource.Name);
525logger.LogError(ex, "Building image for {ResourceName} failed", resource.Name);
653$"Failed to build container image for resource '{resource.Name}' from project '{projectMetadata.ProjectPath}' with exit code {processResult.ExitCode}.";
728$"An execution context is required to evaluate the build environment for resource '{resource.Name}'.");
750$"The build environment variable '{name}' for .NET program resource '{resource.Name}' " +
778$"The build environment property '{propertyName}' for .NET program resource '{resource.Name}' " +
944logger.LogInformation("Building image: {ResourceName}", resource.Name);
1000logger.LogInformation("Building image for {ResourceName} completed", resource.Name);
1004logger.LogError(ex, "Failed to build container image from Dockerfile for {ResourceName}", resource.Name);
ResourceBuilderExtensions.cs (37)
136throw new InvalidOperationException($"Resource '{builder.Resource.Name}' does not support lifetime configuration.");
208throw new InvalidOperationException($"Resource '{builder.Resource.Name}' does not support lifetime configuration.");
448throw new DistributedApplicationException($"The URL parameter '{externalService.Resource.UrlParameter.Name}' for source resource '{externalService.Resource.Name}' is invalid while configuring target resource '{builder.Resource.Name}': {message}");
809var serviceName = name ?? annotation.Resource.Name;
1019throw new InvalidOperationException($"The resource '{source.Resource.Name}' can't be used with withReference because it doesn't provide a connection string, service discovery, or a custom withReference implementation.");
1120connectionName ??= resource.Name;
1197$"'{candidateNames.LogicalName}' on resource '{context.Resource.Name}' both use " +
1327throw new InvalidOperationException($"The URI for service reference '{name}' is invalid while configuring target resource '{builder.Resource.Name}': it must be absolute.");
1332throw new InvalidOperationException($"The URI for service reference '{name}' is invalid while configuring target resource '{builder.Resource.Name}': it cannot contain a fragment.");
1337throw new InvalidOperationException($"The URI for service reference '{name}' is invalid while configuring target resource '{builder.Resource.Name}': it cannot contain a query string.");
1414throw new DistributedApplicationException($"The URL parameter '{externalService.Resource.UrlParameter.Name}' for source resource '{externalService.Resource.Name}' is invalid while configuring target resource '{builder.Resource.Name}': {message}");
2266context.Logger.LogWarning("Could not execute callback to customize endpoint URL as no endpoint with name '{EndpointName}' could be found on resource '{ResourceName}'.", endpointName, builder.Resource.Name);
2312context.Logger.LogWarning("Could not execute callback to add an endpoint URL as no endpoint with name '{EndpointName}' could be found on resource '{ResourceName}'.", endpointName, builder.Resource.Name);
2354context.Logger.LogWarning("Could not execute callback to customize endpoint URL as no URL for endpoint '{EndpointName}' could be found on resource '{ResourceName}'.", endpoint.EndpointName, builder.Resource.Name);
2366context.Logger.LogWarning("Could not execute callback to add an endpoint URL as no endpoint with name '{EndpointName}' could be found on resource '{ResourceName}'.", endpoint.EndpointName, endpoint.Resource.Name);
2557throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself.");
2562throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'.");
2680throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself.");
2685throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'.");
2783throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself.");
2788throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'.");
2843throw new DistributedApplicationException($"Resource '{builder.Resource.Name}' already has a health check with key '{key}'.");
2930?? throw new DistributedApplicationException($"Could not create HTTP health check for resource '{builder.Resource.Name}' as the endpoint selector returned null.");
2934throw new DistributedApplicationException($"Could not create HTTP health check for resource '{builder.Resource.Name}' as the endpoint with name '{endpoint.EndpointName}' and scheme '{endpoint.Scheme}' is not an HTTP endpoint.");
2947throw new DistributedApplicationException($"The endpoint '{endpointName}' does not exist on the resource '{builder.Resource.Name}'.");
2953var healthCheckKey = $"{builder.Resource.Name}_{endpointName}_{path}_{statusCode}_check";
3805?? throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as the endpoint selector returned null.");
3809throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as the endpoint with name '{endpoint.EndpointName}' and scheme '{endpoint.Scheme}' is not an HTTP endpoint.");
3817commandName ??= $"{endpoint.Resource.Name}-{endpoint.EndpointName}-http-{commandOptions.Method.Method.ToLowerInvariant()}-{path}";
4503throw new DistributedApplicationException($"Could not create {errorDisplayNoun} for resource '{builder.Resource.Name}' as the endpoint with name '{matchingEndpoint.EndpointName}' and scheme '{matchingEndpoint.Scheme}' is not an HTTP endpoint.");
4511throw new DistributedApplicationException($"Could not create {errorDisplayNoun} for resource '{builder.Resource.Name}' as no endpoint was found matching one of the specified names: {endpointNamesString}");
4531throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as it has no HTTP endpoints.");
5136builder.Resource.Name,
5241var endpoint = endpointSelector() ?? throw new DistributedApplicationException($"Could not create HTTP probe for resource '{builder.Resource.Name}' as the endpoint selector returned null.");
Aspire.Hosting.Azure (38)
AzureProvisioningController.cs (26)
1100.Select(static resource => resource.Resource.Name)
1238string.Equals(resource.Resource.Name, resourceName, StringComparisons.ResourceName) ||
1239string.Equals(resource.AzureResource.Name, resourceName, StringComparisons.ResourceName));
1296if (visitedResources.Add(resource.Resource.Name))
1385activeOperation.Operation.ResourceNames.Contains(resource.Resource.Name) ||
1386activeOperation.Operation.ResourceNames.Contains(resource.AzureResource.Name)).ToList();
2196driftedResources.Add(resource.Resource.Name);
2290? [resource.Resource.Name]
2291: new[] { resource.Resource.Name, resource.AzureResource.Name })
2785=> resource.AzureResource is AzureBicepResource bicepResource ? bicepResource.Name : resource.Resource.Name;
2827var resourceName = requiredDeploymentResourceName ?? (targetResources.Count == 1 ? targetResources.Single().Resource.Name : string.Join(", ", targetResources.Select(static resource => resource.Resource.Name)));
3380if (!notificationService.TryGetCurrentState(resource.Name, out var resourceEvent))
3615resource is not AzureEnvironmentResource && !activeOperation.AffectsResource(resource.Name))
3666if (seenNames.Add(resource.Name))
3793if (TryGetPublishedTerminalDeploymentState(resource.Resource.Name, out var publishedTerminalState) ||
3807if (!IsResourceInState(resource.Resource.Name, CancelingState) &&
3926resourceLogger.LogInformation("Skipping {resourceName} because it is not a Bicep resource.", resource.AzureResource.Name);
3935resourceLogger.LogInformation("Skipping {resourceName} because it is not configured to be provisioned.", resource.AzureResource.Name);
3947resourceLogger.LogWarning("Cached Azure deployment state for {resourceName} points to a missing Azure resource. Reprovisioning.", resource.AzureResource.Name);
3963resourceLogger.LogInformation("Using connection information stored in user secrets for {resourceName}.", resource.AzureResource.Name);
3970resourceLogger.LogInformation("Resolving {resourceName} as existing resource...", resource.AzureResource.Name);
3974resourceLogger.LogInformation("Provisioning {resourceName}...", resource.AzureResource.Name);
4011resourceLogger.LogError(ex, "Error provisioning {ResourceName}.", resource.AzureResource.Name);
4012FailProvisioning(resource.AzureResource, new InvalidOperationException($"Unable to provision {resource.AzureResource.Name}.", ex));
Aspire.Hosting.Azure.AppContainers (32)
AzureContainerAppResource.cs (10)
44Name = $"print-{targetResource.Name}-summary",
45Description = $"Prints the deployment summary and URL for {targetResource.Name}.",
51var portalLink = await ContainerAppUrls.GetPortalLinkAsync(containerAppEnv, targetResource.Name.ToLowerInvariant(), ctx.CancellationToken).ConfigureAwait(false);
55var endpoint = $"https://{targetResource.Name.ToLowerInvariant()}.{domainValue}";
58ctx.ReportingStep.Log(LogLevel.Information, new MarkdownString($"Successfully deployed **{targetResource.Name}** to {summaryValue}"));
59ctx.Summary.Add(targetResource.Name, new MarkdownString(summaryValue));
65ctx.ReportingStep.Log(LogLevel.Information, new MarkdownString($"Successfully deployed **{targetResource.Name}** to Azure Container Apps environment **{containerAppEnv.Name}**. {summaryValue}"));
66ctx.Summary.Add(targetResource.Name, new MarkdownString(summaryValue));
75Name = $"deploy-{targetResource.Name}",
76Description = $"Aggregation step for deploying {targetResource.Name} to Azure Container Apps.",
Aspire.Hosting.Azure.AppService (26)
Aspire.Hosting.Azure.ContainerRegistry (2)
Aspire.Hosting.Azure.EventHubs (2)
Aspire.Hosting.Azure.FrontDoor (6)
Aspire.Hosting.Azure.Functions (3)
Aspire.Hosting.Azure.Kubernetes (6)
Aspire.Hosting.Azure.Network (3)
Aspire.Hosting.Azure.Sandboxes (39)
AzureSandboxContainerDeployment.cs (22)
70Description = $"Deploys compute resource '{resource.TargetResource.Name}' to ACA sandbox '{resource.Name}'.",
171$"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.");
182$"Azure sandbox resources '{resource.TargetResource.Name}' and '{producer.TargetResource.Name}' have a circular deployment dependency.");
300var diskImageName = CreateSandboxResourceName(targetResource.Name, deployId);
302var diskTask = await context.ReportingStep.CreateTaskAsync($"Creating sandbox disk image for {targetResource.Name}", context.CancellationToken).ConfigureAwait(false);
329var createTask = await context.ReportingStep.CreateTaskAsync($"Creating sandbox for {targetResource.Name}", context.CancellationToken).ConfigureAwait(false);
407stateSection.Data["SourceResourceName"] = targetResource.Name;
502context.Summary.Add(resource.TargetResource.Name, new MarkdownString(CreateSandboxUrlSummary(publicUrl, retainedUrl)));
506context.Summary.Add(resource.TargetResource.Name, new MarkdownString($"Sandbox `{sandboxId}`"));
574["aspire-source"] = resource.TargetResource.Name,
928throw new NotSupportedException($"Resource '{resource.Name}' configures container mounts, but Azure sandbox volume provisioning is not supported by this preview integration.");
981?? throw new InvalidOperationException($"Could not resolve the pushed container image for resource '{resource.TargetResource.Name}'.");
989throw 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.");
1499$"Endpoint '{resolvedEndpoint.Endpoint.Name}' on project resource '{resource.TargetResource.Name}' is exposed through Azure sandbox ingress, which terminates TLS and forwards plaintext HTTP. " +
1507throw 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.");
1526throw 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.");
1533throw 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.");
1551throw new InvalidOperationException($"Resource '{resource.TargetResource.Name}' has Azure sandbox endpoint options for endpoint(s) that are not exposed by EndpointAnnotation: {string.Join(", ", unmatchedEndpointOptions)}.");
1583_ => throw new NotSupportedException($"Endpoint '{endpoint.Name}' on resource '{resource.Name}' uses transport '{endpoint.Transport}'. Azure sandbox ports currently support only HTTP and HTTP/2 endpoints.")
2104stateSection.Data["SourceResourceName"] ??= resource.TargetResource.Name;
Aspire.Hosting.Azure.Tests (69)
AzureSandboxesTests.cs (14)
480var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend");
483Assert.DoesNotContain(model.Resources, resource => resource.Name == "sandboxes-acr");
2021var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend");
2187var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend");
2249var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend");
2288var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend");
2312var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "cache");
2355var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend");
2356var explicitComputeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "backend");
2459var cleanupResource = Assert.Single(model.Resources, resource => resource.Name == "azure-sandbox-cleanup");
2512Assert.Single(model.Resources, resource => resource.Name == "azure-sandbox-cleanup");
2537var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend");
2600var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend");
2868var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend");
Aspire.Hosting.Blazor (18)
Aspire.Hosting.Blazor.Tests (23)
Aspire.Hosting.Browsers (14)
BrowserLogsBuilderExtensions.cs (6)
132var initialConfiguration = BrowserConfiguration.Resolve(builder.ApplicationBuilder.Configuration, parentResource.Name, explicitConfigurationValues);
134$"{parentResource.Name}-browser-logs",
149Properties = CreateInitialProperties(parentResource.Name, initialConfiguration)
186if (resourceNotifications.TryGetCurrentState(parentResource.Name, out var resourceEvent))
330throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, BrowserMessageStrings.BrowserLogsResourceMissingHttpEndpoint, resource.Name));
336throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, BrowserMessageStrings.BrowserLogsEndpointNotAllocated, endpointAnnotation.Name, resource.Name));
Aspire.Hosting.Browsers.Tests (18)
src\Aspire.Hosting.Browsers\BrowserLogsBuilderExtensions.cs (6)
132var initialConfiguration = BrowserConfiguration.Resolve(builder.ApplicationBuilder.Configuration, parentResource.Name, explicitConfigurationValues);
134$"{parentResource.Name}-browser-logs",
149Properties = CreateInitialProperties(parentResource.Name, initialConfiguration)
186if (resourceNotifications.TryGetCurrentState(parentResource.Name, out var resourceEvent))
330throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, BrowserMessageStrings.BrowserLogsResourceMissingHttpEndpoint, resource.Name));
336throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, BrowserMessageStrings.BrowserLogsEndpointNotAllocated, endpointAnnotation.Name, resource.Name));
Aspire.Hosting.Containers.Tests (6)
Aspire.Hosting.DevTunnels (16)
DevTunnelResourceBuilderExtensions.cs (13)
215portLogger.LogInformation("Configured dev tunnel port '{Port}' on tunnel '{Tunnel}' targeting endpoint '{Endpoint}' on resource '{TargetResource}'", tunnelPort, portResource.DevTunnel.TunnelId, portResource.TargetEndpoint.EndpointName, portResource.TargetEndpoint.Resource.Name);
479ErrorMessage = $"The dev tunnel '{tunnelResource.Name}' has not been associated with '{endpointName}' on resource '{targetResource.Name}'. Use 'WithReference({targetResource.Name})' on the dev tunnel to expose this endpoint."
524var serviceName = targetResource.Resource.Name;
574throw new ArgumentException($"Target endpoint '{targetEndpoint.EndpointName}' on resource '{targetEndpoint.Resource.Name}' has already been added to dev tunnel '{tunnel.Name}'.", nameof(targetEndpoint));
584throw new ArgumentException($"Cannot tunnel endpoint '{targetEndpointAnnotation.Name}' with host '{targetEndpointAnnotation.TargetHost}' on resource '{targetResource.Name}' because it is not a localhost endpoint.", nameof(targetEndpoint));
596_ => throw new ArgumentException($"Cannot tunnel endpoint '{targetEndpoint.EndpointName}' on resource '{targetResource.Name}' because it uses the unsupported scheme '{targetEndpoint.Scheme}'. Only 'http' and 'https' endpoints can be tunneled."),
598portOptions.Description ??= $"{targetResource.Name}/{targetEndpoint.EndpointName}";
600var portName = $"{tunnel.Name}-{targetResource.Name}-{targetEndpoint.EndpointName}";
602portOptions.Labels.Add(targetResource.Name);
707new(CustomResourceKnownProperties.Source, $"{targetResource.Name}/{targetEndpoint.EndpointName}"),
708new("TargetResource", targetResource.Name),
760NormalizeUrl(portUri), portResource.TargetEndpoint.Url, portResource.TargetEndpoint.Resource.Name, portResource.TargetEndpoint.EndpointName);
Aspire.Hosting.DevTunnels.Tests (1)
Aspire.Hosting.Docker (25)
Aspire.Hosting.Docker.Tests (6)
Aspire.Hosting.Dotnet (12)
Aspire.Hosting.EntityFrameworkCore (10)
Aspire.Hosting.EntityFrameworkCore.Tests (1)
Aspire.Hosting.Foundry (26)
Aspire.Hosting.Foundry.Tests (7)
Aspire.Hosting.Go (4)
Aspire.Hosting.Go.Tests (14)
Aspire.Hosting.Java (1)
Aspire.Hosting.Java.Tests (14)
Aspire.Hosting.JavaScript (2)
Aspire.Hosting.JavaScript.Tests (1)
Aspire.Hosting.Kafka (2)
Aspire.Hosting.Kafka.Tests (1)
Aspire.Hosting.Keycloak.Tests (2)
Aspire.Hosting.Kubernetes (70)
Deployment\HelmDeploymentEngine.cs (5)
529var endpoints = await GetServiceEndpointsAsync(computeResource.Name.ToServiceName(), @namespace, environment.KubeConfigPath, context.Logger, context.CancellationToken).ConfigureAwait(false);
534context.Summary.Add(computeResource.Name, endpointText);
535context.Logger.LogInformation("Resource {ResourceName}: {Endpoints}", computeResource.Name, endpointText);
539context.Logger.LogDebug("No external endpoints found for {ResourceName}", computeResource.Name);
544context.Logger.LogWarning(ex, "Failed to retrieve endpoints for {ResourceName}", computeResource.Name);
KubernetesResource.cs (21)
37Name = $"print-{resource.Name}-summary",
38Description = $"Retrieves deployment status for {resource.Name}.",
165["app.kubernetes.io/component"] = resource.Name,
209var imageEnvName = $"{resourceInstance.Name.ToHelmValuesSectionName()}_image";
210var value = $"{resourceInstance.Name}:latest";
211var expression = new HelmValue(imageEnvName.ToHelmParameterExpression(resource.Name), value)
257EndpointMappings[endpoint.Name] = new(endpoint.UriScheme, GetKubernetesProtocolName(endpoint.Protocol), resource.Name.ToServiceName(), httpMapping.Port, endpoint.Name);
277EndpointMappings[endpoint.Name] = new(endpoint.UriScheme, GetKubernetesProtocolName(endpoint.Protocol), resource.Name.ToServiceName(), HelmValue.Literal(portValue), endpoint.Name, ServicePort: servicePort);
288paramName.ToHelmParameterExpression(resource.Name),
292EndpointMappings[endpoint.Name] = new(endpoint.UriScheme, GetKubernetesProtocolName(endpoint.Protocol), resource.Name.ToServiceName(), helmValue, endpoint.Name);
433ProcessEnvironmentStringValue(stringValue, key, resource.Name);
436ProcessEnvironmentDefaultValue(value, key, resource.Name);
479Secrets[key] = new(key.ToHelmSecretExpression(TargetResource.Name), secretValue);
679var paramExpression = formattedName.ToHelmParameterExpression(TargetResource.Name);
764var resourceKey = TargetResource.Name.ToHelmValuesSectionName();
767$"Resource '{TargetResource.Name}' maps multiple distinct {sourceKind} sources named '{parameter.Name}' " +
831formattedName.ToHelmSecretExpression(resource.Name) :
832formattedName.ToHelmConfigExpression(resource.Name);
854formattedName.ToHelmSecretExpression(resource.Name) :
855formattedName.ToHelmConfigExpression(resource.Name);
898var helmExpression = key.ToHelmConfigExpression(TargetResource.Name);
Aspire.Hosting.Kubernetes.Tests (7)
Aspire.Hosting.Maui (31)
Lifecycle\MauiBuildQueueEventSubscriber.cs (26)
86if (_nextStartSignals.TryGetValue(resource.Name, out var nextStartSignal))
100queueAnnotation.ResourceCancellations[resource.Name] = resourceCts;
123logger.LogInformation("Building project '{ProjectName}' for {ResourceName}.", parent.Name, resource.Name);
152logger.LogInformation("Build cancelled for resource '{ResourceName}'.", resource.Name);
160logger.LogDebug("Released build lock (resource '{ResourceName}').", resource.Name);
163queueAnnotation.ResourceCancellations.TryRemove(resource.Name, out _);
174logger.LogWarning("No build info annotation found for resource '{ResourceName}'. Startup cannot proceed.", resource.Name);
176$"Resource '{resource.Name}' is missing MauiBuildInfoAnnotation. " +
236$"Build for resource '{resource.Name}' timed out after {BuildTimeout:c}.");
253$"Build failed for resource '{resource.Name}' with exit code {process.ExitCode}.");
256logger.LogInformation("Build succeeded for resource '{ResourceName}'.", resource.Name);
325resource.Name,
333resource.Name,
341logger.LogWarning(ex, "Timed out waiting for resource '{ResourceName}' to reach a launch handoff state after {Timeout}; releasing build lock.", resource.Name, LaunchHandoffTimeout);
348logger.LogWarning(ex, "Timed out waiting for Android resource '{ResourceName}' to finish its launch work after {Timeout}; stopping the resource before releasing the build lock.", resource.Name, LaunchHandoffTimeout);
355logger.LogError("Failed to stop Android resource '{ResourceName}' after its launch handoff timed out. Holding the build lock until the launch terminates, a replacement start takes over, or the application stops.", resource.Name);
371logger.LogError(stopException, "Failed to stop Android resource '{ResourceName}' after its launch handoff timed out. The build lock will remain held until the application stops.", resource.Name);
377logger.LogDebug("Application stopping while waiting for MAUI resource '{ResourceName}' to reach a launch handoff state; releasing build lock.", resource.Name);
381logger.LogWarning(ex, "Failed to wait for resource '{ResourceName}' to reach a stable state; releasing build lock.", resource.Name);
386.Remove(new(resource.Name, nextStartSignal));
391logger.LogDebug("Released build lock (resource '{ResourceName}').", resource.Name);
404resource.Name,
542var wasCancelled = !_isLaunchTimeoutStop.Value && queueAnnotation.CancelResource(resource.Name);
559resource.Name,
573if (queueAnnotation.ResourceCancellations.ContainsKey(resource.Name))
597logger.LogDebug(ex, "Failed to override state to Exited for resource '{ResourceName}'.", resource.Name);
Aspire.Hosting.Maui.Tests (26)
Aspire.Hosting.Milvus.Tests (2)
Aspire.Hosting.MongoDB.Tests (1)
Aspire.Hosting.MySql (2)
Aspire.Hosting.MySql.Tests (4)
Aspire.Hosting.OpenAI.Tests (5)
Aspire.Hosting.Oracle.Tests (3)
Aspire.Hosting.Orleans (4)
Aspire.Hosting.PostgreSQL (2)
Aspire.Hosting.PostgreSQL.Tests (8)
Aspire.Hosting.Qdrant (1)
Aspire.Hosting.Qdrant.Tests (4)
Aspire.Hosting.Radius (99)
Publishing\RadiusInfrastructureBuilder.cs (90)
383var identifier = BicepPostProcessor.SanitizeIdentifier(resource.Name);
391identifier, resource.Name, resourceType, apiVersion,
394_typeInstancesByResourceName[resource.Name] = typeInstance;
395_radiusTypeByResourceName[resource.Name] = resourceType;
416var identifier = BicepPostProcessor.SanitizeIdentifier(resource.Name);
419WarnIfImageMayNotPull(resource.Name, image);
431identifier, resource.Name, image, appConstruct!, envConstruct, connectionTargets, env, ports);
447containerPortSnapshots[resource.Name] = ports.ToDictionary(
618.Where(owner => _typeInstancesByResourceName.TryGetValue(owner.Name, out var construct) &&
1704if (!seen.Add(resource.Name))
2077$".NET program resource '{resource.Name}' cannot be published to Radius because no container image " +
2088return $"{resource.Name}:latest";
2123if (!_radiusTypeByResourceName.TryGetValue(resource.Name, out var radiusType) ||
2146$"Resource '{resource.Name}' is emitted as Radius type '{radiusType}', for which Aspire has no " +
2153!_typeInstancesByResourceName.TryGetValue(resource.Name, out var construct))
2227$"A password was supplied for '{resource.Name}', but the Radius recipe that provisions it deploys the " +
2229$"applied, so '{resource.Name}' would be deployed unauthenticated while its consumers are handed an " +
2231$"'{resource.Name}' yourself if the deployed workload must require one. Diagnostic: ASPIRERADIUS085.");
2250resource.Name,
2252resource.Name);
2318.Where(d => referencedResourceNames.Contains(d.Name) ||
2319_resolvedConnectionStringConsumption.Contains(d.Name))
2320.Select(d => d.Name)
2333resource.Name,
2363.Where(d => referencedResourceNames.Contains(d.Name) ||
2364_resolvedConnectionStringConsumption.Contains(d.Name))
2375$"Resource '{resource.Name}' has a Radius recipe that provisions the single database " +
2426$"'{resource.Name}'. Its Radius recipe generates a separate value for each, and a single parameter " +
2492$"'{resource.Name}'. Give the user name and the password their own parameters. " +
2512$"Resource '{resource.Name}' is emitted as a Radius type that requires '{requiredProperty}' as a " +
2513$"schema property, but '{resource.Name}' exposes no '{requiredProperty}' connection property for " +
2542resource.Name);
2549var referenced = databaseChildren.Where(d => referencedResourceNames.Contains(d.Name)).ToList();
2566$"Resource '{resource.Name}' has {referencedDatabaseNames.Count} referenced databases " +
2589$"Resource '{resource.Name}' declares {distinctDatabaseNames.Count} databases " +
2612if (referencedResourceNames.Contains(resource.Name))
2619resource.Name,
2620databaseChild.Name,
2621resource.Name);
2629resource.Name,
2677$"Resource '{resource.Name}' is emitted as a Radius type whose credential requires a " +
2702$"Resource '{resource.Name}' is emitted as a Radius type that requires '{propertyName}', but " +
2703$"'{resource.Name}' exposes no '{propertyName}' connection property for Aspire to supply it, so the " +
2713var secretIdentifier = BicepPostProcessor.SanitizeIdentifier($"{resource.Name}_{propertyName}_secret");
2716SecretName = BuildKubernetesSecretName($"{resource.Name}-{propertyName}-secret"),
2765$"'{resource.Name}'. Give the user name and the password their own parameters. " +
2771_radiusTypeByResourceName[resource.Name],
2791$"Resource '{resource.Name}' is emitted as a Radius type that requires 'username' as a schema property, " +
2792$"but '{resource.Name}' exposes no 'username' connection property for Aspire to supply it, so the " +
2866$"Resource '{resource.Name}' would be deployed with the user name 'guest', which RabbitMQ restricts to " +
2868$"explicit user name, for example AddRabbitMQ(\"{resource.Name}\", userName: builder.AddParameter(\"{resource.Name}user\")), " +
2929referenced.Add(relationship.Resource.Name);
2965resource.Name);
2998resource.Name,
3000owner.Owner.Name);
3121Add(relationship.Resource, relationship.Resource.Name);
3220: child.Name;
3268$"The '{key}' connection property of Radius resource '{resource.Name}' could not be resolved at publish " +
3346if (!_typeInstancesByResourceName.TryGetValue(resource.Name, out var construct) ||
3347!_radiusTypeByResourceName.TryGetValue(resource.Name, out var radiusType))
3354$"Resource '{resource.Name}' is deployed by a Radius recipe in a different environment than '{_environment.Name}', " +
3355$"so its address cannot be resolved here. Deploy the consumer and '{resource.Name}' to the same Radius environment. " +
3363$"Resource '{resource.Name}' maps to Radius type '{radiusType}', which does not expose an address Aspire can " +
3402$"The endpoint property '{property}' is not supported for Radius backing resource '{resource.Name}'. " +
3415$"Radius type '{radiusType}' used for resource '{resource.Name}' does not publish a host output, " +
3429$"Radius type '{radiusType}' used for resource '{resource.Name}' does not publish a port output, " +
3472$"Endpoint '{endpointReference.EndpointName}' of resource '{resource.Name}' is TLS-enabled, but the Radius " +
3474$"describe how '{resource.Name}' runs locally rather than how the recipe deploys it. Remove the TLS " +
3508$"Resource '{resource.Name}' is provisioned by a Radius recipe as '{radiusType}', which publishes a single " +
3512$"'{resource.Name}' as a container. Diagnostic: ASPIRERADIUS077.");
3538if (radiusResources.Any(p => p.Name == referencedResource.Name)
3539&& typeInstancesByResourceName.TryGetValue(referencedResource.Name, out var targetConstruct))
3541connections[referencedResource.Name] = targetConstruct;
3707key, resource.Name, ex.Message);
3740resource.Name,
3759resource.Name,
3831$"Environment variable '{envVarName}' on resource '{resource.Name}' holds a credential, so it is " +
3868$"Container '{resource.Name}' has environment variables holding credentials, which are published as a " +
3874BicepPostProcessor.SanitizeIdentifier($"{resource.Name}_env_secret"))
3876SecretName = BuildKubernetesSecretName($"{resource.Name}-env-secret"),
3889resource.Name,
4250_resolvedConnectionStringConsumption.Add(consumed.Name);
4289if (string.Equals(owner.Name, childName, StringComparison.Ordinal))
4313_radiusTypeByResourceName.ContainsKey(parent.Name))
4315expressions[child.ConnectionStringExpression.ValueExpression] = child.Name;
4337$"'{endpointReference.Resource.Name}'");
4599$"Parameter '{parameter.Name}' is used as the credential of both '{existing.Owner.Name}' and '{owner.Name}', " +
Aspire.Hosting.Radius.Tests (12)
Aspire.Hosting.Redis.Tests (6)
Aspire.Hosting.RemoteHost.Tests (1)
Aspire.Hosting.Testing.Tests (2)
Aspire.Hosting.Tests (73)
Dashboard\DashboardEventHandlersTests.cs (7)
54var dashboardResource = model.Resources.Single(r => string.Equals(r.Name, KnownResourceNames.AspireDashboard, StringComparisons.ResourceName));
103var dashboardResource = model.Resources.Single(r => string.Equals(r.Name, KnownResourceNames.AspireDashboard, StringComparisons.ResourceName));
195var dashboardResource = model.Resources.Single(r => string.Equals(r.Name, KnownResourceNames.AspireDashboard, StringComparisons.ResourceName));
270var dashboardResource = (IResourceWithEndpoints)model.Resources.Single(r => string.Equals(r.Name, KnownResourceNames.AspireDashboard, StringComparisons.ResourceName));
474var dashboardResource = model.Resources.Single(r => string.Equals(r.Name, KnownResourceNames.AspireDashboard, StringComparisons.ResourceName));
557var dashboardResource = model.Resources.Single(r => string.Equals(r.Name, KnownResourceNames.AspireDashboard, StringComparisons.ResourceName));
631Assert.Equal(KnownResourceNames.AspireDashboard, dashboardResource.Name);
Aspire.Hosting.TestUtilities (6)
Aspire.Hosting.Yarp (5)
Aspire.Playground.Tests (4)
Stress.AppHost (4)