Skip to content
Open
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
2 changes: 1 addition & 1 deletion .vscode/mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"type": "http"
}
}
}
}
10 changes: 10 additions & 0 deletions avm/utl/types/avm-common-types/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

The latest version of the changelog can be found [here](https://github.com/Azure/bicep-registry-modules/blob/main/avm/utl/types/avm-common-types/CHANGELOG.md).

## 0.7.0

### Changes

- Added `serviceGroupTargetResourceIds` as a type.

### Breaking Changes

- None

## 0.6.1

### Changes
Expand Down
9 changes: 9 additions & 0 deletions avm/utl/types/avm-common-types/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import {
privateEndpointSingleServiceType
secretToSetType
secretSetOutputType
serviceGroupTargetResourceIdsType
} from '../../../main.bicep' // Would be: br/public:avm/utl/types/avm-common-types:<version>

// ====================== //
Expand Down Expand Up @@ -333,6 +334,14 @@ param secretSet secretSetOutputType[] = [
}
]
output secretSetOutput secretSetOutputType[] = secretSet

// ================== //
// Service Groups //
// ================== //
param serviceGroupTargetResourceIds serviceGroupTargetResourceIdsType[] = [
'/providers/Microsoft.Management/serviceGroups/myServiceGroup'
]
output serviceGroupTargetResourceIdsOutput serviceGroupTargetResourceIdsType[] = serviceGroupTargetResourceIds
```

</details>
Expand Down
7 changes: 7 additions & 0 deletions avm/utl/types/avm-common-types/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -431,3 +431,10 @@ type secretsOutputType = {
@description('An exported secret\'s references.')
*: secretSetOutputType
}

// ================== //
// Service Groups //
// ================== //
@export()
@description('An AVM-aligned type for the target resource IDs to associate resource to service groups.')
type serviceGroupTargetResourceIdsType = resourceInput<'Microsoft.Relationships/serviceGroupMember@2023-09-01-preview'>.properties.targetId
Copy link
Collaborator

@AlexanderSehr AlexanderSehr Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jtracey93, thanks fir the PR(s) 🚀
Regarding this one: I wonder - what 's the point of the type if it's effectively a string? In other words, what's the type's added value compared to a module's individual implementation via a string parameter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking similar, however I thought I’d raise the PR for us to discuss.

I think centralising it here in the UTL module with an RDT ensures that valid resource IDs are provided for they’d import as its not the typical resource ID, e.g. /subscriptions/xxxxx/resourceGroups/xxxx/RP/type/xxx as its a tenant level input /providers/Microsoft.Management/serviceGroups/xxx

Thoguhts?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would only be possible in Terraform as Bicep does not have a feature like regex validation and the like. In other words, the resourceInput in this case would only check that it's a string - that 'should' be it.
I'd suggest an alternative which is to enforce string as a param type via our Pester tests if anybody defines a serviceGroupTargetResourceId parameter.
I'll bring this topic up in our next team call.

12 changes: 11 additions & 1 deletion avm/utl/types/avm-common-types/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.37.4.10188",
"templateHash": "4786376631151649274"
"templateHash": "7850788189007396851"
},
"name": "Default interface types for AVM modules",
"description": "This module provides you with all common variants for AVM interfaces to be used in AVM modules.\n\nDetails for how to implement these interfaces can be found in the AVM documentation [here](https://azure.github.io/Azure-Verified-Modules/specs/bcp/res/interfaces/).\n"
Expand Down Expand Up @@ -1000,6 +1000,16 @@
"__bicep_export!": true,
"description": "A map of the exported secrets"
}
},
"serviceGroupTargetResourceIdsType": {
"type": "string",
"metadata": {
"__bicep_resource_derived_type!": {
"source": "Microsoft.Relationships/serviceGroupMember@2023-09-01-preview#properties/properties/properties/targetId"
},
"__bicep_export!": true,
"description": "An AVM-aligned type for the target resource IDs to associate resource to service groups."
}
}
},
"resources": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
privateEndpointSingleServiceType
secretToSetType
secretSetOutputType
serviceGroupTargetResourceIdsType
} from '../../../main.bicep' // Would be: br/public:avm/utl/types/avm-common-types:<version>

// ====================== //
Expand Down Expand Up @@ -292,3 +293,11 @@ param secretSet secretSetOutputType[] = [
}
]
output secretSetOutput secretSetOutputType[] = secretSet

// ================== //
// Service Groups //
// ================== //
param serviceGroupTargetResourceIds serviceGroupTargetResourceIdsType[] = [
'/providers/Microsoft.Management/serviceGroups/myServiceGroup'
]
output serviceGroupTargetResourceIdsOutput serviceGroupTargetResourceIdsType[] = serviceGroupTargetResourceIds
2 changes: 1 addition & 1 deletion avm/utl/types/avm-common-types/version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
"version": "0.6"
"version": "0.7"
}