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

resource/app_service: Add support for running Containers #1578

Merged
merged 1 commit into from
Jul 16, 2018

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Jul 15, 2018

Fixes: #580

Used the examples provided in #580 to get this working

Test results in the comments below thanks to @tombuildsstuff

@tombuildsstuff
Copy link
Contributor

Tests pass:

screenshot 2018-07-15 at 23 24 06

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@stack72 stack72 changed the title [WIP] resource/app_service: Add support for running Containers resource/app_service: Add support for running Containers Jul 15, 2018
@tombuildsstuff tombuildsstuff added this to the 1.10.0 milestone Jul 16, 2018
@tombuildsstuff
Copy link
Contributor

Tests pass after a rebase:

screenshot 2018-07-16 at 11 38 44

@tombuildsstuff tombuildsstuff merged commit 545f2f2 into hashicorp:master Jul 16, 2018
tombuildsstuff added a commit that referenced this pull request Jul 16, 2018
@jgmchan
Copy link

jgmchan commented Jul 19, 2018

Hey folks, thanks for the great terraform provider! I've just given this new feature a test and I can't seem to get it to work properly.

As far as I understand, Web App for Containers only works on Linux but the App Service I end up with seems to be running Windows (I'm not entirely sure about this but I do get a Console option in the GUI, instead of an SSH option which is what I see when I provision it through the Azure console). I am also unable to download the logs to work out what is happening on the App Service that was provisioned.

I've created 2 App Services, 1 using the Terraform provider and another just through the Azure console and when I run az webapp list, the only meaningful difference I can see is that the kind value for the Azure console provisioned instance is set to app,linux,container, while the terraform provisioned instance is set to only app.

Here are both of them for reference:
Terraform provisioned instance

{
  "appServicePlanId":
    "/subscriptions/XXXXXXX/resourceGroups/test-rg/providers/Microsoft.Web/serverfarms/terraform-test-jeff",
  "availabilityState": "Normal",
  "clientAffinityEnabled": true,
  "clientCertEnabled": false,
  "cloningInfo": null,
  "containerSize": 0,
  "dailyMemoryTimeQuota": 0,
  "defaultHostName": "terraform-test-jeff.azurewebsites.net",
  "enabled": true,
  "enabledHostNames": [
    "terraform-test-jeff.azurewebsites.net",
    "terraform-test-jeff.scm.azurewebsites.net"
  ],
  "hostNameSslStates": [
    {
      "hostType": "Standard",
      "ipBasedSslResult": null,
      "ipBasedSslState": "NotConfigured",
      "name": "terraform-test-jeff.azurewebsites.net",
      "sslState": "Disabled",
      "thumbprint": null,
      "toUpdate": null,
      "toUpdateIpBasedSsl": null,
      "virtualIp": null
    },
    {
      "hostType": "Repository",
      "ipBasedSslResult": null,
      "ipBasedSslState": "NotConfigured",
      "name": "terraform-test-jeff.scm.azurewebsites.net",
      "sslState": "Disabled",
      "thumbprint": null,
      "toUpdate": null,
      "toUpdateIpBasedSsl": null,
      "virtualIp": null
    }
  ],
  "hostNames": ["terraform-test-jeff.azurewebsites.net"],
  "hostNamesDisabled": false,
  "hostingEnvironmentProfile": null,
  "httpsOnly": true,
  "id":
    "/subscriptions/XXXXXXX/resourceGroups/test-rg/providers/Microsoft.Web/sites/terraform-test-jeff",
  "identity": null,
  "isDefaultContainer": null,
  "kind": "app",
  "lastModifiedTimeUtc": "2018-07-19T06:24:24.673333",
  "location": "Australia Southeast",
  "maxNumberOfWorkers": null,
  "name": "terraform-test-jeff",
  "outboundIpAddresses":
    "52.255.35.249,52.255.39.26,52.255.38.183,52.255.37.221,52.255.32.203",
  "possibleOutboundIpAddresses":
    "52.255.35.249,52.255.39.26,52.255.38.183,52.255.37.221,52.255.32.203,52.255.39.71,52.255.33.39,52.255.42.223",
  "repositorySiteName": "terraform-test-jeff",
  "reserved": false,
  "resourceGroup": "test-rg",
  "scmSiteAlsoStopped": false,
  "siteConfig": null,
  "slotSwapStatus": null,
  "snapshotInfo": null,
  "state": "Running",
  "suspendedTill": null,
  "tags": {},
  "targetSwapSlot": null,
  "trafficManagerHostNames": null,
  "type": "Microsoft.Web/sites",
  "usageState": "Normal"
}

Azure Console provisioned instance

{
  "appServicePlanId":
    "/subscriptions/XXXXXXX/resourceGroups/test-rg/providers/Microsoft.Web/serverfarms/test-jeff",
  "availabilityState": "Normal",
  "clientAffinityEnabled": true,
  "clientCertEnabled": false,
  "cloningInfo": null,
  "containerSize": 0,
  "dailyMemoryTimeQuota": 0,
  "defaultHostName": "test-jeff.azurewebsites.net",
  "enabled": true,
  "enabledHostNames": [
    "test-jeff.azurewebsites.net",
    "test-jeff.scm.azurewebsites.net"
  ],
  "hostNameSslStates": [
    {
      "hostType": "Standard",
      "ipBasedSslResult": null,
      "ipBasedSslState": "NotConfigured",
      "name": "test-jeff.azurewebsites.net",
      "sslState": "Disabled",
      "thumbprint": null,
      "toUpdate": null,
      "toUpdateIpBasedSsl": null,
      "virtualIp": null
    },
    {
      "hostType": "Repository",
      "ipBasedSslResult": null,
      "ipBasedSslState": "NotConfigured",
      "name": "test-jeff.scm.azurewebsites.net",
      "sslState": "Disabled",
      "thumbprint": null,
      "toUpdate": null,
      "toUpdateIpBasedSsl": null,
      "virtualIp": null
    }
  ],
  "hostNames": ["test-jeff.azurewebsites.net"],
  "hostNamesDisabled": false,
  "hostingEnvironmentProfile": null,
  "httpsOnly": false,
  "id":
    "/subscriptions/XXXXXXX/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-jeff",
  "identity": null,
  "isDefaultContainer": null,
  "kind": "app,linux,container",
  "lastModifiedTimeUtc": "2018-07-19T05:56:15.736666",
  "location": "West Europe",
  "maxNumberOfWorkers": null,
  "name": "test-jeff",
  "outboundIpAddresses":
    "52.178.92.96,51.144.224.93,52.232.70.142,52.232.4.132,52.232.64.246,52.169.1.210",
  "possibleOutboundIpAddresses":
    "52.178.92.96,51.144.224.93,52.232.70.142,52.232.4.132,52.232.64.246,52.169.1.210,51.145.159.13,52.136.236.15",
  "repositorySiteName": "test-jeff",
  "reserved": true,
  "resourceGroup": "test-rg",
  "scmSiteAlsoStopped": false,
  "siteConfig": null,
  "slotSwapStatus": null,
  "snapshotInfo": null,
  "state": "Running",
  "suspendedTill": null,
  "tags": {
    "hidden-related:/subscriptions/XXXXXXX/resourcegroups/test-rg/providers/Microsoft.Web/serverfarms/test-jeff":
      "empty"
  },
  "targetSwapSlot": null,
  "trafficManagerHostNames": null,
  "type": "Microsoft.Web/sites",
  "usageState": "Normal"
}

Is this something missing from the provider, or have I missed a configuration for azurerm_app_service somewhere? I can't seem to find anywhere in the docs where I can set the kind value.

@tombuildsstuff
Copy link
Contributor

hi @jgmchan

Linux App Services need to be running within a Reserved App Service Plan as shown here - can you take a look and see if that solves this issue for you?

Thanks!

@jgmchan
Copy link

jgmchan commented Jul 19, 2018

Thanks for the quick response :)

I'll give it a quick test but I'm not sure this is reason because the service plan for the Azure console provisioned instance is not a reserved instance either:

Result from az appservice plan list

{
  "adminSiteName": null,
  "hostingEnvironmentProfile": null,
  "id":
    "/subscriptions/XXXXXXX/resourceGroups/test-rg/providers/Microsoft.Web/serverfarms/test-jeff",
  "isSpot": null,
  "kind": "linux",
  "location": "Australia Southeast",
  "maximumNumberOfWorkers": 10,
  "name": "test-jeff",
  "numberOfSites": 0,
  "perSiteScaling": null,
  "provisioningState": null,
  "reserved": null,
  "resourceGroup": "test-rg",
  "sku": {
    "capabilities": null,
    "capacity": 1,
    "family": "S",
    "locations": null,
    "name": "S1",
    "size": "S1",
    "skuCapacity": null,
    "tier": "Standard"
  },
  "spotExpirationTime": null,
  "status": "Ready",
  "tags": null,
  "targetWorkerCount": null,
  "targetWorkerSizeId": null,
  "type": "Microsoft.Web/serverfarms",
  "workerTierName": null
}

@jgmchan
Copy link

jgmchan commented Jul 19, 2018

I just tested with the reserved instance set to true and it works! Thanks very much for that.

It is a little confusing that it doesn't show up when running azure-cli though and I think it may be nice to validate that the service plan is linux and reserved before allowing the linux_fx_version to be set.

Thanks very much for your help!

@ghost
Copy link

ghost commented Mar 30, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Web App for Containers support
3 participants