-
Notifications
You must be signed in to change notification settings - Fork 757
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
Add logical<->physical zone mapping functions to Bicep #11660
base: main
Are you sure you want to change the base?
Conversation
@@ -113,6 +113,38 @@ maxLength switch | |||
.WithDescription("Combines multiple arrays and returns the concatenated array.") | |||
.WithVariableParameter("arg", LanguageConstants.Array, minimumCount: 1, "The array for concatenation") | |||
.Build(); | |||
|
|||
yield return new FunctionOverloadBuilder("toLogicalZone") | |||
.WithReturnType(LanguageConstants.String) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the result of this function be known at compile time (like toLower('FOO')
), or is this something that can only be decided at deploy time (like resourceGroup()
)?
If this function is decidable at compile time, you can use .WithReturnResultBuilder(TryDeriveLiteralReturnType("toLogicalZone", LanguageConstants.String), LanguageConstants.String)
instead of .WithReturnType(LanguageConstants.String)
to have the type system try to execute this function on its arguments and derive a literal return type.
If this function is only decidable at deploy time (e.g., if the mapping is based on ARM's service configuration or varies from subscription to subscription), it should probably be defined in AzNamespaceType
(like resourceGroup()
is), which would make it part of the az
namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! The fact that it contains a parameter named subscriptionId
tells me it probably belongs in az
regardless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback! It has been moved to the az
namespace.
@jmorerice Do you know which ARM release is required for this PR to be merged? |
The Deployments and ARM release is blocked because of logistical issues with configuring a callback so I'm not quite sure of the exact timeline when it would be ready by unfortunately. |
Microsoft Reviewers: Open in CodeFlow