MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.2k stars 21.35k forks source link

getting 404 Resource not found error when calling the endpoint #112614

Closed javiercoh closed 1 year ago

javiercoh commented 1 year ago

I'm getting a 404 error when calling the Product Recognition endpoint using both cUrl and a custom python script. I was wondering if the steps described on the page are ok or there is something missing

` def analyze_shelf_image(image_url, subscription_key, endpoint):

    headers = {
        'Ocp-Apim-Subscription-Key': subscription_key,
        'Content-Type': 'application/json'
    }

    params = {
        'visualFeatures': 'Objects',
        'details': 'Celebrities,Landmarks'
    }

    data = {
        'url': image_url
    }

    response = requests.post(endpoint, headers=headers, params=params, json=data)
    response_json = response.json()

`


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

SaibabaBalapur-MSFT commented 1 year ago

@javiercoh Thanks for your feedback! We will investigate and update as appropriate.

AjayBathini-MSFT commented 1 year ago

@javiercoh

It's possible that the Product Recognition endpoint is not available or the URL you are using is incorrect. Here are some steps you can take to troubleshoot the issue:

Verify that you have the correct endpoint URL. You can find the endpoint URL in the Azure portal under your Cognitive Services resource.

Check that your subscription key is correct and has not expired. You can find your subscription key in the Azure portal under your Cognitive Services resource.

Try using a different image URL to see if the issue is specific to the image you are using.

Check the response status code and message to see if there are any errors. You can print the response status code and message using the following code:

print(response.status_code) print(response.text) If the status code is 404, it means that the endpoint was not found. In this case, you should double-check the endpoint URL and try again.

I hope this helps! Let me know if you have any other questions.

javiercoh commented 1 year ago

Thanks Ajay

As per your suggestion I have checked the endpoint and key from the portal. Also made sure to regenerate the key before using it but keep getting the same error:

{"error":{"code":"404","message": "Resource not found"}}

when using endpoint https://psir.cognitiveservices.azure.com/

As per this: [image: image.png]

also tried to make the call using the following endpoints:

https://psir.cognitiveservices.azure.com/ vision/v4.0-preview.1/operations/shelfanalysis-productunderstanding:analyze error-> {"error":{"code":"OperationBlocked","message":"This operation or feature is blocked."}}

https://https://psir.cognitiveservices.azure.com/ vision/v4.0-preview.1/operations/shelfanalysis-productunderstanding:analyze error-> Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

I'm probably missing something very obvious but cannot spot it. Would much appreciate your help

El mar, 25 jul 2023 a la(s) 00:41, AjayBathini-MSFT ( @.***) escribió:

@javiercoh https://github.com/javiercoh

It's possible that the Product Recognition endpoint is not available or the URL you are using is incorrect. Here are some steps you can take to troubleshoot the issue:

Verify that you have the correct endpoint URL. You can find the endpoint URL in the Azure portal under your Cognitive Services resource.

Check that your subscription key is correct and has not expired. You can find your subscription key in the Azure portal under your Cognitive Services resource.

Try using a different image URL to see if the issue is specific to the image you are using.

Check the response status code and message to see if there are any errors. You can print the response status code and message using the following code:

print(response.status_code) print(response.text) If the status code is 404, it means that the endpoint was not found. In this case, you should double-check the endpoint URL and try again.

I hope this helps! Let me know if you have any other questions.

— Reply to this email directly, view it on GitHub https://github.com/MicrosoftDocs/azure-docs/issues/112614#issuecomment-1649156790, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQA6ISKZVCOYWPCZMTH5TNLXR5MALANCNFSM6AAAAAA2TJTRTU . You are receiving this because you were mentioned.Message ID: @.***>

javiercoh commented 1 year ago

Also tried change the image url with same results

El mar, 25 jul 2023 a la(s) 12:28, Development Suplai.app @.***) escribió:

Thanks Ajay

As per your suggestion I have checked the endpoint and key from the portal. Also made sure to regenerate the key before using it but keep getting the same error:

{"error":{"code":"404","message": "Resource not found"}}

when using endpoint https://psir.cognitiveservices.azure.com/

As per this: [image: image.png]

also tried to make the call using the following endpoints:

https://psir.cognitiveservices.azure.com/ vision/v4.0-preview.1/operations/shelfanalysis-productunderstanding:analyze error-> {"error":{"code":"OperationBlocked","message":"This operation or feature is blocked."}}

https://https://psir.cognitiveservices.azure.com/ vision/v4.0-preview.1/operations/shelfanalysis-productunderstanding:analyze error-> Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

I'm probably missing something very obvious but cannot spot it. Would much appreciate your help

El mar, 25 jul 2023 a la(s) 00:41, AjayBathini-MSFT ( @.***) escribió:

@javiercoh https://github.com/javiercoh

It's possible that the Product Recognition endpoint is not available or the URL you are using is incorrect. Here are some steps you can take to troubleshoot the issue:

Verify that you have the correct endpoint URL. You can find the endpoint URL in the Azure portal under your Cognitive Services resource.

Check that your subscription key is correct and has not expired. You can find your subscription key in the Azure portal under your Cognitive Services resource.

Try using a different image URL to see if the issue is specific to the image you are using.

Check the response status code and message to see if there are any errors. You can print the response status code and message using the following code:

print(response.status_code) print(response.text) If the status code is 404, it means that the endpoint was not found. In this case, you should double-check the endpoint URL and try again.

I hope this helps! Let me know if you have any other questions.

— Reply to this email directly, view it on GitHub https://github.com/MicrosoftDocs/azure-docs/issues/112614#issuecomment-1649156790, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQA6ISKZVCOYWPCZMTH5TNLXR5MALANCNFSM6AAAAAA2TJTRTU . You are receiving this because you were mentioned.Message ID: @.***>

AjayBathini-MSFT commented 1 year ago

@javiercoh Thank you for your feedback! I'd recommend working closer with our support team via an [Azure support request] (https://docs.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request). Or you can leverage our Q&A forum by posting your issue there so our community, and MVPs can further assist you in troubleshooting this issue or finding potential workarounds. [Teams Q&A forum] (https://docs.microsoft.com/en-us/answers/topics/46488/office-teams-windows-itpro.html) for technical questions about the configuration and administration of Microsoft Teams on Windows. [Microsoft Teams Community forum] (https://answers.microsoft.com/en-us/msteams/forum?sort=LastReplyDate&dir=Desc&tab=All&status=all&mod=&modAge=&advFil=&postedAfter=&postedBefore=&threadType=All&isFilterExpanded=false&page=1) Thank you for your time and patience throughout this issue.

JoseArancibiaC commented 5 months ago

Hi!, Is there any update about this issue? I have same problem.