Skip to content

Commit b59e347

Browse files
committed
raw copy from src
1 parent e193da4 commit b59e347

18 files changed

+176
-45
lines changed

infra/core/ai/cognitiveservices.bicep

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1+
metadata description = 'Creates an Azure Cognitive Services instance.'
12
param name string
23
param location string = resourceGroup().location
34
param tags object = {}
45
@description('The custom subdomain name used to access the API. Defaults to the value of the name parameter.')
56
param customSubDomainName string = name
6-
7-
7+
param disableLocalAuth bool = false
88
param deployments array = []
99
param kind string = 'OpenAI'
1010

1111
@allowed([ 'Enabled', 'Disabled' ])
1212
param publicNetworkAccess string = 'Enabled'
13-
1413
param sku object = {
1514
name: 'S0'
1615
}
@@ -32,6 +31,7 @@ resource account 'Microsoft.CognitiveServices/accounts@2023-05-01' = {
3231
customSubDomainName: customSubDomainName
3332
publicNetworkAccess: publicNetworkAccess
3433
networkAcls: networkAcls
34+
disableLocalAuth: disableLocalAuth
3535
}
3636
sku: sku
3737
}
@@ -51,5 +51,6 @@ resource deployment 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01
5151
}]
5252

5353
output endpoint string = account.properties.endpoint
54+
output endpoints object = account.properties.endpoints
5455
output id string = account.id
5556
output name string = account.name

infra/core/host/appservice.bicep

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,6 @@ resource appService 'Microsoft.Web/sites@2022-03-01' = {
6565

6666
identity: { type: managedIdentity ? 'SystemAssigned' : 'None' }
6767

68-
resource configLogs 'config' = {
69-
name: 'logs'
70-
properties: {
71-
applicationLogs: { fileSystem: { level: 'Verbose' } }
72-
detailedErrorMessages: { enabled: true }
73-
failedRequestsTracing: { enabled: true }
74-
httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } }
75-
}
76-
}
77-
7868
resource basicPublishingCredentialsPoliciesFtp 'basicPublishingCredentialsPolicies' = {
7969
name: 'ftp'
8070
properties: {
@@ -90,7 +80,9 @@ resource appService 'Microsoft.Web/sites@2022-03-01' = {
9080
}
9181
}
9282

93-
module config 'appservice-appsettings.bicep' = if (!empty(appSettings)) {
83+
// Updates to the single Microsoft.sites/web/config resources that need to be performed sequentially
84+
// sites/web/config 'appsettings'
85+
module configAppSettings 'appservice-appsettings.bicep' = {
9486
name: '${name}-appSettings'
9587
params: {
9688
name: appService.name
@@ -99,12 +91,25 @@ module config 'appservice-appsettings.bicep' = if (!empty(appSettings)) {
9991
SCM_DO_BUILD_DURING_DEPLOYMENT: string(scmDoBuildDuringDeployment)
10092
ENABLE_ORYX_BUILD: string(enableOryxBuild)
10193
},
102-
runtimeName == 'python' && appCommandLine == '' ? { PYTHON_ENABLE_GUNICORN_MULTIWORKERS: 'true' } : {},
94+
runtimeName == 'python' && appCommandLine == '' ? { PYTHON_ENABLE_GUNICORN_MULTIWORKERS: 'true'} : {},
10395
!empty(applicationInsightsName) ? { APPLICATIONINSIGHTS_CONNECTION_STRING: applicationInsights.properties.ConnectionString } : {},
10496
!empty(keyVaultName) ? { AZURE_KEY_VAULT_ENDPOINT: keyVault.properties.vaultUri } : {})
10597
}
10698
}
10799

100+
// sites/web/config 'logs'
101+
resource configLogs 'Microsoft.Web/sites/config@2022-03-01' = {
102+
name: 'logs'
103+
parent: appService
104+
properties: {
105+
applicationLogs: { fileSystem: { level: 'Verbose' } }
106+
detailedErrorMessages: { enabled: true }
107+
failedRequestsTracing: { enabled: true }
108+
httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } }
109+
}
110+
dependsOn: [configAppSettings]
111+
}
112+
108113
resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = if (!(empty(keyVaultName))) {
109114
name: keyVaultName
110115
}

