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
outputconnectionStringstring = 'Endpoint=${aiservices.properties.endpoints['Azure AI Model Inference API']}'
The C# code I wanted to write didn't work as expected.
Expected behavior
I expect the repro code to work and generate bicep with an indexer.
Actual behavior
Unhandled exception. System.Collections.Generic.KeyNotFoundException: The given key 'Azure AI Model Inference API' was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Azure.Provisioning.BicepDictionary`1.get_Item(String key)
at Program.<Main>$(String[] args) in D:\source\AspireApp6\AspireApp6.AppHost\Program.cs:line 10
Reproduction Steps
Run the following
usingAzure.Provisioning;usingAzure.Provisioning.CognitiveServices;usingAzure.Provisioning.Expressions;CognitiveServicesAccountai=new(nameof(ai));Infrastructureinfra=new();infra.Add(ai);infra.Add(newProvisioningOutput("connectionString",typeof(string)){Value=BicepFunction.Interpolate($"Endpoint={ai.Properties.Endpoints["Azure AI Model Inference API"]}")});ProvisioningPlanplan=infra.Build();stringbicep=plan.Compile().First().Value;Console.WriteLine(bicep);
Library name and version
Azure.Provisioning
Describe the bug
In order to generate bicep like the following:
The C# code I wanted to write didn't work as expected.
Expected behavior
I expect the repro code to work and generate bicep with an indexer.
Actual behavior
Reproduction Steps
Run the following
Environment
cc @tg-msft @m-nash
The text was updated successfully, but these errors were encountered: