Hi @Kevin Zhu ,
It was a pleasure connecting with you this afternoon. Per our conversation, we were able to check your Application Logs using the Diagnose and solve problems blade and determined the error you're getting was:
2020-10-22T20:34:45.940088583Z [2020-10-22 20:34:45,935] ERROR in app: Exception on /shnGetCamImg [POST]
2020-10-22T20:34:45.940158683Z Traceback (most recent call last):
2020-10-22T20:34:45.940164783Z File "/antenv/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
2020-10-22T20:34:45.940168783Z response = self.full_dispatch_request()
2020-10-22T20:34:45.940172383Z File "/antenv/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
2020-10-22T20:34:45.940176183Z rv = self.handle_user_exception(e)
2020-10-22T20:34:45.940179583Z File "/antenv/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
2020-10-22T20:34:45.940190584Z reraise(exc_type, exc_value, tb)
2020-10-22T20:34:45.940194584Z File "/antenv/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
2020-10-22T20:34:45.940198284Z raise value
2020-10-22T20:34:45.940201784Z File "/antenv/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
2020-10-22T20:34:45.940205384Z rv = self.dispatch_request()
2020-10-22T20:34:45.940208784Z File "/antenv/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
2020-10-22T20:34:45.940212384Z return self.view_functions[rule.endpoint](**req.view_args)
2020-10-22T20:34:45.940215884Z File "/home/site/wwwroot/main.py", line 53, in shnGetCamImg
2020-10-22T20:34:45.940219384Z start_X = int(request.form['startX_Coord'])
2020-10-22T20:34:45.940222784Z ValueError: invalid literal for int() with base 10: ''
which indicates an error with the value of startX_Coord
being converted to an int.
We also determined that your application is dependent on devices that is on your corporate network:
2020-10-22T20:58:17.591916769Z [tcp @ 0x557e3bca62c0] Connection to tcp://192.168.34.79:554?timeout=0 failed: Connection refused
2020-10-22T20:58:17.645864554Z [2020-10-22 20:58:17,638] ERROR in app: Exception on /shnGetCamImg [POST]
2020-10-22T20:58:17.645896455Z Traceback (most recent call last):
2020-10-22T20:58:17.645902155Z File "/antenv/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
2020-10-22T20:58:17.645906555Z response = self.full_dispatch_request()
2020-10-22T20:58:17.645910455Z File "/antenv/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
2020-10-22T20:58:17.645914355Z rv = self.handle_user_exception(e)
2020-10-22T20:58:17.645919855Z File "/antenv/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
2020-10-22T20:58:17.645923555Z reraise(exc_type, exc_value, tb)
2020-10-22T20:58:17.645927055Z File "/antenv/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
2020-10-22T20:58:17.645930855Z raise value
2020-10-22T20:58:17.645945455Z File "/antenv/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
2020-10-22T20:58:17.645949255Z rv = self.dispatch_request()
2020-10-22T20:58:17.645952556Z File "/antenv/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
2020-10-22T20:58:17.645956056Z return self.view_functions[rule.endpoint](**req.view_args)
2020-10-22T20:58:17.645959556Z File "/home/site/wwwroot/main.py", line 73, in shnGetCamImg
2020-10-22T20:58:17.645963056Z imgtest, imgCrop, transformed_image, final_image = imageProcessing(cameraip, start_X, start_Y, width_XY, height_XY, pnt1, pnt2, pnt3, pnt4)
2020-10-22T20:58:17.645969756Z File "/home/site/wwwroot/functions.py", line 117, in imageProcessing
2020-10-22T20:58:17.645973356Z cropPic = frame[start_Y:start_Y+height_XY, start_X:start_X+width_XY]
2020-10-22T20:58:17.645976756Z TypeError: 'NoneType' object is not subscriptable
Per our discussion, Azure can't communicate with local network devices without a Point-to-Site VPN connection. You will have to integrate your app service with a VNET that will be connected to your corporate network with a VPN Gateway appliance. This will allow your app service to establish communication with your camera devices on your corporate network.
Regards,
Ryan