infra/core/host/container-app-upsert.bicep

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
metadata description = 'Creates or updates an existing Azure Container App.'
12
param name string
23
param location string = resourceGroup().location
34
param tags object = {}
@@ -25,6 +26,9 @@ param containerName string = 'main'
2526
@description('The name of the container registry')
2627
param containerRegistryName string = ''
2728

29+
@description('Hostname suffix for container registry. Set when deploying to sovereign clouds')
30+
param containerRegistryHostSuffix string = 'azurecr.io'
31+
2832
@allowed([ 'http', 'grpc' ])
2933
@description('The protocol used by Dapr to connect to the app, e.g., HTTP or gRPC')
3034
param daprAppProtocol string = 'http'
@@ -52,12 +56,13 @@ param identityName string = ''
5256
param imageName string = ''
5357

5458
@description('The secrets required for the container')
55-
param secrets array = []
59+
@secure()
60+
param secrets object = {}
5661

5762
@description('The environment variables for the container')
5863
param env array = []
5964

60-
@description('Specifies if the resource is external')
65+
@description('Specifies if the resource ingress is exposed externally')
6166
param external bool = true
6267

6368
@description('The service binds associated with the container')
@@ -66,7 +71,7 @@ param serviceBinds array = []
6671
@description('The target port for the container')
6772
param targetPort int = 80
6873

69-
resource existingApp 'Microsoft.App/containerApps@2023-04-01-preview' existing = if (exists) {
74+
resource existingApp 'Microsoft.App/containerApps@2023-05-02-preview' existing = if (exists) {
7075
name: name
7176
}
7277

@@ -82,6 +87,7 @@ module app 'container-app.bicep' = {
8287
containerName: containerName
8388
containerAppsEnvironmentName: containerAppsEnvironmentName
8489
containerRegistryName: containerRegistryName
90+
containerRegistryHostSuffix: containerRegistryHostSuffix
8591
containerCpuCoreCount: containerCpuCoreCount
8692
containerMemory: containerMemory
8793
containerMinReplicas: containerMinReplicas

infra/core/host/container-app.bicep

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
metadata description = 'Creates a container app in an Azure Container App environment.'
12
param name string
23
param location string = resourceGroup().location
34
param tags object = {}
@@ -27,6 +28,9 @@ param containerName string = 'main'
2728
@description('The name of the container registry')
2829
param containerRegistryName string = ''
2930

31+
@description('Hostname suffix for container registry. Set when deploying to sovereign clouds')
32+
param containerRegistryHostSuffix string = 'azurecr.io'
33+
3034
@description('The protocol used by Dapr to connect to the app, e.g., http or grpc')
3135
@allowed([ 'http', 'grpc' ])
3236
param daprAppProtocol string = 'http'
@@ -40,7 +44,7 @@ param daprEnabled bool = false
4044
@description('The environment variables for the container')
4145
param env array = []
4246

43-
@description('Specifies if the resource is external')
47+
@description('Specifies if the resource ingress is exposed externally')
4448
param external bool = true
4549

4650
@description('The name of the user-assigned identity')
@@ -59,7 +63,8 @@ param ingressEnabled bool = true
5963
param revisionMode string = 'Single'
6064

6165
@description('The secrets required for the container')
62-
param secrets array = []
66+
@secure()
67+
param secrets object = {}
6368

6469
@description('The service binds associated with the container')
6570
param serviceBinds array = []
@@ -88,7 +93,7 @@ module containerRegistryAccess '../security/registry-access.bicep' = if (usePriv
8893
}
8994
}
9095

91-
resource app 'Microsoft.App/containerApps@2023-04-01-preview' = {
96+
resource app 'Microsoft.App/containerApps@2023-05-02-preview' = {
9297
name: name
9398
location: location
9499
tags: tags
@@ -119,11 +124,14 @@ resource app 'Microsoft.App/containerApps@2023-04-01-preview' = {
119124
appProtocol: daprAppProtocol
120125
appPort: ingressEnabled ? targetPort : 0
121126
} : { enabled: false }
122-
secrets: secrets
127+
secrets: [for secret in items(secrets): {
128+
name: secret.key
129+
value: secret.value
130+
}]
123131
service: !empty(serviceType) ? { type: serviceType } : null
124132
registries: usePrivateRegistry ? [
125133
{
126-
server: '${containerRegistryName}.azurecr.io'
134+
server: '${containerRegistryName}.${containerRegistryHostSuffix}'
127135
identity: userIdentity.id
128136
}
129137
] : []
@@ -149,7 +157,7 @@ resource app 'Microsoft.App/containerApps@2023-04-01-preview' = {
149157
}
150158
}
151159

152-
resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2023-04-01-preview' existing = {
160+
resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2023-05-01' existing = {
153161
name: containerAppsEnvironmentName
154162
}
155163

infra/core/host/container-apps-environment.bicep

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
metadata description = 'Creates an Azure Container Apps environment.'
12
param name string
23
param location string = resourceGroup().location
34
param tags object = {}
@@ -11,7 +12,7 @@ param daprEnabled bool = false
1112
@description('Name of the Log Analytics workspace')
1213
param logAnalyticsWorkspaceName string
1314

14-
resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2023-04-01-preview' = {
15+
resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2023-05-01' = {
1516
name: name
1617
location: location
1718
tags: tags

infra/core/host/container-apps.bicep

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
metadata description = 'Creates an Azure Container Registry and an Azure Container Apps environment.'
12
param name string
23
param location string = resourceGroup().location
34
param tags object = {}
45

56
param containerAppsEnvironmentName string
67
param containerRegistryName string
78
param containerRegistryResourceGroupName string = ''
9+
param containerRegistryAdminUserEnabled bool = false
810
param logAnalyticsWorkspaceName string
911
param applicationInsightsName string = ''
1012

@@ -25,6 +27,7 @@ module containerRegistry 'container-registry.bicep' = {
2527
params: {
2628
name: containerRegistryName
2729
location: location
30+
adminUserEnabled: containerRegistryAdminUserEnabled
2831
tags: tags
2932
}
3033
}

infra/core/host/container-registry.bicep

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
metadata description = 'Creates an Azure Container Registry.'
12
param name string
23
param location string = resourceGroup().location
34
param tags object = {}
@@ -8,6 +9,11 @@ param adminUserEnabled bool = false
89
@description('Indicates whether anonymous pull is enabled')
910
param anonymousPullEnabled bool = false
1011

12+
@description('Azure ad authentication as arm policy settings')
13+
param azureADAuthenticationAsArmPolicy object = {
14+
status: 'enabled'
15+
}
16+
1117
@description('Indicates whether data endpoint is enabled')
1218
param dataEndpointEnabled bool = false
1319

@@ -16,25 +22,59 @@ param encryption object = {
1622
status: 'disabled'
1723
}
1824

25+
@description('Export policy settings')
26+
param exportPolicy object = {
27+
status: 'enabled'
28+
}
29+
30+
@description('Metadata search settings')
31+
param metadataSearch string = 'Disabled'
32+
1933
@description('Options for bypassing network rules')
2034
param networkRuleBypassOptions string = 'AzureServices'
2135

2236
@description('Public network access setting')
2337
param publicNetworkAccess string = 'Enabled'
2438

39+
@description('Quarantine policy settings')
40+
param quarantinePolicy object = {
41+
status: 'disabled'
42+
}
43+
44+
@description('Retention policy settings')
45+
param retentionPolicy object = {
46+
days: 7
47+
status: 'disabled'
48+
}
49+
50+
@description('Scope maps setting')
51+
param scopeMaps array = []
52+
2553
@description('SKU settings')
2654
param sku object = {
2755
name: 'Basic'
2856
}
2957

58+
@description('Soft delete policy settings')
59+
param softDeletePolicy object = {
60+
retentionDays: 7
61+
status: 'disabled'
62+
}
63+
64+
@description('Trust policy settings')
65+
param trustPolicy object = {
66+
type: 'Notary'
67+
status: 'disabled'
68+
}
69+
3070
@description('Zone redundancy setting')
3171
param zoneRedundancy string = 'Disabled'
3272

3373
@description('The log analytics workspace ID used for logging and monitoring')
3474
param workspaceId string = ''
3575

36-
// 2022-02-01-preview needed for anonymousPullEnabled
37-
resource containerRegistry 'Microsoft.ContainerRegistry/registries@2022-02-01-preview' = {
76+
// 2023-11-01-preview needed for metadataSearch
77+
resource containerRegistry 'Microsoft.ContainerRegistry/registries@2023-11-01-preview' = {
3878
name: name
3979
location: location
4080
tags: tags
@@ -44,10 +84,24 @@ resource containerRegistry 'Microsoft.ContainerRegistry/registries@2022-02-01-pr
4484
anonymousPullEnabled: anonymousPullEnabled
4585
dataEndpointEnabled: dataEndpointEnabled
4686
encryption: encryption
87+
metadataSearch: metadataSearch
4788
networkRuleBypassOptions: networkRuleBypassOptions
89+
policies:{
90+
quarantinePolicy: quarantinePolicy
91+
trustPolicy: trustPolicy
92+
retentionPolicy: retentionPolicy
93+
exportPolicy: exportPolicy
94+
azureADAuthenticationAsArmPolicy: azureADAuthenticationAsArmPolicy
95+
softDeletePolicy: softDeletePolicy
96+
}
4897
publicNetworkAccess: publicNetworkAccess
4998
zoneRedundancy: zoneRedundancy
5099
}
100+
101+
resource scopeMap 'scopeMaps' = [for scopeMap in scopeMaps: {
102+
name: scopeMap.name
103+
properties: scopeMap.properties
104+
}]
51105
}
52106

53107
// TODO: Update diagnostics to be its own module
@@ -78,5 +132,6 @@ resource diagnostics 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview'
78132
}
79133
}
80134

