Azure / Azure/azure-functions-host

FunctionAppLogs from Diagnostic settings have different format at "properties" field by OS/SKU

Open
#7,864 12 comments 2 reactions 3 assignees Claimed by @vivekjilla View on GitHub
breaking-change
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

#### Investigative information

Please provide the following:

- Timestamp:
- Function App version: 4.0.1.16815
- Function App name: 2111040060000473ELASTIC-LINUX
- Function name(s) (as appropriate): N/A
- Invocation ID: N/A
- Region: JapanEast

#### Repro steps

Provide the steps required to reproduce the problem:

- Save FunctionAppLogs to storage account from Diagnostic settings.

#### Expected behavior

All OS and SKU should have same format.

#### Actual behavior

■Linux Elastic Premium
"properties" is quoted with "(double quote),
key-values in stringifyed object are quoted with '(single quote)

```
{ "level": "Informational", "resourceId": "/SUBSCRIPTIONS/---/RESOURCEGROUPS/---/PROVIDERS/MICROSOFT.WEB/SITES/2111040060000473ELASTIC-LINUX", "operationName": "Microsoft.Web/sites/functions/log", "category": "FunctionAppLogs", "time": "11/15/2021 11:36:06", "properties": "{'appName':'2111040060000473elastic-linux','roleInstance':'4de66c2ce3805624b7e310460ca35c2789c27a85279b183e8c95aef70dd8d30a','message':'Starting JobHost','category':'Microsoft.Azure.WebJobs.Hosting.JobHostService','hostVersion':'4.0.1.16815','hostInstanceId':'3d7b63ad-2230-4902-9d52-195b26396d5f','level':'Information','levelId':2,'processId':19}", "EventStampType": "Stamp", "EventPrimaryStampName": "waws-prod-ty1-021", "EventStampName": "waws-prod-ty1-021e", "Host": "RD00155D7B6F5E", "EventIpAddress": "10.0.4.43"}
```

■Linux Consumption
"properties" is not quoted, key-value in object are quoted with '(single quote)
Single quotation in json object is invalid

```
{ "time": "2021-11-15T12:27:30Z", "resourceId": "/SUBSCRIPTIONS/---/RESOURCEGROUPS/---/PROVIDERS/MICROSOFT.WEB/SITES/2111040060000473CONSUMPTION-LINUX", "category": "FunctionAppLogs", "operationName": "Microsoft.Web/sites/functions/log", "level": "Informational", "properties": {'appName':'2111040060000473consumption-linux','roleInstance':'0F4222AC-637725731219525275','message':'Starting JobHost','category':'Microsoft.Azure.WebJobs.Hosting.JobHostService','hostVersion':'4.0.1.16815','hostInstanceId':'cf783750-4b85-42ad-ba30-09b691ad4643','level':'Information','levelId':2,'processId':71}}
```

■Windows Elastic Premium
"properties" is not quoted, key-value in object are quoted with "(double quote)
This format is totally valid json

```
{ "time": "2021-11-15T12:33:42.3447980Z", "resourceId": "/SUBSCRIPTIONS/---/RESOURCEGROUPS/---/PROVIDERS/MICROSOFT.WEB/SITES/2111040060000473ELASTIC-WINDOWS", "category": "FunctionAppLogs", "operationName": "Microsoft.Web/sites/functions/log", "level": "Informational", "location": "Japan East", "properties": {"appName":"2111040060000473elastic-windows","roleInstance":"2b4c36a34f16a3e3e5cff084e931fa6d2824e9831242d56c0be5eb98bc673cba","message":"Starting JobHost","category":"Microsoft.Azure.WebJobs.Hosting.JobHostService","hostVersion":"4.0.1.16815","hostInstanceId":"e36b2a05-2985-427f-8611-6f4aba67a07a","level":"Information","levelId":2,"processId":2552}}
```

■Windows Consumption
"properties" is not quoted, key-value in object are quoted with "(double quote)
This format is totally valid json
This format is as same as Windows Elastic Premium

```
{ "time": "2021-11-15T12:30:45.9159658Z", "resourceId": "/SUBSCRIPTIONS/---/RESOURCEGROUPS---/PROVIDERS/MICROSOFT.WEB/SITES/2111040060000473CONSUMPTION-WINDOWS", "category": "FunctionAppLogs", "operationName": "Microsoft.Web/sites/functions/log", "level": "Informational", "location": "Japan East", "properties": {"appName":"2111040060000473consumption-windows","roleInstance":"d476ae96b48fc235309ba1fcc879ec5ce2731f618425933ab7d648744c03d544","message":"Starting JobHost","category":"Microsoft.Azure.WebJobs.Hosting.JobHostService","hostVersion":"4.0.1.16815","hostInstanceId":"6a179724-1237-4598-bc06-d9121dbf40ac","level":"Information","levelId":2,"processId":6796}}
```

#### Known workarounds

N/A

#### Related information

Provide any related information

* Programming language used Node
* Links to source
* Bindings used

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.