-
Notifications
You must be signed in to change notification settings - Fork 544
fix(azure): Set date range in cost management queries #8676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(azure): Set date range in cost management queries #8676
Conversation
|
|
||
| switch dr { | ||
| case "Last7Days": | ||
| now = now.AddDate(0, 0, -1) // ends yesterday |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
The invoice periods might not be supported 100% - We don't support them specifically by converting them to custom date ranges, but the view query API has |
| } | ||
|
|
||
| if qd.Timeframe == nil && item.Properties.DateRange != nil { | ||
| return fmt.Errorf("could not convert date range %q to time period", *item.Properties.DateRange) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't know about this date range we simply refuse fetching incorrect data.
🤖 I have created a release *beep* *boop* --- ## [5.0.0](plugins-source-azure-v4.3.0...plugins-source-azure-v5.0.0) (2023-03-08) ### ⚠ BREAKING CHANGES * **azure-resources:** Remove `azure_azuredata_sql_server_registrations` since the API to sync it is deprecated. You should use the tables under `azurearcdata`, `azure_azurearcdata_sql_server_instances`, `azure_azurearcdata_postgres_instances` or `azure_azurearcdata_sql_managed_instances` to get the most up to date information. See more in this [Azure Go SDK issue comment](Azure/azure-sdk-for-go#19789 (comment)). ### Features * **azure-resources:** Add Monitor Autoscale Settings ([#8696](#8696)) ([030c0c2](030c0c2)) * **azure-resources:** Add Subscription Diagnostic Settings ([#8693](#8693)) ([d84454c](d84454c)) * **docs:** Render tables as a part of the Website and add a [tables search box](https://www.cloudquery.io/tables). The equivalent of the GitHub README.md file is now under each plugin's docs section, for example https://www.cloudquery.io/docs/plugins/sources/aws/tables. The Website HTML page is built from the GitHub markdown file located under each plugin's path in our Website code, for example https://github.com/cloudquery/cloudquery/blob/main/website/pages/docs/plugins/sources/aws/tables.md. For the list of all plugins table files as they are stored on GitHub see https://github.com/cloudquery/cloudquery/tree/main/website/tables ([342b0c5](342b0c5)) ### Bug Fixes * **azure-resources:** Remove `azure_azuredata_sql_server_registrations` ([977137e](977137e)) * **azure:** Set date range in cost management queries ([#8676](#8676)) ([6178e1c](6178e1c)), closes [#8655](#8655) * **deps:** Update golang.org/x/exp digest to c95f2b4 ([#8560](#8560)) ([9c3bd5b](9c3bd5b)) * **deps:** Update module github.com/Azure/azure-sdk-for-go/sdk/azcore to v1.3.1 ([#8567](#8567)) ([d17e2aa](d17e2aa)) * **deps:** Update module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices to v1.3.0 ([#8648](#8648)) ([7639032](7639032)) * **deps:** Update module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2 to v2.2.0 ([#8649](#8649)) ([261aa9c](261aa9c)) * **deps:** Update module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory/v3 to v3.1.0 ([#8650](#8650)) ([359da21](359da21)) * **deps:** Update module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto to v1.2.0 ([#8651](#8651)) ([036adc7](036adc7)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.41.0 ([#8682](#8682)) ([ea9d065](ea9d065)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.42.0 ([#8725](#8725)) ([b83b277](b83b277)) * **deps:** Update module github.com/stretchr/testify to v1.8.2 ([#8599](#8599)) ([2ec8086](2ec8086)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).


The issue here is, the date range 'presets' supported by the UI don't match 1-1 to the presets in view queries. So we have to check and remedy the problem ourselves.
Fixes #8655