135+
output id string = containerRegistry.id
81136
output loginServer string = containerRegistry.properties.loginServer
82137
output name string = containerRegistry.name

infra/core/monitor/applicationinsights-dashboard.bicep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
metadata description = 'Creates a dashboard for an Application Insights instance.'
12
param name string
23
param applicationInsightsName string
34
param location string = resourceGroup().location

infra/core/monitor/applicationinsights.bicep

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
metadata description = 'Creates an Application Insights instance based on an existing Log Analytics workspace.'
12
param name string
2-
param dashboardName string
3+
param dashboardName string = ''
34
param location string = resourceGroup().location
45
param tags object = {}
5-
param includeDashboard bool = true
66
param logAnalyticsWorkspaceId string
77

88
resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
@@ -16,7 +16,7 @@ resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
1616
}
1717
}
1818

19-
module applicationInsightsDashboard 'applicationinsights-dashboard.bicep' = if (includeDashboard) {
19+
module applicationInsightsDashboard 'applicationinsights-dashboard.bicep' = if (!empty(dashboardName)) {
2020
name: 'application-insights-dashboard'
2121
params: {
2222
name: dashboardName
@@ -26,5 +26,6 @@ module applicationInsightsDashboard 'applicationinsights-dashboard.bicep' = if
2626
}
2727

2828
output connectionString string = applicationInsights.properties.ConnectionString
29+
output id string = applicationInsights.id
2930
output instrumentationKey string = applicationInsights.properties.InstrumentationKey
3031
output name string = applicationInsights.name

infra/core/monitor/loganalytics.bicep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
metadata description = 'Creates a Log Analytics workspace.'
12
param name string
23
param location string = resourceGroup().location
34
param tags object = {}

0 commit comments

Comments
 (0)