StatusCode: 500, ReasonPhrase: 'Internal Server Error', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:

Uladzimir Pranevich 0 Reputation points
2024-11-19T14:26:53.7233333+00:00

Hello. Could you please help me? I trying to execute program from Microsoft Learn lesson Exercises/01-use-azure-ai-services (https://github.com/MicrosoftLearning/mslearn-ai-services). I pick c# language.
But after changings in appsettings.json file:
{

"AIServicesEndpoint": "YOUR_AI_SERVICES_ENDPOINT",

"AIServicesKey": "YOUR_AI_SERVICES_KEY"

}
I have the error:
StatusCode: 500, ReasonPhrase: 'Internal Server Error', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:

{

apim-request-id: 3e756acd-e436-4d65-8c56-b9f0bf30284d

Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

X-Content-Type-Options: nosniff

x-ms-region: Poland Central

Date: Tue, 19 Nov 2024 13:32:13 GMT

Content-Length: 111

Content-Type: application/json

}

Data from activity logs:

TenantId

3708dab9-d87b-4270-8f0a-18f7cdd6243b

TimeGenerated [UTC]

2024-11-19T13:26:44.703Z

ResourceId

/SUBSCRIPTIONS/{subsctiptionId}/RESOURCEGROUPS/LEARN/PROVIDERS/MICROSOFT.COGNITIVESERVICES/ACCOUNTS/{serviceName}

Category

RequestResponse

ResourceGroup

LEARN

SubscriptionId

{subsctiptionId}

ResourceProvider

MICROSOFT.COGNITIVESERVICES

Resource

{serviceName}

ResourceType

ACCOUNTS

OperationName

Detect Language

CorrelationId

ca15fd25-3d2e-476d-9306-c0eabc1a2764

DurationMs

9996

CallerIPAddress

31.60.80.***

ResultSignature

500

SourceSystem

Azure

event_s

ShoeboxCallResult

location_s

polandcentral

Tenant_s

polandcentral

properties_s

{"apiName":"Text Analytics API (v3.1)","requestTime":638676195941600255,"requestLength":80,"responseTime":638676196041567332,"responseLength":111,"objectId":""}

Type

AzureDiagnostics

_ResourceId

/subscriptions/{subsctiptionId}/resourcegroups/learn/providers/microsoft.cognitiveservices/accounts/{serviceName}

Thanks.

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,770 questions
{count} votes

3 answers

Sort by: Most helpful
  1. VarunTha 9,420 Reputation points Microsoft Vendor
    2024-11-20T06:38:02.3766667+00:00

    Hi Uladzimir Pranevich,

    Thank you for reaching out to us on Microsoft Q&A forum.

    I understand you’re encountering a 500 Internal Server Error while executing the program from the Microsoft Learn lesson. Here are some steps to help resolve the issue:

    1.Check Endpoint and Key: Ensure that AIServicesEndpoint and AIServicesKey in your appsettings.json are correctly set with the actual values from your Azure portal.

    2.Verify Resource Status: Confirm that your Azure Cognitive Services resource is active and running in the correct region (Poland Central).

    3.Review API Permissions: Make sure your Azure account has the necessary permissions to access the resource.

    4.Investigate Logs: Use Azure Activity Logs to find more details about the error, especially looking at the CorrelationId.

    5.Check API Version: Ensure you are using the correct version of the API as specified in the documentation. Sometimes, using an outdated or unsupported version can lead to errors.

    If you encounter any further challenges, please don't hesitate to get in touch with us, and we'll be more than happy to provide additional assistance.

    If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.

    0 comments No comments

  2. Uladzimir Pranevich 0 Reputation points
    2024-11-20T09:40:43.82+00:00

    @VarunTha Your solutions not help for me. Poland central region for AI Services not working. Changing region to eastus fixing the problem (all other settings the same as Poland central).

    0 comments No comments

  3. VarunTha 9,420 Reputation points Microsoft Vendor
    2024-11-20T15:36:29.07+00:00

    Hi Uladzimir Pranevich,

    Thank you for your update and for letting us know about the resolution. I apologize for the inconvenience you experienced with the Poland Central region for AI Services.

    Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer. They can only accept answers by others, Summarized and posted the solution that you shared, request you to Accept the answer, it will benefit the community find the answers quickly.

    Soultion shared by Uladzimir Pranevich.

    It’s great to hear that switching to the East US region resolved the issue for you. If you have any further questions or need assistance with anything else, please don’t hesitate to reach out. We’re here to help!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.