Description
Library name and version
Azure.AI.Projects 1.0.0-beta.4
Describe the bug
Using the sample code in repro steps against a Custom Keys auth connection throws "System.ArgumentOutOfRangeException: Unknown AuthenticationType value. (Parameter 'value')
Actual value was CustomKeys."
Note that getting that Custom Auth connection in the python Projects SDK works correctly, and non-custom auth connections can be enumerated correctly in .NET Projects SDK.
Expected behavior
Custom Auth connection enumeration doesn't throw, connection response properly listed.
Actual behavior
Unhandled exception. System.ArgumentOutOfRangeException: Unknown AuthenticationType value. (Parameter 'value')
Actual value was CustomKeys.
at Azure.AI.Projects.AuthenticationTypeExtensions.ToAuthenticationType(String value)
at Azure.AI.Projects.UnknownInternalConnectionProperties.DeserializeUnknownInternalConnectionProperties(JsonElement element, ModelReaderWriterOptions options)
at Azure.AI.Projects.ConnectionProperties.DeserializeConnectionProperties(JsonElement element, ModelReaderWriterOptions options)
at Azure.AI.Projects.ConnectionResponse.DeserializeConnectionResponse(JsonElement element, ModelReaderWriterOptions options)
at Azure.AI.Projects.ConnectionResponse.FromResponse(Response response)
at Azure.AI.Projects.ConnectionsClient.GetConnectionAsync(String connectionName, CancellationToken cancellationToken)
at Program.Main(String[] args) in <PROJECT_PATH>\project_test\Program.cs:line 38
at Program.
Reproduction Steps
run the following code:
var connectionString = "project_connection_string";
var modelName = "model"; //"gpt-4o-mini" for example
var clientOptions = new AIProjectClientOptions();
// Adding the custom headers policy
clientOptions.AddPolicy(new CustomHeadersPolicy(), HttpPipelinePosition.PerCall);
var projectClient = new AIProjectClient(connectionString, new AzureCliCredential(), clientOptions);
ConnectionResponse sharepointConnection = await projectClient.GetConnectionsClient().GetConnectionAsync("custom_auth_key_connection_name");
var connectionId = sharepointConnection.Id;
Environment
.NET SDK:
Version: 9.0.103
Commit: 96da45d427
Workload version: 9.0.100-manifests.ea610b94
MSBuild version: 17.12.24+90b52dda6
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.103\
Activity