Azure / Azure/azure-rest-api-specs

Azure: azure.mgmt.monitor python SDK, generates inconsistent OpreationName localized_value

Open
#19,267 2 comments 0 reactions 0 assignees View on GitHub
Mgmt Monitor Monitor - ActivityLogs needs-team-attention Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

Issue: Python SDK "azure.mgmt.monitor" generates inconsistant opreationName localizedValue.
Expection: Python SDK "azure.mgmt.monitor" should generate consistent localized_value

Steps to reproduce the issue:
1. Scenario A: Activity log of unattached disk deleted on - 2022-05-03

```
old_90 = today - datetime.timedelta(days=int(90))
id = rsourceid
fl = ("eventTimestamp ge '{}' and eventTimestamp le '{}' and resourceGroupName eq '{}' and resourceId eq '{}' and resourceType eq 'Microsoft.Compute/disks' and status eq 'Accepted'".format(old_90,today,resource_grp_name,id))
activities = client.activity_logs.list(filter=fl, select=None)
for lg in activities:
print(lg.operation_name)
```

Output:
```
{'additional_properties': {}, 'value': 'Microsoft.Compute/disks/delete', 'localized_value': 'Microsoft.Compute/disks/delete'}
```

2. Scenario B: Activity log of unattached disk deleted on - 2022-05-13
Same code used as above.
Output:
```
{'additional_properties': {}, 'value': 'Microsoft.Compute/disks/delete', 'localized_value': 'Delete Disk'}
```

Scenario A provides an incorrect 'localized_value', and in scenario B we got the correct localized_value.

Contributor guide

Open the contributing guide

Research direction

Start with the azure.mgmt.monitor Activity Logs client and its activity_logs.list entry point, using the two reproduced filters and comparing operation_name.localized_value for the returned events. Trace whether the inconsistency is present in the generated SDK response or the Azure Monitor service; done means the same operation produces a consistent localized_value.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, python
Domain
api, observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.