-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #407 from metadevpro/app-service-asp-net-sample
Provision sample for ASP.NET on azure_rm_app_service
- Loading branch information
Showing
3 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Azure App Service Sample | ||
|
||
Sample to deploy an App Service within an App Service Plan. | ||
|
||
## Creates | ||
|
||
1. A Resource Group | ||
2. An [App Service Plan](https://docs.microsoft.com/en-us/azure/app-service/azure-web-sites-web-hosting-plans-in-depth-overview) | ||
3. An [App Service](https://azure.microsoft.com/en-gb/services/app-service/) configured for usage with .NET 4.x Application | ||
|
||
## Usage | ||
|
||
- Provide values to all variables (credentials and names). | ||
- Create with `terraform apply` | ||
- Destroy all with `terraform destroy --force` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 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" "default" { | ||
name = "${var.resource_group_name}" | ||
location = "${var.location}" | ||
} | ||
|
||
resource "azurerm_app_service_plan" "default" { | ||
name = "${var.app_service_name}-plan" | ||
location = "${azurerm_resource_group.default.location}" | ||
resource_group_name = "${azurerm_resource_group.default.name}" | ||
|
||
sku { | ||
tier = "${var.app_service_plan_sku_tier}" | ||
size = "${var.app_service_plan_sku_size}" | ||
} | ||
} | ||
|
||
resource "azurerm_app_service" "default" { | ||
name = "${var.app_service_name}" | ||
location = "${azurerm_resource_group.default.location}" | ||
resource_group_name = "${azurerm_resource_group.default.name}" | ||
app_service_plan_id = "${azurerm_app_service_plan.default.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" | ||
# } | ||
} | ||
|
||
output "app_service_name" { | ||
value = "${azurerm_app_service.default.name}" | ||
} | ||
|
||
output "app_service_default_hostname" { | ||
value = "https://${azurerm_app_service.default.default_site_hostname}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
variable "resource_group_name" { | ||
type = "string" | ||
} | ||
|
||
variable "location" { | ||
type = "string" | ||
} | ||
|
||
variable "app_service_name" { | ||
type = "string" | ||
} | ||
|
||
variable "app_service_plan_sku_tier" { | ||
type = "string" | ||
default = "Basic" # Basic | Standard | ... | ||
} | ||
|
||
variable "app_service_plan_sku_size" { | ||
type = "string" | ||
default = "B1" # B1 | S1 | ... | ||
} |