title: Terraform marked an "Function App" resource with the parameter "os_type" as lacked
body: <p>The Azure resources &quot;ASP-IS4-INT-FLUX-VOL-ITA-archive&quot; (App Service Plan) and &quot;AF-IS4-INT-FLUX-VOL-ITA-archive&quot; (Function App) has been deployed there more months ago.
  The both Azure resources are configured with the <strong>OS Windows</strong>.</p>
  <p>The terraform code of these resources :</p>
  <pre><code>resource &quot;azurerm_app_service_plan&quot; &quot;ASP-VOL-ITA&quot; {
    name                = &quot;ASP-${var.client}-${var.environment}-${var.project_Flux}-${local.VOL-ITA_client_code}-${local.VOL-ITA_country_code}&quot;
    location            = module.resource_group_VOL-ITA.out_rg_location
    resource_group_name = module.resource_group_VOL-ITA.out_rg_name
    kind                = &quot;functionapp&quot;
    tags                = merge(var.default_tags, var.default_VOL-ITA_tags, var.ASP-VOL-ITA_tags)
  
    sku {
      tier = &quot;Dynamic&quot;
      size = &quot;Y1&quot;
    }
  
    lifecycle {
      ignore_changes = all
    }
  }
  
  
  resource &quot;azurerm_function_app&quot; &quot;AF-VOL-ITA-archive&quot; {
    name                        = &quot;AF-${var.client}-${var.environment}-${var.project_Flux}-${local.VOL-ITA_client_code}-${local.VOL-ITA_country_code}-archive&quot;
    location                    = module.resource_group_VOL-ITA.out_rg_location
    resource_group_name         = module.resource_group_VOL-ITA.out_rg_name
    app_service_plan_id         = azurerm_app_service_plan.ASP-VOL-ITA.id
    https_only                  = &quot;true&quot;
    version                     = &quot;~2&quot;
    storage_connection_string   = module.storage_account_VOL.out_storage_primary_connection_string
    tags                        = merge(var.default_tags, var.default_VOL-ITA_tags, var.AF-VOL-ITA-archive_tags)
  
    lifecycle {
      #ignore_changes = all
      ignore_changes = [
        app_settings,
        storage_connection_string
      ]
    }
  
  }
  </code></pre>
  <p><strong>Terraform version : 1.0.1</strong></p>
  <p><strong>Azurerm provider : 2.68.0</strong></p>
  <p>But since some weeks when I execute a &quot;terraform plan&quot; command this &quot;Function App&quot; is marked as &quot;<strong>update in-place</strong>&quot; whereas I changed nothing since the initial deployment.</p>
  <p>So then I adapted my Terraform code as below :</p>
  <pre><code>resource &quot;azurerm_app_service_plan&quot; &quot;ASP-VOL-ITA&quot; {
    name                = &quot;ASP-${var.client}-${var.environment}-${var.project_Flux}-${local.VOL-ITA_client_code}-${local.VOL-ITA_country_code}&quot;
    location            = module.resource_group_VOL-ITA.out_rg_location
    resource_group_name = module.resource_group_VOL-ITA.out_rg_name
  
    # IN COMMENT
    #kind                = &quot;functionapp&quot;
  
    # ENABLE TWO BELOW LINES
    kind                = &quot;Windows&quot;
    reserved            = false
  
    tags                = merge(var.default_tags, var.default_VOL-ITA_tags, var.ASP-VOL-ITA_tags)
  
    sku {
      tier = &quot;Dynamic&quot;
      size = &quot;Y1&quot;
    }
  
    lifecycle {
      ignore_changes = all
    }
  }
  
  resource &quot;azurerm_function_app&quot; &quot;AF-VOL-ITA-archive&quot; {
    name                        = &quot;AF-${var.client}-${var.environment}-${var.project_Flux}-${local.VOL-ITA_client_code}-${local.VOL-ITA_country_code}-archive&quot;
    location                    = module.resource_group_VOL-ITA.out_rg_location
    resource_group_name         = module.resource_group_VOL-ITA.out_rg_name
    app_service_plan_id         = azurerm_app_service_plan.ASP-VOL-ITA.id
    https_only                  = &quot;true&quot;
    version                     = &quot;~2&quot;
    storage_connection_string   = module.storage_account_VOL.out_storage_primary_connection_string
  
    # ADDING OF THIS LINE
    os_type                     = &quot;&quot;
  
    tags                        = merge(var.default_tags, var.default_VOL-ITA_tags, var.AF-VOL-ITA-archive_tags)
  
    lifecycle {
      #ignore_changes = all
      ignore_changes = [
        app_settings,
        storage_connection_string,
        os_type
      ]
    }
  
  }
  
  </code></pre>
  <p>I tried more tests to fix this behavior.</p>
  <p>I tried to :</p>
  <ul>
  <li><p>in the declaration of the resource Function App I added the variable &quot;<em>os_type</em>&quot; with the value <strong>empty</strong> + in the App Service Plan resource the variables &quot;<em>kind</em>&quot; with &quot;<strong>Windows</strong>&quot; and the variable &quot;<em>reserved</em>&quot; with the value &quot;<strong>false</strong>&quot; <strong>-&gt; The result of the &quot;terraform plan&quot; command is</strong> the Function App resource is marked &quot;<strong>update in-place</strong>&quot; with the adding of the &quot;os_type&quot; variable with empty value.</p>
  </li>
  <li><p>in the declaration of the resource Function App I comment the line with the variable &quot;<em>os_type</em>&quot; + in the App Service Plan resource the variables &quot;<em>kind</em>&quot; with &quot;<strong>Windows</strong>&quot; and the variable &quot;<em>reserved</em>&quot; with the value &quot;<strong>false</strong>&quot; <strong>-&gt; The result of the &quot;terraform plan&quot; command is</strong> the Function App resource is marked as &quot;<strong>update in-place</strong>&quot; with the adding of the &quot;os_type&quot; variable with empty value.</p>
  </li>
  <li><p>Upgrading the version of the azurerm provider from 2.50.0 to 2.68.0 <strong>-&gt; The result is the same as the above scenarios of tests</strong>.</p>
  </li>
  </ul>
  <p>I add the screenshot link which show how Terraform marks the Function App resource : <a href="https://postimg.cc/MvsfmrT9" rel="nofollow noreferrer">https://postimg.cc/MvsfmrT9</a></p>
  <ul>
  <li>I getted the Terraform files of my production environment and then copy these ones in a laboratory environment to do tests, so I did next actions :</li>
  </ul>
  <ol>
  <li>I deployed the &quot;Function App&quot; and &quot;App Service Plan&quot; Azure resources in a labo Azure subscription with the same Terraform configuration (same .tf files, same version of azurerm provider)</li>
  <li>I compared the json structure between the &quot;Function App&quot; resource of the production environment and those of the laboratory environment : <strong>I have the same json lines in both environments</strong>.</li>
  </ol>
  <p>So I don't understand why I haven't the same behavior between the production env and the laboratory env.</p>
  <p><strong>Is anyone has encountered the same behavior ?</strong></p>
  <p><strong>What is the consequence for the availability of the Function App with the change of this one with the adding of &quot;os_type&quot; variable with the empty value if I execute the &quot;terraform apply&quot; command ?</strong></p>