Skip to content

Deployment error related with diagnostic settings error #23

@srihamat

Description

@srihamat

This issue is for a: (mark with an x)

- [ ] bug report 
- [ ] feature request
- [ ] documentation issue or request
- [ x ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  1. Get latest code
  2. Deploy by terraform

Any log messages given by the failure

module.bastion_host.azurerm_bastion_host.bastion_host: Creation complete after 9m52s [id=/subscriptions/xxx/resourceGroups/magic8ballRG/providers/Microsoft.Network/bastionHosts/magic8ballBastionHost]
module.bastion_host.azurerm_monitor_diagnostic_setting.settings: Creating...
╷
│ Error: creating Monitor Diagnostics Setting "DiagnosticsSettings" for Resource "/subscriptions/xxx/resourceGroups/magic8ballRG/providers/Microsoft.Network/bastionHosts/magic8ballBastionHost": diagnosticsettings.DiagnosticSettingsClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="Diagnostic settings does not support retention for new diagnostic settings."
│
│   with module.bastion_host.azurerm_monitor_diagnostic_setting.settings,
│   on modules\bastion_host\main.tf line 35, in resource "azurerm_monitor_diagnostic_setting" "settings":
│   35: resource "azurerm_monitor_diagnostic_setting" "settings" {

Expected/desired behavior

No error

OS and Version?

Windows 10

Versions

Latest - 30-Aug-2023

Mention any other details that might be useful

By refer to https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/migrate-to-azure-storage-lifecycle-policy
I realized there is changed in diagnostic setting storage that going to be deprecation.
Workaround is to either remove setting about retention days or set log retention in the log analytics workspace.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions