-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Feature Request: Web App for Containers support #580
Comments
Hey @mojodna Thanks for opening this issue :) Taking a quick look into this issue - this appears to be a regular App Service with the We don't support this field right now due to a bug in the Azure App Service API - that said once the bug in the API is fixed we can take a look into supporting this functionality. Until then, you should be able to achieve the same thing with the Thanks! |
thanks @tombuildsstuff! |
I picked this back up today and haven't been having any luck getting it to work (and can't find any relevant docs). Here's my template: resource "azurerm_template_deployment" "test" {
name = "template-01"
resource_group_name = "${azurerm_resource_group.rg.name}"
template_body = <<DEPLOY
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"app_service_plan_id": {
"type": "string",
"metadata": {
"description": "App Service Plan ID"
}
},
"name": {
"type": "string",
"metadata": {
"description": "App Name"
}
},
"image": {
"type": "string",
"metadata": {
"description": "Docker image"
}
}
},
"variables": {
},
"resources": [
{
"type": "Microsoft.Web/sites",
"kind": "app,linux,container",
"name": "[parameters('name')]",
"properties": {
"siteConfig": {
"appSettings": [
{
"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE",
"value": "false"
}
],
"linuxFxVersion": "[concat('DOCKER|', parameters('image'))]"
},
"name": "[parameters('name')]",
"serverFarmId": "[parameters('app_service_plan_id')]"
},
"apiVersion": "2016-08-01",
"location": "[resourceGroup().location]"
}
]
}
DEPLOY
parameters {
name = "golang"
image = "golang"
app_service_plan_id = "${azurerm_app_service_plan.plan.id}"
}
deployment_mode = "Incremental"
} Things generally look like they're created properly, but Azure isn't picking it up as a Docker app for some reason. Help? |
+1 I'd also like to be able to use terraform to deploy to Web Apps for Containers. |
This is the template I used that worked. The difference is {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"app_service_plan_id": {
"type": "string",
"metadata": {
"description": "App Service Plan ID"
}
},
"name": {
"type": "string",
"metadata": {
"description": "App Name"
}
},
"image": {
"type": "string",
"metadata": {
"description": "Docker image"
}
}
},
"resources": [
{
"apiVersion": "2016-08-01",
"kind": "app,linux,container",
"name": "[parameters('name')]",
"type": "Microsoft.Web/sites",
"properties": {
"name": "[parameters('name')]",
"siteConfig": {
"alwaysOn": true,
"appSettings": [
{
"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE",
"value": "false"
}
],
"linuxFxVersion": "[concat('DOCKER|', parameters('image'))]"
},
"serverFarmId": "[parameters('app_service_plan_id')]"
},
"location": "[resourceGroup().location]"
}
]
} |
+1 |
I have a one question, how do you add code to point image a private registry? For example, I need to deploy a web app for container and to point this web app to Azure Container Registry. Thanks. |
Hey @maurivg28
That will configure a private registry for the image. Cheers, |
+1 |
Thanks for this, I'm trying to set this up as well. How do I go from the template as shown above, to an actual deployed Docker container that I can load balance to? Does the template provide everything I need, or do I need to reference it from another resource that actually instantiates it? |
I'm struggling to make this work. It creates the web app and I can visit mysubdomain.azurewebsites.net, but I just get a landing page with a link to the portal. One thing missing from these templates is the ability to specify a port for the Docker image. How is this handled? I tried:
And my Docker image, when pulled locally, successfully responds on that port. But since I'm getting a default landing page, I'm beginning to suspect that maybe I'm not setting up the port mapping correctly. Thanks for any help. I wish I wasn't stuck with Azure's complexity, but I hope I can use Terraform to successfully wrangle it. |
This looks great, thanks! When is the next release? I could never get the templates in this issue working despite the fact that I successfully created a container instance via the command line. Unfortunately, command line export of the resulting ARM templates fails, I'm a screen reader user, and the Azure portal and instructions are inaccessible enough that I can't independently follow them. So I pretty much need a text-based configuration format to automate setting this up, and am a bit blocked by not having this in a release. I can certainly wait a few days, I'm just trying to get a rough idea when I might expect to see it out. Thanks again. |
@ndarilek we don’t generally commit to dates for releases, but I have a feeling we’ll be doing a release later this week :) |
what is the status on this one ? |
Support for this shipped in v1.10 of the AzureRM Provider a few weeks back; you can update to this by updating your Provider block and re-running
|
Terraform version:
I'd like to automate deployment of Docker containers as Web Apps to a Linux App Service Plan, i.e. using the equivalent of
az webapp create ... --deployment-container-image-name <image URL>
.The text was updated successfully, but these errors were encountered: