Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: avm/res/app/container-app #833

Merged
merged 51 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0e62948
Initial copy from CARML
oZakari Dec 12, 2023
7575352
Initial workflow for AVM container app
oZakari Dec 12, 2023
7a7d6fa
Fix container app references
oZakari Dec 12, 2023
fcf14f6
Changed [[namePrefix]] to #_namePrefix_# to avoid Bicep compilation i…
oZakari Dec 13, 2023
64d686b
Align serviceShort param with AVM
oZakari Dec 13, 2023
400e1c0
Add diagnostic settings to containr app
oZakari Dec 14, 2023
a79d00f
Update api versions to latest
oZakari Dec 14, 2023
325e804
Merge branch 'main' of https://github.com/Azure/bicep-registry-module…
oZakari Dec 14, 2023
0d6fd9d
Update api version of rg
oZakari Jan 2, 2024
69fecc8
Merge branch 'main' of https://github.com/Azure/bicep-registry-module…
oZakari Jan 2, 2024
c89464e
Updating various api versions
oZakari Jan 2, 2024
9930503
Update readme.md and main.json
oZakari Jan 3, 2024
b043a0e
Change enableDefaultTelemetry to enableTelemetry
oZakari Jan 3, 2024
6b3e060
Fix serviceShort name for default test
oZakari Jan 3, 2024
4ab3582
Fix telemetry resource
oZakari Jan 3, 2024
d3127de
Fix telemetry resource
oZakari Jan 3, 2024
7ef9191
Merge branch 'container-apps' of https://github.com/oZakari/bicep-reg…
oZakari Jan 3, 2024
2cfc7d6
Merge branch 'main' of https://github.com/Azure/bicep-registry-module…
oZakari Jan 19, 2024
f7ed1a0
Update avm/res/app/container-app/version.json
oZakari Jan 19, 2024
ed2565a
Merge branch 'main' of https://github.com/Azure/bicep-registry-module…
oZakari Jan 19, 2024
fd518ab
Merge branch 'container-apps' of https://github.com/oZakari/bicep-reg…
oZakari Jan 19, 2024
dae8768
Update avm/res/app/container-app/main.bicep
oZakari Jan 19, 2024
908a432
Update avm/res/app/container-app/main.bicep
oZakari Jan 19, 2024
8a1af0d
Update avm/res/app/container-app/main.bicep
oZakari Jan 19, 2024
30dcf00
Undo unintentional change to batch account
oZakari Jan 19, 2024
6443274
Update avm/res/app/container-app/tests/e2e/defaults/main.test.bicep
oZakari Jan 19, 2024
a28f0e5
Update avm/res/app/container-app/tests/e2e/defaults/main.test.bicep
oZakari Jan 19, 2024
b2d8ded
Update avm/res/app/container-app/tests/e2e/max/main.test.bicep
oZakari Jan 19, 2024
ce170d9
Update avm/res/app/container-app/tests/e2e/max/main.test.bicep
oZakari Jan 19, 2024
d2aed9d
Update avm/res/app/container-app/tests/e2e/max/dependencies.bicep
oZakari Jan 19, 2024
cf49b4f
Update avm/res/app/container-app/tests/e2e/waf-aligned/main.test.bicep
oZakari Jan 19, 2024
908c939
Update avm/res/app/container-app/tests/e2e/waf-aligned/main.test.bicep
oZakari Jan 19, 2024
a6b19d5
Update avm/res/app/container-app/main.bicep
oZakari Jan 19, 2024
fd46424
Uncommented line for container-app within codeowners
oZakari Jan 19, 2024
dad0ff2
Merge branch 'container-apps' of https://github.com/oZakari/bicep-reg…
oZakari Jan 19, 2024
eda69e5
Switch pipeline agent to support latest ubuntu version
oZakari Jan 19, 2024
255d96c
Update readme and main.json
oZakari Jan 19, 2024
b78cba8
Update readme.md
oZakari Jan 19, 2024
e446ad5
Add additional WAF poperties for test
oZakari Jan 19, 2024
0ed8732
Update readme.md for waf additions
oZakari Jan 19, 2024
96817eb
Removed secrets as not applicable for WAF
oZakari Jan 19, 2024
1357cdf
Fix telemetry resource
oZakari Jan 19, 2024
d477e0e
Fixed role assignment udt
oZakari Jan 19, 2024
c4ede3e
Merge branch 'main' of https://github.com/Azure/bicep-registry-module…
oZakari Jan 22, 2024
000f11a
Attempt to fix readme.md
oZakari Jan 22, 2024
11f4509
Remove extra line
oZakari Jan 23, 2024
0fa64f0
Adjust allLogs capitalization
oZakari Jan 23, 2024
6113d9a
Remove diagnostic settings
oZakari Jan 23, 2024
094f24c
Update readme and main.json
oZakari Jan 23, 2024
a25aabe
Fix readme.md
oZakari Jan 23, 2024
4270fec
Merge branch 'main' into container-apps
oZakari Jan 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 0 additions & 129 deletions avm/res/app/container-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ This module deploys a Container App.
| `Microsoft.App/containerApps` | [2023-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.App/2023-05-01/containerApps) |
| `Microsoft.Authorization/locks` | [2020-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-05-01/locks) |
| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |

