You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use an expression in an interpolated string, the expression doesn't get interpolated correctly.
Expected behavior
The output bicep should look like:
outputconnectionStringstring = 'Endpoint=${ai.properties.endpoints['Azure AI Model Inference API']}'
Actual behavior
outputconnectionStringstring = 'Endpoint=ai.properties.endpoints[\'Azure AI Model Inference API\']'
Reproduction Steps
usingAzure.Provisioning;usingAzure.Provisioning.CognitiveServices;usingAzure.Provisioning.Expressions;CognitiveServicesAccountai=new(nameof(ai));Infrastructureinfra=new();infra.Add(ai);varinferenceEndpoint=newIndexExpression((BicepExpression)ai.Properties.Endpoints!,"Azure AI Model Inference API");infra.Add(newProvisioningOutput("connectionString",typeof(string)){Value=BicepFunction.Interpolate($"Endpoint={inferenceEndpoint}")});ProvisioningPlanplan=infra.Build();stringbicep=plan.Compile().First().Value;Console.WriteLine(bicep);
NOTE: If I cast the IndexExpression to a BicepValue<string> explicitly, then it does produce the right bicep.
varinferenceEndpoint=(BicepValue<string>)newIndexExpression((BicepExpression)ai.Properties.Endpoints!,"Azure AI Model Inference API");infra.Add(newProvisioningOutput("connectionString",typeof(string)){Value=BicepFunction.Interpolate($"Endpoint={inferenceEndpoint}")});
Library name and version
Azure.Provisioning
Describe the bug
When trying to use an expression in an interpolated string, the expression doesn't get interpolated correctly.
Expected behavior
The output bicep should look like:
Actual behavior
Reproduction Steps
NOTE: If I cast the
IndexExpression
to aBicepValue<string>
explicitly, then it does produce the right bicep.Environment
cc @tg-msft @m-nash
The text was updated successfully, but these errors were encountered: