Skip to content

Conversation

@disq
Copy link
Member

@disq disq commented Mar 2, 2023

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

@cq-bot cq-bot added the azure label Mar 2, 2023

switch dr {
case "Last7Days":
now = now.AddDate(0, 0, -1) // ends yesterday
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These dates were verified by the Azure console dates for today, at
Screenshot 2023-03-02 at 09 56 27

@disq
Copy link
Member Author

disq commented Mar 2, 2023

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 TimeframeTypeBillingMonthToDate and TimeframeTypeTheLastBillingMonth which we use, but it might or might not work correctly depending on people's billing schedules. Here are the options in the UI:

Screenshot 2023-03-02 at 10 00 20

}

if qd.Timeframe == nil && item.Properties.DateRange != nil {
return fmt.Errorf("could not convert date range %q to time period", *item.Properties.DateRange)
Copy link
Member Author

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.

@disq disq added the automerge Automatically merge once required checks pass label Mar 6, 2023
@kodiakhq kodiakhq bot merged commit 6178e1c into cloudquery:main Mar 6, 2023
@disq disq deleted the fix/azure_cost_management_date_range branch March 6, 2023 09:12
kodiakhq bot pushed a commit that referenced this pull request Mar 8, 2023
🤖 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate: Azure billing tables data

3 participants