-
Notifications
You must be signed in to change notification settings - Fork 0
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
Create a terraform script to deploy application to Azure app service #1
base: main
Are you sure you want to change the base?
Conversation
Add a new Azure App Service resource and update README for deployment instructions. * **Azure App Service Resource** - Add `azurerm_app_service` resource for application deployment. - Set `app_service_plan_id`, `location`, `name`, `resource_group_name`, and `https_only` attributes. - Configure `site_config` block with `min_tls_version` set to "1.2". - Add `auth_settings` block with `enabled` set to true. - Add `connection_string` block with necessary connection string details. * **README Update** - Update Azure Setup section to include instructions for deploying the application to Azure App Service. - Add a new subsection for application deployment under the Azure Setup section. - Provide detailed steps for creating the Azure App Service and deploying the application.
resource "azurerm_app_service" "app-service3" { | ||
app_service_plan_id = azurerm_app_service_plan.example.id | ||
location = var.location | ||
name = "terragoat-app-service-${var.environment}-deployment" | ||
resource_group_name = azurerm_resource_group.example.name | ||
https_only = true | ||
|
||
site_config { | ||
min_tls_version = "1.2" | ||
} | ||
|
||
auth_settings { | ||
enabled = true | ||
} | ||
|
||
connection_string { | ||
name = "MyConnectionString" | ||
type = "SQLAzure" | ||
value = "Server=tcp:myserver.database.windows.net,1433;Database=mydatabase;User ID=myuser;Password=mypassword;Encrypt=true;Connection Timeout=30;" | ||
} | ||
} |
Check notice
Code scanning / Trivy
Web App accepts incoming client certificate Low
Type: terraform
Vulnerability AVD-AZU-0001
Severity: LOW
Message: App service does not have client certificates enabled.
Link: AVD-AZU-0001
resource "azurerm_app_service" "app-service3" { | ||
app_service_plan_id = azurerm_app_service_plan.example.id | ||
location = var.location | ||
name = "terragoat-app-service-${var.environment}-deployment" | ||
resource_group_name = azurerm_resource_group.example.name | ||
https_only = true | ||
|
||
site_config { | ||
min_tls_version = "1.2" | ||
} | ||
|
||
auth_settings { | ||
enabled = true | ||
} | ||
|
||
connection_string { | ||
name = "MyConnectionString" | ||
type = "SQLAzure" | ||
value = "Server=tcp:myserver.database.windows.net,1433;Database=mydatabase;User ID=myuser;Password=mypassword;Encrypt=true;Connection Timeout=30;" | ||
} | ||
} |
Check notice
Code scanning / Trivy
Web App has registration with AD enabled Low
Type: terraform
Vulnerability AVD-AZU-0002
Severity: LOW
Message: App service does not have an identity type.
Link: AVD-AZU-0002
site_config { | ||
min_tls_version = "1.2" | ||
} |
Check notice
Code scanning / Trivy
Web App uses the latest HTTP version Low
Type: terraform
Vulnerability AVD-AZU-0005
Severity: LOW
Message: App service does not have HTTP/2 enabled.
Link: AVD-AZU-0005
Add a new Azure App Service resource and update README for deployment instructions.
Azure App Service Resource
azurerm_app_service
resource for application deployment.app_service_plan_id
,location
,name
,resource_group_name
, andhttps_only
attributes.site_config
block withmin_tls_version
set to "1.2".auth_settings
block withenabled
set to true.connection_string
block with necessary connection string details.README Update