Azure / Azure/azure-rest-api-specs
[Question] while getting acivity log via rest api, it returned unexpected turkey language value
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 424
Description
### API Spec link
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/rest-activity-log
### API Spec version
2015-04-01
### Question/Query
My customer is using rest api to get activity logs in powershell.
Sypmtom is that returned value had below strange operation name in Turkey.
Microsoft.Compute - mw-p-1020033 : Etiket yaz (KST: 07/24/2024 07:51:28 )
resourceType: Microsoft.Compute
resourceName: mw-p-1020033
operation: **Etiket yaz**
status_result: Succeeded
message:
This is not reproducing now, but they want to know why this happened.
Below is the powershell script they are using and below operationName.localizedValue was the trouble part.
**$operation = $avstatus_result.operationName.localizedValue`**
Please help advise about this symptom.
`$datetime_min_ago = '2024-07-23T22:40:00Z'
$datetime_current = '2024-07-23T23:00:00Z'
$datetime_min_ago = [DateTime]::UtcNow.AddMinutes(-5).ToString('u').Replace(' ','T')
$datetime_current = [DateTime]::UtcNow.ToString('u').Replace(' ','T')
Get-AzSubscription
Set-AzContext -SubscriptionId $subscriptionId
$resource_Groupname = "RG-TFDEUS-PRD"
$avstatus_Uri = https://management.azure.com/subscriptions/$subscriptionId/providers/Microsoft.Insights/eventtypes/management/values?api-version=2015-04-01&`$filter=eventTimestamp ge $datetime_min_ago and eventTimestamp le $datetime_current and resourceGroupName eq $resource_Groupname
$avstatus = RestMethod $avstatus_Uri
$avstatus_results = $avstatus.value | Where-object {$_.resourceId -match "Microsoft.Compute" -OR $_.resourceId -match "Microsoft.Cache" -OR $_.resourceId -match "Microsoft.Sql" -OR $_.resourceId -match "Microsoft.Network"}
$includeSet = @{}
$status_value=""
$arraycount=0
$count=0
Set-TimeZone -Id "UTC"
if($avstatus_results)
{
foreach ($avstatus_result in $avstatus_results){
$status_value = 1
$kstTimeZone = [System.TimeZoneInfo]::FindSystemTimeZoneById('Korea Standard Time')
$eventTimestamp_utc = [DateTime]::SpecifyKind($avstatus_result.eventTimestamp,[DateTimeKind]::utc)
$submissionTimestamp_utc = [DateTime]::SpecifyKind($avstatus_result.submissionTimestamp,[DateTimeKind]::utc)
$eventTimestamp_kst = [System.TimeZoneInfo]::ConvertTime($eventTimestamp_utc, $kstTimeZone)
$submissionTimestamp_kst = [System.TimeZoneInfo]::ConvertTime($submissionTimestamp_utc, $kstTimeZone)
$subscriptionId = $avstatus_result.subscriptionId
$caller = $avstatus_result.caller
$resourceName = $avstatus_result.resourceId.split("/") | Select-Object -Last 1
$resourceType = $avstatus_result.resourceId.split("/") | Select-Object -Last 3 | Select-Object -First 1
**$operation = $avstatus_result.operationName.localizedValue`**
### Environment
powershell
Contributor guide
Research direction
Start with the Azure Monitor activity log REST endpoint in the API Spec link and the PowerShell expression reading operationName.localizedValue. Compare the returned localizedValue with the documented activity-log response and investigate the reported Turkish operation name, noting that the symptom is no longer reproducible. Done requires an explained cause or a confirmed API behavior and a clear next step.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100