Skip to content
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

The azurerm_app_service ressource should apply the app_settings before the source_control section #10286

Closed
SylvainMartel opened this issue Jan 22, 2021 · 2 comments · Fixed by #12280

Comments

@SylvainMartel
Copy link

SylvainMartel commented Jan 22, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Affected Resource(s)

  • azurerm_2.44

Terraform Configuration Files

resource "azurerm_app_service" "app_service" {
  name                    = "app-${local.namespace}"
  location                = azurerm_resource_group.default.location
  resource_group_name     = azurerm_resource_group.default.name
  app_service_plan_id     = azurerm_app_service_plan.service_plan.id
  client_affinity_enabled = false

  site_config {
    java_version           = "11"
    java_container         = "TOMCAT"
    java_container_version = "9.0"
    always_on              = true
  }
  app_settings = {
    "sonar.jdbc.password" = azurerm_mssql_server.sql_server.administrator_login_password
    "sonar.jdbc.url"      = "jdbc:sqlserver://${azurerm_mssql_server.sql_server.name}.database.windows.net:1433;database=${azurerm_mssql_database.sql_database.name};encrypt=true"
    "sonar.jdbc.username" = azurerm_mssql_server.sql_server.administrator_login
    "SonarQubeEdition"    = var.sonarQubeEdition
    "SonarQubeVersion"    = var.sonarQubeVersion

  }

  source_control {
    repo_url           = "https://<edited>"
    branch             = "edition"
    manual_integration = true
  }



}

Debug Output

Panic Output

Expected Behaviour

When terraform deploy the service app, the app_settings should be written before it configure the Deployment settings(the source control block) since the deployment starts as soon as the soruce control is set. The reason is that often, the deployment code requires ENV variables that are written by the app_settings section. So, if the code is deployed before, the ENV variables aren't there yet and the end result is a failure.

What actually happens

the app_settings are configured/added only after the deployment is finished

Important Factoids

References

  • #0000
@jhajduk-microsoft

This comment has been minimized.

@github-actions
Copy link

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.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants