Issue Description
The Azure Event Grid Trigger function in python throws an error on receiving a job event(Azure Media Services). The error is related to DateTime format. The date returned by the job event to the python function cannot be parsed by python. E.g. the eventTime: '2019-12-06T07:41:37.3847161' cannot be parsed by python.
Result: Failure
Exception: ValueError: time data '2019-12-06T07:41:37.3847161' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'
Stack: File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/dispatcher.py", line 297, in _handle__invocation_request
pytype=pb_type_info.pytype)
File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/bindings/meta.py", line 63, in from_incoming_proto
return binding.decode(datum, trigger_metadata=metadata)
File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure/functions/eventgrid.py", line 35, in decode
event_time=cls._parse_datetime(body.get('eventTime')),
File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure/functions/meta.py", line 209, in _parse_datetime
raise last_error
File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure/functions/meta.py", line 204, in _parse_datetime
dt = datetime.datetime.strptime(datetime_str, fmt)
File "/usr/local/lib/python3.7/_strptime.py", line 577, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
File "/usr/local/lib/python3.7/_strptime.py", line 359, in _strptime
(data_string, format))
In my case: eventTime of job event don't have a character 'Z' in last variable: '2019-12-06T07:41:37.3847161'. I test with local and add 'Z' at last eventTime variable: ' '2019-12-06T07:41:37.3847161Z'. The function will run Success.
How I can config eventTime format is correct or any way to workarounds with that eventTime of job event.
Issue Description
The Azure Event Grid Trigger function in python throws an error on receiving a job event(Azure Media Services). The error is related to DateTime format. The date returned by the job event to the python function cannot be parsed by python. E.g. the eventTime: '2019-12-06T07:41:37.3847161' cannot be parsed by python.
In my case: eventTime of job event don't have a character 'Z' in last variable: '2019-12-06T07:41:37.3847161'. I test with local and add 'Z' at last eventTime variable: ' '2019-12-06T07:41:37.3847161Z'. The function will run Success.
How I can config eventTime format is correct or any way to workarounds with that eventTime of job event.