Azure / Azure/bicep

Function to obtain the paired/failover region

Open
#15,987 10 comments 4 reactions 0 assignees View on GitHub
enhancement Needs: Upvote
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 2h
Merged PRs (30d)
79

Description

As a user, I would like the ability to pick the zone related to the redunacy. It's better to explain it by example. Imagine the following Bicep file:

```bicep
module cosmosDb 'br/public:avm/res/document-db/database-account:0.10.1' = {
name: 'cosmosDb'
params: {
name: cosmosDbName
location: 'westus'
disableLocalAuth: true
networkRestrictions: {
publicNetworkAccess: 'Enabled'
networkAclBypass: 'AzureServices'
ipRules: [
'13.91.105.215'
'4.210.172.107'
'13.88.56.148'
'40.91.218.243'
'0.0.0.0'
]
}
locations: [
{
failoverPriority: 0
locationName: 'West US'
isZoneRedundant: false
}
{
failoverPriority: 1
locationName: 'Central US'
isZoneRedundant: false
}
]
enableFreeTier: false
databaseAccountOfferType: 'Standard'
backupPolicyType: 'Periodic'
backupIntervalInMinutes: 240
backupRetentionIntervalInHours: 720
backupStorageRedundancy: 'Geo'
defaultConsistencyLevel: 'Session'
maxStalenessPrefix: 100
maxIntervalInSeconds: 5
sqlDatabases: [
{
name: 'test'
}
]
}
]
}
}
```

The location parameter can be set, which takes me to the locations parameter. For the failover priority, I can use: `pickZones('Microsoft.DocumentDB', 'databaseAccounts', location)`. The challenge is in the second part. It would be beneficial if there were a function like: `pickZoneReferenceName('Microsoft.DocumentDB', 'databaseAccounts', location)`.

If this issue has already been captured or if such a function exists, I hope you can steer me in the right direction.

Contributor guide

Open the contributing guide

Research direction

The issue names no repository files or tests. Start by reviewing the existing pickZones('Microsoft.DocumentDB', 'databaseAccounts', location) function and the Bicep example, then determine how a paired or failover region reference name should be selected; done means the requested function behavior is defined and validated for the shown Cosmos DB scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.