Hi Sambhav Yadav,
The error you are encountering indicates that the Computer Vision API request is failing due to authentication issues. A 401 (PermissionDenied) response usually means that either the subscription key being used is invalid, expired, or not associated with an active Computer Vision resource, or that the request is being sent to the wrong regional endpoint. Each Azure Cognitive Services resource is created in a specific region, and you must use both the correct endpoint URL for that region and the corresponding key from the Azure portal.
To resolve this, please ensure that you are copying the subscription key from the Keys and Endpoint section of your Computer Vision resource in the Azure portal and that you are using the exact regional endpoint listed there (for example, https://<your-resource-name>.cognitiveservices.azure.com/). If you are still using the global endpoint (https://<region>.api.cognitive.microsoft.com/), we recommend switching to the custom endpoint provided in your resource. Additionally, confirm that your Computer Vision resource is active and not disabled or deleted.
If after verifying the key and endpoint you still face issues, regenerating a new key from the portal and updating your application with it can help rule out key-related problems. This should allow your requests to authenticate successfully and return the expected text extraction results from images.
For more information: Authenticate requests to Azure AI services