You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Update avm/res/document-db/mongo-cluster module to support Microsoft Entra user entities (#5260)
## Description
I'm adding a new `user` submodule to `avm/res/document-db/mongo-cluster`
so we can build Azure Developer CLI templates that support Microsoft
Entra authentication end-to-end.
Here's the relevant documentation:
<https://learn.microsoft.com/azure/cosmos-db/mongodb/vcore/how-to-configure-entra-authentication>
Unfortunately, this module was using an older RP, so this caused a few
"domino" changes:
- The `api-version` needed to be updated to at least
`2025-04-01-preview` to support Microsoft Entra authentication
- The `nodeType` property no longer exists in the last API version
- The `highAvailabilityMode` property is now a string with multiple
allowed values
And in keeping with best practices, I just made these minor changes:
- I updated most unit tests to deploy minimal single-node resources to
minimize the amount of churn and extra resources deployed for each CI
run
- I updated the WAF-aligned unit test to deploy triplicate nodes that
are zone-redundant (no redundancy in the initial version)
- I updated the metadata to correctly reference *"Azure Cosmos DB for
MongoDB (vCore)"*
- The WAF-aligned unit test needed tags to suppress a warning from
PSRule
I did notice this behavior, but I didn't fix it in this PR:
- The `max.*` unit test has transient failures. I couldn't pin down what
was causing it, but it was due to the test not being able to "find" the
nested dependencies. I don't have enough information to diagnose if it
was a race condition or a naming collision.
Finally, I didn't suppress the Bicep linter warning for the
`api-version`. That API version is supported in the REST API, but it's
not documented in the specs yet.
This PR depends on this other change to remove linter warnings:
- Azure/azure-rest-api-specs#34580
> [!NOTE]
> I tried my best to scope my changes to the minimal necessary to add
this submodule and Entra authentication support.
## Pipeline Reference
| Pipeline |
| --- |
|
[](https://github.com/seesharprun/bicep-registry-modules/actions/workflows/avm.res.document-db.mongo-cluster.yml)
|
## Type of Change
- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [x] Azure Verified Module updates:
- [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [x] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [x] Breaking changes and I have bumped the MAJOR version in
`version.json`.
- [x] Update to documentation
## Checklist
- [x] I'm sure there are no other open Pull Requests for the same
update/change
- [x] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [x] My corresponding pipelines / checks run clean and green without
any errors or warnings
---------
Co-authored-by: Alexander Sehr <[email protected]>
|[`endIpAddress`](#parameter-endipaddress)| string | The end IP address of the Azure Cosmos DB MongoDB vCore cluster firewall rule. Must be IPv4 format. |
23
+
|[`endIpAddress`](#parameter-endipaddress)| string | The end IP address of the Azure Cosmos DB for MongoDB (vCore) cluster firewall rule. Must be IPv4 format. |
24
24
|[`name`](#parameter-name)| string | The name of the firewall rule. Must match the pattern `^[a-zA-Z0-9][-_a-zA-Z0-9]*`. |
25
-
|[`startIpAddress`](#parameter-startipaddress)| string | The start IP address of the Azure Cosmos DB MongoDB vCore cluster firewall rule. Must be IPv4 format. |
25
+
|[`startIpAddress`](#parameter-startipaddress)| string | The start IP address of the Azure Cosmos DB for MongoDB (vCore) cluster firewall rule. Must be IPv4 format. |
26
26
27
27
**Conditional parameters**
28
28
29
29
| Parameter | Type | Description |
30
30
| :-- | :-- | :-- |
31
-
|[`mongoClusterName`](#parameter-mongoclustername)| string | The name of the parent Azure Cosmos DB MongoDB vCore cluster. Required if the template is used in a standalone deployment. |
31
+
|[`mongoClusterName`](#parameter-mongoclustername)| string | The name of the parent Azure Cosmos DB for MongoDB (vCore) cluster. Required if the template is used in a standalone deployment. |
32
32
33
33
### Parameter: `endIpAddress`
34
34
35
-
The end IP address of the Azure Cosmos DB MongoDB vCore cluster firewall rule. Must be IPv4 format.
35
+
The end IP address of the Azure Cosmos DB for MongoDB (vCore) cluster firewall rule. Must be IPv4 format.
36
36
37
37
- Required: Yes
38
38
- Type: string
@@ -46,14 +46,14 @@ The name of the firewall rule. Must match the pattern `^[a-zA-Z0-9][-_a-zA-Z0-9]
46
46
47
47
### Parameter: `startIpAddress`
48
48
49
-
The start IP address of the Azure Cosmos DB MongoDB vCore cluster firewall rule. Must be IPv4 format.
49
+
The start IP address of the Azure Cosmos DB for MongoDB (vCore) cluster firewall rule. Must be IPv4 format.
50
50
51
51
- Required: Yes
52
52
- Type: string
53
53
54
54
### Parameter: `mongoClusterName`
55
55
56
-
The name of the parent Azure Cosmos DB MongoDB vCore cluster. Required if the template is used in a standalone deployment.
56
+
The name of the parent Azure Cosmos DB for MongoDB (vCore) cluster. Required if the template is used in a standalone deployment.
57
57
58
58
- Required: Yes
59
59
- Type: string
@@ -63,5 +63,5 @@ The name of the parent Azure Cosmos DB MongoDB vCore cluster. Required if the te
63
63
| Output | Type | Description |
64
64
| :-- | :-- | :-- |
65
65
|`name`| string | The name of the firewall rule. |
66
-
|`resourceGroupName`| string | The name of the resource group the Azure Cosmos DB MongoDB vCore cluster was created in. |
66
+
|`resourceGroupName`| string | The name of the resource group the Azure Cosmos DB for MongoDB (vCore) cluster was created in. |
67
67
|`resourceId`| string | The resource ID of the firewall rule. |
metadatadescription = 'This module config firewall rules for the Azure Cosmos DB MongoDB vCore cluster.'
1
+
metadataname = 'Azure Cosmos DB for MongoDB (vCore) cluster Config FireWall Rules'
2
+
metadatadescription = 'This module config firewall rules for the Azure Cosmos DB for MongoDB (vCore) cluster.'
3
3
4
-
@description('Conditional. The name of the parent Azure Cosmos DB MongoDB vCore cluster. Required if the template is used in a standalone deployment.')
4
+
@description('Conditional. The name of the parent Azure Cosmos DB for MongoDB (vCore) cluster. Required if the template is used in a standalone deployment.')
5
5
parammongoClusterNamestring
6
6
7
7
@description('Required. The name of the firewall rule. Must match the pattern `^[a-zA-Z0-9][-_a-zA-Z0-9]*`.')
8
8
paramnamestring
9
9
10
-
@description('Required. The start IP address of the Azure Cosmos DB MongoDB vCore cluster firewall rule. Must be IPv4 format.')
10
+
@description('Required. The start IP address of the Azure Cosmos DB for MongoDB (vCore) cluster firewall rule. Must be IPv4 format.')
11
11
paramstartIpAddressstring
12
12
13
-
@description('Required. The end IP address of the Azure Cosmos DB MongoDB vCore cluster firewall rule. Must be IPv4 format.')
13
+
@description('Required. The end IP address of the Azure Cosmos DB for MongoDB (vCore) cluster firewall rule. Must be IPv4 format.')
Copy file name to clipboardExpand all lines: avm/res/document-db/mongo-cluster/firewall-rule/main.json
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -4,17 +4,17 @@
4
4
"metadata": {
5
5
"_generator": {
6
6
"name": "bicep",
7
-
"version": "0.34.44.8038",
8
-
"templateHash": "4427483613542642631"
7
+
"version": "0.35.1.17967",
8
+
"templateHash": "16764717011313154043"
9
9
},
10
-
"name": "Azure Cosmos DB MongoDB vCore Cluster Config FireWall Rules",
11
-
"description": "This module config firewall rules for the Azure Cosmos DB MongoDB vCore cluster."
10
+
"name": "Azure Cosmos DB for MongoDB (vCore) cluster Config FireWall Rules",
11
+
"description": "This module config firewall rules for the Azure Cosmos DB for MongoDB (vCore) cluster."
12
12
},
13
13
"parameters": {
14
14
"mongoClusterName": {
15
15
"type": "string",
16
16
"metadata": {
17
-
"description": "Conditional. The name of the parent Azure Cosmos DB MongoDB vCore cluster. Required if the template is used in a standalone deployment."
17
+
"description": "Conditional. The name of the parent Azure Cosmos DB for MongoDB (vCore) cluster. Required if the template is used in a standalone deployment."
18
18
}
19
19
},
20
20
"name": {
@@ -26,20 +26,20 @@
26
26
"startIpAddress": {
27
27
"type": "string",
28
28
"metadata": {
29
-
"description": "Required. The start IP address of the Azure Cosmos DB MongoDB vCore cluster firewall rule. Must be IPv4 format."
29
+
"description": "Required. The start IP address of the Azure Cosmos DB for MongoDB (vCore) cluster firewall rule. Must be IPv4 format."
30
30
}
31
31
},
32
32
"endIpAddress": {
33
33
"type": "string",
34
34
"metadata": {
35
-
"description": "Required. The end IP address of the Azure Cosmos DB MongoDB vCore cluster firewall rule. Must be IPv4 format."
35
+
"description": "Required. The end IP address of the Azure Cosmos DB for MongoDB (vCore) cluster firewall rule. Must be IPv4 format."
"name": "[format('{0}/{1}', parameters('mongoClusterName'), if(not(contains(parameters('name'), '.')), parameters('name'), fail('The firewall rule name must match the pattern `^[a-zA-Z0-9][-_a-zA-Z0-9]*`. A `.` is **not** allowed.')))]",
Copy file name to clipboardExpand all lines: avm/res/document-db/mongo-cluster/main.bicep
+71-22Lines changed: 71 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
-
metadataname = 'Azure Cosmos DB MongoDB vCore cluster'
2
-
metadatadescription = '''This module deploys a Azure Cosmos DB MongoDB vCore cluster.
1
+
metadataname = 'Azure Cosmos DB for MongoDB (vCore) cluster'
2
+
metadatadescription = '''This module deploys a Azure Cosmos DB for MongoDB (vCore) cluster.
3
3
4
4
**Note:** This module is not intended for broad, generic use, as it was designed to cater for the requirements of the AZD CLI product. Feature requests and bug fix requests are welcome if they support the development of the AZD CLI but may not be incorporated if they aim to make this module more generic than what it needs to be for its primary use case.'''
5
5
6
-
@description('Required. Name of the Azure Cosmos DB MongoDB vCore cluster.')
6
+
@description('Required. Name of the Azure Cosmos DB for MongoDB (vCore) cluster.')
7
7
paramnamestring
8
8
9
9
@description('Optional. Default to current resource group scope location. Location for all resources.')
@@ -21,7 +21,7 @@ param administratorLogin string
21
21
@maxLength(128)
22
22
paramadministratorLoginPasswordstring
23
23
24
-
@description('Optional. Mode to create the azure cosmos db mongodb vCore cluster.')
24
+
@description('Optional. Mode to create the Azure Cosmos DB for MongoDB (vCore) cluster.')
@description('Optional. Configuration details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible.')
0 commit comments