[New article]: Troubleshooting "name [resource name] is already in use" #681
Labels
doc-idea
Indicates issues that are suggestions for new topics [org][type][category]
documentation
Improvements or additions to documentation
dotnet-aspire/prod
Pri1
High priority, do before Pri2 and Pri3
📌 seQUESTered
Identifies that an issue has been imported into Quest.
Proposed topic or title
Troubleshooting name already in use when deploying Aspire application sto Azure
Location in table of contents.
Troubleshooting
Reason for the article
When deploying an Aspire application to Azure, resources in the application are turned into Azure resources. Azure resources sometimes have a globally scoped name. A good example is Azure AppConfig where all AppConfig instances are in the
[name].azconfig.io
global namespace.The value of
[name]
is derived from the Aspire resource name plus some random characters based on the name of the resource group that the resource is deployed in. Because the[uniqueString(...)]
function that is used to generate these random characters produces a string that when combined with the resource name would exceed the allowable resource name length for AppConfig (in this example), some of the characters are truncated.Unfortunately this creates an opportunity where the combination of
[name]+[truncated hash]
isn't sufficiently unique to avoid conflicts in the global namespace. When a conflict occurs the resource fails to deploy.We need an article that explains this, and also proposes workarounds. One workaround is to avoid using common names like
appconfig
orstorage
for resources and instead pick a name which is more application specific.Depending on the string the potential for conflict is reduced but not eliminated. In these cases knowing how to use the callback methods to set a specific name to avoid using the computed string altogether might be desirable.
Article abstract
When deploying to Azure initial deployments may fail if the resource name is already in use. This article describes several techniques to avoid this problem.
Relevant searches
No response
Associated WorkItem - 261090
The text was updated successfully, but these errors were encountered: