Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 31 additions & 0 deletions .azure/modules/afd-azurefrontdoor.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@


@description('Name of the Azure Front Door instance. Must be globally unique and 3-63 characters, using only lowercase letters, numbers, and hyphens, starting and ending with a letter or number.')
@minLength(3)
@maxLength(63)
param name string

@description('Location for the Azure Front Door resource. Must be set to global.')
@allowed(['global'])
param location string = 'global'

@description('Tags to apply to the Azure Front Door resource.')
param tags object = {}

@description('SKU for Azure Front Door. Allowed values: Standard_AzureFrontDoor, Premium_AzureFrontDoor. Default is Standard_AzureFrontDoor.')
@allowed([
'Standard_AzureFrontDoor'
'Premium_AzureFrontDoor'
])
param sku string = 'Standard_AzureFrontDoor'

resource afd 'Microsoft.Cdn/profiles@2023-05-01' = {
name: name
location: location
tags: tags
sku: {
name: sku
}
}

output id string = afd.id
68 changes: 59 additions & 9 deletions .azure/modules/api-appservice.bicep
Original file line number Diff line number Diff line change
@@ -1,26 +1,72 @@
param name string
param location string
param tags object = {}

@description('The name of the App Service Web App. Must be 1-60 characters, using only alphanumeric characters and hyphens.')
@minLength(1)
@allowed(['Development', 'QA', 'Staging', 'Production'])
@maxLength(60)
param name string

@description('The Azure region where the Web App will be deployed.')
param location string

@description('Tags to apply to the Web App resource.')
param tags object = {}

@description('The environment for the Web App. Allowed values: Development, QA, Staging, Production. Default is Development.')
@allowed([
'Development'
'QA'
'Staging'
'Production'
])
param environment string = 'Development'

@description('The Application Insights instrumentation key for the Web App.')
@minLength(1)
param appiKey string

@description('The Application Insights connection string for the Web App.')
@minLength(1)
param appiConnection string

@description('The resource ID of the App Service Plan.')
@minLength(1)
param planId string
@allowed(['api', 'app', 'app,linux', 'functionapp', 'functionapp,linux'])

@description('The kind of the Web App. Allowed values: api, app, app,linux, functionapp, functionapp,linux. Default is app.')
@allowed([
'api'
'app'
'app,linux'
'functionapp'
'functionapp,linux'
])
param kind string = 'app'
@allowed(['v4.8', 'v6.0', 'v7.0', 'v8.0'])
param dotnetVersion string = 'v8.0'

