Events
17 Mar, 23 - 21 Mar, 23
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When deploying to Azure initial deployments may fail with an error similar to the following:
"The specified name is already in use"
This article describes several techniques to avoid this problem.
When deploying a .NET Aspire project to Azure, the resources in the app model are transformed into Azure resources. Some Azure resources have globally scoped names, such as Azure App Configuration, where all instances are in the [name].azconfig.io
global namespace.
The value of [name]
is derived from the .NET Aspire resource name, along with random characters based on the resource group name. However, the generated string may exceed the allowable length for the resource name in App Configuration. As a result, some characters are truncated to ensure compliance.
When a conflict occurs in the global namespace, the resource fails to deploy because the combination of [name]+[truncated hash]
isn't unique enough.
One workaround is to avoid using common names like appconfig
or storage
for resources. Instead, choose a more meaningful and specific name. This reduces the potential for conflict, but does not completely eliminate it. In such cases, you can use callback methods to set a specific name and avoid using the computed string altogether.
Consider the following example:
var appConfig = builder.AddAzureAppConfiguration(
"appConfig",
(resource, construct, store) =>
{
store.AssignProperty(p => p.Name, "'noncalculatedname'");
});
.NET Aspire feedback
.NET Aspire is an open source project. Select a link to provide feedback:
Events
17 Mar, 23 - 21 Mar, 23
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Customize a .NET Aspire app to use existing Azure resources - Training
In this module, you'll learn how to move backing services for your Azure-hosted .NET Aspire app from containers into native Azure services.
Certification
Microsoft Certified: Azure Developer Associate - Certifications
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.
Documentation
Create custom .NET Aspire hosting integrations - .NET Aspire
Learn how to create a custom .NET Aspire hosting integration for an existing containerized application.
Secure communication between hosting and client integrations - .NET Aspire
Learn how to Secure communication between hosting and client integrations.
External parameters - .NET Aspire
Learn how to express parameters such as secrets, connection strings, and other configuration values that might vary between environments.
.NET Aspire service defaults - .NET Aspire
Learn about the .NET Aspire service defaults project.