Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.

Commit 875d89a

Browse files
polatenginbrandonh-msft
authored andcommitted
resource names and readme file modified
1 parent 9949eab commit 875d89a

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ from the `terraform/` directory you're in after running `terraform apply`.
107107

108108
#### The Azure Function
109109

110-
In your portal, go to the newly-created Azure Function. Its name will be the `<prefix>` value you put in during the Terraform deployment.
110+
In your portal, go to the newly-created Azure Function. Its name will be the `<prefix>-serverless-functionapp` value you put in during the Terraform deployment.
111111

112112
There are a few things to notice:
113113

@@ -178,7 +178,7 @@ which ensures that even if somebody were to submit Function code that attempted
178178

179179
#### The Logic App
180180

181-
In your portal, go to the newly-created Logic App. Its name will be `<prefix>-LA` where `<prefix>` is the value you put in during the Terraform deployment.
181+
In your portal, go to the newly-created Logic App. Its name will be `<prefix>-serverless-la` where `<prefix>` is the value you put in during the Terraform deployment.
182182

183183
##### Execution Logic
184184

@@ -208,7 +208,7 @@ The important part of the Logic App's configuration is that our Terraform deploy
208208

209209
#### Key Vault
210210

211-
In your portal, go to the newly-created Key Vault. Its name will be the `<prefix>` value you put in during the Terraform deployment.
211+
In your portal, go to the newly-created Key Vault. Its name will be the `<prefix>-serverless-kv` value you put in during the Terraform deployment.
212212

213213
The important bits of the Key Vault for this sample are the `Events` and `Access Policies` area
214214

@@ -228,11 +228,11 @@ In order for the Function App to be able to read the values of Key Vault secrets
228228

229229
## Bringing it all together
230230

231-
If you open the Live Stream for the first Application Insights instance (without the `-2` suffix) you'll see the Function happily logging messages every 5 seconds or so:
231+
If you open the Live Stream for the first Application Insights instance (with the `-first` suffix) you'll see the Function happily logging messages every 5 seconds or so:
232232

233233
![](doc/appinsightslivestream1.png)
234234

235-
Moving over to the secondary Application Insights, you'll probably see a screen like this:
235+
Moving over to the secondary Application Insights (with the `-second` suffix), you'll probably see a screen like this:
236236

237237
![](doc/appinsights2dead.png)
238238

terraform/main.tf

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ variable "sp_client_secret" {
3737
}
3838

3939
resource "azurerm_resource_group" "rg" {
40-
name = "serverless-sample-${var.prefix}"
40+
name = "${var.prefix}-serverless-sample"
4141
location = var.location
4242
tags = {
4343
sample = "serverless-keyvault-secret-rotation-handling"
@@ -49,7 +49,7 @@ resource "azurerm_resource_group" "rg" {
4949
##################################################################################
5050

5151
resource "azurerm_application_insights" "logging" {
52-
name = var.prefix
52+
name = "${var.prefix}-serverless-ai-first"
5353
resource_group_name = azurerm_resource_group.rg.name
5454
location = azurerm_resource_group.rg.location
5555
application_type = "web"
@@ -59,7 +59,7 @@ resource "azurerm_application_insights" "logging" {
5959
}
6060

6161
resource "azurerm_application_insights" "logging2" {
62-
name = "${var.prefix}-2"
62+
name = "${var.prefix}-serverless-ai-second"
6363
resource_group_name = azurerm_resource_group.rg.name
6464
location = azurerm_resource_group.rg.location
6565
application_type = "web"
@@ -85,7 +85,7 @@ resource "azurerm_storage_account" "fxnstor" {
8585
}
8686

8787
resource "azurerm_app_service_plan" "fxnapp" {
88-
name = var.prefix
88+
name = "${var.prefix}-serverless-serviceplan"
8989
resource_group_name = azurerm_resource_group.rg.name
9090
location = azurerm_resource_group.rg.location
9191
kind = "functionapp"
@@ -99,7 +99,7 @@ resource "azurerm_app_service_plan" "fxnapp" {
9999
}
100100

101101
resource "azurerm_function_app" "fxn" {
102-
name = var.prefix
102+
name = "${var.prefix}-serverless-functionapp"
103103
resource_group_name = azurerm_resource_group.rg.name
104104
location = azurerm_resource_group.rg.location
105105
app_service_plan_id = azurerm_app_service_plan.fxnapp.id
@@ -124,7 +124,7 @@ resource "azurerm_function_app" "fxn" {
124124
##################################################################################
125125

126126
resource "azurerm_key_vault" "shared_key_vault" {
127-
name = var.prefix
127+
name = "${var.prefix}-serverless-kv"
128128
resource_group_name = azurerm_resource_group.rg.name
129129
location = azurerm_resource_group.rg.location
130130
tenant_id = data.azurerm_client_config.current.tenant_id
@@ -183,7 +183,7 @@ resource "azurerm_key_vault_secret" "logging_app_insights_key" {
183183
##################################################################################
184184

185185
resource "azurerm_log_analytics_workspace" "loganalytics" {
186-
name = "${var.prefix}-law"
186+
name = "${var.prefix}-serverless-law"
187187
resource_group_name = azurerm_resource_group.rg.name
188188
location = azurerm_resource_group.rg.location
189189
sku = "PerGB2018"
@@ -196,7 +196,7 @@ resource "azurerm_log_analytics_workspace" "loganalytics" {
196196
locals {
197197
parameters_body = {
198198
logicapp_keyvaulthandler_name = {
199-
value = "${var.prefix}-LA"
199+
value = "${var.prefix}-serverless-la"
200200
},
201201
vaults_rollingvault_externalid = {
202202
value = azurerm_key_vault.shared_key_vault.id
@@ -226,7 +226,7 @@ locals {
226226
}
227227

228228
resource "azurerm_template_deployment" "logicapp" {
229-
name = "${var.prefix}-LA-deployment"
229+
name = "${var.prefix}-serverless-la-deployment"
230230
resource_group_name = azurerm_resource_group.rg.name
231231
deployment_mode = "Incremental"
232232
parameters_body = jsonencode(local.parameters_body)
@@ -473,11 +473,11 @@ resource "azurerm_role_assignment" "laToFunction" {
473473
# Outputs
474474
##################################################################################
475475

476-
output "AppInsightsKey1" {
476+
output "AppInsightsKey-First" {
477477
value = azurerm_application_insights.logging.instrumentation_key
478478
}
479479

480-
output "AppInsightsKey2" {
480+
output "AppInsightsKey-Second" {
481481
value = azurerm_application_insights.logging2.instrumentation_key
482482
}
483483

0 commit comments

Comments
 (0)