score-aca
is a Score implementation of the Score specification for Azure Container Apps.
When executing the following command, the file score.yaml
is created with the following content:
go run ./cmd/score-aca init
apiVersion: score.dev/v1b1
containers:
main:
image: stefanprodan/podinfo
metadata:
name: example
service:
ports:
web:
port: 8080
To generate a Bicep file from the score.yaml
, execute the following command:
go run ./cmd/score-aca generate score.yaml
The output manifests.bicep
contains the following which indicates:
- The environment that will hold all other resources.
- The Azure Container App based on Container Image.
// Generated by score-aca
// Azure Container Apps Bicep manifest
// Parameters
param environmentName string = 'example-environment'
param containerAppName string = 'example-container-app'
param location string = resourceGroup().location
// Container App Environment
resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-03-01' = {
name: environmentName
location: location
properties: {
appLogsConfiguration: {
destination: 'azure-monitor'
}
}
}
// Container App
resource containerApp 'Microsoft.App/containerApps@2024-03-01' = {
name: containerAppName
location: location
properties: {
environmentId: containerAppEnvironment.id
configuration: {
ingress: {
external: true
targetPort: 8080
}
}
template: {
containers: [
{
name: 'main'
image: 'stefanprodan/podinfo'
}
]
}
}
}
// Outputs
output containerAppFQDN string = containerApp.properties.configuration.ingress.fqdn
export LOCATION="eastus"
export RESOURCE_GROUP="rg-score-aca"
az login
# or
az login --use-device-code
az group create --name ${RESOURCE_GROUP} --location ${LOCATION}
az deployment group create --resource-group "${RESOURCE_GROUP}" --template-file ./manifests.bicep
Most code files here retain the Apache licence header since they were copied or adapted from the reference score-compose
which is Apache licensed. Any modifications to these files should retain the Apache licence and attribution.