Skip to content

Commit 2946278

Browse files
feat: Web-HostingEnvironment - Updated UDTs to pending specs (#4103)
## Description Updated user-defined types with pending Azure/Azure-Verified-Modules#1738 & #4098. ## Pipeline Reference <!-- Insert your Pipeline Status Badge below --> | Pipeline | | -------- | [![avm.res.web.hosting-environment](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.web.hosting-environment.yml/badge.svg?branch=users%2Falsehr%2Favm.res.web.hosting-environment_udt&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.web.hosting-environment.yml) ## Type of Change <!-- Use the checkboxes [x] on the options that are relevant. --> - [ ] 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. - [ ] Feature update backwards compatible feature updates, and I have bumped the MINOR version in `version.json`. - [ ] Breaking changes and I have bumped the MAJOR version in `version.json`. - [ ] Update to documentation
1 parent 6ceed18 commit 2946278

File tree

6 files changed

+235
-280
lines changed

6 files changed

+235
-280
lines changed

avm/res/web/hosting-environment/README.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This module deploys an App Service Environment.
88
- [Usage examples](#Usage-examples)
99
- [Parameters](#Parameters)
1010
- [Outputs](#Outputs)
11+
- [Cross-referenced modules](#Cross-referenced-modules)
1112
- [Data Collection](#Data-Collection)
1213

1314
## Resource Types
@@ -48,8 +49,6 @@ module hostingEnvironment 'br/public:avm/res/web/hosting-environment:<version>'
4849
// Required parameters
4950
name: 'whemin001'
5051
subnetResourceId: '<subnetResourceId>'
51-
// Non-required parameters
52-
location: '<location>'
5352
}
5453
}
5554
```
@@ -72,10 +71,6 @@ module hostingEnvironment 'br/public:avm/res/web/hosting-environment:<version>'
7271
},
7372
"subnetResourceId": {
7473
"value": "<subnetResourceId>"
75-
},
76-
// Non-required parameters
77-
"location": {
78-
"value": "<location>"
7974
}
8075
}
8176
}
@@ -94,8 +89,6 @@ using 'br/public:avm/res/web/hosting-environment:<version>'
9489
// Required parameters
9590
param name = 'whemin001'
9691
param subnetResourceId = '<subnetResourceId>'
97-
// Non-required parameters
98-
param location = '<location>'
9992
```
10093

10194
</details>
@@ -426,7 +419,6 @@ module hostingEnvironment 'br/public:avm/res/web/hosting-environment:<version>'
426419
}
427420
]
428421
internalLoadBalancingMode: 'Web, Publishing'
429-
location: '<location>'
430422
managedIdentities: {
431423
systemAssigned: true
432424
userAssignedResourceIds: [
@@ -501,9 +493,6 @@ module hostingEnvironment 'br/public:avm/res/web/hosting-environment:<version>'
501493
"internalLoadBalancingMode": {
502494
"value": "Web, Publishing"
503495
},
504-
"location": {
505-
"value": "<location>"
506-
},
507496
"managedIdentities": {
508497
"value": {
509498
"systemAssigned": true,
@@ -568,7 +557,6 @@ param diagnosticSettings = [
568557
}
569558
]
570559
param internalLoadBalancingMode = 'Web, Publishing'
571-
param location = '<location>'
572560
param managedIdentities = {
573561
systemAssigned: true
574562
userAssignedResourceIds: [
@@ -702,7 +690,7 @@ The diagnostic settings of the service.
702690
| [`eventHubAuthorizationRuleResourceId`](#parameter-diagnosticsettingseventhubauthorizationruleresourceid) | string | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
703691
| [`eventHubName`](#parameter-diagnosticsettingseventhubname) | string | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
704692
| [`logAnalyticsDestinationType`](#parameter-diagnosticsettingsloganalyticsdestinationtype) | string | A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type. |
705-
| [`logCategoriesAndGroups`](#parameter-diagnosticsettingslogcategoriesandgroups) | array | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
693+
| [`logCategoriesAndGroups`](#parameter-diagnosticsettingslogcategoriesandgroups) | array | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to `[]` to disable log collection. |
706694
| [`marketplacePartnerResourceId`](#parameter-diagnosticsettingsmarketplacepartnerresourceid) | string | The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. |
707695
| [`name`](#parameter-diagnosticsettingsname) | string | The name of diagnostic setting. |
708696
| [`storageAccountResourceId`](#parameter-diagnosticsettingsstorageaccountresourceid) | string | Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
@@ -738,7 +726,7 @@ A string indicating whether the export to Log Analytics should use the default d
738726

739727
### Parameter: `diagnosticSettings.logCategoriesAndGroups`
740728

741-
The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection.
729+
The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to `[]` to disable log collection.
742730

743731
- Required: No
744732
- Type: array
@@ -748,7 +736,8 @@ The name of logs that will be streamed. "allLogs" includes all possible logs for
748736
| Parameter | Type | Description |
749737
| :-- | :-- | :-- |
750738
| [`category`](#parameter-diagnosticsettingslogcategoriesandgroupscategory) | string | Name of a Diagnostic Log category for a resource type this setting is applied to. Set the specific logs to collect here. |
751-
| [`categoryGroup`](#parameter-diagnosticsettingslogcategoriesandgroupscategorygroup) | string | Name of a Diagnostic Log category group for a resource type this setting is applied to. Set to 'AllLogs' to collect all logs. |
739+
| [`categoryGroup`](#parameter-diagnosticsettingslogcategoriesandgroupscategorygroup) | string | Name of a Diagnostic Log category group for a resource type this setting is applied to. Set to `allLogs` to collect all logs. |
740+
| [`enabled`](#parameter-diagnosticsettingslogcategoriesandgroupsenabled) | bool | Enable or disable the category explicitly. Default is `true`. |
752741

753742
### Parameter: `diagnosticSettings.logCategoriesAndGroups.category`
754743

@@ -759,11 +748,18 @@ Name of a Diagnostic Log category for a resource type this setting is applied to
759748

760749
### Parameter: `diagnosticSettings.logCategoriesAndGroups.categoryGroup`
761750

762-
Name of a Diagnostic Log category group for a resource type this setting is applied to. Set to 'AllLogs' to collect all logs.
751+
Name of a Diagnostic Log category group for a resource type this setting is applied to. Set to `allLogs` to collect all logs.
763752

764753
- Required: No
765754
- Type: string
766755

756+
### Parameter: `diagnosticSettings.logCategoriesAndGroups.enabled`
757+
758+
Enable or disable the category explicitly. Default is `true`.
759+
760+
- Required: No
761+
- Type: bool
762+
767763
### Parameter: `diagnosticSettings.marketplacePartnerResourceId`
768764

769765
The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.
@@ -903,7 +899,7 @@ The managed identity definition for this resource.
903899
| Parameter | Type | Description |
904900
| :-- | :-- | :-- |
905901
| [`systemAssigned`](#parameter-managedidentitiessystemassigned) | bool | Enables system assigned managed identity on the resource. |
906-
| [`userAssignedResourceIds`](#parameter-managedidentitiesuserassignedresourceids) | array | The resource ID(s) to assign to the resource. |
902+
| [`userAssignedResourceIds`](#parameter-managedidentitiesuserassignedresourceids) | array | The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption. |
907903

908904
### Parameter: `managedIdentities.systemAssigned`
909905

@@ -914,7 +910,7 @@ Enables system assigned managed identity on the resource.
914910

915911
### Parameter: `managedIdentities.userAssignedResourceIds`
916912

917-
The resource ID(s) to assign to the resource.
913+
The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption.
918914

919915
- Required: No
920916
- Type: array
@@ -1071,6 +1067,14 @@ Switch to make the App Service Environment zone redundant. If enabled, the minim
10711067
| `resourceId` | string | The resource ID of the App Service Environment. |
10721068
| `systemAssignedMIPrincipalId` | string | The principal ID of the system assigned identity. |
10731069

1070+
## Cross-referenced modules
1071+
1072+
This section gives you an overview of all local-referenced module files (i.e., other modules that are referenced in this module) and all remote-referenced files (i.e., Bicep modules that are referenced from a Bicep Registry or Template Specs).
1073+
1074+
| Reference | Type |
1075+
| :-- | :-- |
1076+
| `br/public:avm/utl/types/avm-common-types:0.4.1` | Remote reference |
1077+
10741078
## Data Collection
10751079

10761080
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the [repository](https://aka.ms/avm/telemetry). There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

avm/res/web/hosting-environment/configuration--customdnssuffix/main.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"metadata": {
55
"_generator": {
66
"name": "bicep",
7-
"version": "0.30.3.12046",
8-
"templateHash": "8555887239478847203"
7+
"version": "0.32.4.45862",
8+
"templateHash": "16336480892159448762"
99
},
1010
"name": "Hosting Environment Custom DNS Suffix Configuration",
1111
"description": "This module deploys a Hosting Environment Custom DNS Suffix Configuration.",

avm/res/web/hosting-environment/main.bicep

Lines changed: 9 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ param enableTelemetry bool = true
1414
@description('Optional. Tags of the resource.')
1515
param tags object?
1616

17+
import { lockType } from 'br/public:avm/utl/types/avm-common-types:0.4.1'
1718
@description('Optional. The lock settings of the service.')
18-
param lock lockType
19+
param lock lockType?
1920

21+
import { roleAssignmentType } from 'br/public:avm/utl/types/avm-common-types:0.4.1'
2022
@description('Optional. Array of role assignments to create.')
21-
param roleAssignments roleAssignmentType
22-
23-
//
24-
// Add your parameters here
25-
//
23+
param roleAssignments roleAssignmentType[]?
2624

2725
@allowed([
2826
'ASEv3'
@@ -83,11 +81,13 @@ param subnetResourceId string
8381
@description('Optional. Switch to make the App Service Environment zone redundant. If enabled, the minimum App Service plan instance count will be three, otherwise 1. If enabled, the `dedicatedHostCount` must be set to `-1`.')
8482
param zoneRedundant bool = true
8583

84+
import { managedIdentityAllType } from 'br/public:avm/utl/types/avm-common-types:0.4.1'
8685
@description('Optional. The managed identity definition for this resource.')
87-
param managedIdentities managedIdentitiesType
86+
param managedIdentities managedIdentityAllType?
8887

88+
import { diagnosticSettingLogsOnlyType } from 'br/public:avm/utl/types/avm-common-types:0.4.1'
8989
@description('Optional. The diagnostic settings of the service.')
90-
param diagnosticSettings diagnosticSettingType
90+
param diagnosticSettings diagnosticSettingLogsOnlyType[]?
9191

9292
var formattedUserAssignedIdentities = reduce(
9393
map((managedIdentities.?userAssignedResourceIds ?? []), (id) => { '${id}': {} }),
@@ -253,82 +253,4 @@ output name string = appServiceEnvironment.name
253253
output location string = appServiceEnvironment.location
254254

255255
@description('The principal ID of the system assigned identity.')
256-
output systemAssignedMIPrincipalId string = appServiceEnvironment.?identity.?principalId ?? ''
257-
258-
// =============== //
259-
// Definitions //
260-
// =============== //
261-
262-
type managedIdentitiesType = {
263-
@description('Optional. Enables system assigned managed identity on the resource.')
264-
systemAssigned: bool?
265-
266-
@description('Optional. The resource ID(s) to assign to the resource.')
267-
userAssignedResourceIds: string[]?
268-
}?
269-
270-
type lockType = {
271-
@description('Optional. Specify the name of lock.')
272-
name: string?
273-
274-
@description('Optional. Specify the type of lock.')
275-
kind: ('CanNotDelete' | 'ReadOnly' | 'None')?
276-
}?
277-
278-
type roleAssignmentType = {
279-
@description('Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated.')
280-
name: string?
281-
282-
@description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
283-
roleDefinitionIdOrName: string
284-
285-
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
286-
principalId: string
287-
288-
@description('Optional. The principal type of the assigned principal ID.')
289-
principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device')?
290-
291-
@description('Optional. The description of the role assignment.')
292-
description: string?
293-
294-
@description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container".')
295-
condition: string?
296-
297-
@description('Optional. Version of the condition.')
298-
conditionVersion: '2.0'?
299-
300-
@description('Optional. The Resource Id of the delegated managed identity resource.')
301-
delegatedManagedIdentityResourceId: string?
302-
}[]?
303-
304-
type diagnosticSettingType = {
305-
@description('Optional. The name of diagnostic setting.')
306-
name: string?
307-
308-
@description('Optional. The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to \'\' to disable log collection.')
309-
logCategoriesAndGroups: {
310-
@description('Optional. Name of a Diagnostic Log category for a resource type this setting is applied to. Set the specific logs to collect here.')
311-
category: string?
312-
313-
@description('Optional. Name of a Diagnostic Log category group for a resource type this setting is applied to. Set to \'AllLogs\' to collect all logs.')
314-
categoryGroup: string?
315-
}[]?
316-
317-
@description('Optional. A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type.')
318-
logAnalyticsDestinationType: ('Dedicated' | 'AzureDiagnostics')?
319-
320-
@description('Optional. Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
321-
workspaceResourceId: string?
322-
323-
@description('Optional. Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
324-
storageAccountResourceId: string?
325-
326-
@description('Optional. Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to.')
327-
eventHubAuthorizationRuleResourceId: string?
328-
329-
@description('Optional. Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
330-
eventHubName: string?
331-
332-
@description('Optional. The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.')
333-
marketplacePartnerResourceId: string?
334-
}[]?
256+
output systemAssignedMIPrincipalId string? = appServiceEnvironment.?identity.?principalId

0 commit comments

Comments
 (0)