getting an exception locally. seems there is a bug in the tricep output???
This commit is contained in:
parent
99844d1537
commit
8faa5c7d55
6 changed files with 39 additions and 59 deletions
3
.github/workflows/app.yml
vendored
3
.github/workflows/app.yml
vendored
|
@ -76,6 +76,9 @@ jobs:
|
||||||
sparse-checkout: |
|
sparse-checkout: |
|
||||||
infrastructure
|
infrastructure
|
||||||
|
|
||||||
|
- name: Test bicep
|
||||||
|
run: az bicep build ./infrastructure/main.bicep
|
||||||
|
|
||||||
- name: Az CLI login
|
- name: Az CLI login
|
||||||
uses: azure/login@v2
|
uses: azure/login@v2
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
import { Context } from 'br/Tricep:types:latest'
|
import { Context } from 'br/Tricep:types:latest'
|
||||||
import { with_name } from 'br/Tricep:common/context:latest'
|
import { with_name } from 'br/Tricep:common/context:latest'
|
||||||
import { container_app_environment, container_app, container, with_app_logs, with_auto_scaling, with_environment } from 'br/Tricep:recommended/app/container-app:latest'
|
import { with_managed_identity } from 'br/Tricep:common/identity:latest'
|
||||||
|
import {
|
||||||
|
container_app_environment
|
||||||
|
container_app
|
||||||
|
container
|
||||||
|
with_public_access
|
||||||
|
with_app_logs
|
||||||
|
with_auto_scaling
|
||||||
|
with_environment
|
||||||
|
} from 'br/Tricep:recommended/app/container-app:latest'
|
||||||
|
|
||||||
targetScope = 'resourceGroup'
|
targetScope = 'resourceGroup'
|
||||||
|
|
||||||
|
@ -8,71 +17,42 @@ param context Context
|
||||||
param version string
|
param version string
|
||||||
@secure()
|
@secure()
|
||||||
param registryUrl string
|
param registryUrl string
|
||||||
param customerId string
|
|
||||||
param sharedKey string
|
|
||||||
|
|
||||||
var appName = 'app'
|
var appName = 'app'
|
||||||
|
|
||||||
var environmentConfig = container_app_environment(with_name(context, 'app'), [
|
var environmentConfig = container_app_environment(with_name(context, appName), [])
|
||||||
with_app_logs(customerId, sharedKey)
|
|
||||||
{
|
|
||||||
properties: {
|
|
||||||
appLogsConfiguration: {
|
|
||||||
destination: 'azure-monitor'
|
|
||||||
}
|
|
||||||
peerAuthentication: {
|
|
||||||
mtls: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
peerTrafficConfiguration: {
|
|
||||||
encryption: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
])
|
|
||||||
var appConfig = container_app(
|
var appConfig = container_app(
|
||||||
with_name(context, 'app'),
|
context,
|
||||||
[
|
[
|
||||||
container('${context.project}-${appName}', '${registryUrl}/${context.project}-${appName}:${version}')
|
container({
|
||||||
|
name: '${context.project}-${appName}'
|
||||||
|
image: '${registryUrl}/${context.project}-${appName}:${version}'
|
||||||
|
})
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
with_managed_identity()
|
||||||
with_environment(environment.id)
|
with_environment(environment.id)
|
||||||
with_auto_scaling(0, 1, {
|
with_auto_scaling(0, 1, {
|
||||||
ruleName: {
|
ruleName: {
|
||||||
concurrentRequests: '10'
|
concurrentRequests: '10'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
with_public_access({
|
||||||
|
port: 3000
|
||||||
|
cors: {
|
||||||
|
allowedOrigins: [
|
||||||
|
// 'https://localhost:3000'
|
||||||
|
'*'
|
||||||
|
]
|
||||||
|
allowCredentials: true
|
||||||
|
allowedHeaders: ['*']
|
||||||
|
allowedMethods: ['Get, POST']
|
||||||
|
maxAge: 0
|
||||||
|
}
|
||||||
|
})
|
||||||
{
|
{
|
||||||
properties: {
|
properties: {
|
||||||
configuration: {
|
configuration: {
|
||||||
activeRevisionsMode: 'Single'
|
|
||||||
|
|
||||||
ingress: {
|
|
||||||
external: true
|
|
||||||
targetPort: 3000
|
|
||||||
transport: 'auto'
|
|
||||||
allowInsecure: false
|
|
||||||
traffic: [
|
|
||||||
{
|
|
||||||
weight: 100
|
|
||||||
latestRevision: true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
corsPolicy: {
|
|
||||||
allowedOrigins: [
|
|
||||||
// 'https://localhost:3000'
|
|
||||||
'*'
|
|
||||||
]
|
|
||||||
allowCredentials: true
|
|
||||||
allowedHeaders: ['*']
|
|
||||||
allowedMethods: ['Get, POST']
|
|
||||||
maxAge: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
registries: [
|
registries: [
|
||||||
{
|
{
|
||||||
identity: 'system'
|
identity: 'system'
|
||||||
|
@ -88,12 +68,14 @@ var appConfig = container_app(
|
||||||
resource environment 'Microsoft.App/managedEnvironments@2024-03-01' = {
|
resource environment 'Microsoft.App/managedEnvironments@2024-03-01' = {
|
||||||
name: environmentConfig.name
|
name: environmentConfig.name
|
||||||
location: environmentConfig.location
|
location: environmentConfig.location
|
||||||
|
tags: environmentConfig.tags
|
||||||
properties: environmentConfig.properties
|
properties: environmentConfig.properties
|
||||||
}
|
}
|
||||||
|
|
||||||
resource app 'Microsoft.App/containerApps@2024-03-01' = {
|
resource app 'Microsoft.App/containerApps@2024-03-01' = {
|
||||||
name: appConfig.name
|
name: appConfig.name
|
||||||
location: appConfig.location
|
location: appConfig.location
|
||||||
|
tags: appConfig.tags
|
||||||
identity: appConfig.identity
|
identity: appConfig.identity
|
||||||
properties: appConfig.properties
|
properties: appConfig.properties
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
{
|
{
|
||||||
"experimentalFeaturesEnabled": {
|
"experimentalFeaturesEnabled": {
|
||||||
"assertions": true,
|
"resourceTypedParamsAndOutputs": true
|
||||||
"testFramework": true,
|
|
||||||
"extensibility": true,
|
|
||||||
"resourceDerivedTypes": true,
|
|
||||||
"resourceTypedParamsAndOutputs": true,
|
|
||||||
"sourceMapping": true,
|
|
||||||
"symbolicNameCodegen": true
|
|
||||||
},
|
},
|
||||||
"moduleAliases": {
|
"moduleAliases": {
|
||||||
"br": {
|
"br": {
|
||||||
|
|
|
@ -12,9 +12,8 @@ param registryUrl string
|
||||||
param deployedAt string = utcNow('yyyyMMdd')
|
param deployedAt string = utcNow('yyyyMMdd')
|
||||||
|
|
||||||
var context = create_context({
|
var context = create_context({
|
||||||
name: ''
|
|
||||||
project: projectName
|
project: projectName
|
||||||
nameConventionTemplate: '$type-$env-$loc-$project-$name'
|
nameConventionTemplate: '$type-$environment-$location-$project'
|
||||||
location: location
|
location: location
|
||||||
environment: environment
|
environment: environment
|
||||||
deployedAt: deployedAt
|
deployedAt: deployedAt
|
||||||
|
|
|
@ -13,5 +13,6 @@ var logAnalyticsConfig = log_analytics(context, [
|
||||||
resource monitoring 'Microsoft.OperationalInsights/workspaces@2023-09-01' = {
|
resource monitoring 'Microsoft.OperationalInsights/workspaces@2023-09-01' = {
|
||||||
name: logAnalyticsConfig.name
|
name: logAnalyticsConfig.name
|
||||||
location: logAnalyticsConfig.location
|
location: logAnalyticsConfig.location
|
||||||
|
tags: logAnalyticsConfig.tags
|
||||||
properties: logAnalyticsConfig.properties
|
properties: logAnalyticsConfig.properties
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ var registryConfig = container_registry(context, [
|
||||||
resource registry 'Microsoft.ContainerRegistry/registries@2023-07-01' = {
|
resource registry 'Microsoft.ContainerRegistry/registries@2023-07-01' = {
|
||||||
name: registryConfig.name
|
name: registryConfig.name
|
||||||
location: registryConfig.location
|
location: registryConfig.location
|
||||||
|
tags: registryConfig.tags
|
||||||
sku: registryConfig.sku
|
sku: registryConfig.sku
|
||||||
identity: registryConfig.identity
|
identity: registryConfig.identity
|
||||||
properties: registryConfig.properties
|
properties: registryConfig.properties
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue