Azure / Azure/azure-rest-api-specs
[BUG] Cost Management Scheduled Action API ignores dayOfMonth property
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 424
Description
### API Spec link
https://github.com/Azure/azure-rest-api-specs/blob/8d0bc1f353f04d0cac751e6819064086c972ae99/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2024-08-01/scheduledActions.json#L873
### API Spec version
2023-08-01
### Describe the bug
Swagger indicates that [dayOfMonth](https://github.com/Azure/azure-rest-api-specs/blob/8d0bc1f353f04d0cac751e6819064086c972ae99/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2024-08-01/scheduledActions.json#L873) means that UTC day on which cost analysis data will be emailed. Must be between 1 and 31. This property is applicable when frequency is Monthly and overrides weeksOfMonth or daysOfWeek. Then I tried to set dayOfMonth to 30 while creating Cost Management Scheduled Action but seems it doesn't take effect and Azure Portal always indicates it will be triggered on the first day.
below is the request payload:
```
PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-cm-test01/providers/Microsoft.CostManagement/scheduledActions/testcostviewdzxc2
{
"kind": "Email",
"properties": {
"displayName": "CostByServiceViewdzxc2",
"fileDestination": {
"fileFormats": []
},
"notification": {
"message": "Hi",
"subject": "Cost Management Report for AzureSDKTest Subscription",
"to": [
"test@test.com",
"hashicorp@test.com"
]
},
"notificationEmail": "test@test.com",
"schedule": {
"dayOfMonth": 30,
"daysOfWeek": null,
"endDate": "2025-03-31T15:00:00Z",
"frequency": "Monthly",
"hourOfDay": 0,
"startDate": "2025-03-01T15:00:00Z",
"weeksOfMonth": null
},
"status": "Enabled",
"viewId": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-cm-test01/providers/Microsoft.CostManagement/views/testcostviewdsfgdf"
}
}
```

### Expected behavior
When I try to set dayOfMonth to 30 while creating Cost Management Scheduled Action and Azure Portal should indicate that it will be triggered on 30th day.
### Actual behavior
When I try to set dayOfMonth to 30 while creating Cost Management Scheduled Action and Azure Portal indicates that it will be triggered on the first day.
### Reproduction Steps
1. Create resource group
2. Create resource group cost management view
3. Create cost management scheduled action
### Environment
PROD
Contributor guide
Research direction
Start with the scheduledActions.json specification at the linked stable/2024-08-01 path, around line 873, and inspect how the schedule's dayOfMonth property is defined and represented. Reproduce the monthly schedule request from the issue, then determine whether the specification accurately describes the service behavior; done means the contract and documented expected behavior agree.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, openapi
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100