-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add first batch of code to revision mgmt demo, minor updates to…
… aca-store Signed-off-by: Kristina Devochko <[email protected]>
- Loading branch information
1 parent
0df21e3
commit 39c69e5
Showing
10 changed files
with
165 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,49 @@ | ||
// TODO | ||
targetScope='subscription' | ||
|
||
param acaResourceGroupName string | ||
param environment string | ||
param location string | ||
param locationPrefix string | ||
param tags object | ||
|
||
resource rg 'Microsoft.Resources/resourceGroups@2022-09-01' = { | ||
name: acaResourceGroupName | ||
location: location | ||
} | ||
|
||
module common 'modules/common.bicep' = { | ||
name: 'common' | ||
scope: rg | ||
params: { | ||
environment: environment | ||
location: location | ||
tags: tags | ||
} | ||
} | ||
|
||
module acaenvironment 'modules/aca-environment.bicep' = { | ||
name: 'aca-environment' | ||
scope: rg | ||
params: { | ||
location: location | ||
managedIdentityId: common.outputs.managedIdentityId | ||
tags: tags | ||
} | ||
dependsOn: [common] | ||
} | ||
|
||
module aca 'modules/aca.bicep' = { | ||
name: 'aca' | ||
scope: rg | ||
params: { | ||
environmentId: acaenvironment.outputs.environmentId | ||
location: location | ||
managedIdentityId: common.outputs.managedIdentityId | ||
tags: tags | ||
} | ||
dependsOn: [acaenvironment] | ||
} | ||
|
||
@description('URL for store application') | ||
output storeUrl string = aca.outputs.helloWorldAppUri |
19 changes: 19 additions & 0 deletions
19
aca-revision-and-traffic-management/modules/aca-environment.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
param location string | ||
param managedIdentityId string | ||
param tags object | ||
|
||
resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2023-11-02-preview' = { | ||
name: 'cae-aca-store' | ||
location: location | ||
identity: { | ||
type: 'UserAssigned' | ||
userAssignedIdentities: { | ||
'${managedIdentityId}' : {} | ||
} | ||
} | ||
tags: tags | ||
} | ||
|
||
|
||
output defaultDomain string = containerAppsEnvironment.properties.defaultDomain | ||
output environmentId string = containerAppsEnvironment.id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
param environmentId string | ||
param location string | ||
param managedIdentityId string | ||
param tags object | ||
|
||
resource helloworld 'Microsoft.App/containerApps@2023-05-02-preview' = { | ||
name: 'aca-helloworld' | ||
location: location | ||
tags: tags | ||
identity: { | ||
type: 'UserAssigned' | ||
userAssignedIdentities: { | ||
'${managedIdentityId}' : {} | ||
} | ||
} | ||
properties: { | ||
managedEnvironmentId: environmentId | ||
configuration: { | ||
ingress: { | ||
external: true | ||
targetPort: 80 | ||
transport: 'http' | ||
clientCertificateMode: 'accept' | ||
} | ||
} | ||
template: { | ||
containers: [ | ||
{ | ||
image: 'mcr.microsoft.com/azuredocs/aks-helloworld:v1' | ||
name: 'aca-helloworld' | ||
resources: { | ||
cpu: json('0.5') | ||
memory: '1.0Gi' | ||
} | ||
env: [ | ||
{ | ||
name: 'TITLE' | ||
value: 'Hello World from Azure Container Apps (ACA)!' | ||
} | ||
] | ||
probes: [ | ||
{ | ||
type: 'Liveness' | ||
httpGet: { | ||
path: '/' | ||
port: 80 | ||
} | ||
initialDelaySeconds: 3 | ||
periodSeconds: 3 | ||
failureThreshold: 5 | ||
} | ||
{ | ||
type: 'Readiness' | ||
httpGet: { | ||
path: '/' | ||
port: 80 | ||
} | ||
initialDelaySeconds: 3 | ||
periodSeconds: 3 | ||
failureThreshold: 3 | ||
} | ||
] | ||
} | ||
] | ||
scale: { | ||
minReplicas: 1 | ||
} | ||
} | ||
} | ||
} | ||
|
||
output helloWorldAppUri string = 'https://${helloworld.properties.configuration.ingress.fqdn}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
// TODO | ||
param environment string | ||
param location string | ||
param tags object | ||
|
||
resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { | ||
name: 'uaid-aca-helloworld-common-${environment}' | ||
location: location | ||
tags: tags | ||
} | ||
|
||
output managedIdentityId string = managedIdentity.id | ||
output managedIdentityName string = managedIdentity.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
aca-revision-and-traffic-management/parameters/prod.bicepparam
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
using '../main.bicep' | ||
|
||
param acaResourceGroupName = 'rg-aca-aci-${locationPrefix}-${environment}' | ||
param acaResourceGroupName = 'rg-aca-helloworld-${locationPrefix}-${environment}' | ||
param environment = 'prod' | ||
param location = 'northeurope' | ||
param locationPrefix = 'neu' | ||
|
||
param tags = { | ||
application: 'aca-win-aci' | ||
application: 'aca-revision-traffic-mgmt' | ||
environment: environment | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters