This file contains hidden or 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
| data "azurerm_key_vault" "keyvault" { | |
| name = "keyvault" | |
| resource_group_name = var.resource_group_name | |
| } | |
| data "azurerm_key_vault_certificate" "cert" { | |
| name = "kv-cert" | |
| key_vault_id = data.azurerm_key_vault.keyvault.id | |
| } |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| namespace ConsoleApp3 | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| try |
This file contains hidden or 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
| terraform { | |
| backend "azurerm" {} | |
| } | |
| provider "azurerm" { | |
| features {} | |
| } | |
| module "network" { | |
| source = "./modules/network" |
This file contains hidden or 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
| # App Service Plan + Slots | |
| resource "azurerm_service_plan" "asp" { | |
| name = "tf-asp-demo" | |
| location = var.resource_location | |
| resource_group_name = var.resource_group_name | |
| os_type = "Windows" | |
| sku_name = "P1v2" | |
| tags = { | |
| environment = var.environment_tag |
This file contains hidden or 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
| # Resource Group | |
| resource "azurerm_resource_group" "rg" { | |
| name = var.resource_group_name | |
| location = var.resource_location | |
| } | |
| #Virtual Network | |
| resource "azurerm_virtual_network" "demo_vnet" { | |
| name = "${var.vnet_name}-vnet" | |
| location = var.resource_location |
This file contains hidden or 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
| # SQL Database | |
| resource "azurerm_mssql_server" "db" { | |
| name = "tf-dbsrv" | |
| resource_group_name = var.resource_group_name | |
| location = var.resource_location | |
| version = "12.0" | |
| administrator_login = "missadministrator" | |
| administrator_login_password = "Sq123@p-p455w0rd-enV1r0nm3nT" | |
| public_network_access_enabled = true | |
This file contains hidden or 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
| resource "azurerm_app_service" "app" { | |
| name = "myhealth-apiapp" | |
| location = "Australia East" | |
| resource_group_name = "myhealth-rg" | |
| app_service_plan_id = var.asp_id | |
| app_settings = { | |
| "APPINSIGHTS_INSTRUMENTATIONKEY" = var.ai_ins_key | |
| "APPLICATIONINSIGHTS_CONNECTION_STRING" = var.ai_con_string | |
| } |
This file contains hidden or 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
| data "azurerm_client_config" "current" { | |
| } | |
| resource "azurerm_key_vault_access_policy" "kv_read_access_policy" { | |
| key_vault_id = var.keyvault_id | |
| tenant_id = data.azurerm_client_config.current.tenant_id | |
| object_id = data.azuread_service_principal.app_sp.id | |
| secret_permissions = [ |
This file contains hidden or 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
| # Generating a auto-renewing self signed certificate | |
| resource "azurerm_key_vault_certificate" "self_signed_certificate" { | |
| name = "self-signed-certificate" | |
| key_vault_id = azurerm_key_vault.key_vault.id | |
| certificate_policy { | |
| issuer_parameters { | |
| name = "Self" | |
| } |