23 references to AzureOpenAIRole
Aspire.Hosting.Azure.CognitiveServices (7)
AzureOpenAIExtensions.cs (7)
244/// <param name="roles">The Azure OpenAI roles to be assigned (for example, <see cref="AzureOpenAIRole.CognitiveServicesOpenAIUser"/>).</param> 246/// <exception cref="ArgumentException">Thrown when a role value is not a valid <see cref="AzureOpenAIRole"/> value.</exception> 251params AzureOpenAIRole[] roles) 264AzureOpenAIRole.CognitiveServicesOpenAIContributor => CognitiveServicesBuiltInRole.CognitiveServicesOpenAIContributor, 265AzureOpenAIRole.CognitiveServicesOpenAIUser => CognitiveServicesBuiltInRole.CognitiveServicesOpenAIUser, 266AzureOpenAIRole.CognitiveServicesUser => CognitiveServicesBuiltInRole.CognitiveServicesUser, 267_ => throw new ArgumentException($"'{roles[i]}' is not a valid {nameof(AzureOpenAIRole)} value.", nameof(roles))
Aspire.Hosting.Azure.Tests (16)
AzureOpenAIExtensionsTests.cs (16)
120container.WithRoleAssignments(openai, AzureOpenAIRole.CognitiveServicesOpenAIUser, AzureOpenAIRole.CognitiveServicesOpenAIContributor)); 134container.WithRoleAssignments(openai, AzureOpenAIRole.CognitiveServicesUser)); 146var invalidRole = (AzureOpenAIRole)(-1); 161var invalidRole = (AzureOpenAIRole)123; 164container.WithRoleAssignments(openai, AzureOpenAIRole.CognitiveServicesOpenAIUser, invalidRole)); 178container.WithRoleAssignments(openai, AzureOpenAIRole.CognitiveServicesOpenAIUser, AzureOpenAIRole.CognitiveServicesOpenAIUser)); 193AzureOpenAIRole.CognitiveServicesOpenAIContributor, 194AzureOpenAIRole.CognitiveServicesOpenAIUser, 195AzureOpenAIRole.CognitiveServicesUser 198foreach (var role in roles) 216container.WithRoleAssignments(openai, Array.Empty<AzureOpenAIRole>())); 230container.WithRoleAssignments(openai, (AzureOpenAIRole[]?)null!));