-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azurerm_monitor_diagnostic_setting
- fix log_analytics_destination_type
#20203
azurerm_monitor_diagnostic_setting
- fix log_analytics_destination_type
#20203
Conversation
azurerm_monitor_diagnostic_setting
- set log_analytics_destination_type
inferred value to AzureDiagnostics
azurerm_monitor_diagnostic_setting
- fix log_analytics_destination_type
@teowa the doc you linked, https://github.com/MicrosoftDocs/azure-docs/blob/e294e228cf8249e82172695143e0a21084636b67/articles/azure-monitor/essentials/resource-logs.md#select-the-collection-mode , it says that we should use Dedicated because AzureDiagnostics will be removed in future, right? So we should maybe put a deprecaion on that and change default in 4.0 or something like that? |
As I tested, for some target resources (e.g., KeyVault) this property is not settable, and for other resources (e.g., DataFactory) it still works well, see details in Azure/azure-rest-api-specs#22400. I am still contacting with service team about the details of the affected resource types. Temporarily close this and once a solution is determined I am going to reopen this PR. |
…m into fix_diagnostic_setting_log_analytic_destination_type
The two cases of
We are asking service team to change case1 to return an error. And I think it's better to change this property to |
9431041
to
916b1d1
Compare
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.
LGTM 📓
This functionality has been released in v3.45.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
resolves #20140
The issue is caused by service API behavior change and related to #20048:
log_analytics_destination_type
property default toAzureDiagnostics
. So PRazurerm_monitor_diagnostic_setting
- fix update issue #20048 was introduced to set TF schema property default toAzureDiagnostics
.azurerm_key_vault
) returns empty forlog_analytics_destination_type
property even if you set it asAzureDiagnostics
orDedicated
in request. But some other resources (e.g.azurerm_data_factory
) still default toAzureDiagnostics
. Details is inMicrosoft.Insights/diagnosticSettings@2021-05-01-preview
-logAnalyticsDestinationType
break PUT-GET consistency Azure/azure-rest-api-specs#22400.The above API behavior change happened after PR #20048 (set
log_analytics_destination_type
default toAzureDiagnostics
) was merged. Days ago the API also returnsAzureDiagnostics
for resource like Key Vault, this can be proved by daily test record, it works well before Jan 26, and PR #20048 was merged before Jan 19.From this doc: