-
Notifications
You must be signed in to change notification settings - Fork 418
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regen manifest Prep for multiple tcp ports PR feedback Rules? Fixes Moar fixes Made the endpoint mapping more robust - Added container app context that has a reference to all of the processing contexts. It will handle caching processing contexts. - Resovle host and port based on endpoint mappings Fix bug with additional mapping Move everything to the contexts - Rename ProcessingContext to ContainerAppContext. Make everything private Fixed the formatting More gen Better formatting Full bicep gen Better parameter names More gen Updates Fix formatting Pick the first one Don't throw if there are more than 5 additional endpoints Do port allocation in the bicep generation Fixes Order by group index. Fix and skip a test Fixed test Added target port resolution Fix AI resource Fixed AppInsights issues, deleted old files
- Loading branch information
Showing
66 changed files
with
3,429 additions
and
69 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
65 changes: 65 additions & 0 deletions
65
playground/AzureStorageEndToEnd/AzureStorageEndToEnd.AppHost/api-containerapp.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,65 @@ | ||
param location string | ||
param tags object = {} | ||
param storage_outputs_blobEndpoint string | ||
param default_identity_outputs_id string | ||
param default_identity_outputs_clientId string | ||
param containerAppEnv_outputs_id string | ||
param containerRegistry_outputs_loginServer string | ||
param containerRegistry_outputs_mid string | ||
param api_containerImage string | ||
resource containerApp 'Microsoft.App/containerApps@2023-05-02-preview' = { | ||
name: 'api' | ||
location: location | ||
tags: tags | ||
identity: { | ||
type: 'UserAssigned' | ||
userAssignedIdentities: { | ||
'${default_identity_outputs_id}': {} | ||
} | ||
} | ||
properties: { | ||
environmentId: containerAppEnv_outputs_id | ||
configuration: { | ||
activeRevisionsMode: 'Single' | ||
ingress: { | ||
external: false | ||
targetPort: 8080 | ||
transport: 'http' | ||
additionalPortMappings: [ | ||
{ | ||
external: false | ||
targetPort: 1034 | ||
} | ||
] | ||
} | ||
registries: [ | ||
{ | ||
server: containerRegistry_outputs_loginServer | ||
identity: containerRegistry_outputs_mid | ||
} | ||
] | ||
secrets: [ | ||
{ name: 'connectionstrings--blobs', value: storage_outputs_blobEndpoint } | ||
] | ||
} | ||
template: { | ||
scale: { | ||
minReplicas: 1 | ||
} | ||
containers: [ | ||
{ | ||
image: api_containerImage | ||
name: 'api' | ||
env: [ | ||
{ name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES', value: 'true' } | ||
{ name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES', value: 'true' } | ||
{ name: 'ASPNETCORE_FORWARDEDHEADERS_ENABLED', value: 'true' } | ||
{ name: 'ConnectionStrings__blobs', secretRef: 'connectionstrings--blobs' } | ||
{ name: 'URL', value: 'http://api:1034' } | ||
{ name: 'AZURE_CLIENT_ID', value: default_identity_outputs_clientId } | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
playground/AzureStorageEndToEnd/AzureStorageEndToEnd.AppHost/app.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,48 @@ | ||
param location string | ||
param tags object = {} | ||
param parameters object = {} | ||
param inputs object = {} | ||
module storage 'storage.module.bicep' = { | ||
name: 'storage' | ||
params: { | ||
location: location | ||
principalId: default_identity.outputs.principalId | ||
principalType: 'ServicePrincipal' | ||
} | ||
} | ||
|
||
module containerAppEnv 'containerappenv.bicep' = { | ||
name: 'containerAppEnv' | ||
params: { | ||
location: location | ||
} | ||
} | ||
|
||
module containerRegistry 'containerregistry.bicep' = { | ||
name: 'containerRegistry' | ||
params: { | ||
location: location | ||
} | ||
} | ||
|
||
module default_identity 'default-identity.bicep' = { | ||
name: 'default-identity' | ||
params: { | ||
location: location | ||
} | ||
} | ||
|
||
module api_containerApp 'api-containerapp.bicep' = { | ||
name: 'api-containerApp' | ||
params: { | ||
location: location | ||
storage_outputs_blobEndpoint: storage.outputs.blobEndpoint | ||
default_identity_outputs_id: default_identity.outputs.id | ||
default_identity_outputs_clientId: default_identity.outputs.clientId | ||
containerAppEnv_outputs_id: containerAppEnv.outputs.id | ||
containerRegistry_outputs_loginServer: containerRegistry.outputs.loginServer | ||
containerRegistry_outputs_mid: containerRegistry.outputs.mid | ||
api_containerImage: inputs.api.containerImage | ||
} | ||
} | ||
|
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
34 changes: 34 additions & 0 deletions
34
playground/AzureStorageEndToEnd/AzureStorageEndToEnd.AppHost/containerappenv.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,34 @@ | ||
param location string | ||
param tags object = {} | ||
|
||
var resourceToken = uniqueString(resourceGroup().id) | ||
|
||
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' = { | ||
name: 'law-${resourceToken}' | ||
location: location | ||
properties: { | ||
sku: { | ||
name: 'PerGB2018' | ||
} | ||
} | ||
tags: tags | ||
} | ||
|
||
resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2023-05-01' = { | ||
name: 'cae-${resourceToken}' | ||
location: location | ||
properties: { | ||
appLogsConfiguration: { | ||
destination: 'log-analytics' | ||
logAnalyticsConfiguration: { | ||
customerId: logAnalyticsWorkspace.properties.customerId | ||
sharedKey: logAnalyticsWorkspace.listKeys().primarySharedKey | ||
} | ||
} | ||
} | ||
tags: tags | ||
} | ||
|
||
output id string = containerAppEnvironment.id | ||
output logAnalyticsWorkspaceId string = logAnalyticsWorkspace.id | ||
output defaultDomain string = containerAppEnvironment.properties.defaultDomain |
37 changes: 37 additions & 0 deletions
37
playground/AzureStorageEndToEnd/AzureStorageEndToEnd.AppHost/containerregistry.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,37 @@ | ||
param location string | ||
param tags object = {} | ||
param sku string = 'Basic' | ||
param adminUserEnabled bool = true | ||
|
||
var resourceToken = uniqueString(resourceGroup().id) | ||
|
||
resource containerRegistry 'Microsoft.ContainerRegistry/registries@2023-07-01' = { | ||
name: replace('acr${resourceToken}', '-', '') | ||
location: location | ||
sku: { | ||
name: sku | ||
} | ||
properties: { | ||
adminUserEnabled: adminUserEnabled | ||
} | ||
tags: tags | ||
} | ||
|
||
resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { | ||
name: 'mi-${resourceToken}' | ||
location: location | ||
tags: tags | ||
} | ||
|
||
resource caeMiRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
name: guid(containerRegistry.id, managedIdentity.id, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d')) | ||
scope: containerRegistry | ||
properties: { | ||
principalId: managedIdentity.properties.principalId | ||
principalType: 'ServicePrincipal' | ||
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d') | ||
} | ||
} | ||
|
||
output mid string = managedIdentity.id | ||
output loginServer string = containerRegistry.properties.loginServer |
13 changes: 13 additions & 0 deletions
13
playground/AzureStorageEndToEnd/AzureStorageEndToEnd.AppHost/default-identity.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,13 @@ | ||
param location string | ||
param tags object = {} | ||
|
||
resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { | ||
name: 'cai-${uniqueString(resourceGroup().id)}' | ||
location: location | ||
tags: tags | ||
} | ||
|
||
output id string = identity.id | ||
output clientId string = identity.properties.clientId | ||
output principalId string = identity.properties.principalId | ||
output name string = identity.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
param location string | ||
param tags object = {} | ||
param containerAppEnv_outputs_id string | ||
param containerRegistry_outputs_loginServer string | ||
param containerRegistry_outputs_mid string | ||
param apigateway_containerImage string | ||
resource containerApp 'Microsoft.App/containerApps@2023-05-02-preview' = { | ||
name: 'apigateway' | ||
location: location | ||
tags: tags | ||
properties: { | ||
environmentId: containerAppEnv_outputs_id | ||
configuration: { | ||
activeRevisionsMode: 'Single' | ||
ingress: { | ||
external: false | ||
targetPort: 8080 | ||
transport: 'http' | ||
} | ||
registries: [ | ||
{ | ||
server: containerRegistry_outputs_loginServer | ||
identity: containerRegistry_outputs_mid | ||
} | ||
] | ||
} | ||
template: { | ||
scale: { | ||
minReplicas: 1 | ||
} | ||
containers: [ | ||
{ | ||
image: apigateway_containerImage | ||
name: 'apigateway' | ||
env: [ | ||
{ name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES', value: 'true' } | ||
{ name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES', value: 'true' } | ||
{ name: 'ASPNETCORE_FORWARDEDHEADERS_ENABLED', value: 'true' } | ||
{ name: 'services__basketservice__http__0', value: 'http://basketservice' } | ||
{ name: 'services__basketservice__https__0', value: 'https://basketservice' } | ||
{ name: 'services__catalogservice__http__0', value: 'http://catalogservice' } | ||
{ name: 'services__catalogservice__https__0', value: 'https://catalogservice' } | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.