-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update app insights and function app infra
- Loading branch information
1 parent
7526c9a
commit 56392b5
Showing
7 changed files
with
196 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
asgiref==3.8.1 | ||
azure-core==1.30.0 | ||
azure-core-tracing-opentelemetry==1.0.0b11 | ||
azure-data-tables==12.5.0 | ||
azure-functions==1.18.0 | ||
azure-monitor-opentelemetry==1.4.0 | ||
azure-monitor-opentelemetry-exporter==1.0.0b25 | ||
azure-storage-queue==12.9.0 | ||
certifi==2024.2.2 | ||
cffi==1.16.0 | ||
charset-normalizer==3.3.2 | ||
cryptography==42.0.5 | ||
Deprecated==1.2.14 | ||
fixedint==0.1.6 | ||
idna==3.6 | ||
importlib-metadata==7.0.0 | ||
isodate==0.6.1 | ||
msrest==0.7.1 | ||
multidict==6.0.5 | ||
oauthlib==3.2.2 | ||
opentelemetry-api==1.24.0 | ||
opentelemetry-instrumentation==0.45b0 | ||
opentelemetry-instrumentation-asgi==0.45b0 | ||
opentelemetry-instrumentation-dbapi==0.45b0 | ||
opentelemetry-instrumentation-django==0.45b0 | ||
opentelemetry-instrumentation-fastapi==0.45b0 | ||
opentelemetry-instrumentation-flask==0.45b0 | ||
opentelemetry-instrumentation-psycopg2==0.45b0 | ||
opentelemetry-instrumentation-requests==0.45b0 | ||
opentelemetry-instrumentation-urllib==0.45b0 | ||
opentelemetry-instrumentation-urllib3==0.45b0 | ||
opentelemetry-instrumentation-wsgi==0.45b0 | ||
opentelemetry-resource-detector-azure==0.1.4 | ||
opentelemetry-sdk==1.24.0 | ||
opentelemetry-semantic-conventions==0.45b0 | ||
opentelemetry-util-http==0.45b0 | ||
packaging==24.0 | ||
psutil==5.9.8 | ||
pycparser==2.21 | ||
requests==2.31.0 | ||
requests-oauthlib==2.0.0 | ||
six==1.16.0 | ||
typing_extensions==4.9.0 | ||
urllib3==2.2.1 | ||
wrapt==1.16.0 | ||
yarl==1.9.4 | ||
zipp==3.18.1 |
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,2 +1,2 @@ | ||
paramFile=appins.params.json | ||
az deployment group create --resource-group Purple001 --template-file bicep/appins.bicep --parameters $paramFile | ||
az deployment group create --resource-group Purple001 --template-file appins.bicep --parameters $paramFile |
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,7 +1,89 @@ | ||
targetScope = 'resourceGroup' | ||
@description('the parameters needed to deploy all Azure resources for a function app') | ||
param azLocation string | ||
param azTags object | ||
param projShortName string | ||
param projVersion string | ||
param storageName string | ||
|
||
var hostPlanName = '${projShortName}ServerFarm${projVersion}' | ||
var insightsName = '${projShortName}Insights${projVersion}' | ||
var functionName = '${projShortName}Func${projVersion}' | ||
|
||
// Get a reference to the seperate data lake storage account (data lake) | ||
resource dataLake 'Microsoft.Storage/storageAccounts@2019-06-01' existing = { | ||
scope: resourceGroup(dataLakeRg) | ||
name: dataLakeName | ||
// Get a reference to the seperate configuration storage account (table storage) | ||
resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' existing = { | ||
scope: resourceGroup() | ||
name: storageName | ||
} | ||
|
||
// Get a reference to the previously created app insights in the same RG. | ||
resource insights 'Microsoft.Insights/components@2020-02-02' existing = { | ||
scope: resourceGroup() | ||
name: insightsName | ||
} | ||
|
||
// Specify kind: as 'linux' otherwise it defaults to windows. | ||
@description('Create the App Service Plan for the Server Farm. sku Y1 is the free tier.') | ||
resource hostingPlan 'Microsoft.Web/serverfarms@2022-03-01' = { | ||
name: hostPlanName | ||
location: azLocation | ||
sku: { | ||
name: 'Y1' | ||
tier: 'Dynamic' | ||
size: 'Y1' | ||
family: 'Y' | ||
} | ||
properties: { | ||
reserved: true | ||
} | ||
tags: azTags | ||
} | ||
|
||
// Deploy as linux running python 3.11 | ||
@description('Create the Function App with references to all other resources') | ||
resource functionApp 'Microsoft.Web/sites@2021-03-01' = { | ||
name: functionName | ||
location: azLocation | ||
kind: 'functionapp,linux' | ||
properties: { | ||
reserved: true | ||
serverFarmId: hostingPlan.id | ||
siteConfig: { | ||
linuxFxVersion: 'python|3.11' | ||
appSettings: [ | ||
{ | ||
name: 'AzureWebJobsStorage' | ||
value: 'DefaultEndpointsProtocol=https;AccountName=${storageName};EndpointSuffix=${environment().suffixes.storage};AccountKey=${storageAccount.listKeys().keys[0].value}' | ||
} | ||
{ | ||
name: 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING' | ||
value: 'DefaultEndpointsProtocol=https;AccountName=${storageName};EndpointSuffix=${environment().suffixes.storage};AccountKey=${storageAccount.listKeys().keys[0].value}' | ||
} | ||
{ | ||
name: 'WEBSITE_CONTENTSHARE' | ||
value: toLower(functionName) | ||
} | ||
{ | ||
name: 'FUNCTIONS_EXTENSION_VERSION' | ||
value: '~4' | ||
} | ||
{ | ||
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING' | ||
value: insights.properties.ConnectionString | ||
} | ||
{ | ||
name: 'FUNCTIONS_WORKER_RUNTIME' | ||
value: 'python' | ||
} | ||
{ | ||
name: 'LandregDataStorage' | ||
value: 'DefaultEndpointsProtocol=https;AccountName=${storageName};EndpointSuffix=${environment().suffixes.storage};AccountKey=${storageAccount.listKeys().keys[0].value}' | ||
} | ||
] | ||
ftpsState: 'FtpsOnly' | ||
minTlsVersion: '1.2' | ||
} | ||
httpsOnly: true | ||
} | ||
tags: azTags | ||
} |
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,2 @@ | ||
paramFile=funcapp.params.json | ||
az deployment group create --resource-group Purple001 --template-file funcapp.bicep --parameters $paramFile |
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,28 @@ | ||
{ | ||
"$schema": "http://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"azLocation": { | ||
"value": "uksouth" | ||
}, | ||
"projShortName": { | ||
"value": "Purple" | ||
}, | ||
"projVersion": { | ||
"value": "001" | ||
}, | ||
"storageName": { | ||
"value": "purpledata001" | ||
}, | ||
"azTags": { | ||
"value": { | ||
"App": "Purple", | ||
"Business": "TMRSM", | ||
"Licence": "Open", | ||
"CreatedBy": "Andy Roberts", | ||
"Service": "LandReg Property Prices", | ||
"Region": "UK" | ||
} | ||
} | ||
} | ||
} |
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