From 10633c6c860686f0c5d098a0036281c71bf757af Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Fri, 8 Dec 2017 14:00:49 +0000 Subject: [PATCH] Updating the App Service example to be complete This removes support for Publishing, since the SCM URL's aren't consistent across Sovereign Clouds (China/Germany/Govt etc) Switches to using the new `default_site_hostname` field introduced in #612 rather than assuming what it is --- examples/app-service-asp-net/README.md | 23 ------- examples/app-service-asp-net/app.tf | 66 ------------------- examples/app-service-asp-net/variables.tf | 29 -------- examples/app-service-asp-net/web-package.zip | Bin 378 -> 0 bytes examples/app-service/README.md | 15 +++++ examples/app-service/app.tf | 50 ++++++++++++++ examples/app-service/variables.tf | 21 ++++++ 7 files changed, 86 insertions(+), 118 deletions(-) delete mode 100644 examples/app-service-asp-net/README.md delete mode 100644 examples/app-service-asp-net/app.tf delete mode 100644 examples/app-service-asp-net/variables.tf delete mode 100644 examples/app-service-asp-net/web-package.zip create mode 100644 examples/app-service/README.md create mode 100644 examples/app-service/app.tf create mode 100644 examples/app-service/variables.tf diff --git a/examples/app-service-asp-net/README.md b/examples/app-service-asp-net/README.md deleted file mode 100644 index d0190b8b7a23..000000000000 --- a/examples/app-service-asp-net/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# ASP.NET App-Service Sample - -Sample to deploy an ASP.NET application into Azure App-Services. - -## Creates - -1. A Resource Group -2. An App Service Plan -3. An App Service for usage with .NET -4. Deploy a simple app into (3). - -## Usage - -- Provide values to all variables (credentials and names). -- Create with `terraform apply` -- Destroy all with `terraform destroy --force` - - -## Prerequisites - -- Uses `curl` for application publication. Preinstall curl in your system and add it to the system path. - -**Note:** The Sample uses a local provisioner prepared for a DOS shell (trivial changes needed for a bash shell). \ No newline at end of file diff --git a/examples/app-service-asp-net/app.tf b/examples/app-service-asp-net/app.tf deleted file mode 100644 index 1ba51ae510fd..000000000000 --- a/examples/app-service-asp-net/app.tf +++ /dev/null @@ -1,66 +0,0 @@ -# Configure the Microsoft Azure Provider -provider "azurerm" { - # if you're using a Service Principal (shared account) then either set the environment variables, or fill these in: - # subscription_id = "..." - # client_id = "..." - # client_secret = "..." - # tenant_id = "..." -} - -resource "azurerm_resource_group" "g1" { - name = "${var.resource_group_name}" - location = "${var.location}" -} - -resource "azurerm_app_service_plan" "plan0" { - name = "service-plan0" - location = "${var.location}" - resource_group_name = "${azurerm_resource_group.g1.name}" - - sku { - tier = "Basic" # Basic | Standard | ... - size = "B1" # B1 | S1 | ... - } -} - -# underscores not supported as app_service name -> if not: you will receive error 400 - -resource "azurerm_app_service" "common_service" { - name = "${var.app_service_name}" - location = "${var.location}" - resource_group_name = "${azurerm_resource_group.g1.name}" - app_service_plan_id = "${azurerm_app_service_plan.plan0.id}" - - site_config { - dotnet_framework_version = "v4.0" - remote_debugging_enabled = true - remote_debugging_version = "VS2015" - } - - # app_settings { - # "SOME_KEY" = "some-value" - # } - # connection_string { - # name = "Database" - # type = "SQLServer" - # value = "Server=some-server.mydomain.com;Integrated Security=SSPI" - # } - - provisioner "local-exec" { - command = "curl -k -u ${var.deploy_user}:${var.deploy_pass} -X PUT --data-binary @${var.deployZipFile} https://${azurerm_app_service.common_service.name}.scm.azurewebsites.net/api/zip/site/wwwroot/" - - # interpreter = ["cmd"] - } -} - -output "service" { - value = "${azurerm_app_service.common_service.name}" -} - -output "service_url" { - value = "https://${azurerm_app_service.common_service.name}.azurewebsites.net" -} - -output "admin_url" { - value = "https://${azurerm_app_service.common_service.name}.scm.azurewebsites.net" -} diff --git a/examples/app-service-asp-net/variables.tf b/examples/app-service-asp-net/variables.tf deleted file mode 100644 index 78abf98e6a59..000000000000 --- a/examples/app-service-asp-net/variables.tf +++ /dev/null @@ -1,29 +0,0 @@ -variable "resource_group_name" { - type = "string" - default = "yourGroupName" -} - -variable "location" { - type = "string" - default = "westeurope" -} - -variable "app_service_name" { - type = "string" - - # will create -> mySite123456.azurewebsites.net #should be unique - # default = "mySite123456" -} - -variable "deploy_user" { - type = "string" -} - -variable "deploy_pass" { - type = "string" -} - -variable "deployZipFile" { - type = "string" - default = "web-package.zip" -} diff --git a/examples/app-service-asp-net/web-package.zip b/examples/app-service-asp-net/web-package.zip deleted file mode 100644 index 2291a451f720284b27924254f1867e79bd2e5e68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 378 zcmWIWW@Zs#U|`^2_%XrL`|CZ29CIMg4T!mbI5RILwL&kWBsXXCNsW_dH$Hy)Xp845 z|CKC;A|g3PJa27+iiGYQ-f2^X8b