-
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.
update api version and fix small test tf error
- Loading branch information
Showing
106 changed files
with
1,804 additions
and
830 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
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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -392,7 +392,7 @@ resource "azurerm_api_management_user" "test" { | |
email = "azure-acctest%[email protected]" | ||
state = "active" | ||
confirmation = "signup" | ||
notes = "Used for testing in dimension C-137." | ||
note = "Used for testing in dimension C-137." | ||
} | ||
`, template, rInt, rInt) | ||
} | ||
|
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
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 |
---|---|---|
@@ -1,15 +1,3 @@ | ||
# Azure App Service Sample | ||
## Examples of using the App Service Resources | ||
|
||
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 folder contains examples of using the App Service resources. |
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
# Example: a Linux App Service running a Docker container | ||
|
||
This example provisions a Linux App Service which runs a single Docker container. | ||
|
||
### Notes | ||
|
||
* The Container is launched on the first HTTP Request, which can take a while. | ||
* Continuous Deployment of a single Docker Container can be achieved using the App Setting `DOCKER_ENABLE_CI` to `true`. | ||
* If you're not using App Service Slots and Deployments are handled outside of Terraform - [it's possible to ignore changes to specific fields in the configuration using `ignore_changes` within Terraform's `lifecycle` block](https://www.terraform.io/docs/configuration/resources.html#lifecycle), for example: | ||
|
||
```hcl | ||
resource "azurerm_app_service" "test" { | ||
# ... | ||
site_config = { | ||
# ... | ||
linux_fx_version = "DOCKER|appsvcsample/python-helloworld:0.1.2" | ||
} | ||
lifecycle { | ||
ignore_changes = [ | ||
"site_config.0.linux_fx_version", # deployments are made outside of Terraform | ||
] | ||
} | ||
} | ||
``` |
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,42 @@ | ||
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" "main" { | ||
name = "${var.prefix}-resources" | ||
location = "${var.location}" | ||
} | ||
|
||
resource "azurerm_app_service_plan" "main" { | ||
name = "${var.prefix}-asp" | ||
location = "${azurerm_resource_group.main.location}" | ||
resource_group_name = "${azurerm_resource_group.main.name}" | ||
kind = "Linux" | ||
reserved = true | ||
|
||
sku { | ||
tier = "Standard" | ||
size = "S1" | ||
} | ||
} | ||
|
||
resource "azurerm_app_service" "main" { | ||
name = "${var.prefix}-appservice" | ||
location = "${azurerm_resource_group.main.location}" | ||
resource_group_name = "${azurerm_resource_group.main.name}" | ||
app_service_plan_id = "${azurerm_app_service_plan.main.id}" | ||
|
||
site_config { | ||
app_command_line = "" | ||
linux_fx_version = "DOCKER|appsvcsample/python-helloworld:latest" | ||
} | ||
|
||
app_settings { | ||
"WEBSITES_ENABLE_APP_SERVICE_STORAGE" = "false", | ||
"DOCKER_REGISTRY_SERVER_URL" = "https://index.docker.io" | ||
} | ||
} |
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,7 @@ | ||
output "app_service_name" { | ||
value = "${azurerm_app_service.main.name}" | ||
} | ||
|
||
output "app_service_default_hostname" { | ||
value = "https://${azurerm_app_service.main.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,7 @@ | ||
variable "prefix" { | ||
description = "The prefix used for all resources in this example" | ||
} | ||
|
||
variable "location" { | ||
description = "The Azure location where all resources in this example should be created" | ||
} |
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,24 @@ | ||
# Example: a Linux App Service running multiple containers from a Docker Compose file. | ||
|
||
This example provisions a Linux App Service which runs multiple Docker Containers from Docker Compose file. | ||
|
||
### Notes | ||
|
||
* The Container is launched on the first HTTP Request, which can take a while. | ||
* If you're not using App Service Slots and Deployments are handled outside of Terraform - [it's possible to ignore changes to specific fields in the configuration using `ignore_changes` within Terraform's `lifecycle` block](https://www.terraform.io/docs/configuration/resources.html#lifecycle), for example: | ||
|
||
```hcl | ||
resource "azurerm_app_service" "test" { | ||
# ... | ||
site_config = { | ||
# ... | ||
linux_fx_version = "COMPOSE|${base64encode(file("compose.yml"))}" | ||
} | ||
lifecycle { | ||
ignore_changes = [ | ||
"site_config.0.linux_fx_version", # deployments are made outside of Terraform | ||
] | ||
} | ||
} | ||
``` |
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,27 @@ | ||
version: '3.3' | ||
|
||
services: | ||
db: | ||
image: mysql:5.7 | ||
volumes: | ||
- db_data:/var/lib/mysql | ||
restart: always | ||
environment: | ||
MYSQL_ROOT_PASSWORD: somewordpress | ||
MYSQL_DATABASE: wordpress | ||
MYSQL_USER: wordpress | ||
MYSQL_PASSWORD: wordpress | ||
|
||
wordpress: | ||
depends_on: | ||
- db | ||
image: wordpress:latest | ||
ports: | ||
- "8000:80" | ||
restart: always | ||
environment: | ||
WORDPRESS_DB_HOST: db:3306 | ||
WORDPRESS_DB_USER: wordpress | ||
WORDPRESS_DB_PASSWORD: wordpress | ||
volumes: | ||
db_data: |
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,41 @@ | ||
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" "main" { | ||
name = "${var.prefix}-resources" | ||
location = "${var.location}" | ||
} | ||
|
||
resource "azurerm_app_service_plan" "main" { | ||
name = "${var.prefix}-asp" | ||
location = "${azurerm_resource_group.main.location}" | ||
resource_group_name = "${azurerm_resource_group.main.name}" | ||
kind = "Linux" | ||
reserved = true | ||
|
||
sku { | ||
tier = "Standard" | ||
size = "S1" | ||
} | ||
} | ||
|
||
resource "azurerm_app_service" "main" { | ||
name = "${var.prefix}-appservice" | ||
location = "${azurerm_resource_group.main.location}" | ||
resource_group_name = "${azurerm_resource_group.main.name}" | ||
app_service_plan_id = "${azurerm_app_service_plan.main.id}" | ||
|
||
site_config { | ||
app_command_line = "" | ||
linux_fx_version = "COMPOSE|${base64encode(file("docker-compose.yml"))}" | ||
} | ||
|
||
app_settings { | ||
"WEBSITES_ENABLE_APP_SERVICE_STORAGE" = "false" | ||
} | ||
} |
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,7 @@ | ||
output "app_service_name" { | ||
value = "${azurerm_app_service.main.name}" | ||
} | ||
|
||
output "app_service_default_hostname" { | ||
value = "https://${azurerm_app_service.main.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,7 @@ | ||
variable "prefix" { | ||
description = "The prefix used for all resources in this example" | ||
} | ||
|
||
variable "location" { | ||
description = "The Azure location where all resources in this example should be created" | ||
} |
Oops, something went wrong.