Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ param location string = resourceGroup().location
])
param skuName string = 'Basic'

@description('Optional. The resource ID of a key vault to reference a customer managed key for encryption from.')
@description('Conditional. The resource ID of a key vault to reference a customer managed key for encryption from. Required if \'cMKKeyName\' is not empty.')
param cMKKeyVaultResourceId string = ''

@description('Optional. The name of the customer managed key to use for encryption.')
param cMKKeyName string = ''

@description('Optional. User assigned identity to use when fetching the customer managed key. If not provided, a system-assigned identity can be used - but must be given access to the referenced key vault first.')
@description('Conditional. User assigned identity to use when fetching the customer managed key. Required if \'cMKKeyName\' is not empty.')
param cMKUserAssignedIdentityResourceId string = ''

@description('Optional. The version of the customer managed key to reference for encryption. If not provided, the latest key version is used.')
Expand Down
9 changes: 7 additions & 2 deletions modules/Microsoft.Automation/automationAccounts/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,19 @@ This module deploys an Azure Automation Account.
| :-- | :-- | :-- |
| `name` | string | Name of the Automation Account. |

**Conditional parameters**

| Parameter Name | Type | Default Value | Description |
| :-- | :-- | :-- | :-- |
| `cMKKeyVaultResourceId` | string | `''` | The resource ID of a key vault to reference a customer managed key for encryption from. Required if 'cMKKeyName' is not empty. |
| `cMKUserAssignedIdentityResourceId` | string | `''` | User assigned identity to use when fetching the customer managed key. Required if 'cMKKeyName' is not empty. |

**Optional parameters**

| Parameter Name | Type | Default Value | Allowed Values | Description |
| :-- | :-- | :-- | :-- | :-- |
| `cMKKeyName` | string | `''` | | The name of the customer managed key to use for encryption. |
| `cMKKeyVaultResourceId` | string | `''` | | The resource ID of a key vault to reference a customer managed key for encryption from. |
| `cMKKeyVersion` | string | `''` | | The version of the customer managed key to reference for encryption. If not provided, the latest key version is used. |
| `cMKUserAssignedIdentityResourceId` | string | `''` | | User assigned identity to use when fetching the customer managed key. If not provided, a system-assigned identity can be used - but must be given access to the referenced key vault first. |
| `diagnosticEventHubAuthorizationRuleId` | 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. |
| `diagnosticEventHubName` | 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. |
| `diagnosticLogCategoriesToEnable` | array | `[DscNodeStatus, JobLogs, JobStreams]` | `[DscNodeStatus, JobLogs, JobStreams]` | The name of logs that will be streamed. |
Expand Down
2 changes: 1 addition & 1 deletion modules/Microsoft.Batch/batchAccounts/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ param tags object = {}
@description('Optional. List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane.')
param allowedAuthenticationModes array = []

@description('Optional. The resource ID of a key vault to reference a customer managed key for encryption from.')
@description('Conditional. The resource ID of a key vault to reference a customer managed key for encryption from. Required if \'cMKKeyName\' is not empty.')
param cMKKeyVaultResourceId string = ''

@description('Optional. The name of the customer managed key to use for encryption.')
Expand Down
2 changes: 1 addition & 1 deletion modules/Microsoft.Batch/batchAccounts/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

| Parameter Name | Type | Default Value | Description |
| :-- | :-- | :-- | :-- |
| `cMKKeyVaultResourceId` | string | `''` | The resource ID of a key vault to reference a customer managed key for encryption from. Required if 'cMKKeyName' is not empty. |
| `keyVaultReferenceResourceId` | string | `''` | The key vault to associate with the Batch account. Required if the 'poolAllocationMode' is set to 'UserSubscription' and requires the service principal 'Microsoft Azure Batch' to be granted contributor permissions on this key vault. |

**Optional parameters**
Expand All @@ -40,7 +41,6 @@
| :-- | :-- | :-- | :-- | :-- |
| `allowedAuthenticationModes` | array | `[]` | `[AAD, SharedKey, TaskAuthenticationToken]` | List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. |
| `cMKKeyName` | string | `''` | | The name of the customer managed key to use for encryption. |
| `cMKKeyVaultResourceId` | string | `''` | | The resource ID of a key vault to reference a customer managed key for encryption from. |
| `cMKKeyVersion` | string | `''` | | The version of the customer managed key to reference for encryption. If not provided, the latest key version is used. |
| `diagnosticEventHubAuthorizationRuleId` | 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. |
| `diagnosticEventHubName` | 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. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = {
}

