Repository navigation
Expand file tree
/
Copy pathacr.bicep
More file actions
81 lines (70 loc) · 2.38 KB
/
Copy pathacr.bicep
File metadata and controls
81 lines (70 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//********************************************
// Parameters
//********************************************
@description('Specifies the prefix for the name of the Azure resources.')
@minLength(2)
param prefix string = take(uniqueString(resourceGroup().id), 4)
@description('Specifies the suffix for the name of the Azure resources.')
@minLength(2)
param suffix string = take(uniqueString(resourceGroup().id), 4)
@description('Specifies the location for all resources.')
param location string = resourceGroup().location
@description('Specifies the name of the Azure Log Analytics resource.')
param logAnalyticsName string = ''
@description('Specifies the service tier of the workspace: Free, Standalone, PerNode, Per-GB.')
@allowed([
'Free'
'Standalone'
'PerNode'
'PerGB2018'
])
param logAnalyticsSku string = 'PerNode'
@description('Specifies the workspace data retention in days. -1 means Unlimited retention for the Unlimited Sku. 730 days is the maximum allowed for all other Skus.')
param logAnalyticsRetentionInDays int = 60
@description('Tier of your Azure Container Registry.')
@allowed([
'Basic'
'Standard'
'Premium'
])
param acrSku string = 'Premium'
@description('Specifies the tags to be applied to the resources.')
param tags object = {
environment: 'test'
iac: 'bicep'
}
//********************************************
// Variables
//********************************************
var acrName = '${prefix}acr${suffix}'
//********************************************
// Modules and Resources
//********************************************
module workspace 'modules/log-analytics.bicep' = {
name: 'workspace'
params: {
// properties
name: empty(logAnalyticsName) ? toLower('${prefix}-log-analytics-${suffix}') : logAnalyticsName
location: location
tags: tags
sku: logAnalyticsSku
retentionInDays: logAnalyticsRetentionInDays
}
}
module containerRegistry './modules/container-registry.bicep' = {
name: 'containerRegistry'
params: {
name: acrName
sku: acrSku
adminUserEnabled: true
workspaceId: workspace.outputs.id
location: location
tags: tags
}
}
//********************************************
// Outputs
//********************************************
output acrName string = containerRegistry.outputs.name
output acrLoginServer string = containerRegistry.outputs.loginServer
output logAnalyticsWorkspaceName string = workspace.outputs.name