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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating azurerm_app_service with site_config block fails #1560

Open
ben-lings-tessella opened this Issue Jul 13, 2018 · 6 comments

Comments

Projects
None yet
8 participants
@ben-lings-tessella
Copy link

ben-lings-tessella commented Jul 13, 2018

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 Version

Terraform v0.11.7

  • provider.azurerm v1.9.0
  • provider.random v1.3.1

Affected Resource(s)

  • azurerm_app_service

Terraform Configuration Files

resource "azurerm_app_service" "wordpress" {
  name                = "..."
  resource_group_name = "..."
  location            = "..."

  app_service_plan_id = "${azurerm_app_service_plan.appservice.id}"

  site_config {
 }

  lifecycle {
    ignore_changes = [
      "site_config"
    ]
  }

  app_settings {
    "PHPMYADMIN_EXTENSION_VERSION" = "latest"
    "WEBSITE_DYNAMIC_CACHE" = "0"
    "APPINSIGHTS_INSTRUMENTATIONKEY" = "${azurerm_application_insights.appinsights.instrumentation_key}"
  }

  connection_string {
    name = "defaultConnection"
    type = "MySQL"
    value = "Database=${azurerm_mysql_database.wordpress-db.name};Data Source=${azurerm_mysql_server.database.fqdn};User Id=${azurerm_mysql_server.database.administrator_login}@${azurerm_mysql_server.database.name};Password=${azurerm_mysql_server.database.administrator_login_password}"
  }
}

Debug Output

2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: 2018/07/13 11:46:58 [DEBUG] AzureRM Response for https://management.azure.com/subscriptions/bd1eb79a-90ad-4b11-846d-378898aa9026/providers/Microsoft.Web/checknameavailability?api-version=2016-03-01:
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: HTTP/1.1 200 OK
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Transfer-Encoding: chunked
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Cache-Control: no-cache
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Content-Type: application/json
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Date: Fri, 13 Jul 2018 10:46:58 GMT
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Expires: -1
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Pragma: no-cache
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Server: Microsoft-IIS/10.0
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Strict-Transport-Security: max-age=31536000; includeSubDomains
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Vary: Accept-Encoding
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: X-Aspnet-Version: 4.0.30319
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: X-Content-Type-Options: nosniff
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: X-Ms-Correlation-Request-Id: ab8a44f1-681a-4140-ae68-ab6617292531
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: X-Ms-Ratelimit-Remaining-Subscription-Reads: 14969
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: X-Ms-Request-Id: b4cda202-4c7d-44bf-af72-cdbd4887cbf5
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: X-Ms-Routing-Request-Id: UKWEST:20180713T104658Z:ab8a44f1-681a-4140-ae68-ab6617292531
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: X-Powered-By: ASP.NET
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: 
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: 2f
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: 0
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: 
2018-07-13T11:46:58.555+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: 
2018-07-13T11:46:58.557+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: 2018/07/13 11:46:58 [DEBUG] AzureRM Request:
2018-07-13T11:46:58.557+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: PUT /subscriptions/bd1eb79a-90ad-4b11-846d-378898aa9026/resourceGroups/do0107/providers/Microsoft.Web/sites/REDACTED?api-version=2016-08-01 HTTP/1.1
2018-07-13T11:46:58.557+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Host: management.azure.com
2018-07-13T11:46:58.557+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: User-Agent: Go/go1.9.2 (amd64-darwin) go-autorest/v10.12.0 Azure-SDK-For-Go/v18.0.0 web/2016-09-01;HashiCorp-Terraform-v0.11.3
2018-07-13T11:46:58.557+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Content-Length: 628
2018-07-13T11:46:58.557+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Authorization: Bearer [SNIPPED]
2018-07-13T11:46:58.557+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Content-Type: application/json; charset=utf-8
2018-07-13T11:46:58.557+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Accept-Encoding: gzip
2018-07-13T11:46:58.557+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: 
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: 2018/07/13 11:47:01 [DEBUG] AzureRM Response for https://management.azure.com/subscriptions/bd1eb79a-90ad-4b11-846d-378898aa9026/resourceGroups/do0107/providers/Microsoft.Web/sites/REDACTED?api-version=2016-08-01:
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: HTTP/1.1 409 Conflict
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Content-Length: 641
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Cache-Control: no-cache
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Content-Type: application/json; charset=utf-8
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Date: Fri, 13 Jul 2018 10:47:00 GMT
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Expires: -1
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Pragma: no-cache
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Server: Microsoft-IIS/10.0
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: Strict-Transport-Security: max-age=31536000; includeSubDomains
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: X-Aspnet-Version: 4.0.30319
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: X-Content-Type-Options: nosniff
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: X-Ms-Correlation-Request-Id: f3d9fb7e-c08c-4709-ab40-358a24c0c2bd
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: X-Ms-Ratelimit-Remaining-Subscription-Resource-Requests: 499
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: X-Ms-Request-Id: f3d9fb7e-c08c-4709-ab40-358a24c0c2bd
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: X-Ms-Routing-Request-Id: UKWEST:20180713T104701Z:f3d9fb7e-c08c-4709-ab40-358a24c0c2bd
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: X-Powered-By: ASP.NET
2018-07-13T11:47:01.106+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.9.0_x4: 

