Skip to content

Commit

Permalink
feat(azure): add tags on azure applications (#957)
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->

## Related Issue(s)

- #{issue number}

## Verification

- [ ] **Your** code builds clean without any errors or warnings
- [ ] Manual testing done (required)
- [ ] Relevant automated test added (if you find this hard, leave it and
we'll help out)

## Documentation

- [ ] Documentation is updated (either in `docs`-directory, Altinnpedia
or a separate linked PR in
[altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if
applicable)
  • Loading branch information
arealmaas authored Aug 1, 2024
1 parent 6c76576 commit 4081922
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .azure/applications/graphql/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ param environmentKeyVaultName string
var namePrefix = 'dp-be-${environment}'
var baseImageUrl = 'ghcr.io/digdir/dialogporten-'

var tags = {
Environment: environment
Product: 'Dialogporten'
}

resource appConfiguration 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = {
name: appConfigurationName
}
Expand Down Expand Up @@ -77,6 +82,7 @@ module containerApp '../../modules/containerApp/main.bicep' = {
envVariables: containerAppEnvVars
containerAppEnvId: containerAppEnvironment.id
apimIp: apimIp
tags: tags
}
}

Expand Down
5 changes: 5 additions & 0 deletions .azure/applications/web-api-eu/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ param environmentKeyVaultName string

var namePrefix = 'dp-be-${environment}'
var baseImageUrl = 'ghcr.io/digdir/dialogporten-'
var tags = {
Environment: environment
Product: 'Dialogporten'
}

resource appConfiguration 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = {
name: appConfigurationName
Expand Down Expand Up @@ -81,6 +85,7 @@ module containerApp '../../modules/containerApp/main.bicep' = {
envVariables: containerAppEnvVars
containerAppEnvId: containerAppEnvironment.id
apimIp: apimIp
tags: tags
}
}

Expand Down
6 changes: 5 additions & 1 deletion .azure/applications/web-api-migration-job/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ param environmentKeyVaultName string

var namePrefix = 'dp-be-${environment}'
var baseImageUrl = 'ghcr.io/digdir/dialogporten-'

var tags = {
Environment: environment
Product: 'Dialogporten'
}
var name = '${namePrefix}-db-migration-job'

resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-03-01' existing = {
Expand Down Expand Up @@ -58,6 +61,7 @@ module migrationJob '../../modules/containerAppJob/main.bicep' = {
containerAppEnvId: containerAppEnvironment.id
environmentVariables: containerAppEnvVars
secrets: secrets
tags: tags
}
}

Expand Down
5 changes: 5 additions & 0 deletions .azure/applications/web-api-so/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ param environmentKeyVaultName string

var namePrefix = 'dp-be-${environment}'
var baseImageUrl = 'ghcr.io/digdir/dialogporten-'
var tags = {
Environment: environment
Product: 'Dialogporten'
}

resource appConfiguration 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = {
name: appConfigurationName
Expand Down Expand Up @@ -85,6 +89,7 @@ module containerApp '../../modules/containerApp/main.bicep' = {
envVariables: containerAppEnvVars
containerAppEnvId: containerAppEnvironment.id
apimIp: apimIp
tags: tags
}
}

Expand Down
4 changes: 4 additions & 0 deletions .azure/modules/containerApp/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ param apimIp string?
@description('The ID of the container app environment')
param containerAppEnvId string

@description('The tags to be applied to the container app')
param tags object

var probes = [
{
periodSeconds: 5
Expand Down Expand Up @@ -83,6 +86,7 @@ resource containerApp 'Microsoft.App/containerApps@2024-03-01' = {
]
}
}
tags: tags
}

output identityPrincipalId string = containerApp.identity.principalId
Expand Down
4 changes: 4 additions & 0 deletions .azure/modules/containerAppJob/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ param environmentVariables { name: string, value: string?, secretRef: string? }[
@description('The secrets to be used in the job')
param secrets { name: string, keyVaultUrl: string, identity: 'System' }[] = []

@description('The tags to be applied to the job')
param tags object

resource job 'Microsoft.App/jobs@2024-03-01' = {
name: name
location: location
Expand Down Expand Up @@ -44,6 +47,7 @@ resource job 'Microsoft.App/jobs@2024-03-01' = {
]
}
}
tags: tags
}

output identityPrincipalId string = job.identity.principalId
Expand Down

0 comments on commit 4081922

Please sign in to comment.