ASA Bicep Template confusing and not complete
Regarding the Bicep Template with the ENTERPRISE Tier , The snippet provided is uncomplete and confusing :
resource agentPools 'Microsoft.AppPlatform/Spring/buildservices/agentPools@2022-03-01-preview' = {
name: '${springCloudInstance.name}/default/default' //The only supported value is 'default'
}
resource springCloudMonitoringSettings 'Microsoft.AppPlatform/Spring/buildservices/builders/buildpackBindings@2022-03-01-preview' = {
name: '${springCloudInstance.name}/default/default/default' //The only supported value is 'default'
- 'default' value is different from '/default/default/default'
- To ensure that value is enforced to be 'default' , it should be set with restristed values in Bicep parameters declaration :
For resource azureSpringAppsMonitoringSettings the name is '${azureSpringApps.name}/${buildServiceName}/${builderName}/${monitoringSettingsName}'
As the each 'default' value stands for , in this order :
- 'default' for Build Service name 'default'
- 'default' for Builder 'default'
- 'default' Build Pack binding name 'default'
so it is indeed: name: '${azureSpringApps.name}/${buildServiceName}/${builderName}/${monitoringSettingsName}'
@description('The Azure Spring Apps monitoring Settings name. Only "default" is supported')
@allowed([
'default'
])
param monitoringSettingsName string = 'default'
@description('The Azure Spring Apps Service Registry name. Only "default" is supported')
@allowed([
'default'
])
param serviceRegistryName string = 'default' // The resource name 'Azure Spring Apps Service Registry' is not valid
@description('The Azure Spring Apps Application Configuration Service name. Only "default" is supported')
@allowed([
'default'
])
param applicationConfigurationServiceName string = 'default'
@description('The Azure Spring Apps API Portal name. Only "default" is supported')
@allowed([
'default'
])
param apiPortalName string = 'default'
@description('The Azure Spring Apps Spring Cloud Gateway name. Only "default" is supported')
@allowed([
'default'
])
param gatewayName string = 'default'
@allowed([
'default'
])
@description('The Azure Spring Apps Application Configuration Service Git Repository name. Only "default" is supported')
param gitRepoName string = 'default'
@description('The Azure Spring Apps Build Agent pool name. Only "default" is supported') // to be checked
@allowed([
'default'
])
param buildAgentPoolName string = 'default'
@description('The Azure Spring Apps Build service name. Only "{azureSpringAppsInstanceName}/default" is supported') // to be checked
param buildServiceName string = 'default'
- Monitoring should described as below:
resource azureSpringAppsMonitoringSettings 'Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings@2022-11-01-preview' = if (azureSpringAppsTier=='Enterprise') {
name: '${azureSpringApps.name}/${buildServiceName}/${builderName}/${monitoringSettingsName}' // default (for Build Service ) /default (Builder) /default (Build Pack binding name)
properties: {
bindingType: 'ApplicationInsights'
launchProperties: {
properties: {
sampling_percentage: '10'
connection_string: appInsights.properties.ConnectionString // /!\ ConnectionString for Enterprise tier , InstrumentationKey for Standard Tier
}
}
}
dependsOn: [
buildService
]
}
configurationservices should be more detailed :
// https://learn.microsoft.com/en-us/azure/templates/microsoft.appplatform/2022-09-01-preview/spring/configurationservices?pivots=deployment-language-bicep
resource appconfigservice 'Microsoft.AppPlatform/Spring/configurationServices@2022-11-01-preview' = if (azureSpringAppsTier=='Enterprise') {
name: applicationConfigurationServiceName
parent: azureSpringApps
properties: {
settings: {
gitProperty: {
repositories: [
{
name: gitRepoName
label: configServerLabel
// https://learn.microsoft.com/en-us/azure/spring-apps/how-to-enterprise-application-configuration-service#pattern
// {profile} - Optional. The name of a profile whose properties you may be retrieving.
// An empty value, or the value default, includes properties that are shared across profiles.
// Non-default values include properties for the specified profile and properties for the default profile.
patterns: [
'application'
]
//searchPaths: [
// '/'
//]
uri: gitConfigURI
}
]
}
}
}
}
gateways should be more detailed
// https://learn.microsoft.com/en-us/azure/templates/microsoft.appplatform/2022-11-01-preview/spring/gateways?pivots=deployment-language-bicep
resource gateway 'Microsoft.AppPlatform/Spring/gateways@2022-11-01-preview' = if (azureSpringAppsTier=='Enterprise') {
name: gatewayName
parent: azureSpringApps
sku: {
name: azureSpringAppsSkuName
capacity: any(1)
tier: azureSpringAppsTier
}
properties: {
corsProperties: {
allowCredentials: false
allowedOrigins: [
'*'
]
allowedMethods: [
'GET'
]
allowedHeaders: [
'*'
]
}
httpsOnly: false
public: true
// az spring gateway update --help
resourceRequests: {
cpu: '1' // CPU resource quantity. Should be 500m or number of CPU cores.
memory: '1Gi' // Memory resource quantity. Should be 512Mi or #Gi, e.g., 1Gi, 3Gi.
}
ssoProperties: {
clientId: apiPortalSsoClientId
clientSecret: apiPortalSsoClientSecret
issuerUri: apiPortalSsoIssuerUri
scope: [
'openid'
'profile'
'email'
]
}
}
}
output gatewayId string = gateway.id
output gatewayUrl string = gateway.properties.url
API Portal should be more detailed
resource apiPortal 'Microsoft.AppPlatform/Spring/apiPortals@2022-11-01-preview' = if (azureSpringAppsTier=='Enterprise') {
name: apiPortalName
parent: azureSpringApps
sku: {
name: azureSpringAppsSkuName
capacity: any(1) // Number of instance ?
tier: azureSpringAppsTier
}
properties: {
gatewayIds: [
'${azureSpringApps.id}/gateways/${gatewayName}'
]
httpsOnly: false
public: true
ssoProperties: {
clientId: apiPortalSsoClientId
clientSecret: apiPortalSsoClientSecret
issuerUri: apiPortalSsoIssuerUri
scope: [
'openid'
'profile'
'email'
]
}
}
}
output apiPortalId string = apiPortal.id
output apiPortalUrl string = apiPortal.properties.url
output gatewayIds array = apiPortal.properties.gatewayIds
routeConfigs should be provided :
resource CustomersGatewayRouteConfig 'Microsoft.AppPlatform/Spring/gateways/routeConfigs@2022-11-01-preview' = if (azureSpringAppsTier=='Enterprise') {
name: 'customers-service-gateway-route-config'
parent: gateway
properties: {
appResourceId: customersserviceapp.id
protocol: 'HTTP'
filters: [
'StripPrefix=0'
]
predicates: [
'/api/customer/**'
'/owners'
]
routes: [
{
description: 'customers-service'
title: 'customers-service'
uri: 'http://customers-service'
order: 1
ssoEnabled: apiPortalSsoEnabled
}
]
}
}
output CustomersGatewayRouteConfigId string = CustomersGatewayRouteConfig.id
output CustomersGatewayRouteConfigAppResourceId string = CustomersGatewayRouteConfig.properties.appResourceId
output CustomersGatewayRouteConfigRoutes array = CustomersGatewayRouteConfig.properties.routes
output CustomersGatewayRouteConfigIsSsoEnabled bool = CustomersGatewayRouteConfig.properties.ssoEnabled
output CustomersGatewayRouteConfigPredicates array = CustomersGatewayRouteConfig.properties.predicates
App bindings should be detailed:
resource customersbinding 'Microsoft.AppPlatform/Spring/apps/bindings@2022-11-01-preview' = if (azureSpringAppsTier=='Enterprise') {
name: 'customers-service-binding'
parent: customersserviceapp
properties: {
bindingParameters: {}
resourceId: customersserviceapp.id
key: 'customers-service' // There is no API Key for MySQL
}
dependsOn: [
serviceRegistry
]
}
The App should be detailed including the addonConfigs for applicationConfigurationService and serviceRegistry :
resource customersserviceapp 'Microsoft.AppPlatform/Spring/apps@2022-11-01-preview' = {
name: 'customers-service'
location: location
parent: azureSpringApps
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'${customersServicedentity.id}': {}
}
}
properties: {
addonConfigs: {
azureMonitor: {
enabled: true
}
applicationConfigurationService: {
resourceId: '${azureSpringApps.id}/configurationServices/${applicationConfigurationServiceName}'
}
serviceRegistry: {
resourceId: '${azureSpringApps.id}/serviceRegistries/${serviceRegistryName}'
}
}
httpsOnly: false
public: true
temporaryDisk: {
mountPath: '/tmp'
sizeInGB: 5
}
}
dependsOn: [
appconfigservice
]
}
ALL the build services should be detailed, not only the agentPools :
resource buildService 'Microsoft.AppPlatform/Spring/buildServices@2022-11-01-preview' existing = if (azureSpringAppsTier=='Enterprise') {
//scope: resourceGroup('my RG')
name: '${azureSpringAppsInstanceName}/${buildServiceName}'
}
resource buildagentpool 'Microsoft.AppPlatform/Spring/buildServices/agentPools@2022-11-01-preview' = if (azureSpringAppsTier=='Enterprise') {
// '{your-service-name}/default/default' //{your-service-name}/{build-service-name}/{agenpool-name}
name: '${azureSpringAppsInstanceName}/${buildServiceName}/${buildAgentPoolName}' // default/default as buildServiceName / agentpoolName
properties: {
poolSize: {
name: 'S1'
}
}
dependsOn: [
azureSpringApps
]
}
// az spring build-service builder create --help
// https://learn.microsoft.com/en-us/azure/spring-apps/how-to-enterprise-build-service?tabs=azure-portal#default-builder-and-tanzu-buildpacks
resource builder 'Microsoft.AppPlatform/Spring/buildServices/builders@2022-11-01-preview' = if (azureSpringAppsTier=='Enterprise') {
name: builderName
parent: buildService
properties: {
buildpackGroups: [
{
buildpacks: [
{
id: 'tanzu-buildpacks/java-azure'
}
]
name: 'java'
}
]
// https://docs.vmware.com/en/VMware-Tanzu-Buildpacks/services/tanzu-buildpacks/GUID-full-stack-release-notes.html
//
stack: {
id: 'io.buildpacks.stacks.bionic' // io.buildpacks.stacks.bionic-base or tanzu-base-bionic-stack ? https://docs.pivotal.io/tanzu-buildpacks/stacks.html , OSS from https://github.com/paketo-buildpacks/java
version: 'base' // 1.2.35 https://network.tanzu.vmware.com/products/tanzu-base-bionic-stack#/releases/1218795/artifact_references
}
}
dependsOn: [
azureSpringApps
]
}
// https://github.com/Azure/Azure-Spring-Apps/issues/28
resource build 'Microsoft.AppPlatform/Spring/buildServices/builds@2022-11-01-preview' = if (azureSpringAppsTier=='Enterprise') {
name: buildName
parent: buildService
properties: {
agentPool: buildagentpool.id
builder: builder.id
env: {}
relativePath: '/'
}
dependsOn: [
azureSpringApps
]
}
- predefinedAccelerators should be documented
resource appAccelerators 'Microsoft.AppPlatform/Spring/applicationAccelerators@2022-11-01-preview' = if (azureSpringAppsTier=='Enterprise') {
name: 'default'
parent: azureSpringApps
sku: {
name: 'S1'
}
}
output appAcceleratorsId string = appAccelerators.id
output appAcceleratorsComponents array = appAccelerators.properties.components
// az spring application-accelerator predefined-accelerator show -n "Acme Fitness Store" -g rg-iac-asa-petclinic-mic-srv
// Acme Fitness Store
// Tanzu Java Restful Web App
// Node Express
// Spring Cloud Serverless
// C# Weather Forecast
resource predefinedAccelerators 'Microsoft.AppPlatform/Spring/applicationAccelerators/predefinedAccelerators@2022-11-01-preview' existing = if (azureSpringAppsTier=='Enterprise') {
name: 'Acme Fitness Store'
parent: appAccelerators
}
output predefinedAcceleratorsId string = predefinedAccelerators.id
output predefinedAcceleratorsName string = predefinedAccelerators.name
output predefinedAcceleratorsDescription string = predefinedAccelerators.properties.description
- applicationLiveViews should be documented
resource appLiveViews 'Microsoft.AppPlatform/Spring/applicationLiveViews@2022-11-01-preview' = if (azureSpringAppsTier=='Enterprise') {
name: 'default'
parent: azureSpringApps
}
output appLiveViewsId string = appLiveViews.id
output appLiveViewsComponents array = appLiveViews.properties.components
See Also https://github.com/Azure/Azure-Spring-Apps/issues/28
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: b9b09efa-c6ea-a491-d8f5-3aeae3a1555f
- Version Independent ID: 4da6e18e-743c-00b4-5484-734c83c9d1bb
- Content: Quickstart - Provision Azure Spring Apps using Bicep
- Content Source: articles/spring-apps/quickstart-deploy-infrastructure-vnet-bicep.md
- Service: spring-apps
- GitHub Login: @KarlErickson
- Microsoft Alias: karler
@ezYakaEagle442 I've delegated this to content author @KarlErickson to review and share his valuable insights.
@ezYakaEagle442 apologies - I missed this earlier. Thanks for the feedback! I've informed the product team so they can take a look.
Please review and fix the doc
We have represented this work in an Azure DevOps work item, and will investigate and fix.
#please-close