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

Fix race condition in bicep / ARM template #564

Merged
merged 1 commit into from
Nov 2, 2023
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
22 changes: 11 additions & 11 deletions scripts/deploy/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ resource appServiceWebDeploy 'Microsoft.Web/sites/extensions@2022-09-01' = if (d
}
dependsOn: [
appServiceWebConfig
webSubnetConnection
]
}

Expand Down Expand Up @@ -463,7 +464,6 @@ resource appServiceMemoryPipelineConfig 'Microsoft.Web/sites/config@2022-09-01'
minTlsVersion: '1.2'
netFrameworkVersion: 'v6.0'
use32BitWorkerProcess: false
vnetName: webSubnetConnection.name
glahaye marked this conversation as resolved.
Show resolved Hide resolved
vnetRouteAllEnabled: true
appSettings: [
{
Expand Down Expand Up @@ -623,6 +623,7 @@ resource appServiceMemoryPipelineDeploy 'Microsoft.Web/sites/extensions@2022-09-
}
dependsOn: [
appServiceMemoryPipelineConfig
memSubnetConnection
]
}

Expand Down Expand Up @@ -883,16 +884,6 @@ resource virtualNetwork 'Microsoft.Network/virtualNetworks@2021-05-01' = {
privateLinkServiceNetworkPolicies: 'Enabled'
}
}
{
glahaye marked this conversation as resolved.
Show resolved Hide resolved
name: 'postgresSubnet'
properties: {
addressPrefix: '10.0.3.0/24'
serviceEndpoints: []
delegations: []
privateEndpointNetworkPolicies: 'Disabled'
privateLinkServiceNetworkPolicies: 'Enabled'
}
}
]
}
}
Expand Down Expand Up @@ -936,6 +927,15 @@ resource webSubnetConnection 'Microsoft.Web/sites/virtualNetworkConnections@2022
}
}

resource memSubnetConnection 'Microsoft.Web/sites/virtualNetworkConnections@2022-09-01' = {
parent: appServiceMemoryPipeline
name: 'memSubnetConnection'
properties: {
vnetResourceId: virtualNetwork.properties.subnets[0].id
isSwift: true
}
}

resource qdrantSubnetConnection 'Microsoft.Web/sites/virtualNetworkConnections@2022-09-01' = if (memoryStore == 'Qdrant') {
parent: appServiceQdrant
name: 'qdrantSubnetConnection'
Expand Down
37 changes: 20 additions & 17 deletions scripts/deploy/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "7392657133670008096"
"templateHash": "9623885437439794816"
}
},
"parameters": {
Expand Down Expand Up @@ -335,7 +335,8 @@
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', format('app-{0}-webapi', variables('uniqueName')))]",
"[resourceId('Microsoft.Web/sites/config', format('app-{0}-webapi', variables('uniqueName')), 'web')]"
"[resourceId('Microsoft.Web/sites/config', format('app-{0}-webapi', variables('uniqueName')), 'web')]",
"[resourceId('Microsoft.Web/sites/virtualNetworkConnections', format('app-{0}-webapi', variables('uniqueName')), 'webSubnetConnection')]"
]
},
{
Expand Down Expand Up @@ -369,7 +370,6 @@
"minTlsVersion": "1.2",
"netFrameworkVersion": "v6.0",
"use32BitWorkerProcess": false,
"vnetName": "webSubnetConnection",
"vnetRouteAllEnabled": true,
"appSettings": [
{
Expand Down Expand Up @@ -525,8 +525,7 @@
"[resourceId('Microsoft.Search/searchServices', format('acs-{0}', variables('uniqueName')))]",
"[resourceId('Microsoft.CognitiveServices/accounts', format('cog-ocr-{0}', variables('uniqueName')))]",
"[resourceId('Microsoft.CognitiveServices/accounts', format('ai-{0}', variables('uniqueName')))]",
"[resourceId('Microsoft.Storage/storageAccounts', format('st{0}', variables('rgIdHash')))]",
"[resourceId('Microsoft.Web/sites/virtualNetworkConnections', format('app-{0}-webapi', variables('uniqueName')), 'webSubnetConnection')]"
"[resourceId('Microsoft.Storage/storageAccounts', format('st{0}', variables('rgIdHash')))]"
]
},
{
Expand All @@ -540,7 +539,8 @@
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', format('app-{0}-memorypipeline', variables('uniqueName')))]",
"[resourceId('Microsoft.Web/sites/config', format('app-{0}-memorypipeline', variables('uniqueName')), 'web')]"
"[resourceId('Microsoft.Web/sites/config', format('app-{0}-memorypipeline', variables('uniqueName')), 'web')]",
"[resourceId('Microsoft.Web/sites/virtualNetworkConnections', format('app-{0}-memorypipeline', variables('uniqueName')), 'memSubnetConnection')]"
]
},
{
Expand Down Expand Up @@ -836,16 +836,6 @@
"privateEndpointNetworkPolicies": "Disabled",
"privateLinkServiceNetworkPolicies": "Enabled"
}
},
{
"name": "postgresSubnet",
"properties": {
"addressPrefix": "10.0.3.0/24",
"serviceEndpoints": [],
"delegations": [],
"privateEndpointNetworkPolicies": "Disabled",
"privateLinkServiceNetworkPolicies": "Enabled"
}
}
]
},
Expand Down Expand Up @@ -899,6 +889,19 @@
"[resourceId('Microsoft.Network/virtualNetworks', format('vnet-{0}', variables('uniqueName')))]"
]
},
{
"type": "Microsoft.Web/sites/virtualNetworkConnections",
"apiVersion": "2022-09-01",
"name": "[format('{0}/{1}', format('app-{0}-memorypipeline', variables('uniqueName')), 'memSubnetConnection')]",
"properties": {
"vnetResourceId": "[reference(resourceId('Microsoft.Network/virtualNetworks', format('vnet-{0}', variables('uniqueName'))), '2021-05-01').subnets[0].id]",
"isSwift": true
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', format('app-{0}-memorypipeline', variables('uniqueName')))]",
"[resourceId('Microsoft.Network/virtualNetworks', format('vnet-{0}', variables('uniqueName')))]"
]
},
{
"condition": "[equals(parameters('memoryStore'), 'Qdrant')]",
"type": "Microsoft.Web/sites/virtualNetworkConnections",
Expand Down Expand Up @@ -1159,4 +1162,4 @@
"value": "[concat(createArray(), if(parameters('deployWebSearcherPlugin'), createArray(format('function-{0}-websearcher-plugin', variables('uniqueName'))), createArray()))]"
}
}
}
}
94 changes: 0 additions & 94 deletions scripts/deploy/object.txt

This file was deleted.