An Azure service that provides an event-driven serverless compute platform.
Thanks. i was able to fix the issues by providing package path to swagger instead of providing name of the package in the requirments.txt. Thanks again
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello Everyone ,
As soon as we add import swagger_client as cris_client to the init.py code and we deploy it function give 500 error . If comment that line out then it works. We do need to use swagger client library that we imported to do speech to text project.
In case it useful we used this guide to create it .
https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/python/from-blob .
Any help would appreciate here is our requriments.txt context and here is the sample code.
azure-functions==1.7.2
azure-cognitiveservices-speech==1.17.0
requests==2.25.1
swagger-ui-py==0.3.0
protobuf==3.17.3
python-dateutil==2.8.1
six==1.16.0
certifi==2021.5.30
python_dateutil==2.8.1
urllib3==1.26.6
import logging
import azure.functions as func
import sys
import requests,json,os
import time
import swagger_client as cris_client
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
name = req.params.get('name')
if not name:
try:
req_body = req.get_json()
except ValueError:
pass
else:
name = req_body.get('name')
RECORDINGS_BLOB_URI = req_body.get('name')
if name:
#json_result=transcribe(RECORDINGS_BLOB_URI)
#return func.HttpResponse({json_result})
return func.HttpResponse(f"Hello, {name}. This HTTP triggered function executed successfully.")
else:
return func.HttpResponse(
"This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.",
status_code=200
)
An Azure service that provides an event-driven serverless compute platform.
Answer accepted by question author
Thanks. i was able to fix the issues by providing package path to swagger instead of providing name of the package in the requirments.txt. Thanks again
@Tigran Can you navigate to your application insights logs for your function app and verify what exception is logged for the 500 error. It looks like module not found.
Can you confirm which module you are referring as swagger_client or cris_client as I don't see as pypi packages. If the modules can be installed using pip then you can mentioned the same in your requirements.txt
But in case if those module or dependencies cannot be installed using pip then you need to use build native dependencies or enable remote build.
You can refer to python troubleshooting document for more details.