Panic Output

Expected Behavior

Site_config is applied

Actual Behavior

Error

Error: Error applying plan:

1 error(s) occurred:

* azurerm_app_service.wordpress-test: 1 error(s) occurred:

* azurerm_app_service.wordpress-test: web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> <nil>

Steps to Reproduce

  1. terraform apply

Important Factoids

Removing the site_config block allows the app service to be created. Specifying the site_config as an update to an existing site also seems to work.

References

  • #0000
@dburriss

This comment has been minimized.

Copy link

dburriss commented Sep 14, 2018

Can confirm. Same error and commenting out site_config allowed app service to be created.

  terraform -version
  Terraform v0.11.8
  + provider.azurerm v1.15.0
@alastairtree

This comment has been minimized.

Copy link
Contributor

alastairtree commented Nov 7, 2018

Still an issue in provider.azurerm v1.18.0

@Kappa013

This comment has been minimized.

Copy link

Kappa013 commented Dec 5, 2018

Ran into this problem as well, using the following versions;

Terraform v0.11.10

  • provider.azurerm v1.19.0
@arichiardi

This comment has been minimized.

Copy link
Contributor

arichiardi commented Jan 9, 2019

Still an issue with 1.20.0 and terraform 0.11.10

To expand a little, it seems that in my case the always_on = true option in site_config, which is not really supported with my Consumption plan sku, is causing the error.

So I am not sure that in my case this is due to the whole site_config map but it rather seems like that one of its key when not supported gives out an cryptic error.

@justinyoo

This comment has been minimized.

Copy link

justinyoo commented Jan 12, 2019

I had the exact same issue as @arichiardi. The site_config itself isn't a problem, but the always_on = true option is the problem. When I put other option like use_32_bit_worker_process = true/false, it doesn't cause this issue.

  • Terraform v0.11.11
  • provider.azurerm v1.20.0
@UizzUW

This comment has been minimized.

Copy link

UizzUW commented Feb 14, 2019

Still hitting this on 0.11.11 / 1.22.0. Disabiling always_on explicitly (even though I never had it enabled in the first place) does not seem to help.

One thing I found which helps, though, is first running apply with the site_config block commented, then uncommenting it and running apply one more time. I also found the delta's shape a bit fishy during the second apply when using an empty site_config {} block - it seems to nuke a few more things than it should :

  ~ azurerm_app_service.fancypants_app_service
      site_config.0.default_documents.#: "9" => "0"
      site_config.0.default_documents.0: "Default.htm" => ""
      site_config.0.default_documents.1: "Default.html" => ""
      site_config.0.default_documents.2: "Default.asp" => ""
      site_config.0.default_documents.3: "index.htm" => ""
      site_config.0.default_documents.4: "index.html" => ""
      site_config.0.default_documents.5: "iisstart.htm" => ""
      site_config.0.default_documents.6: "default.aspx" => ""
      site_config.0.default_documents.7: "index.php" => ""
      site_config.0.default_documents.8: "hostingstart.html" => ""
      site_config.0.php_version:         "5.6" => ""

I think they should remain the same even if not specified under the site_config block, since all of its properties are optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment