Skip to content

Commit

Permalink
Always deploy storage account for the server (#782)
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell authored Sep 11, 2023
1 parent 879e9e3 commit e199332
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions server/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ resource providedServiceBusNamespace 'Microsoft.ServiceBus/namespaces@2021-11-01
}

/* Storage Account */
resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = if (eventBusTransport == 'QueueStorage' && !hasProvidedStorageAccount) {
resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = if (!hasProvidedStorageAccount) {
name: '${name}-${collisionSuffix}'
location: location
kind: 'StorageV2'
Expand All @@ -158,7 +158,7 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = if (eve
}
}
}
resource providedStorageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' existing = if (eventBusTransport == 'QueueStorage' && hasProvidedStorageAccount) {
resource providedStorageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' existing = if (hasProvidedStorageAccount) {
// Inspired by https://github.com/Azure/bicep/issues/1722#issuecomment-952118402
// Example: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Fabrikam/providers/Microsoft.Storage/storageAccounts/fabrikam
// 0 -> '', 1 -> 'subscriptions', 2 -> '00000000-0000-0000-0000-000000000000', 3 -> 'resourceGroups'
Expand Down
38 changes: 19 additions & 19 deletions server/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@
"eventBusTransport": {
"type": "string",
"defaultValue": "ServiceBus",
"metadata": {
"description": "Merge strategy to use when setting auto complete on created pull requests."
},
"allowedValues": [
"InMemory",
"ServiceBus",
"QueueStorage"
]
],
"metadata": {
"description": "Merge strategy to use when setting auto complete on created pull requests."
}
},
"failOnException": {
"type": "bool",
Expand All @@ -85,15 +85,15 @@
"autoCompleteMergeStrategy": {
"type": "string",
"defaultValue": "Squash",
"metadata": {
"description": "Merge strategy to use when setting auto complete on created pull requests."
},
"allowedValues": [
"NoFastForward",
"Rebase",
"RebaseMerge",
"Squash"
]
],
"metadata": {
"description": "Merge strategy to use when setting auto complete on created pull requests."
}
},
"autoApprove": {
"type": "bool",
Expand All @@ -105,12 +105,12 @@
"jobHostType": {
"type": "string",
"defaultValue": "ContainerInstances",
"metadata": {
"description": "Where to host new update jobs."
},
"allowedValues": [
"ContainerInstances"
]
],
"metadata": {
"description": "Where to host new update jobs."
}
},
"jobsResourceGroupName": {
"type": "string",
Expand Down Expand Up @@ -185,20 +185,20 @@
"minReplicas": {
"type": "int",
"defaultValue": 1,
"minValue": 1,
"maxValue": 2,
"metadata": {
"description": "The minimum number of replicas"
},
"maxValue": 2,
"minValue": 1
}
},
"maxReplicas": {
"type": "int",
"defaultValue": 1,
"minValue": 1,
"maxValue": 5,
"metadata": {
"description": "The maximum number of replicas"
},
"maxValue": 5,
"minValue": 1
}
}
},
"variables": {
Expand Down Expand Up @@ -240,7 +240,7 @@
}
},
{
"condition": "[and(equals(parameters('eventBusTransport'), 'QueueStorage'), not(variables('hasProvidedStorageAccount')))]",
"condition": "[not(variables('hasProvidedStorageAccount'))]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2022-09-01",
"name": "[format('{0}-{1}', parameters('name'), variables('collisionSuffix'))]",
Expand Down

0 comments on commit e199332

Please sign in to comment.