Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 3 additions & 4 deletions cli/azd/internal/scaffold/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@ func Execute(
func supportingFiles(spec InfraSpec) []string {
files := []string{"/abbreviations.json"}

if spec.DbRedis != nil {
files = append(files, "/modules/set-redis-conn.bicep")
}

if len(spec.Services) > 0 {
if spec.DbRedis != nil {
files = append(files, "/modules/set-redis-conn.bicep")
}
files = append(files, "/modules/fetch-container-image.bicep")
}

Expand Down
4 changes: 4 additions & 0 deletions cli/azd/resources/scaffold/templates/resources.bicept
Comment thread
JeffreyCA marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ module cosmos 'br/public:avm/res/document-db/database-account:0.8.1' = {
}
]
{{- end}}
{{- if .Services}}
secretsExportConfiguration: {
keyVaultResourceId: keyVault.outputs.resourceId
primaryWriteConnectionStringSecretName: 'MONGODB-URL'
}
{{- end}}
capabilitiesToAdd: [ 'EnableServerless' ]
}
}
Expand Down Expand Up @@ -398,6 +400,7 @@ module redis 'br/public:avm/res/cache/redis:0.3.2' = {
}
}

{{- if .Services}}
module redisConn './modules/set-redis-conn.bicep' = {
name: 'redisConn'
params: {
Expand All @@ -408,6 +411,7 @@ module redisConn './modules/set-redis-conn.bicep' = {
}
}
{{- end}}
{{- end}}

{{- if .Services}}
// Create a keyvault to store secrets
Expand Down