-
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
Diagnostic Setting fails to apply if logAnalyticsDestinationType
is set
#20019
Comments
Not sure what caused this behaviour but deleting the diagnostic settings on the portal and re-running the pipeline fixed it for me. I re-ran the pipeline several times after that and no issues |
I’ll try deleting a few diagnostics settings this morning - I can confirm they create just fine, but then on a second run they all want to be updated. |
Hi @cpressland , thanks for submitting issue! From the provided error message |
@teowa thanks for the reply, this is happening on 100% of our diagnostics settings, even ones that were written over four years ago with very complex log setups. Of course, the issue only occurs after we taint or manually delete the setting via the Portal. It gets created just fine, with all of the correct settings, and then fails to reconcile on future runs. I plan to handle the removal of |
So this is fun, tainting and replacing Diagnostic Settings gives me a completely random chance of getting |
I have the same problem. Removing the diagnostic setting manually worked for me as a workaround to fix my terraform apply! |
By checking the code, this is a bug in the provider when updating the diagnostic setting, I am going to submit PR to fix this. |
Same for me. If I delete monitoring setting on portal all work fine but second run produce error. Only for apply step. terraform plan works with no error. |
terraform plan always report drift. try to upgrade to 3.40 , but not work
|
constant updates to the resource with diff identical to the above |
@teowa does it work for you? |
Please see #20140 |
Same in 3.42.0 . it's still reporting update of locanalytics_destination_type without taking any effect after apply: resource "azurerm_monitor_diagnostic_setting" "logs" { |
Yep, no change in behaviour on 3.42.0 for me. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Is there an existing issue for this?
Community Note
Terraform Version
1.3.7
AzureRM Provider Version
3.39.1
Affected Resource(s)/Data Source(s)
azurerm_monitor_diagnostic_setting
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
No change should be applied as the default IS AzureDiagnostics according to Documentation here
Actual Behaviour
We have a single diagnostic setting which has
"logAnalyticsDestinationType": "AzureDiagnostics"
set, while all other Diagnostics Settings have"logAnalyticsDestinationType": null
.AzureRM Provider appears to be trying to set
"AzureDiagnostics"
tonull
during a plan/apply, but the Azure API appears to be rejecting this.I have destroyed other diagnostics settings, upon recreating them they always get set with
"AzureDiagnostics"
instead ofnull
, this suggests an API change within Azure that the provider needs to handle better.Steps to Reproduce
terraform plan
on the same Diagnostic SettingImportant Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: