Azdev-ify changes for latest /bicep/core
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
param appServiceName string
|
||||
param cosmosConnectionStringKey string = ''
|
||||
param cosmosDatabaseName string = ''
|
||||
param cosmosEndpoint string = ''
|
||||
|
||||
module appServiceConfigCosmosSettings 'appservice-config-union.bicep' = {
|
||||
name: '${appServiceName}-appservice-config-cosmos-settings'
|
||||
params: {
|
||||
appServiceName: appServiceName
|
||||
configName: 'appsettings'
|
||||
currentConfigProperties: list(resourceId('Microsoft.Web/sites/config', appServiceName, 'appsettings'), '2022-03-01').properties
|
||||
additionalConfigProperties: {
|
||||
AZURE_COSMOS_CONNECTION_STRING_KEY: cosmosConnectionStringKey
|
||||
AZURE_COSMOS_DATABASE_NAME: cosmosDatabaseName
|
||||
AZURE_COSMOS_ENDPOINT: cosmosEndpoint
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
param appServiceName string
|
||||
|
||||
resource siteConfigLogs 'Microsoft.Web/sites/config@2022-03-01' = {
|
||||
name: '${appServiceName}/logs'
|
||||
properties: {
|
||||
applicationLogs: { fileSystem: { level: 'Verbose' } }
|
||||
detailedErrorMessages: { enabled: true }
|
||||
failedRequestsTracing: { enabled: true }
|
||||
httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } }
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
param appServiceName string
|
||||
param sqlConnectionStringKey string
|
||||
|
||||
module appServiceConfigSqlServerSettings 'appservice-config-union.bicep' = {
|
||||
name: '${appServiceName}-appservice-config-sqlserver-settings'
|
||||
params: {
|
||||
appServiceName: appServiceName
|
||||
configName: 'appsettings'
|
||||
currentConfigProperties: list(resourceId('Microsoft.Web/sites/config', appServiceName, 'appsettings'), '2022-03-01').properties
|
||||
additionalConfigProperties: {
|
||||
AZURE_SQL_CONNECTION_STRING_KEY: sqlConnectionStringKey
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
param additionalConfigProperties object
|
||||
param appServiceName string
|
||||
param configName string
|
||||
param currentConfigProperties object
|
||||
|
||||
resource siteConfigUnion 'Microsoft.Web/sites/config@2022-03-01' = {
|
||||
name: '${appServiceName}/${configName}'
|
||||
properties: union(currentConfigProperties, additionalConfigProperties)
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
param environmentName string
|
||||
param location string = resourceGroup().location
|
||||
|
||||
param allowedOrigins array = []
|
||||
param appCommandLine string = ''
|
||||
param applicationInsightsName string = ''
|
||||
param appServicePlanId string
|
||||
param appSettings object = {}
|
||||
param keyVaultName string = ''
|
||||
param linuxFxVersion string = 'DOTNETCORE|6.0'
|
||||
param managedIdentity bool = !(empty(keyVaultName))
|
||||
param scmDoBuildDuringDeployment bool = false
|
||||
param serviceName string
|
||||
|
||||
module appService 'appservice.bicep' = {
|
||||
name: '${serviceName}-appservice-dotnet'
|
||||
params: {
|
||||
environmentName: environmentName
|
||||
location: location
|
||||
allowedOrigins: allowedOrigins
|
||||
appCommandLine: appCommandLine
|
||||
applicationInsightsName: applicationInsightsName
|
||||
appServicePlanId: appServicePlanId
|
||||
appSettings: appSettings
|
||||
keyVaultName: keyVaultName
|
||||
linuxFxVersion: linuxFxVersion
|
||||
managedIdentity: managedIdentity
|
||||
scmDoBuildDuringDeployment: scmDoBuildDuringDeployment
|
||||
serviceName: serviceName
|
||||
}
|
||||
}
|
||||
|
||||
output identityPrincipalId string = appService.outputs.identityPrincipalId
|
||||
output name string = appService.outputs.name
|
||||
output uri string = appService.outputs.uri
|
||||
@@ -1,35 +0,0 @@
|
||||
param environmentName string
|
||||
param location string = resourceGroup().location
|
||||
|
||||
param allowedOrigins array = []
|
||||
param appCommandLine string = ''
|
||||
param applicationInsightsName string = ''
|
||||
param appServicePlanId string
|
||||
param appSettings object = {}
|
||||
param keyVaultName string = ''
|
||||
param linuxFxVersion string = 'NODE|16-lts'
|
||||
param managedIdentity bool = !(empty(keyVaultName))
|
||||
param scmDoBuildDuringDeployment bool = false
|
||||
param serviceName string
|
||||
|
||||
module appService 'appservice.bicep' = {
|
||||
name: '${serviceName}-appservice-node'
|
||||
params: {
|
||||
environmentName: environmentName
|
||||
location: location
|
||||
allowedOrigins: allowedOrigins
|
||||
appCommandLine: appCommandLine
|
||||
applicationInsightsName: applicationInsightsName
|
||||
appServicePlanId: appServicePlanId
|
||||
appSettings: appSettings
|
||||
keyVaultName: keyVaultName
|
||||
linuxFxVersion: linuxFxVersion
|
||||
managedIdentity: managedIdentity
|
||||
scmDoBuildDuringDeployment: scmDoBuildDuringDeployment
|
||||
serviceName: serviceName
|
||||
}
|
||||
}
|
||||
|
||||
output identityPrincipalId string = appService.outputs.identityPrincipalId
|
||||
output name string = appService.outputs.name
|
||||
output uri string = appService.outputs.uri
|
||||
@@ -1,35 +0,0 @@
|
||||
param environmentName string
|
||||
param location string = resourceGroup().location
|
||||
|
||||
param allowedOrigins array = []
|
||||
param appCommandLine string = ''
|
||||
param applicationInsightsName string = ''
|
||||
param appServicePlanId string
|
||||
param appSettings object = {}
|
||||
param keyVaultName string = ''
|
||||
param linuxFxVersion string = 'PYTHON|3.8'
|
||||
param managedIdentity bool = !(empty(keyVaultName))
|
||||
param scmDoBuildDuringDeployment bool = true
|
||||
param serviceName string
|
||||
|
||||
module appService 'appservice.bicep' = {
|
||||
name: '${serviceName}-appservice-python'
|
||||
params: {
|
||||
environmentName: environmentName
|
||||
location: location
|
||||
allowedOrigins: allowedOrigins
|
||||
appCommandLine: appCommandLine
|
||||
applicationInsightsName: applicationInsightsName
|
||||
appServicePlanId: appServicePlanId
|
||||
appSettings: appSettings
|
||||
keyVaultName: keyVaultName
|
||||
linuxFxVersion: linuxFxVersion
|
||||
managedIdentity: managedIdentity
|
||||
scmDoBuildDuringDeployment: scmDoBuildDuringDeployment
|
||||
serviceName: serviceName
|
||||
}
|
||||
}
|
||||
|
||||
output identityPrincipalId string = appService.outputs.identityPrincipalId
|
||||
output name string = appService.outputs.name
|
||||
output uri string = appService.outputs.uri
|
||||
@@ -1,34 +1,42 @@
|
||||
param environmentName string
|
||||
param name string
|
||||
param location string = resourceGroup().location
|
||||
param tags object = {}
|
||||
|
||||
// Reference Properties
|
||||
param applicationInsightsName string = ''
|
||||
param appServicePlanId string
|
||||
param keyVaultName string = ''
|
||||
param managedIdentity bool = !empty(keyVaultName)
|
||||
|
||||
// Runtime Properties
|
||||
@allowed([
|
||||
'dotnet', 'dotnetcore', 'dotnet-isolated', 'node', 'python', 'java', 'powershell', 'custom'
|
||||
])
|
||||
param runtimeName string
|
||||
param runtimeNameAndVersion string = '${runtimeName}|${runtimeVersion}'
|
||||
param runtimeVersion string
|
||||
|
||||
// Microsoft.Web/sites Properties
|
||||
param kind string = 'app,linux'
|
||||
|
||||
// Microsoft.Web/sites/config
|
||||
param allowedOrigins array = []
|
||||
param alwaysOn bool = true
|
||||
param appCommandLine string = ''
|
||||
param applicationInsightsName string = ''
|
||||
param appServicePlanId string
|
||||
param appSettings object = {}
|
||||
param clientAffinityEnabled bool = false
|
||||
param enableOryxBuild bool = contains(kind, 'linux')
|
||||
param functionAppScaleLimit int = -1
|
||||
param keyVaultName string = ''
|
||||
param kind string = 'app,linux'
|
||||
param linuxFxVersion string = ''
|
||||
param managedIdentity bool = !(empty(keyVaultName))
|
||||
param linuxFxVersion string = runtimeNameAndVersion
|
||||
param minimumElasticInstanceCount int = -1
|
||||
param numberOfWorkers int = -1
|
||||
param scmDoBuildDuringDeployment bool = false
|
||||
param serviceName string
|
||||
param use32BitWorkerProcess bool = false
|
||||
|
||||
var abbrs = loadJsonContent('../../abbreviations.json')
|
||||
var tags = { 'azd-env-name': environmentName }
|
||||
var resourceToken = toLower(uniqueString(subscription().id, environmentName, location))
|
||||
|
||||
var prefix = contains(kind, 'function') ? abbrs.webSitesFunctions : abbrs.webSitesAppService
|
||||
|
||||
resource appService 'Microsoft.Web/sites@2022-03-01' = {
|
||||
name: '${prefix}${serviceName}-${resourceToken}'
|
||||
name: name
|
||||
location: location
|
||||
tags: union(tags, { 'azd-service-name': serviceName })
|
||||
tags: tags
|
||||
kind: kind
|
||||
properties: {
|
||||
serverFarmId: appServicePlanId
|
||||
@@ -49,41 +57,30 @@ resource appService 'Microsoft.Web/sites@2022-03-01' = {
|
||||
httpsOnly: true
|
||||
}
|
||||
|
||||
identity: managedIdentity ? { type: 'SystemAssigned' } : null
|
||||
identity: { type: managedIdentity ? 'SystemAssigned' : 'None' }
|
||||
|
||||
resource appSettings 'config' = {
|
||||
resource configAppSettings 'config' = {
|
||||
name: 'appsettings'
|
||||
properties: union({
|
||||
properties: union(appSettings,
|
||||
{
|
||||
SCM_DO_BUILD_DURING_DEPLOYMENT: string(scmDoBuildDuringDeployment)
|
||||
ENABLE_ORYX_BUILD: string(enableOryxBuild)
|
||||
},
|
||||
!(empty(applicationInsightsName)) ? { APPLICATIONINSIGHTS_CONNECTION_STRING: applicationInsights.properties.ConnectionString } : {},
|
||||
!(empty(keyVaultName)) ? { AZURE_KEY_VAULT_ENDPOINT: keyVault.properties.vaultUri } : {})
|
||||
!empty(applicationInsightsName) ? { APPLICATIONINSIGHTS_CONNECTION_STRING: applicationInsights.properties.ConnectionString } : {},
|
||||
!empty(keyVaultName) ? { AZURE_KEY_VAULT_ENDPOINT: keyVault.properties.vaultUri } : {})
|
||||
}
|
||||
}
|
||||
|
||||
module appSettingsUnion 'appservice-config-union.bicep' = if (!empty(appSettings)) {
|
||||
name: '${serviceName}-app-settings-union'
|
||||
params: {
|
||||
appServiceName: appService.name
|
||||
configName: 'appsettings'
|
||||
currentConfigProperties: appService::appSettings.list().properties
|
||||
additionalConfigProperties: appSettings
|
||||
}
|
||||
}
|
||||
|
||||
module siteConfigLogs 'appservice-config-logs.bicep' = {
|
||||
name: '${serviceName}-appservice-config-logs'
|
||||
params: {
|
||||
appServiceName: appService.name
|
||||
}
|
||||
}
|
||||
|
||||
module keyVaultAccess '../security/keyvault-access.bicep' = if (!(empty(keyVaultName))) {
|
||||
name: '${serviceName}-appservice-keyvault-access'
|
||||
params: {
|
||||
principalId: appService.identity.principalId
|
||||
environmentName: environmentName
|
||||
location: location
|
||||
resource configLogs 'config' = {
|
||||
name: 'logs'
|
||||
properties: {
|
||||
applicationLogs: { fileSystem: { level: 'Verbose' } }
|
||||
detailedErrorMessages: { enabled: true }
|
||||
failedRequestsTracing: { enabled: true }
|
||||
httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } }
|
||||
}
|
||||
dependsOn: [
|
||||
configAppSettings
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +88,7 @@ resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = if (!(empty(
|
||||
name: keyVaultName
|
||||
}
|
||||
|
||||
resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = if (!(empty(applicationInsightsName))) {
|
||||
resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = if (!empty(applicationInsightsName)) {
|
||||
name: applicationInsightsName
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
param environmentName string
|
||||
param location string = resourceGroup().location
|
||||
|
||||
param sku object = {
|
||||
name: 'Y1'
|
||||
tier: 'Dynamic'
|
||||
size: 'Y1'
|
||||
family: 'Y'
|
||||
}
|
||||
|
||||
module appServicePlanFunctions 'appserviceplan.bicep' = {
|
||||
name: 'appserviceplan-functions'
|
||||
params: {
|
||||
environmentName: environmentName
|
||||
location: location
|
||||
sku: sku
|
||||
kind: 'functionapp'
|
||||
}
|
||||
}
|
||||
|
||||
output appServicePlanId string = appServicePlanFunctions.outputs.appServicePlanId
|
||||
@@ -1,15 +0,0 @@
|
||||
param environmentName string
|
||||
param location string = resourceGroup().location
|
||||
|
||||
param sku object = { name: 'B1' }
|
||||
|
||||
module appServicePlanSites 'appserviceplan.bicep' = {
|
||||
name: 'appserviceplan-sites'
|
||||
params: {
|
||||
environmentName: environmentName
|
||||
location: location
|
||||
sku: sku
|
||||
}
|
||||
}
|
||||
|
||||
output appServicePlanId string = appServicePlanSites.outputs.appServicePlanId
|
||||
@@ -1,16 +1,13 @@
|
||||
param environmentName string
|
||||
param name string
|
||||
param location string = resourceGroup().location
|
||||
param tags object = {}
|
||||
|
||||
param kind string = ''
|
||||
param reserved bool = true
|
||||
param sku object
|
||||
|
||||
var abbrs = loadJsonContent('../../abbreviations.json')
|
||||
var resourceToken = toLower(uniqueString(subscription().id, environmentName, location))
|
||||
var tags = { 'azd-env-name': environmentName }
|
||||
|
||||
resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
|
||||
name: '${abbrs.webServerFarms}${resourceToken}'
|
||||
name: name
|
||||
location: location
|
||||
tags: tags
|
||||
sku: sku
|
||||
@@ -20,4 +17,4 @@ resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
|
||||
}
|
||||
}
|
||||
|
||||
output appServicePlanId string = appServicePlan.id
|
||||
output id string = appServicePlan.id
|
||||
|
||||
@@ -1,25 +1,28 @@
|
||||
param environmentName string
|
||||
param name string
|
||||
param location string = resourceGroup().location
|
||||
param tags object = {}
|
||||
|
||||
param containerAppsEnvironmentName string = ''
|
||||
param containerName string = 'main'
|
||||
param containerRegistryName string = ''
|
||||
param env array = []
|
||||
param external bool = true
|
||||
param imageName string
|
||||
param keyVaultName string = ''
|
||||
param managedIdentity bool = !(empty(keyVaultName))
|
||||
param managedIdentity bool = !empty(keyVaultName)
|
||||
param targetPort int = 80
|
||||
param serviceName string
|
||||
|
||||
var abbrs = loadJsonContent('../../abbreviations.json')
|
||||
var resourceToken = toLower(uniqueString(subscription().id, environmentName, location))
|
||||
var tags = { 'azd-env-name': environmentName }
|
||||
@description('CPU cores allocated to a single container instance, e.g. 0.5')
|
||||
param containerCpuCoreCount string = '0.5'
|
||||
|
||||
@description('Memory allocated to a single container instance, e.g. 1Gi')
|
||||
param containerMemory string = '1.0Gi'
|
||||
|
||||
resource app 'Microsoft.App/containerApps@2022-03-01' = {
|
||||
name: '${abbrs.appContainerApps}${serviceName}-${resourceToken}'
|
||||
name: name
|
||||
location: location
|
||||
tags: union(tags, { 'azd-service-name': serviceName })
|
||||
identity: managedIdentity ? { type: 'SystemAssigned' } : null
|
||||
tags: tags
|
||||
identity: { type: managedIdentity ? 'SystemAssigned' : 'None' }
|
||||
properties: {
|
||||
managedEnvironmentId: containerAppsEnvironment.id
|
||||
configuration: {
|
||||
@@ -47,33 +50,28 @@ resource app 'Microsoft.App/containerApps@2022-03-01' = {
|
||||
containers: [
|
||||
{
|
||||
image: imageName
|
||||
name: 'main'
|
||||
name: containerName
|
||||
env: env
|
||||
resources: {
|
||||
cpu: json(containerCpuCoreCount)
|
||||
memory: containerMemory
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module keyVaultAccess '../security/keyvault-access.bicep' = if (!(empty(keyVaultName))) {
|
||||
name: '${serviceName}-appservice-keyvault-access'
|
||||
params: {
|
||||
environmentName: environmentName
|
||||
location: location
|
||||
keyVaultName: keyVaultName
|
||||
principalId: app.identity.principalId
|
||||
}
|
||||
}
|
||||
|
||||
resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2022-03-01' existing = {
|
||||
name: !empty(containerAppsEnvironmentName) ? containerAppsEnvironmentName : '${abbrs.appManagedEnvironments}${resourceToken}'
|
||||
name: containerAppsEnvironmentName
|
||||
}
|
||||
|
||||
// 2022-02-01-preview needed for anonymousPullEnabled
|
||||
resource containerRegistry 'Microsoft.ContainerRegistry/registries@2022-02-01-preview' existing = {
|
||||
name: !empty(containerRegistryName) ? containerRegistryName : '${abbrs.containerRegistryRegistries}${resourceToken}'
|
||||
name: containerRegistryName
|
||||
}
|
||||
|
||||
output identityPrincipalId string = managedIdentity ? app.identity.principalId : ''
|
||||
output imageName string = imageName
|
||||
output name string = app.name
|
||||
output uri string = 'https://${app.properties.configuration.ingress.fqdn}'
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
param environmentName string
|
||||
param name string
|
||||
param location string = resourceGroup().location
|
||||
param tags object = {}
|
||||
|
||||
param containerAppsEnvironmentName string = ''
|
||||
param logAnalyticsWorkspaceName string
|
||||
|
||||
var abbrs = loadJsonContent('../../abbreviations.json')
|
||||
var resourceToken = toLower(uniqueString(subscription().id, environmentName, location))
|
||||
var tags = { 'azd-env-name': environmentName }
|
||||
|
||||
resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2022-03-01' = {
|
||||
name: !empty(containerAppsEnvironmentName) ? containerAppsEnvironmentName : '${abbrs.appManagedEnvironments}${resourceToken}'
|
||||
name: name
|
||||
location: location
|
||||
tags: tags
|
||||
properties: {
|
||||
@@ -23,8 +19,8 @@ resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2022-03-01'
|
||||
}
|
||||
}
|
||||
|
||||
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' existing = {
|
||||
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = {
|
||||
name: logAnalyticsWorkspaceName
|
||||
}
|
||||
|
||||
output containerAppsEnvironmentName string = containerAppsEnvironment.name
|
||||
output name string = containerAppsEnvironment.name
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
param environmentName string
|
||||
param name string
|
||||
param location string = resourceGroup().location
|
||||
param tags object = {}
|
||||
|
||||
param containerAppsEnvironmentName string = ''
|
||||
param containerAppsGroupName string = 'app'
|
||||
param containerRegistryName string = ''
|
||||
param logAnalyticsWorkspaceName string = ''
|
||||
|
||||
module containerAppsEnvironment 'container-apps-environment.bicep' = {
|
||||
name: '${containerAppsGroupName}-container-apps-environment'
|
||||
name: '${name}-container-apps-environment'
|
||||
params: {
|
||||
environmentName: environmentName
|
||||
name: containerAppsEnvironmentName
|
||||
location: location
|
||||
containerAppsEnvironmentName: containerAppsEnvironmentName
|
||||
tags: tags
|
||||
logAnalyticsWorkspaceName: logAnalyticsWorkspaceName
|
||||
}
|
||||
}
|
||||
|
||||
module containerRegistry 'container-registry.bicep' = {
|
||||
name: '${containerAppsGroupName}-container-registry'
|
||||
name: '${name}-container-registry'
|
||||
params: {
|
||||
environmentName: environmentName
|
||||
name: containerRegistryName
|
||||
location: location
|
||||
containerRegistryName: containerRegistryName
|
||||
tags: tags
|
||||
}
|
||||
}
|
||||
|
||||
output containerAppsEnvironmentName string = containerAppsEnvironment.outputs.containerAppsEnvironmentName
|
||||
output containerRegistryEndpoint string = containerRegistry.outputs.containerRegistryEndpoint
|
||||
output containerRegistryName string = containerRegistry.outputs.containerRegistryName
|
||||
output environmentName string = containerAppsEnvironment.outputs.name
|
||||
output registryLoginServer string = containerRegistry.outputs.loginServer
|
||||
output registryName string = containerRegistry.outputs.name
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
param environmentName string
|
||||
param name string
|
||||
param location string = resourceGroup().location
|
||||
param tags object = {}
|
||||
|
||||
param adminUserEnabled bool = true
|
||||
param anonymousPullEnabled bool = false
|
||||
param containerRegistryName string = ''
|
||||
param dataEndpointEnabled bool = false
|
||||
param encryption object = {
|
||||
status: 'disabled'
|
||||
@@ -11,17 +11,13 @@ param encryption object = {
|
||||
param networkRuleBypassOptions string = 'AzureServices'
|
||||
param publicNetworkAccess string = 'Enabled'
|
||||
param sku object = {
|
||||
name: 'Standard'
|
||||
name: 'Basic'
|
||||
}
|
||||
param zoneRedundancy string = 'Disabled'
|
||||
|
||||
var abbrs = loadJsonContent('../../abbreviations.json')
|
||||
var resourceToken = toLower(uniqueString(subscription().id, environmentName, location))
|
||||
var tags = { 'azd-env-name': environmentName }
|
||||
|
||||
// 2022-02-01-preview needed for anonymousPullEnabled
|
||||
resource containerRegistry 'Microsoft.ContainerRegistry/registries@2022-02-01-preview' = {
|
||||
name: !empty(containerRegistryName) ? containerRegistryName : '${abbrs.containerRegistryRegistries}${resourceToken}'
|
||||
name: name
|
||||
location: location
|
||||
tags: tags
|
||||
sku: sku
|
||||
@@ -36,5 +32,5 @@ resource containerRegistry 'Microsoft.ContainerRegistry/registries@2022-02-01-pr
|
||||
}
|
||||
}
|
||||
|
||||
output containerRegistryEndpoint string = containerRegistry.properties.loginServer
|
||||
output containerRegistryName string = containerRegistry.name
|
||||
output loginServer string = containerRegistry.properties.loginServer
|
||||
output name string = containerRegistry.name
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
param environmentName string
|
||||
param location string = resourceGroup().location
|
||||
|
||||
param allowedOrigins array = []
|
||||
param applicationInsightsName string = ''
|
||||
param appServicePlanId string
|
||||
param appSettings object = {}
|
||||
param keyVaultName string = ''
|
||||
param linuxFxVersion string = 'NODE|16'
|
||||
param managedIdentity bool = !(empty(keyVaultName))
|
||||
param serviceName string
|
||||
param storageAccountName string
|
||||
|
||||
module functions 'functions.bicep' = {
|
||||
name: '${serviceName}-functions-node'
|
||||
params: {
|
||||
environmentName: environmentName
|
||||
location: location
|
||||
allowedOrigins: allowedOrigins
|
||||
applicationInsightsName: applicationInsightsName
|
||||
appServicePlanId: appServicePlanId
|
||||
appSettings: appSettings
|
||||
functionsWorkerRuntime: 'node'
|
||||
keyVaultName: keyVaultName
|
||||
linuxFxVersion: linuxFxVersion
|
||||
managedIdentity: managedIdentity
|
||||
serviceName: serviceName
|
||||
storageAccountName: storageAccountName
|
||||
}
|
||||
}
|
||||
|
||||
output identityPrincipalId string = functions.outputs.identityPrincipalId
|
||||
output name string = functions.outputs.name
|
||||
output uri string = functions.outputs.uri
|
||||
@@ -1,34 +0,0 @@
|
||||
param environmentName string
|
||||
param location string = resourceGroup().location
|
||||
|
||||
param allowedOrigins array = []
|
||||
param applicationInsightsName string = ''
|
||||
param appServicePlanId string
|
||||
param appSettings object = {}
|
||||
param keyVaultName string = ''
|
||||
param linuxFxVersion string = 'PYTHON|3.8'
|
||||
param managedIdentity bool = !(empty(keyVaultName))
|
||||
param serviceName string
|
||||
param storageAccountName string
|
||||
|
||||
module functions 'functions.bicep' = {
|
||||
name: '${serviceName}-functions-python'
|
||||
params: {
|
||||
environmentName: environmentName
|
||||
location: location
|
||||
allowedOrigins: allowedOrigins
|
||||
applicationInsightsName: applicationInsightsName
|
||||
appServicePlanId: appServicePlanId
|
||||
appSettings: appSettings
|
||||
functionsWorkerRuntime: 'python'
|
||||
keyVaultName: keyVaultName
|
||||
linuxFxVersion: linuxFxVersion
|
||||
managedIdentity: managedIdentity
|
||||
serviceName: serviceName
|
||||
storageAccountName: storageAccountName
|
||||
}
|
||||
}
|
||||
|
||||
output identityPrincipalId string = functions.outputs.identityPrincipalId
|
||||
output name string = functions.outputs.name
|
||||
output uri string = functions.outputs.uri
|
||||
@@ -1,41 +1,63 @@
|
||||
param environmentName string
|
||||
param name string
|
||||
param location string = resourceGroup().location
|
||||
param tags object = {}
|
||||
|
||||
param allowedOrigins array = []
|
||||
param alwaysOn bool = false
|
||||
// Reference Properties
|
||||
param applicationInsightsName string = ''
|
||||
param appServicePlanId string
|
||||
param keyVaultName string = ''
|
||||
param managedIdentity bool = !empty(keyVaultName)
|
||||
param storageAccountName string
|
||||
|
||||
// Runtime Properties
|
||||
@allowed([
|
||||
'dotnet', 'dotnetcore', 'dotnet-isolated', 'node', 'python', 'java', 'powershell', 'custom'
|
||||
])
|
||||
param runtimeName string
|
||||
param runtimeNameAndVersion string = '${runtimeName}|${runtimeVersion}'
|
||||
param runtimeVersion string
|
||||
|
||||
// Function Settings
|
||||
@allowed([
|
||||
'~4', '~3', '~2', '~1'
|
||||
])
|
||||
param extensionVersion string = '~4'
|
||||
|
||||
// Microsoft.Web/sites Properties
|
||||
param kind string = 'functionapp,linux'
|
||||
|
||||
// Microsoft.Web/sites/config
|
||||
param allowedOrigins array = []
|
||||
param alwaysOn bool = true
|
||||
param appCommandLine string = ''
|
||||
param appSettings object = {}
|
||||
param clientAffinityEnabled bool = false
|
||||
param functionAppScaleLimit int = 200
|
||||
param functionsExtensionVersion string = '~4'
|
||||
param functionsWorkerRuntime string
|
||||
param kind string = 'functionapp,linux'
|
||||
param linuxFxVersion string = ''
|
||||
param keyVaultName string = ''
|
||||
param managedIdentity bool = !(empty(keyVaultName))
|
||||
param minimumElasticInstanceCount int = 0
|
||||
param numberOfWorkers int = 1
|
||||
param enableOryxBuild bool = contains(kind, 'linux')
|
||||
param functionAppScaleLimit int = -1
|
||||
param linuxFxVersion string = runtimeNameAndVersion
|
||||
param minimumElasticInstanceCount int = -1
|
||||
param numberOfWorkers int = -1
|
||||
param scmDoBuildDuringDeployment bool = true
|
||||
param serviceName string
|
||||
param storageAccountName string
|
||||
param use32BitWorkerProcess bool = false
|
||||
|
||||
module functions 'appservice.bicep' = {
|
||||
name: '${serviceName}-functions'
|
||||
name: '${name}-functions'
|
||||
params: {
|
||||
environmentName: environmentName
|
||||
name: name
|
||||
location: location
|
||||
tags: tags
|
||||
allowedOrigins: allowedOrigins
|
||||
alwaysOn: alwaysOn
|
||||
appCommandLine: appCommandLine
|
||||
applicationInsightsName: applicationInsightsName
|
||||
appServicePlanId: appServicePlanId
|
||||
appSettings: union(appSettings, {
|
||||
AzureWebJobsStorage: 'DefaultEndpointsProtocol=https;AccountName=${storage.name};AccountKey=${storage.listKeys().keys[0].value};EndpointSuffix=${environment().suffixes.storage}'
|
||||
FUNCTIONS_EXTENSION_VERSION: functionsExtensionVersion
|
||||
FUNCTIONS_WORKER_RUNTIME: functionsWorkerRuntime
|
||||
FUNCTIONS_EXTENSION_VERSION: extensionVersion
|
||||
FUNCTIONS_WORKER_RUNTIME: runtimeName
|
||||
})
|
||||
clientAffinityEnabled: clientAffinityEnabled
|
||||
enableOryxBuild: enableOryxBuild
|
||||
functionAppScaleLimit: functionAppScaleLimit
|
||||
keyVaultName: keyVaultName
|
||||
kind: kind
|
||||
@@ -43,8 +65,10 @@ module functions 'appservice.bicep' = {
|
||||
managedIdentity: managedIdentity
|
||||
minimumElasticInstanceCount: minimumElasticInstanceCount
|
||||
numberOfWorkers: numberOfWorkers
|
||||
runtimeName: runtimeName
|
||||
runtimeVersion: runtimeVersion
|
||||
runtimeNameAndVersion: runtimeNameAndVersion
|
||||
scmDoBuildDuringDeployment: scmDoBuildDuringDeployment
|
||||
serviceName: serviceName
|
||||
use32BitWorkerProcess: use32BitWorkerProcess
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
param environmentName string
|
||||
param name string
|
||||
param location string = resourceGroup().location
|
||||
param tags object = {}
|
||||
|
||||
param serviceName string
|
||||
param sku object = {
|
||||
name: 'Free'
|
||||
tier: 'Free'
|
||||
}
|
||||
|
||||
var abbrs = loadJsonContent('../../abbreviations.json')
|
||||
var resourceToken = toLower(uniqueString(subscription().id, environmentName, location))
|
||||
var tags = { 'azd-env-name': environmentName }
|
||||
|
||||
resource web 'Microsoft.Web/staticSites@2022-03-01' = {
|
||||
name: '${abbrs.webStaticSites}${serviceName}-${resourceToken}'
|
||||
name: name
|
||||
location: location
|
||||
tags: union(tags, { 'azd-service-name': serviceName })
|
||||
tags: tags
|
||||
sku: sku
|
||||
properties: {
|
||||
provider: 'Custom'
|
||||
|
||||
Reference in New Issue
Block a user