resource keyPermissions 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid('msi-${keyVault::key.id}-${location}-${managedIdentity.id}-Key-Reader-RoleAssignment')
name: guid('msi-${keyVault::key.id}-${location}-${managedIdentity.id}-Key-Key-Vault-Crypto-User-RoleAssignment')
scope: keyVault::key
properties: {
principalId: managedIdentity.properties.principalId
Expand All @@ -77,15 +77,9 @@ output subnetResourceId string = virtualNetwork.properties.subnets[0].id
@description('The resource ID of the created Key Vault.')
output keyVaultResourceId string = keyVault.id

@description('The vault URI of the created Key Vault.')
output keyVaultUri string = keyVault.properties.vaultUri

@description('The name of the created Key Vault encryption key.')
output keyVaultKeyName string = keyVault::key.name

@description('The version of the created Key Vault encryption key.')
output keyVaultKeyVersion string = last(split(keyVault::key.properties.keyUriWithVersion, '/'))

@description('The resource ID of the created Managed Identity.')
output managedIdentityResourceId string = managedIdentity.id

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,9 @@ module testDeployment '../../deploy.bicep' = {
enableDefaultTelemetry: enableDefaultTelemetry
name: '<<namePrefix>>${serviceShort}001'
kind: 'SpeechServices'
encryption: {
keySource: 'Microsoft.KeyVault'
keyVaultProperties: {
identityClientId: resourceGroupResources.outputs.managedIdentityClientId
keyName: resourceGroupResources.outputs.keyVaultKeyName
keyVaultUri: resourceGroupResources.outputs.keyVaultUri
keyversion: resourceGroupResources.outputs.keyVaultKeyVersion
}
}
cMKKeyVaultResourceId: resourceGroupResources.outputs.keyVaultResourceId
cMKKeyName: resourceGroupResources.outputs.keyVaultKeyName
cMKUserAssignedIdentityResourceId: resourceGroupResources.outputs.managedIdentityResourceId
publicNetworkAccess: 'Enabled'
sku: 'S0'
userAssignedIdentities: {
Expand Down
44 changes: 40 additions & 4 deletions modules/Microsoft.CognitiveServices/accounts/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,20 @@ param apiProperties object = {}
@description('Optional. Allow only Azure AD authentication. Should be enabled for security reasons.')
param disableLocalAuth bool = true

@description('Optional. Properties to configure encryption.')
param encryption object = {}
@description('Conditional. The resource ID of a key vault to reference a customer managed key for encryption from. Required if \'cMKKeyName\' is not empty.')
param cMKKeyVaultResourceId string = ''

@description('Optional. The name of the customer managed key to use for encryption. Cannot be deployed together with the parameter \'systemAssignedIdentity\' enabled.')
param cMKKeyName string = ''

@description('Conditional. User assigned identity to use when fetching the customer managed key. Required if \'cMKKeyName\' is not empty.')
param cMKUserAssignedIdentityResourceId string = ''

@description('Optional. The version of the customer managed key to reference for encryption. If not provided, latest is used.')
param cMKKeyVersion string = ''

@description('Optional. The flag to enable dynamic throttling.')
param dynamicThrottlingEnabled bool = false

@description('Optional. Resource migration token.')
param migrationToken string = ''
Expand Down Expand Up @@ -195,7 +207,22 @@ resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (ena
}
}

resource cognitiveServices 'Microsoft.CognitiveServices/accounts@2021-10-01' = {
resource cMKKeyVault 'Microsoft.KeyVault/vaults@2021-06-01-preview' existing = if (!empty(cMKKeyVaultResourceId)) {
name: last(split(cMKKeyVaultResourceId, '/'))
scope: resourceGroup(split(cMKKeyVaultResourceId, '/')[2], split(cMKKeyVaultResourceId, '/')[4])
}

resource cMKKeyVaultKey 'Microsoft.KeyVault/vaults/keys@2021-10-01' existing = if (!empty(cMKKeyVaultResourceId) && !empty(cMKKeyName)) {
name: '${last(split(cMKKeyVaultResourceId, '/'))}/${cMKKeyName}'
scope: resourceGroup(split(cMKKeyVaultResourceId, '/')[2], split(cMKKeyVaultResourceId, '/')[4])
}

resource cMKUserAssignedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' existing = if (!empty(cMKUserAssignedIdentityResourceId)) {
name: last(split(cMKUserAssignedIdentityResourceId, '/'))
scope: resourceGroup(split(cMKUserAssignedIdentityResourceId, '/')[2], split(cMKUserAssignedIdentityResourceId, '/')[4])
}

resource cognitiveServices 'Microsoft.CognitiveServices/accounts@2022-10-01' = {
name: name
kind: kind
identity: identity
Expand All @@ -215,11 +242,20 @@ resource cognitiveServices 'Microsoft.CognitiveServices/accounts@2021-10-01' = {
allowedFqdnList: allowedFqdnList
apiProperties: apiProperties
disableLocalAuth: disableLocalAuth
encryption: !empty(encryption) ? encryption : null
encryption: !empty(cMKKeyName) ? {
keySource: 'Microsoft.KeyVault'
keyVaultProperties: {
identityClientId: cMKUserAssignedIdentity.properties.clientId
keyVaultUri: cMKKeyVault.properties.vaultUri
keyName: cMKKeyName
keyVersion: !empty(cMKKeyVersion) ? cMKKeyVersion : last(split(cMKKeyVaultKey.properties.keyUriWithVersion, '/'))
}
} : null
migrationToken: !empty(migrationToken) ? migrationToken : null
restore: restore
restrictOutboundNetworkAccess: restrictOutboundNetworkAccess
userOwnedStorage: !empty(userOwnedStorage) ? userOwnedStorage : null
dynamicThrottlingEnabled: dynamicThrottlingEnabled
}
}

Expand Down
40 changes: 18 additions & 22 deletions modules/Microsoft.CognitiveServices/accounts/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This module deploys different kinds of cognitive services resources
| :-- | :-- |
| `Microsoft.Authorization/locks` | [2020-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-05-01/locks) |
| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
| `Microsoft.CognitiveServices/accounts` | [2021-10-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.CognitiveServices/2021-10-01/accounts) |
| `Microsoft.CognitiveServices/accounts` | [2022-10-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.CognitiveServices/2022-10-01/accounts) |
| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |
| `Microsoft.Network/privateEndpoints` | [2022-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Network/2022-05-01/privateEndpoints) |
| `Microsoft.Network/privateEndpoints/privateDnsZoneGroups` | [2022-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Network/2022-05-01/privateEndpoints/privateDnsZoneGroups) |
Expand All @@ -35,6 +35,8 @@ This module deploys different kinds of cognitive services resources

| Parameter Name | Type | Default Value | Description |
| :-- | :-- | :-- | :-- |
| `cMKKeyVaultResourceId` | string | `''` | The resource ID of a key vault to reference a customer managed key for encryption from. Required if 'cMKKeyName' is not empty. |
| `cMKUserAssignedIdentityResourceId` | string | `''` | User assigned identity to use when fetching the customer managed key. Required if 'cMKKeyName' is not empty. |
| `customSubDomainName` | string | `''` | Subdomain name used for token-based authentication. Required if 'networkAcls' or 'privateEndpoints' are set. |
| `userAssignedIdentities` | object | `{object}` | The ID(s) to assign to the resource. Required if a user assigned identity is used for encryption. |

Expand All @@ -44,6 +46,8 @@ This module deploys different kinds of cognitive services resources
| :-- | :-- | :-- | :-- | :-- |
| `allowedFqdnList` | array | `[]` | | List of allowed FQDN. |
| `apiProperties` | object | `{object}` | | The API properties for special APIs. |
| `cMKKeyName` | string | `''` | | The name of the customer managed key to use for encryption. Cannot be deployed together with the parameter 'systemAssignedIdentity' enabled. |
| `cMKKeyVersion` | string | `''` | | The version of the customer managed key to reference for encryption. If not provided, latest is used. |
| `diagnosticEventHubAuthorizationRuleId` | 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. |
| `diagnosticEventHubName` | 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. |
| `diagnosticLogCategoriesToEnable` | array | `[Audit, RequestResponse]` | `[Audit, RequestResponse]` | The name of logs that will be streamed. |
Expand All @@ -53,8 +57,8 @@ This module deploys different kinds of cognitive services resources
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
| `diagnosticWorkspaceId` | string | `''` | | Resource ID of the diagnostic log analytics workspace. |
| `disableLocalAuth` | bool | `True` | | Allow only Azure AD authentication. Should be enabled for security reasons. |
| `dynamicThrottlingEnabled` | bool | `False` | | The flag to enable dynamic throttling. |
| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via a Globally Unique Identifier (GUID). |
| `encryption` | object | `{object}` | | Properties to configure encryption. |
| `location` | string | `[resourceGroup().location]` | | Location for all Resources. |
| `lock` | string | `''` | `['', CanNotDelete, ReadOnly]` | Specify the type of lock. |
| `migrationToken` | string | `''` | | Resource migration token. |
Expand Down Expand Up @@ -606,16 +610,10 @@ module accounts './Microsoft.CognitiveServices/accounts/deploy.bicep' = {
kind: 'SpeechServices'
name: '<<namePrefix>>csaencr001'
// Non-required parameters
cMKKeyName: '<cMKKeyName>'
cMKKeyVaultResourceId: '<cMKKeyVaultResourceId>'
cMKUserAssignedIdentityResourceId: '<cMKUserAssignedIdentityResourceId>'
enableDefaultTelemetry: '<enableDefaultTelemetry>'
encryption: {
keySource: 'Microsoft.KeyVault'
keyVaultProperties: {
identityClientId: '<identityClientId>'
keyName: '<keyName>'
keyVaultUri: '<keyVaultUri>'
keyversion: '<keyversion>'
}
}
publicNetworkAccess: 'Enabled'
sku: 'S0'
userAssignedIdentities: {
Expand Down Expand Up @@ -645,20 +643,18 @@ module accounts './Microsoft.CognitiveServices/accounts/deploy.bicep' = {
"value": "<<namePrefix>>csaencr001"
},
// Non-required parameters
"cMKKeyName": {
"value": "<cMKKeyName>"
},
"cMKKeyVaultResourceId": {
"value": "<cMKKeyVaultResourceId>"
},
"cMKUserAssignedIdentityResourceId": {
"value": "<cMKUserAssignedIdentityResourceId>"
},
"enableDefaultTelemetry": {
"value": "<enableDefaultTelemetry>"
},
"encryption": {
"value": {
"keySource": "Microsoft.KeyVault",
"keyVaultProperties": {
"identityClientId": "<identityClientId>",
"keyName": "<keyName>",
"keyVaultUri": "<keyVaultUri>",
"keyversion": "<keyversion>"
}
}
},
"publicNetworkAccess": {
"value": "Enabled"
},
Expand Down
4 changes: 2 additions & 2 deletions modules/Microsoft.ContainerRegistry/registries/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (ena
}
}

resource encryptionIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' existing = if (!empty(cMKUserAssignedIdentityResourceId)) {
resource cMKUserAssignedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' existing = if (!empty(cMKUserAssignedIdentityResourceId)) {
name: last(split(cMKUserAssignedIdentityResourceId, '/'))
scope: resourceGroup(split(cMKUserAssignedIdentityResourceId, '/')[2], split(cMKUserAssignedIdentityResourceId, '/')[4])
}
Expand All @@ -245,7 +245,7 @@ resource registry 'Microsoft.ContainerRegistry/registries@2022-02-01-preview' =
encryption: !empty(cMKKeyName) ? {
status: 'enabled'
keyVaultProperties: {
identity: encryptionIdentity.properties.clientId
identity: cMKUserAssignedIdentity.properties.clientId
keyIdentifier: !empty(cMKKeyVersion) ? '${cMKKeyVaultKey.properties.keyUri}/${cMKKeyVersion}' : cMKKeyVaultKey.properties.keyUriWithVersion
}
} : null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,18 @@ param count int = 1
param sourceResourceId string = ''

@description('Optional. Whether to enable auto-scaler.')
@allowed([
true
false
])
param enableAutoScaling bool = false

@description('Optional. This is only supported on certain VM sizes and in certain Azure regions. For more information, see: /azure/aks/enable-host-encryption. For security reasons, this setting should be enabled.')
@allowed([
true
false
])
param enableEncryptionAtHost bool = false

@description('Optional. See Add a FIPS-enabled node pool (https://docs.microsoft.com/en-us/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details.')
@allowed([
true
false
])
param enableFIPS bool = false

@description('Optional. Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see assigning a public IP per node (https://docs.microsoft.com/en-us/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false.')
@allowed([
true
false
])
@description('Optional. Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see assigning a public IP per node (https://docs.microsoft.com/en-us/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools).')
param enableNodePublicIP bool = false

@description('Optional. Whether to enable UltraSSD.')
@allowed([
true
false
])
param enableUltraSSD bool = false

@description('Optional. GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.')
Expand Down
Loading