## Usage examples

Expand Down Expand Up @@ -150,14 +149,6 @@ module containerApp 'br/public:avm/res/app/container-app:<version>' = {
environmentId: '<environmentId>'
name: 'acamax001'
// Non-required parameters
diagnosticSettings: [
{
eventHubAuthorizationRuleResourceId: '<eventHubAuthorizationRuleResourceId>'
eventHubName: '<eventHubName>'
storageAccountResourceId: '<storageAccountResourceId>'
workspaceResourceId: '<workspaceResourceId>'
}
]
location: '<location>'
lock: {
kind: 'CanNotDelete'
Expand Down Expand Up @@ -250,16 +241,6 @@ module containerApp 'br/public:avm/res/app/container-app:<version>' = {
"value": "acamax001"
},
// Non-required parameters
"diagnosticSettings": {
"value": [
{
"eventHubAuthorizationRuleResourceId": "<eventHubAuthorizationRuleResourceId>",
"eventHubName": "<eventHubName>",
"storageAccountResourceId": "<storageAccountResourceId>",
"workspaceResourceId": "<workspaceResourceId>"
}
]
},
"location": {
"value": "<location>"
},
Expand Down Expand Up @@ -362,14 +343,6 @@ module containerApp 'br/public:avm/res/app/container-app:<version>' = {
environmentId: '<environmentId>'
name: 'acawaf001'
// Non-required parameters
diagnosticSettings: [
{
eventHubAuthorizationRuleResourceId: '<eventHubAuthorizationRuleResourceId>'
eventHubName: '<eventHubName>'
storageAccountResourceId: '<storageAccountResourceId>'
workspaceResourceId: '<workspaceResourceId>'
}
]
ingressAllowInsecure: false
ingressExternal: false
location: '<location>'
Expand Down Expand Up @@ -439,16 +412,6 @@ module containerApp 'br/public:avm/res/app/container-app:<version>' = {
"value": "acawaf001"
},
// Non-required parameters
"diagnosticSettings": {
"value": [
{
"eventHubAuthorizationRuleResourceId": "<eventHubAuthorizationRuleResourceId>",
"eventHubName": "<eventHubName>",
"storageAccountResourceId": "<storageAccountResourceId>",
"workspaceResourceId": "<workspaceResourceId>"
}
]
},
"ingressAllowInsecure": {
"value": false
},
Expand Down Expand Up @@ -502,7 +465,6 @@ module containerApp 'br/public:avm/res/app/container-app:<version>' = {
| [`activeRevisionsMode`](#parameter-activerevisionsmode) | string | ActiveRevisionsMode controls how active revisions are handled for the Container app. |
| [`customDomains`](#parameter-customdomains) | array | Custom domain bindings for Container App hostnames. |
| [`dapr`](#parameter-dapr) | object | Dapr configuration for the Container App. |
| [`diagnosticSettings`](#parameter-diagnosticsettings) | array | The diagnostic settings of the service. |
| [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. |
| [`exposedPort`](#parameter-exposedport) | int | Exposed Port in containers for TCP traffic from ingress. |
| [`ingressAllowInsecure`](#parameter-ingressallowinsecure) | bool | Bool indicating if HTTP connections to is allowed. If set to false HTTP connections are automatically redirected to HTTPS connections. |
Expand Down Expand Up @@ -582,97 +544,6 @@ Dapr configuration for the Container App.
- Type: object
- Default: `{}`

### Parameter: `diagnosticSettings`

The diagnostic settings of the service.

- Required: No
- Type: array

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`eventHubAuthorizationRuleResourceId`](#parameter-diagnosticsettingseventhubauthorizationruleresourceid) | string | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| [`eventHubName`](#parameter-diagnosticsettingseventhubname) | string | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
| [`logAnalyticsDestinationType`](#parameter-diagnosticsettingsloganalyticsdestinationtype) | string | A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type. |
| [`logCategoriesAndGroups`](#parameter-diagnosticsettingslogcategoriesandgroups) | array | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
| [`marketplacePartnerResourceId`](#parameter-diagnosticsettingsmarketplacepartnerresourceid) | string | The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. |
| [`metricCategories`](#parameter-diagnosticsettingsmetriccategories) | array | The name of metrics that will be streamed. "allMetrics" includes all possible metrics for the resource. Set to '' to disable metric collection. |
| [`name`](#parameter-diagnosticsettingsname) | string | The name of diagnostic setting. |
| [`storageAccountResourceId`](#parameter-diagnosticsettingsstorageaccountresourceid) | string | Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
| [`workspaceResourceId`](#parameter-diagnosticsettingsworkspaceresourceid) | string | Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |

### Parameter: `diagnosticSettings.eventHubAuthorizationRuleResourceId`

Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to.

- Required: No
- Type: string

### Parameter: `diagnosticSettings.eventHubName`

Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.

- Required: No
- Type: string

### Parameter: `diagnosticSettings.logAnalyticsDestinationType`

A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type.

- Required: No
- Type: string
- Allowed:
```Bicep
[
'AzureDiagnostics'
'Dedicated'
]
```

### Parameter: `diagnosticSettings.logCategoriesAndGroups`

The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection.

- Required: No
- Type: array

### Parameter: `diagnosticSettings.marketplacePartnerResourceId`

The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.

- Required: No
- Type: string

### Parameter: `diagnosticSettings.metricCategories`

The name of metrics that will be streamed. "allMetrics" includes all possible metrics for the resource. Set to '' to disable metric collection.

- Required: No
- Type: array

### Parameter: `diagnosticSettings.name`

The name of diagnostic setting.

- Required: No
- Type: string

### Parameter: `diagnosticSettings.storageAccountResourceId`

Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.

- Required: No
- Type: string

### Parameter: `diagnosticSettings.workspaceResourceId`

Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.

- Required: No
- Type: string

### Parameter: `enableTelemetry`

Enable/Disable usage telemetry for module.
Expand Down
67 changes: 0 additions & 67 deletions avm/res/app/container-app/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ param tags object?
@description('Optional. Collection of private container registry credentials for containers used by the Container app.')
param registries array = []

@description('Optional. The diagnostic settings of the service.')
param diagnosticSettings diagnosticSettingType

@description('Optional. The managed identity definition for this resource.')
param managedIdentities managedIdentitiesType

Expand Down Expand Up @@ -194,32 +191,6 @@ resource containerApp 'Microsoft.App/containerApps@2023-05-01' = {
}
}

resource containerApp_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = [for (diagnosticSetting, index) in (diagnosticSettings ?? []): {
oZakari marked this conversation as resolved.
Show resolved Hide resolved
name: diagnosticSetting.?name ?? '${name}-diagnosticSettings'
properties: {
storageAccountId: diagnosticSetting.?storageAccountResourceId
workspaceId: diagnosticSetting.?workspaceResourceId
eventHubAuthorizationRuleId: diagnosticSetting.?eventHubAuthorizationRuleResourceId
eventHubName: diagnosticSetting.?eventHubName
metrics: diagnosticSetting.?metricCategories ?? [
{
category: 'AllMetrics'
timeGrain: null
enabled: true
}
]
logs: diagnosticSetting.?logCategoriesAndGroups ?? [
{
categoryGroup: 'AllLogs'
enabled: true
}
]
marketplacePartnerId: diagnosticSetting.?marketplacePartnerResourceId
logAnalyticsDestinationType: diagnosticSetting.?logAnalyticsDestinationType
}
scope: containerApp
}]

resource containerApp_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!empty(lock ?? {}) && lock.?kind != 'None') {
name: lock.?name ?? 'lock-${name}'
properties: {
Expand Down Expand Up @@ -262,44 +233,6 @@ output location string = containerApp.location
// Definitions //
// =============== //

type diagnosticSettingType = {
@description('Optional. The name of diagnostic setting.')
name: string?

@description('Optional. The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to \'\' to disable log collection.')
logCategoriesAndGroups: {
@description('Optional. Name of a Diagnostic Log category for a resource type this setting is applied to. Set the specific logs to collect here.')
category: string?

@description('Optional. Name of a Diagnostic Log category group for a resource type this setting is applied to. Set to \'AllLogs\' to collect all logs.')
categoryGroup: string?
}[]?

@description('Optional. The name of metrics that will be streamed. "allMetrics" includes all possible metrics for the resource. Set to \'\' to disable metric collection.')
metricCategories: {
@description('Required. Name of a Diagnostic Metric category for a resource type this setting is applied to. Set to \'AllMetrics\' to collect all metrics.')
category: string
}[]?

@description('Optional. A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type.')
logAnalyticsDestinationType: ('Dedicated' | 'AzureDiagnostics')?

@description('Optional. Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
workspaceResourceId: string?

@description('Optional. Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
storageAccountResourceId: string?

@description('Optional. Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to.')
eventHubAuthorizationRuleResourceId: string?

@description('Optional. Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
eventHubName: string?

@description('Optional. The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.')
marketplacePartnerResourceId: string?
}[]?

type managedIdentitiesType = {
@description('Optional. Enables system assigned managed identity on the resource.')
systemAssigned: bool?
Expand Down
Loading