resource apiResource 'Microsoft.Web/sites@2023-12-01' = {
@description('The .NET version for the Web App. Allowed values: v4.8 (for .NET Framework), 6.0, 7.0, 8.0, 9.0, 10.0 (for .NET). Default is 10.0.')
@allowed([
'v4.8'
'6.0'
'7.0'
'8.0'
'9.0'
'10.0'
])
param dotnetVersion string = '10.0'

@description('Enable Always On for the App Service')
param alwaysOn bool = false

resource apiAppResource 'Microsoft.Web/sites@2023-12-01' = {
name: name
location: location
kind: kind
tags: empty(tags) ? null : tags
properties: {
serverFarmId: planId
httpsOnly: true
siteConfig: {
netFrameworkVersion: dotnetVersion
ftpsState: 'Disabled'
alwaysOn: alwaysOn
appSettings: [
{
name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
Expand All @@ -34,6 +80,10 @@ resource apiResource 'Microsoft.Web/sites@2023-12-01' = {
name: 'ASPNETCORE_ENVIRONMENT'
value: environment
}
{
name: 'WEBSITE_RUN_FROM_PACKAGE'
value: '1'
}
]
}
}
Expand All @@ -42,4 +92,4 @@ resource apiResource 'Microsoft.Web/sites@2023-12-01' = {
}
}

output id string = apiResource.id
output id string = apiAppResource.id
30 changes: 19 additions & 11 deletions .azure/modules/apim-apimanagement.bicep
Original file line number Diff line number Diff line change
@@ -1,38 +1,46 @@
@description('The name of the API Management service instance')
param apiManagementServiceName string = 'apiservice${uniqueString(resourceGroup().id)}'

@description('The email address of the owner of the service')
@description('The name of the API Management service instance. Must be 1-50 characters, use only letters, numbers, and hyphens, and start/end with a letter or number.')
@minLength(1)
@maxLength(50)
param name string = 'apiservice${uniqueString(resourceGroup().id)}'

@description('The email address of the owner of the API Management service. Must be a valid email address.')
@minLength(5)
@maxLength(100)
param publisherEmail string

@description('The name of the owner of the service')
@description('The name of the owner of the API Management service. Must be at least 1 character.')
@minLength(1)
param publisherName string

@description('The pricing tier of this API Management service')
@description('The pricing tier (SKU) of this API Management service. Allowed values: Developer, Standard, Premium. Default is Developer.')
@allowed([
'Developer'
'Standard'
'Premium'
])
param sku string = 'Developer'

@description('The instance size of this API Management service.')
@description('Tags to apply to the API Management service resource.')
param tags object = {}

@description('The instance size (capacity) of this API Management service. Allowed values: 1, 2. Default is 1.')
@allowed([
1
2
])
param skuCount int = 1
param capacity int = 1

@description('Location for all resources.')
@description('Location for all resources. Defaults to the resource group location.')
param location string = resourceGroup().location

resource apiManagementServiceName_resource 'Microsoft.ApiManagement/service@2022-08-01' = {
name: apiManagementServiceName
resource apimResource 'Microsoft.ApiManagement/service@2023-05-01-preview' = {
name: name
location: location
tags: tags
sku: {
name: sku
capacity: skuCount
capacity: capacity
}
properties: {
publisherEmail: publisherEmail
Expand Down
45 changes: 10 additions & 35 deletions .azure/modules/appcs-appconfigurationstore.bicep
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@description('Specifies the name of the App Configuration store.')
@description('Specifies the name of the App Configuration store. 5-50 chars, lowercase letters, numbers, and -')
@minLength(5)
@maxLength(50)
param name string

@description('Specifies the sku of the App Configuration store.')
Expand All @@ -11,46 +13,19 @@ param sku string = 'free'
@description('Specifies the Azure location where the app configuration store should be created.')
param location string = toLower(replace(resourceGroup().location, ' ', ''))

@description('Sentinel key to refresh configs for no label and Development label.')
param appcsKeys array = [
'Shared:Sentinel'
'Shared:Sentinel$Development'
]

@description('Sentinel value is 1. When changed to 0, will trigger config refreshes.')
param appcsValues array = [
'1'
'1'
]

@description('Specifies the content type of the key-value resources. For feature flag, the value should be application/vnd.microsoft.appconfig.ff+json;charset=utf-8. For Key Value reference, the value should be application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8. Otherwise, it\'s optional.')
param contentType string = 'text/plain'

@description('Adds tags for the key-value resources. It\'s optional')
param tags object = {
tag1: 'tag-value-1'
tag2: 'tag-value-2'
}

resource name_resource 'Microsoft.AppConfiguration/configurationStores@2023-03-01' = {
name: name
location: location
sku: {
name: sku
}
}

resource name_appcsKeys 'Microsoft.AppConfiguration/configurationStores/keyValues@2023-03-01' = [for (item, i) in appcsKeys: {
name: '${name}/${item}'
identity: {
type: 'SystemAssigned'
}
properties: {
value: appcsValues[i]
contentType: contentType
tags: empty(tags) ? null : tags
disableLocalAuth: true
publicNetworkAccess: 'Disabled'
}
dependsOn: [
name_resource
]
}]
}


output reference_key_value_value string = reference(resourceId('Microsoft.AppConfiguration/configurationStores/keyValues', name, appcsKeys[0]), '2020-07-01-preview').value
output reference_key_value_object object = reference(resourceId('Microsoft.AppConfiguration/configurationStores/keyValues', name, appcsKeys[1]), '2020-07-01-preview')
29 changes: 22 additions & 7 deletions .azure/modules/appi-applicationinsights.bicep
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@

param location string

@description('The Azure region where the Application Insights resource will be deployed. Allowed: eastus, eastus2, westus, westus2, centralus.')
@allowed([
'eastus'
'eastus2'
'westus'
'westus2'
'centralus'
])
param location string

@description('Tags to apply to the Application Insights resource.')
param tags object = {}
param name string
param Application_Type string
param Flow_Type string

@description('Specifies the name of the Application Insights resource. 1-255 characters, letters, numbers, and -')
@minLength(1)
@maxLength(255)
param name string

@description('The resource ID of the Log Analytics workspace to link to Application Insights. Must be a valid resourceId string.')
@minLength(1)
param workResourceId string

resource appiResource 'Microsoft.Insights/components@2020-02-02' = {
Expand All @@ -12,10 +28,9 @@ resource appiResource 'Microsoft.Insights/components@2020-02-02' = {
tags: empty(tags) ? null : tags
kind:'web'
properties: {
Application_Type: Application_Type
Flow_Type: Flow_Type
Application_Type: 'web'
Flow_Type: 'Bluefield'
WorkspaceResourceId: workResourceId

}
}

Expand Down
54 changes: 28 additions & 26 deletions .azure/modules/bot-botservice.bicep
Original file line number Diff line number Diff line change
@@ -1,74 +1,76 @@

@description('The name of the Bot Service resource. Must be 2-64 characters, using only letters, numbers, and hyphens, starting and ending with a letter or number.')
@minLength(2)
@maxLength(64)
param name string


@description('The SKU (pricing tier) for the Bot Service. Allowed values: F0 (Free), S1 (Standard). Default is S1.')
@allowed([
'F0'
'S1'
])
param sku string = 'S1'

@description('The Microsoft App ID for the Bot Service. Must be a valid GUID.')
@minLength(1)
param msAppId string

@description('The Microsoft App password/secret value for the Bot Service. Required for authentication.')
@minLength(1)
param msAppValue string

@description('The display name for the Bot Service. Optional, defaults to the resource name if not provided.')
@maxLength(64)
param displayName string = ''
param resourceTags object = {
'Microsoft.BotService/botServices': {}
}

@description('Tags to apply to the Bot Service resource.')
param tags object = {}

var location = resourceGroup().location
var uniqueSuffix = toLower(substring(uniqueString(resourceGroup().id, 'Microsoft.BotService/bots', name), 0, 6))
var botDisplayName = (empty(displayName) ? name : displayName)
var keyVaultName_var = 'kv-${name}'
var botDisplayName = empty(displayName) ? name : displayName
var kvName = 'kv-${name}'
var appPasswordSecret = 'bot-${replace(name, '_', '-')}-pwd-${uniqueSuffix}'
var appPasswordSecretId = keyVaultName_appPasswordSecret.id
var empty = {}
var botTags = (contains(resourceTags, 'Microsoft.BotService/botServices') ? resourceTags.Microsoft.BotService / botServices : empty)
var appPasswordSecretId = empty(msAppValue) ? '' : keyVaultName_appPasswordSecret.id

resource keyVaultName 'Microsoft.KeyVault/vaults@2023-07-01' = {
name: keyVaultName_var
name: kvName
location: location
properties: {
tenantId: subscription().tenantId
sku: {
family: 'A'
name: 'standard'
}
enableRbacAuthorization: true
accessPolicies: []
enabledForTemplateDeployment: true
}
}


resource keyVaultName_appPasswordSecret 'Microsoft.KeyVault/vaults/secrets@2023-07-01' = if (!empty(msAppValue)) {
parent: keyVaultName
name: '${appPasswordSecret}'
name: appPasswordSecret
properties: {
value: msAppValue
}
}


resource name_resource 'Microsoft.BotService/botServices@2022-09-15' = {
name: name
kind: 'azurebot'
location: 'global'
sku: {
name: sku
}
tags: botTags
tags: tags
properties: {
displayName: botDisplayName
msaAppId: msAppId
openWithHint: 'bfcomposer://'
appPasswordHint: appPasswordSecretId
endpoint: 'https://REPLACE-WITH-YOUR-BOT-ENDPOINT/api/messages'
}
dependsOn: []
}

resource keyVaultName_appPasswordSecret_Microsoft_Resources_provisioned_for 'Microsoft.KeyVault/vaults/secrets/providers/links@2018-02-01' = {
name: '${keyVaultName_var}/${appPasswordSecret}/Microsoft.Resources/provisioned-for'
location: location
properties: {
targetId: resourceId('Microsoft.BotService/bots', name)
sourceId: appPasswordSecretId
}
dependsOn: [
keyVaultName
name_resource
]
}
Loading
Loading