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
.Net: Bug: System.ClientModel.ClientResultException: 'HTTP 401 (PermissionDenied) Principal does not have access to API/Operation.' when running VectorStoreRAG.csproj
#10020
Open
radrad opened this issue
Dec 19, 2024
· 0 comments
{"HTTP 401 (PermissionDenied)\r\n\r\nPrincipal does not have access to API/Operation."} | System.ClientModel.ClientResultException
This is a part of header for post message I managed to see.
I don't know where it the pipeline a token is added.
{Method: POST, RequestUri: 'https://.openai.azure.com/openai/deployments//chat/completions?api-version=2024-10-01-preview', Version: 1.1, Content: System.ClientModel.Primitives.HttpClientPipelineTransport+HttpPipelineRequest+MessageBodyAdapter, Headers:
{
Accept: application/json
User-Agent: Semantic-Kernel azsdk-net-AI.OpenAI/2.1.0-beta.2 (.NET 8.0.11; Microsoft Windows 10.0.22000)
x-ms-client-request-id: 3245c4e1-4d0c-94c2-234234
Content-Type: application/json
}}
I did run az login prior to running code. Both of these don't work. Below you can see in the image assigned [Cognitive Services Contributor] and even [owner] to my azure account. So I exhausted my ideas.
kernelBuilder.AddAzureOpenAIChatCompletion(
appConfig.AzureOpenAIConfig.ChatDeploymentName,
appConfig.AzureOpenAIConfig.Endpoint,
new AzureCliCredential());
kernelBuilder.AddAzureOpenAIChatCompletion(
appConfig.AzureOpenAIConfig.ChatDeploymentName,
appConfig.AzureOpenAIConfig.Endpoint,
new DefaultAzureCredential());
When I tried using another overrinden method with appConfig.AzureOpenAIConfig.ApiKey instead it did work. But I would like to avoid using api keys.
How I am supposed to run this code?
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Bug: System.ClientModel.ClientResultException: 'HTTP 401 (PermissionDenied) Principal does not have access to API/Operation.' when running VectorStoreRAG.csproj
.Net: Bug: System.ClientModel.ClientResultException: 'HTTP 401 (PermissionDenied) Principal does not have access to API/Operation.' when running VectorStoreRAG.csproj
Dec 19, 2024
Semanatic kernel version: "1.32.0.0"
Z:\semantic-kernel\dotnet\src\Connectors\Connectors.OpenAI\Core\ClientCore.cs
Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.RunRequestAsync(System.Func<System.Threading.Tasks.Task>) in ClientCore.cs
{"HTTP 401 (PermissionDenied)\r\n\r\nPrincipal does not have access to API/Operation."} | System.ClientModel.ClientResultException
This is a part of header for post message I managed to see.
I don't know where it the pipeline a token is added.
{Method: POST, RequestUri: 'https://.openai.azure.com/openai/deployments//chat/completions?api-version=2024-10-01-preview', Version: 1.1, Content: System.ClientModel.Primitives.HttpClientPipelineTransport+HttpPipelineRequest+MessageBodyAdapter, Headers:
{
Accept: application/json
User-Agent: Semantic-Kernel azsdk-net-AI.OpenAI/2.1.0-beta.2 (.NET 8.0.11; Microsoft Windows 10.0.22000)
x-ms-client-request-id: 3245c4e1-4d0c-94c2-234234
Content-Type: application/json
}}
I did run az login prior to running code. Both of these don't work. Below you can see in the image assigned [Cognitive Services Contributor] and even [owner] to my azure account. So I exhausted my ideas.
When I tried using another overrinden method with appConfig.AzureOpenAIConfig.ApiKey instead it did work. But I would like to avoid using api keys.
How I am supposed to run this code?
The text was updated successfully, but these errors were encountered: