-
Notifications
You must be signed in to change notification settings - Fork 416
-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better Azure resource name scheme / versioning Azure bicep #5756
Comments
Consider exposing this via a default value like |
@tg-msft - so your suggestion is to have both a "global" |
Yes. I think you're going to want more granularity than "all 8" or "all 9." We could always start globally though and add per-resource overrides in the future. |
Linking with @mitchdenny's proposal: #3121 to make this |
I'd actually like to obsolete the existing |
Problem
In 8.x, we used an early/alpha version of Azure.Provisioning. This version used a naming scheme for Azure resources that tried to be the least common denominator of all resources.
This causes problems like Invalid Cloud deployment of Azure Service Bus topics - name truncation (dotnet/aspire#5341).
The new version of Azure.Provisioning has a better scheme that has information about what names the resource type allows (max length, valid characters, etc.).
However, we are not able to take advantage of this new scheme. It is a breaking change to take this new naming scheme. If someone used 8.x to deploy to Azure, then updated to 9.0 and deployed again they would get duplicate resources since the naming scheme changed. For example, there is a separator now and
toLower
is no longer called in bicep but instead theresource.ResourceName
is sanitized first before putting it in the bicep. If the resource doesn't allow upper case characters, the ResourceName is lowered. For resources that support upper case characters, this means a different resource name.The new naming scheme is better than the old, but maintaining compatibliity is not allowing us to use it.
Proposed Solution
We should add a compatibility switch to allow developers who upgrade to the new version of .NET Aspire to continue using the same "deployment version" as a previous version.
One way we could do this is to allow
Annotations
on theIDistributedApplicationBuilder
. One of the annotations would be anAzureDeploymentVersion
annotation that would have values like:Current
would be the default if there is no annotation specified. We would add new versions as we needed. And new breaking changes to the bicep would be gated behind a check if the specified AzureDeploymentVersion was "new enough".This allows people to use the
9.0
.NET Aspire, but continue to use the old naming scheme.We would also use this in other behavior changes - like when we change Azure PostgreSQL and Redis to use managed identity by default. Other "better defaults, but breaking changes" would do the same.
cc @mitchdenny @davidfowl @tg-msft
The text was updated successfully, but these errors were encountered: