Azure / Azure/azure-functions-host
Azure functions proxies changes timezone offset for values hardcoded in responseOverrides to the local timezone of the host.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
I have set up a simple proxy for test use that should return some static json data when responding to a request.
Part of this data is date / time values with a specific timezone offset.
When the proxy responds all the date/time values are altered to be in the timezone of the host. (Locally it gets my current timezone, in Azure it becomes UTC).
#### Investigative information
This setup in proxies.json:
```
(...)
"responseOverrides": {
"response.body": {
"status": 1,
"message": "Success",
"data": {
"ID": [
{
"start_time": "2021-05-20T00:30:00-05:00",
"end_time": "2021-05-20T01:54:00-05:00"
} (...)
```
Yields the following when requested through the proxy:
```
HTTP/1.1 200 OK
Connection: close
Date: Wed, 02 Jun 2021 14:12:46 GMT
Content-Type: application/json
Server: Kestrel
Content-Length: 6689
{
"status": 1,
"message": "Success",
"data": {
"ID": [
{
"start_time": "2021-05-20T07:30:00+02:00",
"end_time": "2021-05-20T08:54:00+02:00"
} (...)
```
#### Repro steps
1. Set up a proxy with some hardcoded response body override that includes a datetime in iso format with timezone offset specified (must be different from the timezone of the host).
2. Call the proxy endpoint
#### Expected behavior
The content provided as a hardcoded value in `proxies.json` should be returned verbatim
#### Actual behavior
Datetime values are returned converted to the timezone offset of the current host.
I have observed this both locally using Azure core tools, and when hosted in Azure.
#### Known workarounds
None
#### Related information
Provide any related information
* Language of function app: Python (Not sure if relevant to proxies)
* Links to source: N/A
* Bindings used: N/A
* Version: Not sure about the Azure hosted one, locally I use core tool v `3.0.3568`
Contributor guide
Assessment
This issue has not been assessed yet.