Skip to content

Commit 3336b4f

Browse files
committed
Format file
1 parent 67191d4 commit 3336b4f

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

.azuredevops/deploy-azure-function.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ variables:
1919
functionAppPath: "v1"
2020

2121
${{ if eq(parameters.azureFunctionProgrammingModel, 'v2') }}:
22-
functionAppName: "af-dev9d"
22+
functionAppName: "af-v2-dev9d"
2323
functionAppPath: "v2"
2424

2525
jobs:

ops/stack.tf

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ resource "azurerm_resource_group" "af-rg" {
88
name = "af-rg-${var.env}"
99
location = var.region
1010
}
11+
1112
resource "azurerm_storage_account" "main-sa" {
1213
name = "mainsa${var.env}${random_id.unique-id.hex}"
1314
resource_group_name = azurerm_resource_group.af-rg.name
@@ -73,10 +74,10 @@ resource "azurerm_application_insights" "af-appi" {
7374
}
7475

7576
############################################
76-
# AF V2
77+
# AF V1
7778
############################################
78-
resource "azurerm_storage_account" "af-sa" {
79-
name = "afsa${var.env}${random_id.unique-id.hex}"
79+
resource "azurerm_storage_account" "af-sa-v1" {
80+
name = "afsav1${var.env}${random_id.unique-id.hex}"
8081
resource_group_name = azurerm_resource_group.af-rg.name
8182
location = azurerm_resource_group.af-rg.location
8283
account_tier = "Standard"
@@ -99,13 +100,13 @@ resource "azurerm_storage_account" "af-sa" {
99100
}
100101
}
101102

102-
resource "azurerm_linux_function_app" "af" {
103-
name = "af-${var.env}${random_id.unique-id.hex}"
103+
resource "azurerm_linux_function_app" "af-v1" {
104+
name = "af-v1-${var.env}${random_id.unique-id.hex}"
104105
resource_group_name = azurerm_resource_group.af-rg.name
105106
location = azurerm_resource_group.af-rg.location
106107

107-
storage_account_name = azurerm_storage_account.af-sa.name
108-
storage_account_access_key = azurerm_storage_account.af-sa.primary_access_key
108+
storage_account_name = azurerm_storage_account.af-sa-v1.name
109+
storage_account_access_key = azurerm_storage_account.af-sa-v1.primary_access_key
109110
service_plan_id = azurerm_service_plan.af-splan.id
110111
functions_extension_version = var.function_version
111112
public_network_access_enabled = false
@@ -124,17 +125,17 @@ resource "azurerm_linux_function_app" "af" {
124125
}
125126

126127

127-
resource "azurerm_role_assignment" "function_storage_access" {
128-
scope = azurerm_storage_account.af-sa.id
128+
resource "azurerm_role_assignment" "function_storage_access-v1" {
129+
scope = azurerm_storage_account.af-sa-v1.id
129130
role_definition_name = "Storage Blob Data Contributor"
130-
principal_id = azurerm_linux_function_app.af.identity[0].principal_id
131+
principal_id = azurerm_linux_function_app.af-v1.identity[0].principal_id
131132
}
132133

133134
############################################
134-
# AF V1
135+
# AF V2
135136
############################################
136-
resource "azurerm_storage_account" "af-sa-v1" {
137-
name = "afsav1${var.env}${random_id.unique-id.hex}"
137+
resource "azurerm_storage_account" "af-sa-v2" {
138+
name = "afsav2${var.env}${random_id.unique-id.hex}"
138139
resource_group_name = azurerm_resource_group.af-rg.name
139140
location = azurerm_resource_group.af-rg.location
140141
account_tier = "Standard"
@@ -157,13 +158,13 @@ resource "azurerm_storage_account" "af-sa-v1" {
157158
}
158159
}
159160

160-
resource "azurerm_linux_function_app" "af-v1" {
161-
name = "af-v1-${var.env}${random_id.unique-id.hex}"
161+
resource "azurerm_linux_function_app" "af-v2" {
162+
name = "af-v2-${var.env}${random_id.unique-id.hex}"
162163
resource_group_name = azurerm_resource_group.af-rg.name
163164
location = azurerm_resource_group.af-rg.location
164165

165-
storage_account_name = azurerm_storage_account.af-sa-v1.name
166-
storage_account_access_key = azurerm_storage_account.af-sa-v1.primary_access_key
166+
storage_account_name = azurerm_storage_account.af-sa-v2.name
167+
storage_account_access_key = azurerm_storage_account.af-sa-v2.primary_access_key
167168
service_plan_id = azurerm_service_plan.af-splan.id
168169
functions_extension_version = var.function_version
169170
public_network_access_enabled = false
@@ -181,9 +182,8 @@ resource "azurerm_linux_function_app" "af-v1" {
181182
}
182183
}
183184

184-
185-
resource "azurerm_role_assignment" "function_storage_access-v1" {
186-
scope = azurerm_storage_account.af-sa-v1.id
185+
resource "azurerm_role_assignment" "function_storage_access" {
186+
scope = azurerm_storage_account.af-sa-v2.id
187187
role_definition_name = "Storage Blob Data Contributor"
188-
principal_id = azurerm_linux_function_app.af.identity[0].principal_id
188+
principal_id = azurerm_linux_function_app.af-v2.identity[0].principal_id
189189
}

0 commit comments

Comments
 (0)