diff --git a/bicepconfig.json b/bicepconfig.json index 6f7008fa9f..3fd4240a72 100644 --- a/bicepconfig.json +++ b/bicepconfig.json @@ -7,6 +7,9 @@ "rules": { "explicit-values-for-loc-params": { "level": "off" // Reason: Our modules default to e.g. the location of their parent resource group which is sufficient if deploying a self-contained solution + }, + "prefer-unquoted-property-names": { + "level": "off" // Reason: This complains primarily about RBAC roles which are all in quotes to be consistent within the list of roles with and without spaces in their name } } } diff --git a/modules/Microsoft.AAD/DomainServices/deploy.bicep b/modules/Microsoft.AAD/DomainServices/deploy.bicep index 4ebf3faacb..6dd0d3441b 100644 --- a/modules/Microsoft.AAD/DomainServices/deploy.bicep +++ b/modules/Microsoft.AAD/DomainServices/deploy.bicep @@ -35,7 +35,7 @@ param additionalRecipients array = [] ]) param domainConfigurationType string = 'FullySynced' -@description('Optional. The value is to synchronise scoped users and groups.') +@description('Optional. The value is to synchronize scoped users and groups.') param filteredSync string = 'Enabled' @description('Optional. The value is to enable clients making request using TLSv1.') diff --git a/modules/Microsoft.AAD/DomainServices/readme.md b/modules/Microsoft.AAD/DomainServices/readme.md index 3983b63fe0..54da13d95d 100644 --- a/modules/Microsoft.AAD/DomainServices/readme.md +++ b/modules/Microsoft.AAD/DomainServices/readme.md @@ -44,7 +44,7 @@ This template deploys Azure Active Directory Domain Services (AADDS). | `domainConfigurationType` | string | `'FullySynced'` | `[FullySynced, ResourceTrusting]` | The value is to provide domain configuration type. | | `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via the Customer Usage Attribution ID (GUID). | | `externalAccess` | string | `'Enabled'` | `[Enabled, Disabled]` | The value is to enable the Secure LDAP for external services of Azure ADDS Services. | -| `filteredSync` | string | `'Enabled'` | | The value is to synchronise scoped users and groups. | +| `filteredSync` | string | `'Enabled'` | | The value is to synchronize scoped users and groups. | | `kerberosArmoring` | string | `'Enabled'` | `[Enabled, Disabled]` | The value is to enable to provide a protected channel between the Kerberos client and the KDC. | | `kerberosRc4Encryption` | string | `'Enabled'` | `[Enabled, Disabled]` | The value is to enable Kerberos requests that use RC4 encryption. | | `ldaps` | string | `'Enabled'` | `[Enabled, Disabled]` | A flag to determine whether or not Secure LDAP is enabled or disabled. | @@ -207,72 +207,11 @@ $pfxCertificate = [System.Convert]::ToBase64String($rawCertByteStream) ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "domainName": { - "value": "<>.onmicrosoft.com" - }, - "sku": { - "value": "Standard" - }, - "lock": { - "value": "CanNotDelete" - }, - "replicaSets": { - "value": [ - { - "location": "WestEurope", - "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-aadds-001/subnets/AADDSSubnet" - } - ] - }, - "pfxCertificate": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "pfxBase64Certificate" - } - }, - "pfxCertificatePassword": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "pfxCertificatePassword" - } - }, - "additionalRecipients": { - "value": [ - "<>@noreply.github.com" - ] - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Parameters

@@ -287,24 +226,94 @@ resource kv1 'Microsoft.KeyVault/vaults@2019-09-01' existing = { module DomainServices './Microsoft.AAD/DomainServices/deploy.bicep' = { name: '${uniqueString(deployment().name)}-DomainServices' params: { + // Required parameters domainName: '<>.onmicrosoft.com' - sku: 'Standard' + // Non-required parameters + additionalRecipients: [ + '<>@noreply.github.com' + ] + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' lock: 'CanNotDelete' + pfxCertificate: kv1.getSecret('pfxBase64Certificate') + pfxCertificatePassword: kv1.getSecret('pfxCertificatePassword') replicaSets: [ { location: 'WestEurope' subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-aadds-001/subnets/AADDSSubnet' } ] - pfxCertificate: kv1.getSecret('pfxBase64Certificate') - pfxCertificatePassword: kv1.getSecret('pfxCertificatePassword') - additionalRecipients: [ - '<>@noreply.github.com' - ] - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + sku: 'Standard' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "domainName": { + "value": "<>.onmicrosoft.com" + }, + // Non-required parameters + "additionalRecipients": { + "value": [ + "<>@noreply.github.com" + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "pfxCertificate": { + "reference": { + "keyVault": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "secretName": "pfxBase64Certificate" + } + }, + "pfxCertificatePassword": { + "reference": { + "keyVault": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "secretName": "pfxCertificatePassword" + } + }, + "replicaSets": { + "value": [ + { + "location": "WestEurope", + "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-aadds-001/subnets/AADDSSubnet" + } + ] + }, + "sku": { + "value": "Standard" + } } } ``` diff --git a/modules/Microsoft.AnalysisServices/servers/readme.md b/modules/Microsoft.AnalysisServices/servers/readme.md index a5e08d351a..3b1fe5c97a 100644 --- a/modules/Microsoft.AnalysisServices/servers/readme.md +++ b/modules/Microsoft.AnalysisServices/servers/readme.md @@ -157,82 +157,11 @@ roleAssignments: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>azasweumax001" - }, - "lock": { - "value": "CanNotDelete" - }, - "skuName": { - "value": "S0" - }, - "skuCapacity": { - "value": 1 - }, - "firewallSettings": { - "value": { - "firewallRules": [ - { - "firewallRuleName": "AllowFromAll", - "rangeStart": "0.0.0.0", - "rangeEnd": "255.255.255.255" - } - ], - "enablePowerBIService": true - } - }, - "diagnosticLogsRetentionInDays": { - "value": 365 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogCategoriesToEnable": { - "value": [ - "Engine", - "Service" - ] - }, - "diagnosticMetricsToEnable": { - "value": [ - "AllMetrics" - ] - } - } -} -``` - -
+

Example 1: Max

@@ -242,40 +171,42 @@ roleAssignments: [ module servers './Microsoft.AnalysisServices/servers/deploy.bicep' = { name: '${uniqueString(deployment().name)}-servers' params: { + // Required parameters name: '<>azasweumax001' - lock: 'CanNotDelete' - skuName: 'S0' - skuCapacity: 1 + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogCategoriesToEnable: [ + 'Engine' + 'Service' + ] + diagnosticLogsRetentionInDays: 365 + diagnosticMetricsToEnable: [ + 'AllMetrics' + ] + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' firewallSettings: { + enablePowerBIService: true firewallRules: [ { firewallRuleName: 'AllowFromAll' - rangeStart: '0.0.0.0' rangeEnd: '255.255.255.255' + rangeStart: '0.0.0.0' } ] - enablePowerBIService: true } - diagnosticLogsRetentionInDays: 365 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogCategoriesToEnable: [ - 'Engine' - 'Service' - ] - diagnosticMetricsToEnable: [ - 'AllMetrics' - ] + skuCapacity: 1 + skuName: 'S0' } } ``` @@ -283,25 +214,85 @@ module servers './Microsoft.AnalysisServices/servers/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>azasweumin001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>azasweumax001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogCategoriesToEnable": { + "value": [ + "Engine", + "Service" + ] + }, + "diagnosticLogsRetentionInDays": { + "value": 365 + }, + "diagnosticMetricsToEnable": { + "value": [ + "AllMetrics" + ] + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "firewallSettings": { + "value": { + "enablePowerBIService": true, + "firewallRules": [ + { + "firewallRuleName": "AllowFromAll", + "rangeEnd": "255.255.255.255", + "rangeStart": "0.0.0.0" + } + ] + } + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] + }, + "skuCapacity": { + "value": 1 + }, + "skuName": { + "value": "S0" } + } } ```
+

+ +

Example 2: Min

@@ -319,56 +310,26 @@ module servers './Microsoft.AnalysisServices/servers/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>azasweux001" - }, - "lock": { - "value": "CanNotDelete" - }, - "skuName": { - "value": "S0" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>azasweumin001" } + } } ```
+

+ +

Example 3: Parameters

@@ -378,22 +339,76 @@ module servers './Microsoft.AnalysisServices/servers/deploy.bicep' = { module servers './Microsoft.AnalysisServices/servers/deploy.bicep' = { name: '${uniqueString(deployment().name)}-servers' params: { + // Required parameters name: '<>azasweux001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' lock: 'CanNotDelete' - skuName: 'S0' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + skuName: 'S0' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>azasweux001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "skuName": { + "value": "S0" + } } } ``` diff --git a/modules/Microsoft.ApiManagement/service/readme.md b/modules/Microsoft.ApiManagement/service/readme.md index c6734912af..f77ca283df 100644 --- a/modules/Microsoft.ApiManagement/service/readme.md +++ b/modules/Microsoft.ApiManagement/service/readme.md @@ -268,193 +268,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-apim-max-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "publisherEmail": { - "value": "apimgmt-noreply@mail.windowsazure.com" - }, - "publisherName": { - "value": "<>-az-amorg-x-001" - }, - "apis": { - "value": [ - { - "name": "echo-api", - "displayName": "Echo API", - "path": "echo", - "serviceUrl": "http://echoapi.cloudapp.net/api", - "apiVersionSet": { - "name": "echo-version-set", - "properties": { - "description": "echo-version-set", - "displayName": "echo-version-set", - "versioningScheme": "Segment" - } - } - } - ] - }, - "authorizationServers": { - "value": [ - { - "name": "AuthServer1", - "authorizationEndpoint": "https://login.microsoftonline.com/651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/authorize", - "grantTypes": [ - "authorizationCode" - ], - "clientCredentialsKeyVaultId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", - "clientIdSecretName": "apimclientid", - "clientSecretSecretName": "apimclientsecret", - "clientRegistrationEndpoint": "http://localhost", - "tokenEndpoint": "https://login.microsoftonline.com/651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/token" - } - ] - }, - "backends": { - "value": [ - { - "name": "backend", - "url": "http://echoapi.cloudapp.net/api", - "tls": { - "validateCertificateChain": false, - "validateCertificateName": false - } - } - ] - }, - "caches": { - "value": [ - { - "name": "westeurope", - "connectionString": "connectionstringtest", - "useFromLocation": "westeurope" - } - ] - }, - "identityProviders": { - "value": [ - { - "name": "aadProvider" - } - ] - }, - "namedValues": { - "value": [ - { - "name": "apimkey", - "displayName": "apimkey", - "secret": true - } - ] - }, - "policies": { - "value": [ - { - "value": " ", - "format": "xml" - } - ] - }, - "portalSettings": { - "value": [ - { - "name": "signin", - "properties": { - "enabled": false - } - }, - { - "name": "signup", - "properties": { - "enabled": false, - "termsOfService": { - "enabled": false, - "consentRequired": false - } - } - } - ] - }, - "products": { - "value": [ - { - "name": "Starter", - "subscriptionRequired": false, - "approvalRequired": false, - "apis": [ - { - "name": "echo-api" - } - ], - "groups": [ - { - "name": "developers" - } - ] - } - ] - }, - "subscriptions": { - "value": [ - { - "scope": "/apis", - "name": "testArmSubscriptionAllApis" - } - ] - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Max

@@ -464,16 +282,13 @@ userAssignedIdentities: { module service './Microsoft.ApiManagement/service/deploy.bicep' = { name: '${uniqueString(deployment().name)}-service' params: { + // Required parameters name: '<>-az-apim-max-001' - lock: 'CanNotDelete' publisherEmail: 'apimgmt-noreply@mail.windowsazure.com' publisherName: '<>-az-amorg-x-001' + // Non-required parameters apis: [ { - name: 'echo-api' - displayName: 'Echo API' - path: 'echo' - serviceUrl: 'http://echoapi.cloudapp.net/api' apiVersionSet: { name: 'echo-version-set' properties: { @@ -482,55 +297,65 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { versioningScheme: 'Segment' } } + displayName: 'Echo API' + name: 'echo-api' + path: 'echo' + serviceUrl: 'http://echoapi.cloudapp.net/api' } ] authorizationServers: [ { - name: 'AuthServer1' authorizationEndpoint: 'https://login.microsoftonline.com/651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/authorize' - grantTypes: [ - 'authorizationCode' - ] clientCredentialsKeyVaultId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' clientIdSecretName: 'apimclientid' - clientSecretSecretName: 'apimclientsecret' clientRegistrationEndpoint: 'http://localhost' + clientSecretSecretName: 'apimclientsecret' + grantTypes: [ + 'authorizationCode' + ] + name: 'AuthServer1' tokenEndpoint: 'https://login.microsoftonline.com/651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/token' } ] backends: [ { name: 'backend' - url: 'http://echoapi.cloudapp.net/api' tls: { validateCertificateChain: false validateCertificateName: false } + url: 'http://echoapi.cloudapp.net/api' } ] caches: [ { - name: 'westeurope' connectionString: 'connectionstringtest' + name: 'westeurope' useFromLocation: 'westeurope' } ] + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' identityProviders: [ { name: 'aadProvider' } ] + lock: 'CanNotDelete' namedValues: [ { - name: 'apimkey' displayName: 'apimkey' + name: 'apimkey' secret: true } ] policies: [ { - value: ' ' format: 'xml' + value: ' ' } ] portalSettings: [ @@ -545,52 +370,47 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { properties: { enabled: false termsOfService: { - enabled: false consentRequired: false + enabled: false } } } ] products: [ { - name: 'Starter' - subscriptionRequired: false - approvalRequired: false apis: [ { name: 'echo-api' } ] + approvalRequired: false groups: [ { name: 'developers' } ] + name: 'Starter' + subscriptionRequired: false + } + ] + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' } ] subscriptions: [ { - scope: '/apis' name: 'testArmSubscriptionAllApis' + scope: '/apis' } ] systemAssignedIdentity: true userAssignedIdentities: { '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' } } ``` @@ -598,31 +418,196 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-apim-min-001" - }, - "publisherEmail": { - "value": "apimgmt-noreply@mail.windowsazure.com" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-apim-max-001" + }, + "publisherEmail": { + "value": "apimgmt-noreply@mail.windowsazure.com" + }, + "publisherName": { + "value": "<>-az-amorg-x-001" + }, + // Non-required parameters + "apis": { + "value": [ + { + "apiVersionSet": { + "name": "echo-version-set", + "properties": { + "description": "echo-version-set", + "displayName": "echo-version-set", + "versioningScheme": "Segment" + } + }, + "displayName": "Echo API", + "name": "echo-api", + "path": "echo", + "serviceUrl": "http://echoapi.cloudapp.net/api" + } + ] + }, + "authorizationServers": { + "value": [ + { + "authorizationEndpoint": "https://login.microsoftonline.com/651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/authorize", + "clientCredentialsKeyVaultId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", + "clientIdSecretName": "apimclientid", + "clientRegistrationEndpoint": "http://localhost", + "clientSecretSecretName": "apimclientsecret", + "grantTypes": [ + "authorizationCode" + ], + "name": "AuthServer1", + "tokenEndpoint": "https://login.microsoftonline.com/651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/token" + } + ] + }, + "backends": { + "value": [ + { + "name": "backend", + "tls": { + "validateCertificateChain": false, + "validateCertificateName": false + }, + "url": "http://echoapi.cloudapp.net/api" + } + ] + }, + "caches": { + "value": [ + { + "connectionString": "connectionstringtest", + "name": "westeurope", + "useFromLocation": "westeurope" + } + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "identityProviders": { + "value": [ + { + "name": "aadProvider" + } + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "namedValues": { + "value": [ + { + "displayName": "apimkey", + "name": "apimkey", + "secret": true + } + ] + }, + "policies": { + "value": [ + { + "format": "xml", + "value": " " + } + ] + }, + "portalSettings": { + "value": [ + { + "name": "signin", + "properties": { + "enabled": false + } }, - "publisherName": { - "value": "<>-az-amorg-x-001" + { + "name": "signup", + "properties": { + "enabled": false, + "termsOfService": { + "consentRequired": false, + "enabled": false + } + } } + ] + }, + "products": { + "value": [ + { + "apis": [ + { + "name": "echo-api" + } + ], + "approvalRequired": false, + "groups": [ + { + "name": "developers" + } + ], + "name": "Starter", + "subscriptionRequired": false + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "subscriptions": { + "value": [ + { + "name": "testArmSubscriptionAllApis", + "scope": "/apis" + } + ] + }, + "systemAssignedIdentity": { + "value": true + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } } + } } ```
+

+ +

Example 2: Min

@@ -632,6 +617,7 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { module service './Microsoft.ApiManagement/service/deploy.bicep' = { name: '${uniqueString(deployment().name)}-service' params: { + // Required parameters name: '<>-az-apim-min-001' publisherEmail: 'apimgmt-noreply@mail.windowsazure.com' publisherName: '<>-az-amorg-x-001' @@ -642,72 +628,33 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-apim-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "publisherEmail": { - "value": "apimgmt-noreply@mail.windowsazure.com" - }, - "publisherName": { - "value": "<>-az-amorg-x-001" - }, - "portalSettings": { - "value": [ - { - "name": "signin", - "properties": { - "enabled": false - } - }, - { - "name": "signup", - "properties": { - "enabled": false, - "termsOfService": { - "enabled": false, - "consentRequired": false - } - } - } - ] - }, - "policies": { - "value": [ - { - "value": " ", - "format": "xml" - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-apim-min-001" + }, + "publisherEmail": { + "value": "apimgmt-noreply@mail.windowsazure.com" + }, + "publisherName": { + "value": "<>-az-amorg-x-001" } + } } ```
+

+ +

Example 3: Parameters

@@ -717,10 +664,18 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { module service './Microsoft.ApiManagement/service/deploy.bicep' = { name: '${uniqueString(deployment().name)}-service' params: { + // Required parameters name: '<>-az-apim-x-001' - lock: 'CanNotDelete' publisherEmail: 'apimgmt-noreply@mail.windowsazure.com' publisherName: '<>-az-amorg-x-001' + // Non-required parameters + lock: 'CanNotDelete' + policies: [ + { + format: 'xml' + value: ' ' + } + ] portalSettings: [ { name: 'signin' @@ -733,24 +688,18 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { properties: { enabled: false termsOfService: { - enabled: false consentRequired: false + enabled: false } } } ] - policies: [ - { - value: ' ' - format: 'xml' - } - ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -759,3 +708,71 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-apim-x-001" + }, + "publisherEmail": { + "value": "apimgmt-noreply@mail.windowsazure.com" + }, + "publisherName": { + "value": "<>-az-amorg-x-001" + }, + // Non-required parameters + "lock": { + "value": "CanNotDelete" + }, + "policies": { + "value": [ + { + "format": "xml", + "value": " " + } + ] + }, + "portalSettings": { + "value": [ + { + "name": "signin", + "properties": { + "enabled": false + } + }, + { + "name": "signup", + "properties": { + "enabled": false, + "termsOfService": { + "consentRequired": false, + "enabled": false + } + } + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.AppConfiguration/configurationStores/keyValues/readme.md b/modules/Microsoft.AppConfiguration/configurationStores/keyValues/readme.md index f70de3d865..e1b3cade81 100644 --- a/modules/Microsoft.AppConfiguration/configurationStores/keyValues/readme.md +++ b/modules/Microsoft.AppConfiguration/configurationStores/keyValues/readme.md @@ -7,7 +7,6 @@ This module deploys an App Configuration Store. - [Resource types](#Resource-types) - [Parameters](#Parameters) - [Outputs](#Outputs) -- [Deployment examples](#Deployment-examples) ## Resource types @@ -169,85 +168,6 @@ roleAssignments: [

-======= -### Parameter Usage: `privateEndpoints` - -To use Private Endpoint the following dependencies must be deployed: - -- Destination subnet must be created with the following configuration option - `"privateEndpointNetworkPolicies": "Disabled"`. Setting this option acknowledges that NSG rules are not applied to Private Endpoints (this capability is coming soon). A full example is available in the Virtual Network Module. -- Although not strictly required, it is highly recommended to first create a private DNS Zone to host Private Endpoint DNS records. See [Azure Private Endpoint DNS configuration](https://docs.microsoft.com/en-us/azure/private-link/private-endpoint-dns) for more information. - -

- -Parameter JSON format - -```json -"privateEndpoints": { - "value": [ - // Example showing all available fields - { - "name": "sxx-az-pe", // Optional: Name will be automatically generated if one is not provided here - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/sxx-az-vnet-x-001/subnets/sxx-az-subnet-x-001", - "service": "<>", // e.g. vault, registry, file, blob, queue, table etc. - "privateDnsZoneResourceIds": [ // Optional: No DNS record will be created if a private DNS zone Resource ID is not specified - "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/privatelink.blob.core.windows.net" - ], - "customDnsConfigs": [ // Optional - { - "fqdn": "customname.test.local", - "ipAddresses": [ - "10.10.10.10" - ] - } - ] - }, - // Example showing only mandatory fields - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/sxx-az-vnet-x-001/subnets/sxx-az-subnet-x-001", - "service": "<>" // e.g. vault, registry, file, blob, queue, table etc. - } - ] -} -``` - -
- -
- -Bicep format - -```bicep -privateEndpoints: [ - // Example showing all available fields - { - name: 'sxx-az-pe' // Optional: Name will be automatically generated if one is not provided here - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/sxx-az-vnet-x-001/subnets/sxx-az-subnet-x-001' - service: '<>' // e.g. vault registry file blob queue table etc. - privateDnsZoneResourceIds: [ // Optional: No DNS record will be created if a private DNS zone Resource ID is not specified - '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/privatelink.blob.core.windows.net' - ] - // Optional - customDnsConfigs: [ - { - fqdn: 'customname.test.local' - ipAddresses: [ - '10.10.10.10' - ] - } - ] - } - // Example showing only mandatory fields - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/sxx-az-vnet-x-001/subnets/sxx-az-subnet-x-001' - service: '<>' // e.g. vault registry file blob queue table etc. - } -] -``` - -
-

- ->>>>>>> 3c13c7e234f0efcae26a25417453c58843d2002d ## Outputs | Output Name | Type | Description | @@ -255,153 +175,3 @@ privateEndpoints: [ | `name` | string | The name of the key values. | | `resourceGroupName` | string | The resource group the batch account was deployed into. | | `resourceId` | string | The resource ID of the key values. | - -## Deployment examples - -

Example 1

- -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-appcs-min-001" - } - } -} - -``` - -
- -
- -via Bicep module - -```bicep -module configurationStores './Microsoft.AppConfiguration/configurationStores/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-configurationStores' - params: { - name: '<>-az-appcs-min-001' - } -``` - -
-

- -

Example 2

- -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-appcs-x-001" - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "systemAssignedIdentity": { - "value": true - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "createMode": { - "value": "Default" - }, - "disableLocalAuth": { - "value": false - }, - "enablePurgeProtection": { - "value": false - }, - "publicNetworkAccess": { - "value": "Enabled" - }, - "softDeleteRetentionInDays": { - "value": 1 - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "configurationStores" - } - ] - } - } -} - -``` - -
- -
- -via Bicep module - -```bicep -module configurationStores './Microsoft.AppConfiguration/configurationStores/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-configurationStores' - params: { - name: '<>-az-appcs-x-001' - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' - systemAssignedIdentity: true - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] - createMode: 'Default' - disableLocalAuth: false - enablePurgeProtection: false - publicNetworkAccess: 'Enabled' - softDeleteRetentionInDays: 1 - privateEndpoints: [ - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'configurationStores' - } - ] - } -``` - -
-

diff --git a/modules/Microsoft.AppConfiguration/configurationStores/readme.md b/modules/Microsoft.AppConfiguration/configurationStores/readme.md index 42e1502cd5..7651115a55 100644 --- a/modules/Microsoft.AppConfiguration/configurationStores/readme.md +++ b/modules/Microsoft.AppConfiguration/configurationStores/readme.md @@ -189,7 +189,6 @@ roleAssignments: [

-======= ### Parameter Usage: `privateEndpoints` To use Private Endpoint the following dependencies must be deployed: @@ -267,7 +266,6 @@ privateEndpoints: [

->>>>>>> 3c13c7e234f0efcae26a25417453c58843d2002d ## Outputs | Output Name | Type | Description | @@ -280,25 +278,11 @@ privateEndpoints: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-appcs-min-001" - } - } -} -``` - -
+

Example 1: Min

@@ -316,96 +300,26 @@ module configurationStores './Microsoft.AppConfiguration/configurationStores/dep

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-appcs-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "systemAssignedIdentity": { - "value": true - }, - "keyValues": { - "value": [ - { - "name": "keyName", - "value": "valueName", - "contentType": "contentType", - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "createMode": { - "value": "Default" - }, - "disableLocalAuth": { - "value": false - }, - "enablePurgeProtection": { - "value": false - }, - "publicNetworkAccess": { - "value": "Enabled" - }, - "softDeleteRetentionInDays": { - "value": 1 - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "configurationStores" - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>-az-appcs-min-001" } + } } ```
+

+ +

Example 2: Parameters

@@ -415,48 +329,142 @@ module configurationStores './Microsoft.AppConfiguration/configurationStores/dep module configurationStores './Microsoft.AppConfiguration/configurationStores/deploy.bicep' = { name: '${uniqueString(deployment().name)}-configurationStores' params: { + // Required parameters name: '<>-az-appcs-x-001' - lock: 'CanNotDelete' + // Non-required parameters + createMode: 'Default' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' diagnosticLogsRetentionInDays: 7 diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' - systemAssignedIdentity: true + disableLocalAuth: false + enablePurgeProtection: false keyValues: [ { - name: 'keyName' - value: 'valueName' contentType: 'contentType' + name: 'keyName' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + value: 'valueName' } ] + lock: 'CanNotDelete' + privateEndpoints: [ + { + service: 'configurationStores' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + ] + publicNetworkAccess: 'Enabled' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - createMode: 'Default' - disableLocalAuth: false - enablePurgeProtection: false - publicNetworkAccess: 'Enabled' softDeleteRetentionInDays: 1 - privateEndpoints: [ - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'configurationStores' - } - ] + systemAssignedIdentity: true + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-appcs-x-001" + }, + // Non-required parameters + "createMode": { + "value": "Default" + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "disableLocalAuth": { + "value": false + }, + "enablePurgeProtection": { + "value": false + }, + "keyValues": { + "value": [ + { + "contentType": "contentType", + "name": "keyName", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "value": "valueName" + } + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "privateEndpoints": { + "value": [ + { + "service": "configurationStores", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "publicNetworkAccess": { + "value": "Enabled" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "softDeleteRetentionInDays": { + "value": 1 + }, + "systemAssignedIdentity": { + "value": true + } } } ``` diff --git a/modules/Microsoft.Authorization/locks/readme.md b/modules/Microsoft.Authorization/locks/readme.md index 67a3ece4a7..c0581c16a7 100644 --- a/modules/Microsoft.Authorization/locks/readme.md +++ b/modules/Microsoft.Authorization/locks/readme.md @@ -42,31 +42,11 @@ This module deploys Authorization Locks. ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "level": { - "value": "CanNotDelete" - }, - "resourceGroupName": { - "value": "adp-<>-az-locks-rg-001" - }, - "subscriptionId": { - "value": "<>" - } - } -} -``` - -
+

Example 1: Rg

@@ -76,7 +56,9 @@ This module deploys Authorization Locks. module locks './Microsoft.Authorization/locks/deploy.bicep' = { name: '${uniqueString(deployment().name)}-locks' params: { + // Required parameters level: 'CanNotDelete' + // Non-required parameters resourceGroupName: 'adp-<>-az-locks-rg-001' subscriptionId: '<>' } @@ -85,3 +67,30 @@ module locks './Microsoft.Authorization/locks/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "level": { + "value": "CanNotDelete" + }, + // Non-required parameters + "resourceGroupName": { + "value": "adp-<>-az-locks-rg-001" + }, + "subscriptionId": { + "value": "<>" + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Authorization/policyAssignments/deploy.bicep b/modules/Microsoft.Authorization/policyAssignments/deploy.bicep index 6aa7fbf82a..bfd3872675 100644 --- a/modules/Microsoft.Authorization/policyAssignments/deploy.bicep +++ b/modules/Microsoft.Authorization/policyAssignments/deploy.bicep @@ -27,7 +27,7 @@ param identity string = 'SystemAssigned' @sys.description('Optional. The Resource ID for the user assigned identity to assign to the policy assignment.') param userAssignedIdentityId string = '' -@sys.description('Required. The IDs Of the Azure Role Definition list that is used to assign permissions to the identity. You need to provide either the fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.. See https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles for the list IDs for built-in Roles. They must match on what is on the policy definition.') +@sys.description('Optional. The IDs Of the Azure Role Definition list that is used to assign permissions to the identity. You need to provide either the fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.. See https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles for the list IDs for built-in Roles. They must match on what is on the policy definition.') param roleDefinitionIds array = [] @sys.description('Optional. The policy assignment metadata. Metadata is an open ended object and is typically a collection of key-value pairs.') diff --git a/modules/Microsoft.Authorization/policyAssignments/managementGroup/deploy.bicep b/modules/Microsoft.Authorization/policyAssignments/managementGroup/deploy.bicep index 4d8b181860..9c491f4ac8 100644 --- a/modules/Microsoft.Authorization/policyAssignments/managementGroup/deploy.bicep +++ b/modules/Microsoft.Authorization/policyAssignments/managementGroup/deploy.bicep @@ -28,7 +28,7 @@ param identity string = 'SystemAssigned' @sys.description('Optional. The Resource ID for the user assigned identity to assign to the policy assignment.') param userAssignedIdentityId string = '' -@sys.description('Required. The IDs Of the Azure Role Definition list that is used to assign permissions to the identity. You need to provide either the fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.. See https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles for the list IDs for built-in Roles. They must match on what is on the policy definition.') +@sys.description('Optional. The IDs Of the Azure Role Definition list that is used to assign permissions to the identity. You need to provide either the fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.. See https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles for the list IDs for built-in Roles. They must match on what is on the policy definition.') param roleDefinitionIds array = [] @sys.description('Optional. The policy assignment metadata. Metadata is an open ended object and is typically a collection of key-value pairs.') diff --git a/modules/Microsoft.Authorization/policyAssignments/readme.md b/modules/Microsoft.Authorization/policyAssignments/readme.md index c7ce95ebe3..1107c0467e 100644 --- a/modules/Microsoft.Authorization/policyAssignments/readme.md +++ b/modules/Microsoft.Authorization/policyAssignments/readme.md @@ -24,7 +24,6 @@ With this module you can perform policy assignments across the management group, | :-- | :-- | :-- | | `name` | string | Specifies the name of the policy assignment. Maximum length is 24 characters for management group scope, 64 characters for subscription and resource group scopes. | | `policyDefinitionId` | string | Specifies the ID of the policy definition or policy set definition being assigned. | -| `roleDefinitionIds` | array | The IDs Of the Azure Role Definition list that is used to assign permissions to the identity. You need to provide either the fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.. See https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles for the list IDs for built-in Roles. They must match on what is on the policy definition. | **Optional parameters** | Parameter Name | Type | Default Value | Allowed Values | Description | @@ -41,6 +40,7 @@ With this module you can perform policy assignments across the management group, | `notScopes` | array | `[]` | | The policy excluded scopes. | | `parameters` | object | `{object}` | | Parameters for the policy assignment if needed. | | `resourceGroupName` | string | `''` | | The Target Scope for the Policy. The name of the resource group for the policy assignment. | +| `roleDefinitionIds` | array | `[]` | | The IDs Of the Azure Role Definition list that is used to assign permissions to the identity. You need to provide either the fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.. See https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles for the list IDs for built-in Roles. They must match on what is on the policy definition. | | `subscriptionId` | string | `''` | | The Target Scope for the Policy. The subscription ID of the subscription for the policy assignment. | | `userAssignedIdentityId` | string | `''` | | The Resource ID for the user assigned identity to assign to the policy assignment. | @@ -168,28 +168,11 @@ module policyassignment 'yourpath/modules/Microsoft.Authorization.policyAssignme ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-min-mg-polAss" - }, - "policyDefinitionID": { - "value": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d" - } - } -} -``` - -
+

Example 1: Mg Min

@@ -199,6 +182,7 @@ module policyassignment 'yourpath/modules/Microsoft.Authorization.policyAssignme module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyAssignments' params: { + // Required parameters name: '<>-min-mg-polAss' policyDefinitionID: '/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d' } @@ -208,79 +192,30 @@ module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bic

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-mg-polAss" - }, - "displayName": { - "value": "[Display Name] Policy Assignment at the management group scope" - }, - "description": { - "value": "[Description] Policy Assignment at the management group scope" - }, - "policyDefinitionId": { - "value": "/providers/Microsoft.Authorization/policyDefinitions/4f9dc7db-30c1-420c-b61a-e1d640128d26" - }, - "parameters": { - "value": { - "tagName": { - "value": "env" - }, - "tagValue": { - "value": "prod" - } - } - }, - "nonComplianceMessages": { - "value": [ - { - "message": "Violated Policy Assignment - This is a Non Compliance Message" - } - ] - }, - "enforcementMode": { - "value": "DoNotEnforce" - }, - "metadata": { - "value": { - "category": "Security", - "version": "1.0" - } - }, - "location": { - "value": "australiaeast" - }, - "notScopes": { - "value": [ - "/subscriptions/<>/resourceGroups/validation-rg" - ] - }, - "identity": { - "value": "SystemAssigned" - }, - "roleDefinitionIds": { - "value": [ - "/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c" - ] - }, - "managementGroupId": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-min-mg-polAss" + }, + "policyDefinitionID": { + "value": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d" } + } } ```
+

+ +

Example 2: Mg

@@ -290,37 +225,39 @@ module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bic module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyAssignments' params: { + // Required parameters name: '<>-mg-polAss' - displayName: '[Display Name] Policy Assignment at the management group scope' - description: '[Description] Policy Assignment at the management group scope' policyDefinitionId: '/providers/Microsoft.Authorization/policyDefinitions/4f9dc7db-30c1-420c-b61a-e1d640128d26' - parameters: { - tagName: { - value: 'env' - } - tagValue: { - value: 'prod' - } + // Non-required parameters + description: '[Description] Policy Assignment at the management group scope' + displayName: '[Display Name] Policy Assignment at the management group scope' + enforcementMode: 'DoNotEnforce' + identity: 'SystemAssigned' + location: 'australiaeast' + managementGroupId: '<>' + metadata: { + category: 'Security' + version: '1.0' } nonComplianceMessages: [ { message: 'Violated Policy Assignment - This is a Non Compliance Message' } ] - enforcementMode: 'DoNotEnforce' - metadata: { - category: 'Security' - version: '1.0' - } - location: 'australiaeast' notScopes: [ '/subscriptions/<>/resourceGroups/validation-rg' ] - identity: 'SystemAssigned' + parameters: { + tagName: { + value: 'env' + } + tagValue: { + value: 'prod' + } + } roleDefinitionIds: [ '/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c' ] - managementGroupId: '<>' } } ``` @@ -328,34 +265,82 @@ module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bic

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-mg-polAss" + }, + "policyDefinitionId": { + "value": "/providers/Microsoft.Authorization/policyDefinitions/4f9dc7db-30c1-420c-b61a-e1d640128d26" + }, + // Non-required parameters + "description": { + "value": "[Description] Policy Assignment at the management group scope" + }, + "displayName": { + "value": "[Display Name] Policy Assignment at the management group scope" + }, + "enforcementMode": { + "value": "DoNotEnforce" + }, + "identity": { + "value": "SystemAssigned" + }, + "location": { + "value": "australiaeast" + }, + "managementGroupId": { + "value": "<>" + }, + "metadata": { + "value": { + "category": "Security", + "version": "1.0" + } + }, + "nonComplianceMessages": { + "value": [ + { + "message": "Violated Policy Assignment - This is a Non Compliance Message" + } + ] + }, + "notScopes": { + "value": [ + "/subscriptions/<>/resourceGroups/validation-rg" + ] + }, "parameters": { - "name": { - "value": "<>-min-rg-polAss" - }, - "policyDefinitionID": { - "value": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d" + "value": { + "tagName": { + "value": "env" }, - "subscriptionId": { - "value": "<>" - }, - "resourceGroupName": { - "value": "validation-rg" + "tagValue": { + "value": "prod" } + } + }, + "roleDefinitionIds": { + "value": [ + "/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c" + ] } + } } ```
+

+ +

Example 3: Rg Min

@@ -365,10 +350,12 @@ module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bic module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyAssignments' params: { + // Required parameters name: '<>-min-rg-polAss' policyDefinitionID: '/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d' - subscriptionId: '<>' + // Non-required parameters resourceGroupName: 'validation-rg' + subscriptionId: '<>' } } ``` @@ -376,85 +363,37 @@ module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bic

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-rg-polAss" - }, - "displayName": { - "value": "[Display Name] Policy Assignment at the resource group scope" - }, - "description": { - "value": "[Description] Policy Assignment at the resource group scope" - }, - "policyDefinitionId": { - "value": "/providers/Microsoft.Authorization/policyDefinitions/4f9dc7db-30c1-420c-b61a-e1d640128d26" - }, - "parameters": { - "value": { - "tagName": { - "value": "env" - }, - "tagValue": { - "value": "prod" - } - } - }, - "nonComplianceMessages": { - "value": [ - { - "message": "Violated Policy Assignment - This is a Non Compliance Message" - } - ] - }, - "enforcementMode": { - "value": "DoNotEnforce" - }, - "metadata": { - "value": { - "category": "Security", - "version": "1.0" - } - }, - "location": { - "value": "australiaeast" - }, - "notScopes": { - "value": [ - "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - ] - }, - "identity": { - "value": "UserAssigned" - }, - "userAssignedIdentityId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" - }, - "roleDefinitionIds": { - "value": [ - "/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c" - ] - }, - "subscriptionId": { - "value": "<>" - }, - "resourceGroupName": { - "value": "validation-rg" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-min-rg-polAss" + }, + "policyDefinitionID": { + "value": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d" + }, + // Non-required parameters + "resourceGroupName": { + "value": "validation-rg" + }, + "subscriptionId": { + "value": "<>" } + } } ```
+

+ +

Example 4: Rg

@@ -464,39 +403,41 @@ module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bic module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyAssignments' params: { + // Required parameters name: '<>-rg-polAss' - displayName: '[Display Name] Policy Assignment at the resource group scope' - description: '[Description] Policy Assignment at the resource group scope' policyDefinitionId: '/providers/Microsoft.Authorization/policyDefinitions/4f9dc7db-30c1-420c-b61a-e1d640128d26' - parameters: { - tagName: { - value: 'env' - } - tagValue: { - value: 'prod' - } + // Non-required parameters + description: '[Description] Policy Assignment at the resource group scope' + displayName: '[Display Name] Policy Assignment at the resource group scope' + enforcementMode: 'DoNotEnforce' + identity: 'UserAssigned' + location: 'australiaeast' + metadata: { + category: 'Security' + version: '1.0' } nonComplianceMessages: [ { message: 'Violated Policy Assignment - This is a Non Compliance Message' } ] - enforcementMode: 'DoNotEnforce' - metadata: { - category: 'Security' - version: '1.0' - } - location: 'australiaeast' notScopes: [ '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' ] - identity: 'UserAssigned' - userAssignedIdentityId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' + parameters: { + tagName: { + value: 'env' + } + tagValue: { + value: 'prod' + } + } + resourceGroupName: 'validation-rg' roleDefinitionIds: [ '/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c' ] subscriptionId: '<>' - resourceGroupName: 'validation-rg' + userAssignedIdentityId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' } } ``` @@ -504,31 +445,88 @@ module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bic

-

Example 5

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-rg-polAss" + }, + "policyDefinitionId": { + "value": "/providers/Microsoft.Authorization/policyDefinitions/4f9dc7db-30c1-420c-b61a-e1d640128d26" + }, + // Non-required parameters + "description": { + "value": "[Description] Policy Assignment at the resource group scope" + }, + "displayName": { + "value": "[Display Name] Policy Assignment at the resource group scope" + }, + "enforcementMode": { + "value": "DoNotEnforce" + }, + "identity": { + "value": "UserAssigned" + }, + "location": { + "value": "australiaeast" + }, + "metadata": { + "value": { + "category": "Security", + "version": "1.0" + } + }, + "nonComplianceMessages": { + "value": [ + { + "message": "Violated Policy Assignment - This is a Non Compliance Message" + } + ] + }, + "notScopes": { + "value": [ + "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + ] + }, "parameters": { - "name": { - "value": "<>-min-sub-polAss" + "value": { + "tagName": { + "value": "env" }, - "policyDefinitionID": { - "value": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d" - }, - "subscriptionId": { - "value": "<>" + "tagValue": { + "value": "prod" } + } + }, + "resourceGroupName": { + "value": "validation-rg" + }, + "roleDefinitionIds": { + "value": [ + "/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c" + ] + }, + "subscriptionId": { + "value": "<>" + }, + "userAssignedIdentityId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" } + } } ```
+

+ +

Example 5: Sub Min

@@ -538,8 +536,10 @@ module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bic module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyAssignments' params: { + // Required parameters name: '<>-min-sub-polAss' policyDefinitionID: '/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d' + // Non-required parameters subscriptionId: '<>' } } @@ -548,82 +548,34 @@ module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bic

-

Example 6

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-sub-polAss" - }, - "displayName": { - "value": "[Display Name] Policy Assignment at the subscription scope" - }, - "description": { - "value": "[Description] Policy Assignment at the subscription scope" - }, - "policyDefinitionId": { - "value": "/providers/Microsoft.Authorization/policyDefinitions/4f9dc7db-30c1-420c-b61a-e1d640128d26" - }, - "parameters": { - "value": { - "tagName": { - "value": "env" - }, - "tagValue": { - "value": "prod" - } - } - }, - "nonComplianceMessages": { - "value": [ - { - "message": "Violated Policy Assignment - This is a Non Compliance Message" - } - ] - }, - "enforcementMode": { - "value": "DoNotEnforce" - }, - "metadata": { - "value": { - "category": "Security", - "version": "1.0" - } - }, - "location": { - "value": "australiaeast" - }, - "notScopes": { - "value": [ - "/subscriptions/<>/resourceGroups/validation-rg" - ] - }, - "identity": { - "value": "UserAssigned" - }, - "userAssignedIdentityId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" - }, - "roleDefinitionIds": { - "value": [ - "/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c" - ] - }, - "subscriptionId": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-min-sub-polAss" + }, + "policyDefinitionID": { + "value": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d" + }, + // Non-required parameters + "subscriptionId": { + "value": "<>" } + } } ```
+

+ +

Example 6: Sub

@@ -633,38 +585,118 @@ module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bic module policyAssignments './Microsoft.Authorization/policyAssignments/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyAssignments' params: { + // Required parameters name: '<>-sub-polAss' - displayName: '[Display Name] Policy Assignment at the subscription scope' - description: '[Description] Policy Assignment at the subscription scope' policyDefinitionId: '/providers/Microsoft.Authorization/policyDefinitions/4f9dc7db-30c1-420c-b61a-e1d640128d26' - parameters: { - tagName: { - value: 'env' - } - tagValue: { - value: 'prod' - } + // Non-required parameters + description: '[Description] Policy Assignment at the subscription scope' + displayName: '[Display Name] Policy Assignment at the subscription scope' + enforcementMode: 'DoNotEnforce' + identity: 'UserAssigned' + location: 'australiaeast' + metadata: { + category: 'Security' + version: '1.0' } nonComplianceMessages: [ { message: 'Violated Policy Assignment - This is a Non Compliance Message' } ] - enforcementMode: 'DoNotEnforce' - metadata: { - category: 'Security' - version: '1.0' - } - location: 'australiaeast' notScopes: [ '/subscriptions/<>/resourceGroups/validation-rg' ] - identity: 'UserAssigned' - userAssignedIdentityId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' + parameters: { + tagName: { + value: 'env' + } + tagValue: { + value: 'prod' + } + } roleDefinitionIds: [ '/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c' ] subscriptionId: '<>' + userAssignedIdentityId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-sub-polAss" + }, + "policyDefinitionId": { + "value": "/providers/Microsoft.Authorization/policyDefinitions/4f9dc7db-30c1-420c-b61a-e1d640128d26" + }, + // Non-required parameters + "description": { + "value": "[Description] Policy Assignment at the subscription scope" + }, + "displayName": { + "value": "[Display Name] Policy Assignment at the subscription scope" + }, + "enforcementMode": { + "value": "DoNotEnforce" + }, + "identity": { + "value": "UserAssigned" + }, + "location": { + "value": "australiaeast" + }, + "metadata": { + "value": { + "category": "Security", + "version": "1.0" + } + }, + "nonComplianceMessages": { + "value": [ + { + "message": "Violated Policy Assignment - This is a Non Compliance Message" + } + ] + }, + "notScopes": { + "value": [ + "/subscriptions/<>/resourceGroups/validation-rg" + ] + }, + "parameters": { + "value": { + "tagName": { + "value": "env" + }, + "tagValue": { + "value": "prod" + } + } + }, + "roleDefinitionIds": { + "value": [ + "/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c" + ] + }, + "subscriptionId": { + "value": "<>" + }, + "userAssignedIdentityId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" + } } } ``` diff --git a/modules/Microsoft.Authorization/policyAssignments/resourceGroup/deploy.bicep b/modules/Microsoft.Authorization/policyAssignments/resourceGroup/deploy.bicep index f6da6c336e..2cd0edbf87 100644 --- a/modules/Microsoft.Authorization/policyAssignments/resourceGroup/deploy.bicep +++ b/modules/Microsoft.Authorization/policyAssignments/resourceGroup/deploy.bicep @@ -28,7 +28,7 @@ param identity string = 'SystemAssigned' @sys.description('Optional. The Resource ID for the user assigned identity to assign to the policy assignment.') param userAssignedIdentityId string = '' -@sys.description('Required. The IDs Of the Azure Role Definition list that is used to assign permissions to the identity. You need to provide either the fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.. See https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles for the list IDs for built-in Roles. They must match on what is on the policy definition.') +@sys.description('Optional. The IDs Of the Azure Role Definition list that is used to assign permissions to the identity. You need to provide either the fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.. See https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles for the list IDs for built-in Roles. They must match on what is on the policy definition.') param roleDefinitionIds array = [] @sys.description('Optional. The policy assignment metadata. Metadata is an open ended object and is typically a collection of key-value pairs.') diff --git a/modules/Microsoft.Authorization/policyAssignments/subscription/deploy.bicep b/modules/Microsoft.Authorization/policyAssignments/subscription/deploy.bicep index 53406f3f2b..3da57a2b4c 100644 --- a/modules/Microsoft.Authorization/policyAssignments/subscription/deploy.bicep +++ b/modules/Microsoft.Authorization/policyAssignments/subscription/deploy.bicep @@ -28,7 +28,7 @@ param identity string = 'SystemAssigned' @sys.description('Optional. The Resource ID for the user assigned identity to assign to the policy assignment.') param userAssignedIdentityId string = '' -@sys.description('Required. The IDs Of the Azure Role Definition list that is used to assign permissions to the identity. You need to provide either the fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.. See https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles for the list IDs for built-in Roles. They must match on what is on the policy definition.') +@sys.description('Optional. The IDs Of the Azure Role Definition list that is used to assign permissions to the identity. You need to provide either the fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.. See https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles for the list IDs for built-in Roles. They must match on what is on the policy definition.') param roleDefinitionIds array = [] @sys.description('Optional. The policy assignment metadata. Metadata is an open ended object and is typically a collection of key-value pairs.') diff --git a/modules/Microsoft.Authorization/policyDefinitions/readme.md b/modules/Microsoft.Authorization/policyDefinitions/readme.md index 8f340ddb14..45146c1451 100644 --- a/modules/Microsoft.Authorization/policyDefinitions/readme.md +++ b/modules/Microsoft.Authorization/policyDefinitions/readme.md @@ -126,51 +126,11 @@ module policydefinition 'yourpath/modules/Microsoft.Authorization.policyDefiniti ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-mg-min-policyDef" - }, - "policyRule": { - "value": { - "if": { - "allOf": [ - { - "equals": "Microsoft.KeyVault/vaults", - "field": "type" - } - ] - }, - "then": { - "effect": "[parameters('effect')]" - } - } - }, - "parameters": { - "value": { - "effect": { - "allowedValues": [ - "Audit" - ], - "defaultValue": "Audit", - "type": "String" - } - } - } - } -} -``` - -
+

Example 1: Mg Min

@@ -180,6 +140,7 @@ module policydefinition 'yourpath/modules/Microsoft.Authorization.policyDefiniti module policyDefinitions './Microsoft.Authorization/policyDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyDefinitions' params: { + // Required parameters name: '<>-mg-min-policyDef' policyRule: { if: { @@ -194,6 +155,7 @@ module policyDefinitions './Microsoft.Authorization/policyDefinitions/deploy.bic effect: '[parameters('effect')]' } } + // Non-required parameters parameters: { effect: { allowedValues: [ @@ -210,88 +172,54 @@ module policyDefinitions './Microsoft.Authorization/policyDefinitions/deploy.bic

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-mg-policyDef" - }, - "displayName": { - "value": "[DisplayName] This policy definition is deployed at the management group scope" - }, - "description": { - "value": "[Description] This policy definition is deployed at the management group scope" - }, - "policyRule": { - "value": { - "if": { - "allOf": [ - { - "field": "type", - "equals": "Microsoft.Resources/subscriptions" - }, - { - "field": "[concat('tags[', parameters('tagName'), ']')]", - "exists": "false" - } - ] - }, - "then": { - "effect": "modify", - "details": { - "roleDefinitionIds": [ - "/providers/microsoft.authorization/roleDefinitions/4a9ae827-6dc8-4573-8ac7-8239d42aa03f" - ], - "operations": [ - { - "operation": "add", - "field": "[concat('tags[', parameters('tagName'), ']')]", - "value": "[parameters('tagValue')]" - } - ] - } - } - } - }, - "parameters": { - "value": { - "tagName": { - "type": "String", - "metadata": { - "displayName": "Tag Name", - "description": "Name of the tag, such as 'environment'" - } - }, - "tagValue": { - "type": "String", - "metadata": { - "displayName": "Tag Value", - "description": "Value of the tag, such as 'production'" - } - } - } - }, - "metadata": { - "value": { - "category": "Security" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-mg-min-policyDef" + }, + "policyRule": { + "value": { + "if": { + "allOf": [ + { + "equals": "Microsoft.KeyVault/vaults", + "field": "type" } + ] }, - "managementGroupId": { - "value": "<>" + "then": { + "effect": "[parameters('effect')]" + } + } + }, + // Non-required parameters + "parameters": { + "value": { + "effect": { + "allowedValues": [ + "Audit" + ], + "defaultValue": "Audit", + "type": "String" } + } } + } } ```
+

+ +

Example 2: Mg

@@ -301,58 +229,60 @@ module policyDefinitions './Microsoft.Authorization/policyDefinitions/deploy.bic module policyDefinitions './Microsoft.Authorization/policyDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyDefinitions' params: { + // Required parameters name: '<>-mg-policyDef' - displayName: '[DisplayName] This policy definition is deployed at the management group scope' - description: '[Description] This policy definition is deployed at the management group scope' policyRule: { if: { allOf: [ { - field: 'type' equals: 'Microsoft.Resources/subscriptions' + field: 'type' } { - field: '[concat('tags[' parameters('tagName') ']')]' exists: 'false' + field: '[concat('tags[' parameters('tagName') ']')]' } ] } then: { - effect: 'modify' details: { - roleDefinitionIds: [ - '/providers/microsoft.authorization/roleDefinitions/4a9ae827-6dc8-4573-8ac7-8239d42aa03f' - ] operations: [ { - operation: 'add' field: '[concat('tags[' parameters('tagName') ']')]' + operation: 'add' value: '[parameters('tagValue')]' } ] + roleDefinitionIds: [ + '/providers/microsoft.authorization/roleDefinitions/4a9ae827-6dc8-4573-8ac7-8239d42aa03f' + ] } + effect: 'modify' } } + // Non-required parameters + description: '[Description] This policy definition is deployed at the management group scope' + displayName: '[DisplayName] This policy definition is deployed at the management group scope' + managementGroupId: '<>' + metadata: { + category: 'Security' + } parameters: { tagName: { - type: 'String' metadata: { - displayName: 'Tag Name' description: 'Name of the tag such as 'environment'' + displayName: 'Tag Name' } + type: 'String' } tagValue: { - type: 'String' metadata: { - displayName: 'Tag Value' description: 'Value of the tag such as 'production'' + displayName: 'Tag Value' } + type: 'String' } } - metadata: { - category: 'Security' - } - managementGroupId: '<>' } } ``` @@ -360,54 +290,91 @@ module policyDefinitions './Microsoft.Authorization/policyDefinitions/deploy.bic

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-sub-min-policyDef" - }, - "policyRule": { - "value": { - "if": { - "allOf": [ - { - "equals": "Microsoft.KeyVault/vaults", - "field": "type" - } - ] - }, - "then": { - "effect": "[parameters('effect')]" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-mg-policyDef" + }, + "policyRule": { + "value": { + "if": { + "allOf": [ + { + "equals": "Microsoft.Resources/subscriptions", + "field": "type" + }, + { + "exists": "false", + "field": "[concat('tags[', parameters('tagName'), ']')]" } + ] }, - "parameters": { - "value": { - "effect": { - "allowedValues": [ - "Audit" - ], - "defaultValue": "Audit", - "type": "String" - } - } + "then": { + "details": { + "operations": [ + { + "field": "[concat('tags[', parameters('tagName'), ']')]", + "operation": "add", + "value": "[parameters('tagValue')]" + } + ], + "roleDefinitionIds": [ + "/providers/microsoft.authorization/roleDefinitions/4a9ae827-6dc8-4573-8ac7-8239d42aa03f" + ] + }, + "effect": "modify" + } + } + }, + // Non-required parameters + "description": { + "value": "[Description] This policy definition is deployed at the management group scope" + }, + "displayName": { + "value": "[DisplayName] This policy definition is deployed at the management group scope" + }, + "managementGroupId": { + "value": "<>" + }, + "metadata": { + "value": { + "category": "Security" + } + }, + "parameters": { + "value": { + "tagName": { + "metadata": { + "description": "Name of the tag, such as 'environment'", + "displayName": "Tag Name" + }, + "type": "String" }, - "subscriptionId": { - "value": "<>" + "tagValue": { + "metadata": { + "description": "Value of the tag, such as 'production'", + "displayName": "Tag Value" + }, + "type": "String" } + } } + } } ```
+

+ +

Example 3: Sub Min

@@ -417,6 +384,7 @@ module policyDefinitions './Microsoft.Authorization/policyDefinitions/deploy.bic module policyDefinitions './Microsoft.Authorization/policyDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyDefinitions' params: { + // Required parameters name: '<>-sub-min-policyDef' policyRule: { if: { @@ -431,6 +399,7 @@ module policyDefinitions './Microsoft.Authorization/policyDefinitions/deploy.bic effect: '[parameters('effect')]' } } + // Non-required parameters parameters: { effect: { allowedValues: [ @@ -448,88 +417,57 @@ module policyDefinitions './Microsoft.Authorization/policyDefinitions/deploy.bic

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-sub-policyDef" - }, - "displayName": { - "value": "[DisplayName] This policy definition is deployed at subscription scope" - }, - "description": { - "value": "[Description] This policy definition is deployed at subscription scope" - }, - "policyRule": { - "value": { - "if": { - "allOf": [ - { - "field": "type", - "equals": "Microsoft.Resources/subscriptions" - }, - { - "field": "[concat('tags[', parameters('tagName'), ']')]", - "exists": "false" - } - ] - }, - "then": { - "effect": "modify", - "details": { - "roleDefinitionIds": [ - "/providers/microsoft.authorization/roleDefinitions/4a9ae827-6dc8-4573-8ac7-8239d42aa03f" - ], - "operations": [ - { - "operation": "add", - "field": "[concat('tags[', parameters('tagName'), ']')]", - "value": "[parameters('tagValue')]" - } - ] - } - } - } - }, - "parameters": { - "value": { - "tagName": { - "type": "String", - "metadata": { - "displayName": "Tag Name", - "description": "Name of the tag, such as 'environment'" - } - }, - "tagValue": { - "type": "String", - "metadata": { - "displayName": "Tag Value", - "description": "Value of the tag, such as 'production'" - } - } - } - }, - "metadata": { - "value": { - "category": "Security" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-sub-min-policyDef" + }, + "policyRule": { + "value": { + "if": { + "allOf": [ + { + "equals": "Microsoft.KeyVault/vaults", + "field": "type" } + ] }, - "subscriptionId": { - "value": "<>" + "then": { + "effect": "[parameters('effect')]" } + } + }, + // Non-required parameters + "parameters": { + "value": { + "effect": { + "allowedValues": [ + "Audit" + ], + "defaultValue": "Audit", + "type": "String" + } + } + }, + "subscriptionId": { + "value": "<>" } + } } ```
+

+ +

Example 4: Sub

@@ -539,57 +477,59 @@ module policyDefinitions './Microsoft.Authorization/policyDefinitions/deploy.bic module policyDefinitions './Microsoft.Authorization/policyDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyDefinitions' params: { + // Required parameters name: '<>-sub-policyDef' - displayName: '[DisplayName] This policy definition is deployed at subscription scope' - description: '[Description] This policy definition is deployed at subscription scope' policyRule: { if: { allOf: [ { - field: 'type' equals: 'Microsoft.Resources/subscriptions' + field: 'type' } { - field: '[concat('tags[' parameters('tagName') ']')]' exists: 'false' + field: '[concat('tags[' parameters('tagName') ']')]' } ] } then: { - effect: 'modify' details: { - roleDefinitionIds: [ - '/providers/microsoft.authorization/roleDefinitions/4a9ae827-6dc8-4573-8ac7-8239d42aa03f' - ] operations: [ { - operation: 'add' field: '[concat('tags[' parameters('tagName') ']')]' + operation: 'add' value: '[parameters('tagValue')]' } ] + roleDefinitionIds: [ + '/providers/microsoft.authorization/roleDefinitions/4a9ae827-6dc8-4573-8ac7-8239d42aa03f' + ] } + effect: 'modify' } } + // Non-required parameters + description: '[Description] This policy definition is deployed at subscription scope' + displayName: '[DisplayName] This policy definition is deployed at subscription scope' + metadata: { + category: 'Security' + } parameters: { tagName: { - type: 'String' metadata: { - displayName: 'Tag Name' description: 'Name of the tag such as 'environment'' + displayName: 'Tag Name' } + type: 'String' } tagValue: { - type: 'String' metadata: { - displayName: 'Tag Value' description: 'Value of the tag such as 'production'' + displayName: 'Tag Value' } + type: 'String' } } - metadata: { - category: 'Security' - } subscriptionId: '<>' } } @@ -597,3 +537,87 @@ module policyDefinitions './Microsoft.Authorization/policyDefinitions/deploy.bic

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-sub-policyDef" + }, + "policyRule": { + "value": { + "if": { + "allOf": [ + { + "equals": "Microsoft.Resources/subscriptions", + "field": "type" + }, + { + "exists": "false", + "field": "[concat('tags[', parameters('tagName'), ']')]" + } + ] + }, + "then": { + "details": { + "operations": [ + { + "field": "[concat('tags[', parameters('tagName'), ']')]", + "operation": "add", + "value": "[parameters('tagValue')]" + } + ], + "roleDefinitionIds": [ + "/providers/microsoft.authorization/roleDefinitions/4a9ae827-6dc8-4573-8ac7-8239d42aa03f" + ] + }, + "effect": "modify" + } + } + }, + // Non-required parameters + "description": { + "value": "[Description] This policy definition is deployed at subscription scope" + }, + "displayName": { + "value": "[DisplayName] This policy definition is deployed at subscription scope" + }, + "metadata": { + "value": { + "category": "Security" + } + }, + "parameters": { + "value": { + "tagName": { + "metadata": { + "description": "Name of the tag, such as 'environment'", + "displayName": "Tag Name" + }, + "type": "String" + }, + "tagValue": { + "metadata": { + "description": "Value of the tag, such as 'production'", + "displayName": "Tag Value" + }, + "type": "String" + } + } + }, + "subscriptionId": { + "value": "<>" + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Authorization/policyExemptions/readme.md b/modules/Microsoft.Authorization/policyExemptions/readme.md index d2cb79de7e..9855b7dfb2 100644 --- a/modules/Microsoft.Authorization/policyExemptions/readme.md +++ b/modules/Microsoft.Authorization/policyExemptions/readme.md @@ -149,28 +149,11 @@ module policyexemption 'yourpath/modules/Microsoft.Authorization.policyExemption ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-min-mg-polexem" - }, - "policyAssignmentId": { - "value": "/providers/Microsoft.Management/managementGroups/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-mg-pass-loc-rg" - } - } -} -``` - -
+

Example 1: Mg Min

@@ -180,6 +163,7 @@ module policyexemption 'yourpath/modules/Microsoft.Authorization.policyExemption module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyExemptions' params: { + // Required parameters name: '<>-min-mg-polexem' policyAssignmentId: '/providers/Microsoft.Management/managementGroups/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-mg-pass-loc-rg' } @@ -189,45 +173,30 @@ module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-mg-polexem" - }, - "displayName": { - "value": "[Display Name] policy exempt (management group scope)" - }, - "policyAssignmentId": { - "value": "/providers/Microsoft.Management/managementGroups/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-mg-pass-loc-rg" - }, - "exemptionCategory": { - "value": "Waiver" - }, - "metadata": { - "value": { - "category": "Security" - } - }, - "expiresOn": { - "value": "2025-10-02T03:57:00.000Z" - }, - "managementGroupId": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-min-mg-polexem" + }, + "policyAssignmentId": { + "value": "/providers/Microsoft.Management/managementGroups/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-mg-pass-loc-rg" } + } } ```
+

+ +

Example 2: Mg

@@ -237,15 +206,17 @@ module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyExemptions' params: { + // Required parameters name: '<>-mg-polexem' - displayName: '[Display Name] policy exempt (management group scope)' policyAssignmentId: '/providers/Microsoft.Management/managementGroups/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-mg-pass-loc-rg' + // Non-required parameters + displayName: '[Display Name] policy exempt (management group scope)' exemptionCategory: 'Waiver' + expiresOn: '2025-10-02T03:57:00Z' + managementGroupId: '<>' metadata: { category: 'Security' } - expiresOn: '2025-10-02T03:57:00Z' - managementGroupId: '<>' } } ``` @@ -253,34 +224,48 @@ module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-min-rg-polexem" - }, - "policyAssignmentId": { - "value": "/subscriptions/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-sb-pass-loc-rg" - }, - "subscriptionId": { - "value": "<>" - }, - "resourceGroupName": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-mg-polexem" + }, + "policyAssignmentId": { + "value": "/providers/Microsoft.Management/managementGroups/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-mg-pass-loc-rg" + }, + // Non-required parameters + "displayName": { + "value": "[Display Name] policy exempt (management group scope)" + }, + "exemptionCategory": { + "value": "Waiver" + }, + "expiresOn": { + "value": "2025-10-02T03:57:00Z" + }, + "managementGroupId": { + "value": "<>" + }, + "metadata": { + "value": { + "category": "Security" + } } + } } ```
+

+ +

Example 3: Rg Min

@@ -290,10 +275,12 @@ module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyExemptions' params: { + // Required parameters name: '<>-min-rg-polexem' policyAssignmentId: '/subscriptions/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-sb-pass-loc-rg' - subscriptionId: '<>' + // Non-required parameters resourceGroupName: '<>' + subscriptionId: '<>' } } ``` @@ -301,48 +288,37 @@ module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-rg-polexem" - }, - "displayName": { - "value": "[Display Name] policy exempt (resource group scope)" - }, - "policyAssignmentId": { - "value": "/subscriptions/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-sb-pass-loc-rg" - }, - "exemptionCategory": { - "value": "Waiver" - }, - "metadata": { - "value": { - "category": "Security" - } - }, - "expiresOn": { - "value": "2025-10-02T03:57:00.000Z" - }, - "subscriptionId": { - "value": "<>" - }, - "resourceGroupName": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-min-rg-polexem" + }, + "policyAssignmentId": { + "value": "/subscriptions/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-sb-pass-loc-rg" + }, + // Non-required parameters + "resourceGroupName": { + "value": "<>" + }, + "subscriptionId": { + "value": "<>" } + } } ```
+

+ +

Example 4: Rg

@@ -352,16 +328,18 @@ module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyExemptions' params: { + // Required parameters name: '<>-rg-polexem' - displayName: '[Display Name] policy exempt (resource group scope)' policyAssignmentId: '/subscriptions/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-sb-pass-loc-rg' + // Non-required parameters + displayName: '[Display Name] policy exempt (resource group scope)' exemptionCategory: 'Waiver' + expiresOn: '2025-10-02T03:57:00Z' metadata: { category: 'Security' } - expiresOn: '2025-10-02T03:57:00Z' - subscriptionId: '<>' resourceGroupName: '<>' + subscriptionId: '<>' } } ``` @@ -369,31 +347,51 @@ module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep

-

Example 5

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-min-sub-polexem" - }, - "policyAssignmentId": { - "value": "/subscriptions/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-sb-pass-loc-rg" - }, - "subscriptionId": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-rg-polexem" + }, + "policyAssignmentId": { + "value": "/subscriptions/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-sb-pass-loc-rg" + }, + // Non-required parameters + "displayName": { + "value": "[Display Name] policy exempt (resource group scope)" + }, + "exemptionCategory": { + "value": "Waiver" + }, + "expiresOn": { + "value": "2025-10-02T03:57:00Z" + }, + "metadata": { + "value": { + "category": "Security" + } + }, + "resourceGroupName": { + "value": "<>" + }, + "subscriptionId": { + "value": "<>" } + } } ```
+

+ +

Example 5: Sub Min

@@ -403,8 +401,10 @@ module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyExemptions' params: { + // Required parameters name: '<>-min-sub-polexem' policyAssignmentId: '/subscriptions/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-sb-pass-loc-rg' + // Non-required parameters subscriptionId: '<>' } } @@ -413,45 +413,34 @@ module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep

-

Example 6

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-sub-polexem" - }, - "displayName": { - "value": "[Display Name] policy exempt (subscription scope)" - }, - "policyAssignmentId": { - "value": "/subscriptions/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-sb-pass-loc-rg" - }, - "exemptionCategory": { - "value": "Waiver" - }, - "metadata": { - "value": { - "category": "Security" - } - }, - "expiresOn": { - "value": "2025-10-02T03:57:00.000Z" - }, - "subscriptionId": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-min-sub-polexem" + }, + "policyAssignmentId": { + "value": "/subscriptions/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-sb-pass-loc-rg" + }, + // Non-required parameters + "subscriptionId": { + "value": "<>" } + } } ```
+

+ +

Example 6: Sub

@@ -461,14 +450,16 @@ module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policyExemptions' params: { + // Required parameters name: '<>-sub-polexem' - displayName: '[Display Name] policy exempt (subscription scope)' policyAssignmentId: '/subscriptions/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-sb-pass-loc-rg' + // Non-required parameters + displayName: '[Display Name] policy exempt (subscription scope)' exemptionCategory: 'Waiver' + expiresOn: '2025-10-02T03:57:00Z' metadata: { category: 'Security' } - expiresOn: '2025-10-02T03:57:00Z' subscriptionId: '<>' } } @@ -476,3 +467,44 @@ module policyExemptions './Microsoft.Authorization/policyExemptions/deploy.bicep

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-sub-polexem" + }, + "policyAssignmentId": { + "value": "/subscriptions/<>/providers/Microsoft.Authorization/policyAssignments/adp-<>-sb-pass-loc-rg" + }, + // Non-required parameters + "displayName": { + "value": "[Display Name] policy exempt (subscription scope)" + }, + "exemptionCategory": { + "value": "Waiver" + }, + "expiresOn": { + "value": "2025-10-02T03:57:00Z" + }, + "metadata": { + "value": { + "category": "Security" + } + }, + "subscriptionId": { + "value": "<>" + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Authorization/policySetDefinitions/readme.md b/modules/Microsoft.Authorization/policySetDefinitions/readme.md index 8479158522..1c08e7c8a4 100644 --- a/modules/Microsoft.Authorization/policySetDefinitions/readme.md +++ b/modules/Microsoft.Authorization/policySetDefinitions/readme.md @@ -132,39 +132,11 @@ module policysetdefinition 'yourpath/modules/Microsoft.Authorization.policySetDe ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-mg-min-policySet" - }, - "policyDefinitions": { - "value": [ - { - "parameters": { - "listOfAllowedLocations": { - "value": [ - "australiaeast" - ] - } - }, - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c" - } - ] - } - } -} -``` - -
+

Example 1: Mg Min

@@ -174,6 +146,7 @@ module policysetdefinition 'yourpath/modules/Microsoft.Authorization.policySetDe module policySetDefinitions './Microsoft.Authorization/policySetDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policySetDefinitions' params: { + // Required parameters name: '<>-mg-min-policySet' policyDefinitions: [ { @@ -194,82 +167,41 @@ module policySetDefinitions './Microsoft.Authorization/policySetDefinitions/depl

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-mg-policySet" - }, - "displayName": { - "value": "[DisplayName] This policy set definition is deployed at management group scope" - }, - "description": { - "value": "[Description] This policy set definition is deployed at management group scope" - }, - "policyDefinitionGroups": { - "value": [ - { - "name": "Network" - }, - { - "name": "ARM" - } - ] - }, - "policyDefinitions": { - "value": [ - { - "groupNames": [ - "ARM" - ], - "parameters": { - "listOfAllowedLocations": { - "value": [ - "australiaeast" - ] - } - }, - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c", - "policyDefinitionReferenceId": "Allowed locations_1" - }, - { - "groupNames": [ - "ARM" - ], - "parameters": { - "listOfAllowedLocations": { - "value": [ - "australiaeast" - ] - } - }, - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988", - "policyDefinitionReferenceId": "Allowed locations for resource groups_1" - } - ] - }, - "metadata": { - "value": { - "category": "Security", - "version": "1" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-mg-min-policySet" + }, + "policyDefinitions": { + "value": [ + { + "parameters": { + "listOfAllowedLocations": { + "value": [ + "australiaeast" + ] } - }, - "managementGroupId": { - "value": "<>" + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c" } + ] } + } } ```
+

+ +

Example 2: Mg

@@ -279,17 +211,8 @@ module policySetDefinitions './Microsoft.Authorization/policySetDefinitions/depl module policySetDefinitions './Microsoft.Authorization/policySetDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policySetDefinitions' params: { + // Required parameters name: '<>-mg-policySet' - displayName: '[DisplayName] This policy set definition is deployed at management group scope' - description: '[Description] This policy set definition is deployed at management group scope' - policyDefinitionGroups: [ - { - name: 'Network' - } - { - name: 'ARM' - } - ] policyDefinitions: [ { groupNames: [ @@ -320,11 +243,22 @@ module policySetDefinitions './Microsoft.Authorization/policySetDefinitions/depl policyDefinitionReferenceId: 'Allowed locations for resource groups_1' } ] + // Non-required parameters + description: '[Description] This policy set definition is deployed at management group scope' + displayName: '[DisplayName] This policy set definition is deployed at management group scope' + managementGroupId: '<>' metadata: { category: 'Security' version: '1' } - managementGroupId: '<>' + policyDefinitionGroups: [ + { + name: 'Network' + } + { + name: 'ARM' + } + ] } } ``` @@ -332,42 +266,85 @@ module policySetDefinitions './Microsoft.Authorization/policySetDefinitions/depl

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-sub-min-policySet" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-mg-policySet" + }, + "policyDefinitions": { + "value": [ + { + "groupNames": [ + "ARM" + ], + "parameters": { + "listOfAllowedLocations": { + "value": [ + "australiaeast" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c", + "policyDefinitionReferenceId": "Allowed locations_1" }, - "policyDefinitions": { - "value": [ - { - "parameters": { - "listOfAllowedLocations": { - "value": [ - "australiaeast" - ] - } - }, - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c" - } - ] + { + "groupNames": [ + "ARM" + ], + "parameters": { + "listOfAllowedLocations": { + "value": [ + "australiaeast" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988", + "policyDefinitionReferenceId": "Allowed locations for resource groups_1" + } + ] + }, + // Non-required parameters + "description": { + "value": "[Description] This policy set definition is deployed at management group scope" + }, + "displayName": { + "value": "[DisplayName] This policy set definition is deployed at management group scope" + }, + "managementGroupId": { + "value": "<>" + }, + "metadata": { + "value": { + "category": "Security", + "version": "1" + } + }, + "policyDefinitionGroups": { + "value": [ + { + "name": "Network" }, - "subscriptionId": { - "value": "<>" + { + "name": "ARM" } + ] } + } } ```
+

+ +

Example 3: Sub Min

@@ -377,6 +354,7 @@ module policySetDefinitions './Microsoft.Authorization/policySetDefinitions/depl module policySetDefinitions './Microsoft.Authorization/policySetDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policySetDefinitions' params: { + // Required parameters name: '<>-sub-min-policySet' policyDefinitions: [ { @@ -390,6 +368,7 @@ module policySetDefinitions './Microsoft.Authorization/policySetDefinitions/depl policyDefinitionId: '/providers/Microsoft.Authorization/policyDefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c' } ] + // Non-required parameters subscriptionId: '<>' } } @@ -398,82 +377,45 @@ module policySetDefinitions './Microsoft.Authorization/policySetDefinitions/depl

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-sub-policySet" - }, - "displayName": { - "value": "[DisplayName] This policy set definition is deployed at subscription scope" - }, - "description": { - "value": "[Description] This policy set definition is deployed at subscription scope" - }, - "policyDefinitionGroups": { - "value": [ - { - "name": "Network" - }, - { - "name": "ARM" - } - ] - }, - "policyDefinitions": { - "value": [ - { - "groupNames": [ - "ARM" - ], - "parameters": { - "listOfAllowedLocations": { - "value": [ - "australiaeast" - ] - } - }, - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c", - "policyDefinitionReferenceId": "Allowed locations_1" - }, - { - "groupNames": [ - "ARM" - ], - "parameters": { - "listOfAllowedLocations": { - "value": [ - "australiaeast" - ] - } - }, - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988", - "policyDefinitionReferenceId": "Allowed locations for resource groups_1" - } - ] - }, - "metadata": { - "value": { - "category": "Security", - "version": "1" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-sub-min-policySet" + }, + "policyDefinitions": { + "value": [ + { + "parameters": { + "listOfAllowedLocations": { + "value": [ + "australiaeast" + ] } - }, - "subscriptionId": { - "value": "<>" + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c" } + ] + }, + // Non-required parameters + "subscriptionId": { + "value": "<>" } + } } ```
+

+ +

Example 4: Sub

@@ -483,17 +425,8 @@ module policySetDefinitions './Microsoft.Authorization/policySetDefinitions/depl module policySetDefinitions './Microsoft.Authorization/policySetDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-policySetDefinitions' params: { + // Required parameters name: '<>-sub-policySet' - displayName: '[DisplayName] This policy set definition is deployed at subscription scope' - description: '[Description] This policy set definition is deployed at subscription scope' - policyDefinitionGroups: [ - { - name: 'Network' - } - { - name: 'ARM' - } - ] policyDefinitions: [ { groupNames: [ @@ -524,10 +457,21 @@ module policySetDefinitions './Microsoft.Authorization/policySetDefinitions/depl policyDefinitionReferenceId: 'Allowed locations for resource groups_1' } ] + // Non-required parameters + description: '[Description] This policy set definition is deployed at subscription scope' + displayName: '[DisplayName] This policy set definition is deployed at subscription scope' metadata: { category: 'Security' version: '1' } + policyDefinitionGroups: [ + { + name: 'Network' + } + { + name: 'ARM' + } + ] subscriptionId: '<>' } } @@ -535,3 +479,81 @@ module policySetDefinitions './Microsoft.Authorization/policySetDefinitions/depl

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-sub-policySet" + }, + "policyDefinitions": { + "value": [ + { + "groupNames": [ + "ARM" + ], + "parameters": { + "listOfAllowedLocations": { + "value": [ + "australiaeast" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c", + "policyDefinitionReferenceId": "Allowed locations_1" + }, + { + "groupNames": [ + "ARM" + ], + "parameters": { + "listOfAllowedLocations": { + "value": [ + "australiaeast" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988", + "policyDefinitionReferenceId": "Allowed locations for resource groups_1" + } + ] + }, + // Non-required parameters + "description": { + "value": "[Description] This policy set definition is deployed at subscription scope" + }, + "displayName": { + "value": "[DisplayName] This policy set definition is deployed at subscription scope" + }, + "metadata": { + "value": { + "category": "Security", + "version": "1" + } + }, + "policyDefinitionGroups": { + "value": [ + { + "name": "Network" + }, + { + "name": "ARM" + } + ] + }, + "subscriptionId": { + "value": "<>" + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Authorization/roleAssignments/readme.md b/modules/Microsoft.Authorization/roleAssignments/readme.md index 0c05aa9723..acf37691d9 100644 --- a/modules/Microsoft.Authorization/roleAssignments/readme.md +++ b/modules/Microsoft.Authorization/roleAssignments/readme.md @@ -167,28 +167,11 @@ This module can be deployed at the management group, subscription or resource gr ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleDefinitionIdOrName": { - "value": "Storage Queue Data Reader" - }, - "principalId": { - "value": "<>" - } - } -} -``` - -
+

Example 1: Mg Min

@@ -198,8 +181,9 @@ This module can be deployed at the management group, subscription or resource gr module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep' = { name: '${uniqueString(deployment().name)}-roleAssignments' params: { - roleDefinitionIdOrName: 'Storage Queue Data Reader' + // Required parameters principalId: '<>' + roleDefinitionIdOrName: 'Storage Queue Data Reader' } } ``` @@ -207,37 +191,30 @@ module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep'

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleDefinitionIdOrName": { - "value": "Backup Reader" - }, - "description": { - "value": "Role Assignment (management group scope)" - }, - "principalId": { - "value": "<>" - }, - "principalType": { - "value": "ServicePrincipal" - }, - "managementGroupId": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "principalId": { + "value": "<>" + }, + "roleDefinitionIdOrName": { + "value": "Storage Queue Data Reader" } + } } ```
+

+ +

Example 2: Mg

@@ -247,11 +224,13 @@ module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep' module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep' = { name: '${uniqueString(deployment().name)}-roleAssignments' params: { + // Required parameters + principalId: '<>' roleDefinitionIdOrName: 'Backup Reader' + // Non-required parameters description: 'Role Assignment (management group scope)' - principalId: '<>' - principalType: 'ServicePrincipal' managementGroupId: '<>' + principalType: 'ServicePrincipal' } } ``` @@ -259,34 +238,40 @@ module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep'

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleDefinitionIdOrName": { - "value": "Storage Queue Data Reader" - }, - "principalId": { - "value": "<>" - }, - "subscriptionId": { - "value": "<>" - }, - "resourceGroupName": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "principalId": { + "value": "<>" + }, + "roleDefinitionIdOrName": { + "value": "Backup Reader" + }, + // Non-required parameters + "description": { + "value": "Role Assignment (management group scope)" + }, + "managementGroupId": { + "value": "<>" + }, + "principalType": { + "value": "ServicePrincipal" } + } } ```
+

+ +

Example 3: Rg Min

@@ -296,10 +281,12 @@ module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep' module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep' = { name: '${uniqueString(deployment().name)}-roleAssignments' params: { - roleDefinitionIdOrName: 'Storage Queue Data Reader' + // Required parameters principalId: '<>' - subscriptionId: '<>' + roleDefinitionIdOrName: 'Storage Queue Data Reader' + // Non-required parameters resourceGroupName: '<>' + subscriptionId: '<>' } } ``` @@ -307,40 +294,37 @@ module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep'

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleDefinitionIdOrName": { - "value": "Backup Reader" - }, - "description": { - "value": "Role Assignment (resource group scope)" - }, - "principalId": { - "value": "<>" - }, - "principalType": { - "value": "ServicePrincipal" - }, - "subscriptionId": { - "value": "<>" - }, - "resourceGroupName": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "principalId": { + "value": "<>" + }, + "roleDefinitionIdOrName": { + "value": "Storage Queue Data Reader" + }, + // Non-required parameters + "resourceGroupName": { + "value": "<>" + }, + "subscriptionId": { + "value": "<>" } + } } ```
+

+ +

Example 4: Rg

@@ -350,12 +334,14 @@ module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep' module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep' = { name: '${uniqueString(deployment().name)}-roleAssignments' params: { + // Required parameters + principalId: '<>' roleDefinitionIdOrName: 'Backup Reader' + // Non-required parameters description: 'Role Assignment (resource group scope)' - principalId: '<>' principalType: 'ServicePrincipal' - subscriptionId: '<>' resourceGroupName: '<>' + subscriptionId: '<>' } } ``` @@ -363,31 +349,43 @@ module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep'

-

Example 5

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleDefinitionIdOrName": { - "value": "Storage Queue Data Reader" - }, - "principalId": { - "value": "<>" - }, - "subscriptionId": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "principalId": { + "value": "<>" + }, + "roleDefinitionIdOrName": { + "value": "Backup Reader" + }, + // Non-required parameters + "description": { + "value": "Role Assignment (resource group scope)" + }, + "principalType": { + "value": "ServicePrincipal" + }, + "resourceGroupName": { + "value": "<>" + }, + "subscriptionId": { + "value": "<>" } + } } ```
+

+ +

Example 5: Sub Min

@@ -397,8 +395,10 @@ module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep' module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep' = { name: '${uniqueString(deployment().name)}-roleAssignments' params: { - roleDefinitionIdOrName: 'Storage Queue Data Reader' + // Required parameters principalId: '<>' + roleDefinitionIdOrName: 'Storage Queue Data Reader' + // Non-required parameters subscriptionId: '<>' } } @@ -407,37 +407,34 @@ module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep'

-

Example 6

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleDefinitionIdOrName": { - "value": "Backup Reader" - }, - "description": { - "value": "Role Assignment (subscription scope)" - }, - "principalId": { - "value": "<>" - }, - "principalType": { - "value": "ServicePrincipal" - }, - "subscriptionId": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "principalId": { + "value": "<>" + }, + "roleDefinitionIdOrName": { + "value": "Storage Queue Data Reader" + }, + // Non-required parameters + "subscriptionId": { + "value": "<>" } + } } ```
+

+ +

Example 6: Sub

@@ -447,9 +444,11 @@ module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep' module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep' = { name: '${uniqueString(deployment().name)}-roleAssignments' params: { + // Required parameters + principalId: '<>' roleDefinitionIdOrName: 'Backup Reader' + // Non-required parameters description: 'Role Assignment (subscription scope)' - principalId: '<>' principalType: 'ServicePrincipal' subscriptionId: '<>' } @@ -458,3 +457,36 @@ module roleAssignments './Microsoft.Authorization/roleAssignments/deploy.bicep'

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "principalId": { + "value": "<>" + }, + "roleDefinitionIdOrName": { + "value": "Backup Reader" + }, + // Non-required parameters + "description": { + "value": "Role Assignment (subscription scope)" + }, + "principalType": { + "value": "ServicePrincipal" + }, + "subscriptionId": { + "value": "<>" + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Authorization/roleDefinitions/readme.md b/modules/Microsoft.Authorization/roleDefinitions/readme.md index 1af3c4a999..0cc1742f21 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/readme.md +++ b/modules/Microsoft.Authorization/roleDefinitions/readme.md @@ -171,31 +171,11 @@ This module can be deployed both at subscription or resource group level: ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleName": { - "value": "<>-az-testRole-mg-min" - }, - "actions": { - "value": [ - "Microsoft.Compute/galleries/read", - "Microsoft.Compute/galleries/images/read" - ] - } - } -} -``` - -
+

Example 1: Mg Min

@@ -205,10 +185,12 @@ This module can be deployed both at subscription or resource group level: module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-roleDefinitions' params: { + // Required parameters roleName: '<>-az-testRole-mg-min' + // Non-required parameters actions: [ - 'Microsoft.Compute/galleries/read' 'Microsoft.Compute/galleries/images/read' + 'Microsoft.Compute/galleries/read' ] } } @@ -217,59 +199,34 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep'

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleName": { - "value": "<>-az-testRole-mg" - }, - "description": { - "value": "Test Custom Role Definition Standard (management group scope)" - }, - "actions": { - "value": [ - "Microsoft.Compute/galleries/*", - "Microsoft.Network/virtualNetworks/read" - ] - }, - "notActions": { - "value": [ - "Microsoft.Compute/images/write", - "Microsoft.Compute/images/delete", - "Microsoft.Network/virtualNetworks/subnets/join/action" - ] - }, - "dataActions": { - "value": [ - "Microsoft.Storage/storageAccounts/blobServices/*/read" - ] - }, - "notDataActions": { - "value": [ - "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read" - ] - }, - "assignableScopes": { - "value": [ - "/providers/Microsoft.Management/managementGroups/<>" - ] - }, - "managementGroupId": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "roleName": { + "value": "<>-az-testRole-mg-min" + }, + // Non-required parameters + "actions": { + "value": [ + "Microsoft.Compute/galleries/images/read", + "Microsoft.Compute/galleries/read" + ] } + } } ```
+

+ +

Example 2: Mg

@@ -279,27 +236,29 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-roleDefinitions' params: { + // Required parameters roleName: '<>-az-testRole-mg' - description: 'Test Custom Role Definition Standard (management group scope)' + // Non-required parameters actions: [ 'Microsoft.Compute/galleries/*' 'Microsoft.Network/virtualNetworks/read' ] - notActions: [ - 'Microsoft.Compute/images/write' - 'Microsoft.Compute/images/delete' - 'Microsoft.Network/virtualNetworks/subnets/join/action' + assignableScopes: [ + '/providers/Microsoft.Management/managementGroups/<>' ] dataActions: [ 'Microsoft.Storage/storageAccounts/blobServices/*/read' ] + description: 'Test Custom Role Definition Standard (management group scope)' + managementGroupId: '<>' + notActions: [ + 'Microsoft.Compute/images/delete' + 'Microsoft.Compute/images/write' + 'Microsoft.Network/virtualNetworks/subnets/join/action' + ] notDataActions: [ 'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read' ] - assignableScopes: [ - '/providers/Microsoft.Management/managementGroups/<>' - ] - managementGroupId: '<>' } } ``` @@ -307,37 +266,62 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep'

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleName": { - "value": "<>-az-testRole-rg-min" - }, - "actions": { - "value": [ - "Microsoft.Compute/galleries/read", - "Microsoft.Compute/galleries/images/read" - ] - }, - "subscriptionId": { - "value": "<>" - }, - "resourceGroupName": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "roleName": { + "value": "<>-az-testRole-mg" + }, + // Non-required parameters + "actions": { + "value": [ + "Microsoft.Compute/galleries/*", + "Microsoft.Network/virtualNetworks/read" + ] + }, + "assignableScopes": { + "value": [ + "/providers/Microsoft.Management/managementGroups/<>" + ] + }, + "dataActions": { + "value": [ + "Microsoft.Storage/storageAccounts/blobServices/*/read" + ] + }, + "description": { + "value": "Test Custom Role Definition Standard (management group scope)" + }, + "managementGroupId": { + "value": "<>" + }, + "notActions": { + "value": [ + "Microsoft.Compute/images/delete", + "Microsoft.Compute/images/write", + "Microsoft.Network/virtualNetworks/subnets/join/action" + ] + }, + "notDataActions": { + "value": [ + "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read" + ] } + } } ```
+

+ +

Example 3: Rg Min

@@ -347,13 +331,15 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-roleDefinitions' params: { + // Required parameters roleName: '<>-az-testRole-rg-min' + // Non-required parameters actions: [ - 'Microsoft.Compute/galleries/read' 'Microsoft.Compute/galleries/images/read' + 'Microsoft.Compute/galleries/read' ] - subscriptionId: '<>' resourceGroupName: '<>' + subscriptionId: '<>' } } ``` @@ -361,62 +347,40 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep'

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleName": { - "value": "<>-az-testRole-rg" - }, - "description": { - "value": "Test Custom Role Definition Standard (resource group scope)" - }, - "actions": { - "value": [ - "Microsoft.Compute/galleries/*", - "Microsoft.Network/virtualNetworks/read" - ] - }, - "notActions": { - "value": [ - "Microsoft.Compute/images/write", - "Microsoft.Compute/images/delete", - "Microsoft.Network/virtualNetworks/subnets/join/action" - ] - }, - "dataActions": { - "value": [ - "Microsoft.Storage/storageAccounts/blobServices/*/read" - ] - }, - "notDataActions": { - "value": [ - "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read" - ] - }, - "assignableScopes": { - "value": [ - "/subscriptions/<>/resourceGroups/<>" - ] - }, - "subscriptionId": { - "value": "<>" - }, - "resourceGroupName": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "roleName": { + "value": "<>-az-testRole-rg-min" + }, + // Non-required parameters + "actions": { + "value": [ + "Microsoft.Compute/galleries/images/read", + "Microsoft.Compute/galleries/read" + ] + }, + "resourceGroupName": { + "value": "<>" + }, + "subscriptionId": { + "value": "<>" } + } } ```
+

+ +

Example 4: Rg

@@ -426,28 +390,30 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-roleDefinitions' params: { + // Required parameters roleName: '<>-az-testRole-rg' - description: 'Test Custom Role Definition Standard (resource group scope)' + // Non-required parameters actions: [ 'Microsoft.Compute/galleries/*' 'Microsoft.Network/virtualNetworks/read' ] - notActions: [ - 'Microsoft.Compute/images/write' - 'Microsoft.Compute/images/delete' - 'Microsoft.Network/virtualNetworks/subnets/join/action' + assignableScopes: [ + '/subscriptions/<>/resourceGroups/<>' ] dataActions: [ 'Microsoft.Storage/storageAccounts/blobServices/*/read' ] + description: 'Test Custom Role Definition Standard (resource group scope)' + notActions: [ + 'Microsoft.Compute/images/delete' + 'Microsoft.Compute/images/write' + 'Microsoft.Network/virtualNetworks/subnets/join/action' + ] notDataActions: [ 'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read' ] - assignableScopes: [ - '/subscriptions/<>/resourceGroups/<>' - ] - subscriptionId: '<>' resourceGroupName: '<>' + subscriptionId: '<>' } } ``` @@ -455,34 +421,65 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep'

-

Example 5

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleName": { - "value": "<>-az-testRole-sub-min" - }, - "actions": { - "value": [ - "Microsoft.Compute/galleries/read", - "Microsoft.Compute/galleries/images/read" - ] - }, - "subscriptionId": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "roleName": { + "value": "<>-az-testRole-rg" + }, + // Non-required parameters + "actions": { + "value": [ + "Microsoft.Compute/galleries/*", + "Microsoft.Network/virtualNetworks/read" + ] + }, + "assignableScopes": { + "value": [ + "/subscriptions/<>/resourceGroups/<>" + ] + }, + "dataActions": { + "value": [ + "Microsoft.Storage/storageAccounts/blobServices/*/read" + ] + }, + "description": { + "value": "Test Custom Role Definition Standard (resource group scope)" + }, + "notActions": { + "value": [ + "Microsoft.Compute/images/delete", + "Microsoft.Compute/images/write", + "Microsoft.Network/virtualNetworks/subnets/join/action" + ] + }, + "notDataActions": { + "value": [ + "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read" + ] + }, + "resourceGroupName": { + "value": "<>" + }, + "subscriptionId": { + "value": "<>" } + } } ```
+

+ +

Example 5: Sub Min

@@ -492,10 +489,12 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-roleDefinitions' params: { + // Required parameters roleName: '<>-az-testRole-sub-min' + // Non-required parameters actions: [ - 'Microsoft.Compute/galleries/read' 'Microsoft.Compute/galleries/images/read' + 'Microsoft.Compute/galleries/read' ] subscriptionId: '<>' } @@ -505,59 +504,37 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep'

-

Example 6

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleName": { - "value": "<>-az-testRole-sub" - }, - "description": { - "value": "Test Custom Role Definition Standard (subscription scope)" - }, - "actions": { - "value": [ - "Microsoft.Compute/galleries/*", - "Microsoft.Network/virtualNetworks/read" - ] - }, - "notActions": { - "value": [ - "Microsoft.Compute/images/write", - "Microsoft.Compute/images/delete", - "Microsoft.Network/virtualNetworks/subnets/join/action" - ] - }, - "dataActions": { - "value": [ - "Microsoft.Storage/storageAccounts/blobServices/*/read" - ] - }, - "notDataActions": { - "value": [ - "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read" - ] - }, - "assignableScopes": { - "value": [ - "/subscriptions/<>" - ] - }, - "subscriptionId": { - "value": "<>" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "roleName": { + "value": "<>-az-testRole-sub-min" + }, + // Non-required parameters + "actions": { + "value": [ + "Microsoft.Compute/galleries/images/read", + "Microsoft.Compute/galleries/read" + ] + }, + "subscriptionId": { + "value": "<>" } + } } ```
+

+ +

Example 6: Sub

@@ -567,26 +544,28 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-roleDefinitions' params: { + // Required parameters roleName: '<>-az-testRole-sub' - description: 'Test Custom Role Definition Standard (subscription scope)' + // Non-required parameters actions: [ 'Microsoft.Compute/galleries/*' 'Microsoft.Network/virtualNetworks/read' ] - notActions: [ - 'Microsoft.Compute/images/write' - 'Microsoft.Compute/images/delete' - 'Microsoft.Network/virtualNetworks/subnets/join/action' + assignableScopes: [ + '/subscriptions/<>' ] dataActions: [ 'Microsoft.Storage/storageAccounts/blobServices/*/read' ] + description: 'Test Custom Role Definition Standard (subscription scope)' + notActions: [ + 'Microsoft.Compute/images/delete' + 'Microsoft.Compute/images/write' + 'Microsoft.Network/virtualNetworks/subnets/join/action' + ] notDataActions: [ 'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read' ] - assignableScopes: [ - '/subscriptions/<>' - ] subscriptionId: '<>' } } @@ -594,3 +573,58 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep'

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "roleName": { + "value": "<>-az-testRole-sub" + }, + // Non-required parameters + "actions": { + "value": [ + "Microsoft.Compute/galleries/*", + "Microsoft.Network/virtualNetworks/read" + ] + }, + "assignableScopes": { + "value": [ + "/subscriptions/<>" + ] + }, + "dataActions": { + "value": [ + "Microsoft.Storage/storageAccounts/blobServices/*/read" + ] + }, + "description": { + "value": "Test Custom Role Definition Standard (subscription scope)" + }, + "notActions": { + "value": [ + "Microsoft.Compute/images/delete", + "Microsoft.Compute/images/write", + "Microsoft.Network/virtualNetworks/subnets/join/action" + ] + }, + "notDataActions": { + "value": [ + "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read" + ] + }, + "subscriptionId": { + "value": "<>" + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Automation/automationAccounts/readme.md b/modules/Microsoft.Automation/automationAccounts/readme.md index 0e9d3de8ee..ec1b90645a 100644 --- a/modules/Microsoft.Automation/automationAccounts/readme.md +++ b/modules/Microsoft.Automation/automationAccounts/readme.md @@ -344,39 +344,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-aut-encr-001" - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "cMKUserAssignedIdentityResourceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" - }, - "cMKKeyName": { - "value": "keyEncryptionKey" - }, - "cMKKeyVaultResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" - } - } -} -``` - -
+

Example 1: Encr

@@ -386,13 +358,15 @@ userAssignedIdentities: { module automationAccounts './Microsoft.Automation/automationAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-automationAccounts' params: { + // Required parameters name: '<>-az-aut-encr-001' + // Non-required parameters + cMKKeyName: 'keyEncryptionKey' + cMKKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002' + cMKUserAssignedIdentityResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' userAssignedIdentities: { '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } - cMKUserAssignedIdentityResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' - cMKKeyName: 'keyEncryptionKey' - cMKKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002' } } ``` @@ -400,25 +374,42 @@ module automationAccounts './Microsoft.Automation/automationAccounts/deploy.bice

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-aut-min-001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-aut-encr-001" + }, + // Non-required parameters + "cMKKeyName": { + "value": "keyEncryptionKey" + }, + "cMKKeyVaultResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" + }, + "cMKUserAssignedIdentityResourceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } } + } } ```
+

+ +

Example 2: Min

@@ -436,215 +427,26 @@ module automationAccounts './Microsoft.Automation/automationAccounts/deploy.bice

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-aut-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "schedules": { - "value": [ - { - "name": "TestSchedule", - "startTime": "", - "expiryTime": "9999-12-31T13:00", - "interval": 15, - "frequency": "Minute", - "timeZone": "Europe/Berlin", - "advancedSchedule": {} - } - ] - }, - "modules": { - "value": [ - { - "name": "PSWindowsUpdate", - "version": "latest", - "uri": "https://www.powershellgallery.com/api/v2/package" - } - ] - }, - "runbooks": { - "value": [ - { - "name": "TestRunbook", - "runbookType": "PowerShell", - "description": "Test runbook", - "uri": "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.automation/101-automation/scripts/AzureAutomationTutorial.ps1", - "version": "1.0.0.0" - } - ] - }, - "jobSchedules": { - "value": [ - { - "scheduleName": "TestSchedule", - "runbookName": "TestRunbook" - } - ] - }, - "variables": { - "value": [ - { - "name": "TestString", - "value": "\"TestString\"", - "description": "TestStringDescription" - }, - { - "name": "TestInteger", - "value": "500", - "description": "TestIntegerDescription" - }, - { - "name": "TestBoolean", - "value": "false", - "description": "TestBooleanDescription" - }, - { - "name": "TestDateTime", - "value": "\"\\/Date(1637934042656)\\/\"", - "description": "TestDateTimeDescription", - "isEncrypted": false - }, - { - "name": "TestEncryptedVariable", - "value": "\"TestEncryptedValue\"", - "description": "TestEncryptedDescription" - } - ] - }, - "linkedWorkspaceResourceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-aut-001" - }, - "gallerySolutions": { - "value": [ - { - "name": "Updates", - "product": "OMSGallery", - "publisher": "Microsoft" - } - ] - }, - "softwareUpdateConfigurations": { - "value": [ - { - "name": "Windows_ZeroDay", - "frequency": "Month", - "operatingSystem": "Windows", - "rebootSetting": "IfRequired", - "scopeByTags": { - "Update": [ - "Automatic-Wave1" - ] - }, - "maintenanceWindow": "PT4H", - "updateClassifications": [ - "Critical", - "Security", - "UpdateRollup", - "FeaturePack", - "ServicePack", - "Definition", - "Tools", - "Updates" - ], - "includeUpdates": [ - "654321" - ], - "excludeUpdates": [ - "123456" - ], - "interval": 1, - "monthlyOccurrences": [ - { - "occurrence": 3, - "day": "Friday" - } - ], - "startTime": "22:00" - }, - { - "name": "Linux_ZeroDay", - "frequency": "OneTime", - "operatingSystem": "Linux", - "rebootSetting": "IfRequired", - "maintenanceWindow": "PT4H", - "updateClassifications": [ - "Critical", - "Security", - "Other" - ], - "includeUpdates": [ - "kernel" - ], - "excludeUpdates": [ - "icacls" - ], - "startTime": "22:00" - } - ] - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "Webhook" - }, - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "DSCAndHybridWorker" - } - ] - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>-az-aut-min-001" } + } } ```
+

+ +

Example 3: Parameters

@@ -654,81 +456,92 @@ module automationAccounts './Microsoft.Automation/automationAccounts/deploy.bice module automationAccounts './Microsoft.Automation/automationAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-automationAccounts' params: { + // Required parameters name: '<>-az-aut-x-001' - lock: 'CanNotDelete' - schedules: [ - { - name: 'TestSchedule' - startTime: '' - expiryTime: '9999-12-31T13:00' - interval: 15 - frequency: 'Minute' - timeZone: 'Europe/Berlin' - advancedSchedule: {} - } - ] - modules: [ - { - name: 'PSWindowsUpdate' - version: 'latest' - uri: 'https://www.powershellgallery.com/api/v2/package' - } - ] - runbooks: [ + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + gallerySolutions: [ { - name: 'TestRunbook' - runbookType: 'PowerShell' - description: 'Test runbook' - uri: 'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.automation/101-automation/scripts/AzureAutomationTutorial.ps1' - version: '1.0.0.0' + name: 'Updates' + product: 'OMSGallery' + publisher: 'Microsoft' } ] jobSchedules: [ { - scheduleName: 'TestSchedule' runbookName: 'TestRunbook' + scheduleName: 'TestSchedule' } ] - variables: [ + linkedWorkspaceResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-aut-001' + lock: 'CanNotDelete' + modules: [ { - name: 'TestString' - value: '\'TestString\'' - description: 'TestStringDescription' + name: 'PSWindowsUpdate' + uri: 'https://www.powershellgallery.com/api/v2/package' + version: 'latest' } + ] + privateEndpoints: [ { - name: 'TestInteger' - value: '500' - description: 'TestIntegerDescription' + service: 'Webhook' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' } { - name: 'TestBoolean' - value: 'false' - description: 'TestBooleanDescription' + service: 'DSCAndHybridWorker' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' } + ] + roleAssignments: [ { - name: 'TestDateTime' - value: '\'\\/Date(1637934042656)\\/\'' - description: 'TestDateTimeDescription' - isEncrypted: false + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' } + ] + runbooks: [ { - name: 'TestEncryptedVariable' - value: '\'TestEncryptedValue\'' - description: 'TestEncryptedDescription' + description: 'Test runbook' + name: 'TestRunbook' + runbookType: 'PowerShell' + uri: 'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.automation/101-automation/scripts/AzureAutomationTutorial.ps1' + version: '1.0.0.0' } ] - linkedWorkspaceResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-aut-001' - gallerySolutions: [ + schedules: [ { - name: 'Updates' - product: 'OMSGallery' - publisher: 'Microsoft' + advancedSchedule: {} + expiryTime: '9999-12-31T13:00' + frequency: 'Minute' + interval: 15 + name: 'TestSchedule' + startTime: '' + timeZone: 'Europe/Berlin' } ] softwareUpdateConfigurations: [ { - name: 'Windows_ZeroDay' + excludeUpdates: [ + '123456' + ] frequency: 'Month' + includeUpdates: [ + '654321' + ] + interval: 1 + maintenanceWindow: 'PT4H' + monthlyOccurrences: [ + { + day: 'Friday' + occurrence: 3 + } + ] + name: 'Windows_ZeroDay' operatingSystem: 'Windows' rebootSetting: 'IfRequired' scopeByTags: { @@ -736,79 +549,281 @@ module automationAccounts './Microsoft.Automation/automationAccounts/deploy.bice 'Automatic-Wave1' ] } - maintenanceWindow: 'PT4H' + startTime: '22:00' updateClassifications: [ 'Critical' - 'Security' - 'UpdateRollup' + 'Definition' 'FeaturePack' + 'Security' 'ServicePack' - 'Definition' 'Tools' + 'UpdateRollup' 'Updates' ] - includeUpdates: [ - '654321' - ] + } + { excludeUpdates: [ - '123456' + 'icacls' ] - interval: 1 - monthlyOccurrences: [ - { - occurrence: 3 - day: 'Friday' - } + frequency: 'OneTime' + includeUpdates: [ + 'kernel' ] - startTime: '22:00' - } - { + maintenanceWindow: 'PT4H' name: 'Linux_ZeroDay' - frequency: 'OneTime' operatingSystem: 'Linux' rebootSetting: 'IfRequired' - maintenanceWindow: 'PT4H' + startTime: '22:00' updateClassifications: [ 'Critical' - 'Security' 'Other' + 'Security' ] - includeUpdates: [ - 'kernel' - ] - excludeUpdates: [ - 'icacls' - ] - startTime: '22:00' - } - ] - privateEndpoints: [ - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'Webhook' - } - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'DSCAndHybridWorker' } ] systemAssignedIdentity: true userAssignedIdentities: { '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } - roleAssignments: [ + variables: [ { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] + description: 'TestStringDescription' + name: 'TestString' + value: '\'TestString\'' + } + { + description: 'TestIntegerDescription' + name: 'TestInteger' + value: '500' + } + { + description: 'TestBooleanDescription' + name: 'TestBoolean' + value: 'false' + } + { + description: 'TestDateTimeDescription' + isEncrypted: false + name: 'TestDateTime' + value: '\'\\/Date(1637934042656)\\/\'' + } + { + description: 'TestEncryptedDescription' + name: 'TestEncryptedVariable' + value: '\'TestEncryptedValue\'' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-aut-x-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "gallerySolutions": { + "value": [ + { + "name": "Updates", + "product": "OMSGallery", + "publisher": "Microsoft" + } + ] + }, + "jobSchedules": { + "value": [ + { + "runbookName": "TestRunbook", + "scheduleName": "TestSchedule" + } + ] + }, + "linkedWorkspaceResourceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-aut-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "modules": { + "value": [ + { + "name": "PSWindowsUpdate", + "uri": "https://www.powershellgallery.com/api/v2/package", + "version": "latest" + } + ] + }, + "privateEndpoints": { + "value": [ + { + "service": "Webhook", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + }, + { + "service": "DSCAndHybridWorker", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "runbooks": { + "value": [ + { + "description": "Test runbook", + "name": "TestRunbook", + "runbookType": "PowerShell", + "uri": "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.automation/101-automation/scripts/AzureAutomationTutorial.ps1", + "version": "1.0.0.0" + } + ] + }, + "schedules": { + "value": [ + { + "advancedSchedule": {}, + "expiryTime": "9999-12-31T13:00", + "frequency": "Minute", + "interval": 15, + "name": "TestSchedule", + "startTime": "", + "timeZone": "Europe/Berlin" + } + ] + }, + "softwareUpdateConfigurations": { + "value": [ + { + "excludeUpdates": [ + "123456" + ], + "frequency": "Month", + "includeUpdates": [ + "654321" + ], + "interval": 1, + "maintenanceWindow": "PT4H", + "monthlyOccurrences": [ + { + "day": "Friday", + "occurrence": 3 + } + ], + "name": "Windows_ZeroDay", + "operatingSystem": "Windows", + "rebootSetting": "IfRequired", + "scopeByTags": { + "Update": [ + "Automatic-Wave1" + ] + }, + "startTime": "22:00", + "updateClassifications": [ + "Critical", + "Definition", + "FeaturePack", + "Security", + "ServicePack", + "Tools", + "UpdateRollup", + "Updates" + ] + }, + { + "excludeUpdates": [ + "icacls" + ], + "frequency": "OneTime", + "includeUpdates": [ + "kernel" + ], + "maintenanceWindow": "PT4H", + "name": "Linux_ZeroDay", + "operatingSystem": "Linux", + "rebootSetting": "IfRequired", + "startTime": "22:00", + "updateClassifications": [ + "Critical", + "Other", + "Security" + ] + } + ] + }, + "systemAssignedIdentity": { + "value": true + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + }, + "variables": { + "value": [ + { + "description": "TestStringDescription", + "name": "TestString", + "value": "\"TestString\"" + }, + { + "description": "TestIntegerDescription", + "name": "TestInteger", + "value": "500" + }, + { + "description": "TestBooleanDescription", + "name": "TestBoolean", + "value": "false" + }, + { + "description": "TestDateTimeDescription", + "isEncrypted": false, + "name": "TestDateTime", + "value": "\"\\/Date(1637934042656)\\/\"" + }, + { + "description": "TestEncryptedDescription", + "name": "TestEncryptedVariable", + "value": "\"TestEncryptedValue\"" + } + ] + } } } ``` diff --git a/modules/Microsoft.Batch/batchAccounts/readme.md b/modules/Microsoft.Batch/batchAccounts/readme.md index e83ea9b824..4af4aac994 100644 --- a/modules/Microsoft.Batch/batchAccounts/readme.md +++ b/modules/Microsoft.Batch/batchAccounts/readme.md @@ -221,56 +221,11 @@ privateEndpoints: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>azbaweuencr001" - }, - "poolAllocationMode": { - "value": "BatchService" - }, - "storageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "storageAuthenticationMode": { - "value": "BatchAccountManagedIdentity" - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "storageAccessIdentity": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" - }, - "cMKKeyName": { - "value": "keyEncryptionKey" - }, - "cMKKeyVaultResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "batchAccount" - } - ] - } - } -} -``` - -
+

Example 1: Encr

@@ -280,22 +235,24 @@ privateEndpoints: [ module batchAccounts './Microsoft.Batch/batchAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-batchAccounts' params: { + // Required parameters name: '<>azbaweuencr001' - poolAllocationMode: 'BatchService' storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - storageAuthenticationMode: 'BatchAccountManagedIdentity' - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } - storageAccessIdentity: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' + // Non-required parameters cMKKeyName: 'keyEncryptionKey' cMKKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002' + poolAllocationMode: 'BatchService' privateEndpoints: [ { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' service: 'batchAccount' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' } ] + storageAccessIdentity: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' + storageAuthenticationMode: 'BatchAccountManagedIdentity' + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } } } ``` @@ -303,28 +260,59 @@ module batchAccounts './Microsoft.Batch/batchAccounts/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>azbaweumin001" - }, - "storageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>azbaweuencr001" + }, + "storageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + // Non-required parameters + "cMKKeyName": { + "value": "keyEncryptionKey" + }, + "cMKKeyVaultResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" + }, + "poolAllocationMode": { + "value": "BatchService" + }, + "privateEndpoints": { + "value": [ + { + "service": "batchAccount", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" } + ] + }, + "storageAccessIdentity": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" + }, + "storageAuthenticationMode": { + "value": "BatchAccountManagedIdentity" + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } } + } } ```
+

+ +

Example 2: Min

@@ -334,6 +322,7 @@ module batchAccounts './Microsoft.Batch/batchAccounts/deploy.bicep' = { module batchAccounts './Microsoft.Batch/batchAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-batchAccounts' params: { + // Required parameters name: '<>azbaweumin001' storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' } @@ -343,66 +332,30 @@ module batchAccounts './Microsoft.Batch/batchAccounts/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>azbaweux001" - }, - "lock": { - "value": "CanNotDelete" - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "batchAccount" - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "poolAllocationMode": { - "value": "BatchService" - }, - "storageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "systemAssignedIdentity": { - "value": true - }, - "storageAuthenticationMode": { - "value": "BatchAccountManagedIdentity" - }, - "storageAccessIdentity": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>azbaweumin001" + }, + "storageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" } + } } ```
+

+ +

Example 3: Parameters

@@ -412,24 +365,88 @@ module batchAccounts './Microsoft.Batch/batchAccounts/deploy.bicep' = { module batchAccounts './Microsoft.Batch/batchAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-batchAccounts' params: { + // Required parameters name: '<>azbaweux001' + storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' lock: 'CanNotDelete' + poolAllocationMode: 'BatchService' privateEndpoints: [ { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' service: 'batchAccount' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' - poolAllocationMode: 'BatchService' - storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - systemAssignedIdentity: true - storageAuthenticationMode: 'BatchAccountManagedIdentity' storageAccessIdentity: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' + storageAuthenticationMode: 'BatchAccountManagedIdentity' + systemAssignedIdentity: true + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>azbaweux001" + }, + "storageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "poolAllocationMode": { + "value": "BatchService" + }, + "privateEndpoints": { + "value": [ + { + "service": "batchAccount", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "storageAccessIdentity": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" + }, + "storageAuthenticationMode": { + "value": "BatchAccountManagedIdentity" + }, + "systemAssignedIdentity": { + "value": true + } } } ``` diff --git a/modules/Microsoft.CognitiveServices/accounts/readme.md b/modules/Microsoft.CognitiveServices/accounts/readme.md index a469252ba0..3fb7e9b5c1 100644 --- a/modules/Microsoft.CognitiveServices/accounts/readme.md +++ b/modules/Microsoft.CognitiveServices/accounts/readme.md @@ -404,50 +404,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-cgs-encr-001" - }, - "kind": { - "value": "SpeechServices" - }, - "sku": { - "value": "S0" - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "publicNetworkAccess": { - "value": "Enabled" - }, - "encryption": { - "value": { - "keySource": "Microsoft.KeyVault", - "keyVaultProperties": { - "identityClientId": "c907a696-36f4-49fe-b926-39e3aabba814", // ID must be updated for new identity - "keyVaultUri": "https://adp-<>-az-kv-nopr-002.vault.azure.net/", - "keyName": "keyEncryptionKey", - "keyversion": "4570a207ec394a0bbbe4fc9adc663a51" // Version must be updated for new keys - } - } - } - } -} -``` - -
+

Example 1: Encr

@@ -457,22 +418,24 @@ userAssignedIdentities: { module accounts './Microsoft.CognitiveServices/accounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-accounts' params: { - name: '<>-az-cgs-encr-001' + // Required parameters kind: 'SpeechServices' - sku: 'S0' - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } - publicNetworkAccess: 'Enabled' + name: '<>-az-cgs-encr-001' + // Non-required parameters encryption: { keySource: 'Microsoft.KeyVault' keyVaultProperties: { identityClientId: 'c907a696-36f4-49fe-b926-39e3aabba814' - keyVaultUri: 'https://adp-<>-az-kv-nopr-002.vault.azure.net/' keyName: 'keyEncryptionKey' + keyVaultUri: 'https://adp-<>-az-kv-nopr-002.vault.azure.net/' keyversion: '4570a207ec394a0bbbe4fc9adc663a51' } } + publicNetworkAccess: 'Enabled' + sku: 'S0' + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } } } ``` @@ -480,28 +443,53 @@ module accounts './Microsoft.CognitiveServices/accounts/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-cgs-min-001" - }, - "kind": { - "value": "SpeechServices" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "kind": { + "value": "SpeechServices" + }, + "name": { + "value": "<>-az-cgs-encr-001" + }, + // Non-required parameters + "encryption": { + "value": { + "keySource": "Microsoft.KeyVault", + "keyVaultProperties": { + "identityClientId": "c907a696-36f4-49fe-b926-39e3aabba814", + "keyName": "keyEncryptionKey", + "keyVaultUri": "https://adp-<>-az-kv-nopr-002.vault.azure.net/", + "keyversion": "4570a207ec394a0bbbe4fc9adc663a51" } + } + }, + "publicNetworkAccess": { + "value": "Enabled" + }, + "sku": { + "value": "S0" + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } } + } } ```
+

+ +

Example 2: Min

@@ -511,8 +499,9 @@ module accounts './Microsoft.CognitiveServices/accounts/deploy.bicep' = { module accounts './Microsoft.CognitiveServices/accounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-accounts' params: { - name: '<>-az-cgs-min-001' + // Required parameters kind: 'SpeechServices' + name: '<>-az-cgs-min-001' } } ``` @@ -520,81 +509,30 @@ module accounts './Microsoft.CognitiveServices/accounts/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-cgs-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "kind": { - "value": "Face" - }, - "sku": { - "value": "S0" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "networkAcls": { - "value": { - "defaultAction": "deny", - "virtualNetworkRules": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001", - "action": "Allow" - } - ] - } - }, - "customSubDomainName": { - "value": "<>xdomain" - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "kind": { + "value": "SpeechServices" + }, + "name": { + "value": "<>-az-cgs-min-001" } + } } ```
+

+ +

Example 3: Parameters

@@ -604,37 +542,39 @@ module accounts './Microsoft.CognitiveServices/accounts/deploy.bicep' = { module accounts './Microsoft.CognitiveServices/accounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-accounts' params: { + // Required parameters + kind: 'Face' name: '<>-az-cgs-x-001' + // Non-required parameters + customSubDomainName: '<>xdomain' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' lock: 'CanNotDelete' - kind: 'Face' - sku: 'S0' - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] networkAcls: { defaultAction: 'deny' virtualNetworkRules: [ { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' action: 'Allow' + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' } ] } - customSubDomainName: '<>xdomain' + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + sku: 'S0' systemAssignedIdentity: true userAssignedIdentities: { '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' } } ``` @@ -642,50 +582,84 @@ module accounts './Microsoft.CognitiveServices/accounts/deploy.bicep' = {

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-cgs-speech-001" - }, - "kind": { - "value": "SpeechServices" - }, - "sku": { - "value": "S0" - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "customSubDomainName": { - "value": "<>speechdomain" - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "account" - } - ] + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "kind": { + "value": "Face" + }, + "name": { + "value": "<>-az-cgs-x-001" + }, + // Non-required parameters + "customSubDomainName": { + "value": "<>xdomain" + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "networkAcls": { + "value": { + "defaultAction": "deny", + "virtualNetworkRules": [ + { + "action": "Allow", + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" + } + ] + } + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] + }, + "sku": { + "value": "S0" + }, + "systemAssignedIdentity": { + "value": true + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } } + } } ```
+

+ +

Example 4: Speech

@@ -695,20 +669,68 @@ module accounts './Microsoft.CognitiveServices/accounts/deploy.bicep' = { module accounts './Microsoft.CognitiveServices/accounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-accounts' params: { - name: '<>-az-cgs-speech-001' + // Required parameters kind: 'SpeechServices' - sku: 'S0' - systemAssignedIdentity: true - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } + name: '<>-az-cgs-speech-001' + // Non-required parameters customSubDomainName: '<>speechdomain' privateEndpoints: [ { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' service: 'account' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' } ] + sku: 'S0' + systemAssignedIdentity: true + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "kind": { + "value": "SpeechServices" + }, + "name": { + "value": "<>-az-cgs-speech-001" + }, + // Non-required parameters + "customSubDomainName": { + "value": "<>speechdomain" + }, + "privateEndpoints": { + "value": [ + { + "service": "account", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "sku": { + "value": "S0" + }, + "systemAssignedIdentity": { + "value": true + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + } } } ``` diff --git a/modules/Microsoft.Compute/availabilitySets/readme.md b/modules/Microsoft.Compute/availabilitySets/readme.md index 69d0451b6a..c2fe02a3f3 100644 --- a/modules/Microsoft.Compute/availabilitySets/readme.md +++ b/modules/Microsoft.Compute/availabilitySets/readme.md @@ -149,25 +149,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-avs-min-001" - } - } -} -``` - -
+

Example 1: Min

@@ -185,41 +171,26 @@ module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-avs-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "proximityPlacementGroupId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/proximityPlacementGroups/adp-<>-az-ppg-x-001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>-az-avs-min-001" } + } } ```
+

+ +

Example 2: Parameters

@@ -229,17 +200,56 @@ module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { name: '${uniqueString(deployment().name)}-availabilitySets' params: { + // Required parameters name: '<>-az-avs-x-001' + // Non-required parameters lock: 'CanNotDelete' + proximityPlacementGroupId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/proximityPlacementGroups/adp-<>-az-ppg-x-001' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - proximityPlacementGroupId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/proximityPlacementGroups/adp-<>-az-ppg-x-001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-avs-x-001" + }, + // Non-required parameters + "lock": { + "value": "CanNotDelete" + }, + "proximityPlacementGroupId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/proximityPlacementGroups/adp-<>-az-ppg-x-001" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } } } ``` diff --git a/modules/Microsoft.Compute/diskEncryptionSets/readme.md b/modules/Microsoft.Compute/diskEncryptionSets/readme.md index 7e22cabc31..d3099a7366 100644 --- a/modules/Microsoft.Compute/diskEncryptionSets/readme.md +++ b/modules/Microsoft.Compute/diskEncryptionSets/readme.md @@ -151,41 +151,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-des-x-001" - }, - "keyVaultResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "keyName": { - "value": "keyEncryptionKey" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -195,15 +165,17 @@ tags: { module diskEncryptionSets './Microsoft.Compute/diskEncryptionSets/deploy.bicep' = { name: '${uniqueString(deployment().name)}-diskEncryptionSets' params: { - name: '<>-az-des-x-001' - keyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' + // Required parameters keyName: 'keyEncryptionKey' + keyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' + name: '<>-az-des-x-001' + // Non-required parameters roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -212,3 +184,40 @@ module diskEncryptionSets './Microsoft.Compute/diskEncryptionSets/deploy.bicep'

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "keyName": { + "value": "keyEncryptionKey" + }, + "keyVaultResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "name": { + "value": "<>-az-des-x-001" + }, + // Non-required parameters + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Compute/disks/readme.md b/modules/Microsoft.Compute/disks/readme.md index 06951fb6aa..9245f46da8 100644 --- a/modules/Microsoft.Compute/disks/readme.md +++ b/modules/Microsoft.Compute/disks/readme.md @@ -165,44 +165,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-disk-image-001" - }, - "sku": { - "value": "Standard_LRS" - }, - "createOption": { - "value": "FromImage" - }, - "imageReferenceId": { - "value": "/Subscriptions/<>/Providers/Microsoft.Compute/Locations/westeurope/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/14393.4906.2112080838" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Image

@@ -212,16 +179,18 @@ tags: { module disks './Microsoft.Compute/disks/deploy.bicep' = { name: '${uniqueString(deployment().name)}-disks' params: { + // Required parameters name: '<>-az-disk-image-001' sku: 'Standard_LRS' + // Non-required parameters createOption: 'FromImage' imageReferenceId: '/Subscriptions/<>/Providers/Microsoft.Compute/Locations/westeurope/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/14393.4906.2112080838' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -231,47 +200,47 @@ module disks './Microsoft.Compute/disks/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-disk-import-001" - }, - "sku": { - "value": "Standard_LRS" - }, - "createOption": { - "value": "Import" - }, - "sourceUri": { - "value": "https://adp<>azsax001.blob.core.windows.net/vhds/adp-<>-az-imgt-x-001.vhd" - }, - "storageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-disk-image-001" + }, + "sku": { + "value": "Standard_LRS" + }, + // Non-required parameters + "createOption": { + "value": "FromImage" + }, + "imageReferenceId": { + "value": "/Subscriptions/<>/Providers/Microsoft.Compute/Locations/westeurope/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/14393.4906.2112080838" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] } + } } ```
+

+ +

Example 2: Import

@@ -281,19 +250,21 @@ module disks './Microsoft.Compute/disks/deploy.bicep' = { module disks './Microsoft.Compute/disks/deploy.bicep' = { name: '${uniqueString(deployment().name)}-disks' params: { + // Required parameters name: '<>-az-disk-import-001' sku: 'Standard_LRS' + // Non-required parameters createOption: 'Import' - sourceUri: 'https://adp<>azsax001.blob.core.windows.net/vhds/adp-<>-az-imgt-x-001.vhd' - storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + sourceUri: 'https://adp<>azsax001.blob.core.windows.net/vhds/adp-<>-az-imgt-x-001.vhd' + storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' } } ``` @@ -301,41 +272,50 @@ module disks './Microsoft.Compute/disks/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-disk-min-001" - }, - "sku": { - "value": "Standard_LRS" - }, - "diskSizeGB": { - "value": 1 - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-disk-import-001" + }, + "sku": { + "value": "Standard_LRS" + }, + // Non-required parameters + "createOption": { + "value": "Import" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] + }, + "sourceUri": { + "value": "https://adp<>azsax001.blob.core.windows.net/vhds/adp-<>-az-imgt-x-001.vhd" + }, + "storageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" } + } } ```
+

+ +

Example 3: Min

@@ -345,15 +325,17 @@ module disks './Microsoft.Compute/disks/deploy.bicep' = { module disks './Microsoft.Compute/disks/deploy.bicep' = { name: '${uniqueString(deployment().name)}-disks' params: { + // Required parameters name: '<>-az-disk-min-001' sku: 'Standard_LRS' + // Non-required parameters diskSizeGB: 1 roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -363,59 +345,44 @@ module disks './Microsoft.Compute/disks/deploy.bicep' = {

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-disk-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "sku": { - "value": "UltraSSD_LRS" - }, - "diskSizeGB": { - "value": 128 - }, - "logicalSectorSize": { - "value": 512 - }, - "diskIOPSReadWrite": { - "value": 500 - }, - "diskMBpsReadWrite": { - "value": 60 - }, - "osType": { - "value": "Windows" - }, - "publicNetworkAccess": { - "value": "Enabled" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-disk-min-001" + }, + "sku": { + "value": "Standard_LRS" + }, + // Non-required parameters + "diskSizeGB": { + "value": 1 + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] } + } } ```
+

+ +

Example 4: Parameters

@@ -425,21 +392,23 @@ module disks './Microsoft.Compute/disks/deploy.bicep' = { module disks './Microsoft.Compute/disks/deploy.bicep' = { name: '${uniqueString(deployment().name)}-disks' params: { + // Required parameters name: '<>-az-disk-x-001' - lock: 'CanNotDelete' sku: 'UltraSSD_LRS' - diskSizeGB: 128 - logicalSectorSize: 512 + // Non-required parameters diskIOPSReadWrite: 500 diskMBpsReadWrite: 60 + diskSizeGB: 128 + lock: 'CanNotDelete' + logicalSectorSize: 512 osType: 'Windows' publicNetworkAccess: 'Enabled' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -448,3 +417,58 @@ module disks './Microsoft.Compute/disks/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-disk-x-001" + }, + "sku": { + "value": "UltraSSD_LRS" + }, + // Non-required parameters + "diskIOPSReadWrite": { + "value": 500 + }, + "diskMBpsReadWrite": { + "value": 60 + }, + "diskSizeGB": { + "value": 128 + }, + "lock": { + "value": "CanNotDelete" + }, + "logicalSectorSize": { + "value": 512 + }, + "osType": { + "value": "Windows" + }, + "publicNetworkAccess": { + "value": "Enabled" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Compute/galleries/readme.md b/modules/Microsoft.Compute/galleries/readme.md index 7ac821f3aa..e9967a2994 100644 --- a/modules/Microsoft.Compute/galleries/readme.md +++ b/modules/Microsoft.Compute/galleries/readme.md @@ -148,66 +148,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>azsigweuimages001" - }, - "images": { - "value": [ - { - "name": "<>-az-imgd-x-003" - }, - { - "name": "<>-az-imgd-x-001", - "osType": "Windows", - "osState": "Generalized", - "publisher": "MicrosoftWindowsServer", - "offer": "WindowsServer", - "sku": "2022-datacenter-azure-edition", - "minRecommendedvCPUs": 2, - "maxRecommendedvCPUs": 8, - "minRecommendedMemory": 4, - "maxRecommendedMemory": 16, - "hyperVGeneration": "V1", - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - { - "name": "<>-az-imgd-x-002", - "osType": "Linux", - "osState": "Generalized", - "publisher": "canonical", - "offer": "0001-com-ubuntu-server-focal", - "sku": "20_04-lts-gen2", - "minRecommendedvCPUs": 1, - "maxRecommendedvCPUs": 4, - "minRecommendedMemory": 4, - "maxRecommendedMemory": 32, - "hyperVGeneration": "V2" - } - ] - } - } -} -``` - -
+

Example 1: Images

@@ -217,44 +162,46 @@ tags: { module galleries './Microsoft.Compute/galleries/deploy.bicep' = { name: '${uniqueString(deployment().name)}-galleries' params: { + // Required parameters name: '<>azsigweuimages001' + // Non-required parameters images: [ { name: '<>-az-imgd-x-003' } { + hyperVGeneration: 'V1' + maxRecommendedMemory: 16 + maxRecommendedvCPUs: 8 + minRecommendedMemory: 4 + minRecommendedvCPUs: 2 name: '<>-az-imgd-x-001' - osType: 'Windows' + offer: 'WindowsServer' osState: 'Generalized' + osType: 'Windows' publisher: 'MicrosoftWindowsServer' - offer: 'WindowsServer' - sku: '2022-datacenter-azure-edition' - minRecommendedvCPUs: 2 - maxRecommendedvCPUs: 8 - minRecommendedMemory: 4 - maxRecommendedMemory: 16 - hyperVGeneration: 'V1' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + sku: '2022-datacenter-azure-edition' } { + hyperVGeneration: 'V2' + maxRecommendedMemory: 32 + maxRecommendedvCPUs: 4 + minRecommendedMemory: 4 + minRecommendedvCPUs: 1 name: '<>-az-imgd-x-002' - osType: 'Linux' + offer: '0001-com-ubuntu-server-focal' osState: 'Generalized' + osType: 'Linux' publisher: 'canonical' - offer: '0001-com-ubuntu-server-focal' sku: '20_04-lts-gen2' - minRecommendedvCPUs: 1 - maxRecommendedvCPUs: 4 - minRecommendedMemory: 4 - maxRecommendedMemory: 32 - hyperVGeneration: 'V2' } ] } @@ -264,38 +211,69 @@ module galleries './Microsoft.Compute/galleries/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>azsigweux001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>azsigweuimages001" + }, + // Non-required parameters + "images": { + "value": [ + { + "name": "<>-az-imgd-x-003" }, - "lock": { - "value": "CanNotDelete" + { + "hyperVGeneration": "V1", + "maxRecommendedMemory": 16, + "maxRecommendedvCPUs": 8, + "minRecommendedMemory": 4, + "minRecommendedvCPUs": 2, + "name": "<>-az-imgd-x-001", + "offer": "WindowsServer", + "osState": "Generalized", + "osType": "Windows", + "publisher": "MicrosoftWindowsServer", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "sku": "2022-datacenter-azure-edition" }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] + { + "hyperVGeneration": "V2", + "maxRecommendedMemory": 32, + "maxRecommendedvCPUs": 4, + "minRecommendedMemory": 4, + "minRecommendedvCPUs": 1, + "name": "<>-az-imgd-x-002", + "offer": "0001-com-ubuntu-server-focal", + "osState": "Generalized", + "osType": "Linux", + "publisher": "canonical", + "sku": "20_04-lts-gen2" } + ] } + } } ```
+

+ +

Example 2: Parameters

@@ -305,14 +283,16 @@ module galleries './Microsoft.Compute/galleries/deploy.bicep' = { module galleries './Microsoft.Compute/galleries/deploy.bicep' = { name: '${uniqueString(deployment().name)}-galleries' params: { + // Required parameters name: '<>azsigweux001' + // Non-required parameters lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -321,3 +301,37 @@ module galleries './Microsoft.Compute/galleries/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>azsigweux001" + }, + // Non-required parameters + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Compute/images/readme.md b/modules/Microsoft.Compute/images/readme.md index de9985b177..74b5fb2747 100644 --- a/modules/Microsoft.Compute/images/readme.md +++ b/modules/Microsoft.Compute/images/readme.md @@ -149,53 +149,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-img-x-001" - }, - "osAccountType": { - "value": "Premium_LRS" - }, - "osType": { - "value": "Windows" - }, - "osDiskBlobUri": { - "value": "https://adp<>azsax001.blob.core.windows.net/vhds/adp-<>-az-imgt-x-001.vhd" - }, - "osDiskCaching": { - "value": "ReadWrite" - }, - "zoneResilient": { - "value": true - }, - "hyperVGeneration": { - "value": "V1" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -205,21 +163,72 @@ tags: { module images './Microsoft.Compute/images/deploy.bicep' = { name: '${uniqueString(deployment().name)}-images' params: { + // Required parameters name: '<>-az-img-x-001' osAccountType: 'Premium_LRS' - osType: 'Windows' osDiskBlobUri: 'https://adp<>azsax001.blob.core.windows.net/vhds/adp-<>-az-imgt-x-001.vhd' osDiskCaching: 'ReadWrite' - zoneResilient: true + osType: 'Windows' + // Non-required parameters hyperVGeneration: 'V1' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + zoneResilient: true + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-img-x-001" + }, + "osAccountType": { + "value": "Premium_LRS" + }, + "osDiskBlobUri": { + "value": "https://adp<>azsax001.blob.core.windows.net/vhds/adp-<>-az-imgt-x-001.vhd" + }, + "osDiskCaching": { + "value": "ReadWrite" + }, + "osType": { + "value": "Windows" + }, + // Non-required parameters + "hyperVGeneration": { + "value": "V1" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "zoneResilient": { + "value": true + } } } ``` diff --git a/modules/Microsoft.Compute/proximityPlacementGroups/readme.md b/modules/Microsoft.Compute/proximityPlacementGroups/readme.md index d9244bbe7b..3fc16f4c27 100644 --- a/modules/Microsoft.Compute/proximityPlacementGroups/readme.md +++ b/modules/Microsoft.Compute/proximityPlacementGroups/readme.md @@ -146,38 +146,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-ppg-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -187,14 +160,14 @@ tags: { module proximityPlacementGroups './Microsoft.Compute/proximityPlacementGroups/deploy.bicep' = { name: '${uniqueString(deployment().name)}-proximityPlacementGroups' params: { - name: '<>-az-ppg-x-001' lock: 'CanNotDelete' + name: '<>-az-ppg-x-001' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -203,3 +176,35 @@ module proximityPlacementGroups './Microsoft.Compute/proximityPlacementGroups/de

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "lock": { + "value": "CanNotDelete" + }, + "name": { + "value": "<>-az-ppg-x-001" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Compute/virtualMachineScaleSets/readme.md b/modules/Microsoft.Compute/virtualMachineScaleSets/readme.md index 9499c2b043..61e2d9d935 100644 --- a/modules/Microsoft.Compute/virtualMachineScaleSets/readme.md +++ b/modules/Microsoft.Compute/virtualMachineScaleSets/readme.md @@ -873,79 +873,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-scaleset-linux-min-001" - }, - "osDisk": { - "value": { - "createOption": "fromImage", - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" - } - } - }, - "osType": { - "value": "Linux" - }, - "skuName": { - "value": "Standard_B2s" - }, - "imageReference": { - "value": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18.04-LTS", - "version": "latest" - } - }, - "adminUsername": { - "value": "scaleSetAdmin" - }, - "disablePasswordAuthentication": { - "value": true - }, - "publicKeys": { - "value": [ - { - "path": "/home/scaleSetAdmin/.ssh/authorized_keys", - "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure" - } - ] - }, - "nicConfigurations": { - "value": [ - { - "nicSuffix": "-nic01", - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "subnet": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-002" - } - } - } - ] - } - ] - } - } -} -``` - -
+

Example 1: Linux Min

@@ -955,6 +887,14 @@ userAssignedIdentities: { module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualMachineScaleSets' params: { + // Required parameters + adminUsername: 'scaleSetAdmin' + imageReference: { + offer: 'UbuntuServer' + publisher: 'Canonical' + sku: '18.04-LTS' + version: 'latest' + } name: '<>-scaleset-linux-min-001' osDisk: { createOption: 'fromImage' @@ -965,23 +905,10 @@ module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/depl } osType: 'Linux' skuName: 'Standard_B2s' - imageReference: { - publisher: 'Canonical' - offer: 'UbuntuServer' - sku: '18.04-LTS' - version: 'latest' - } - adminUsername: 'scaleSetAdmin' + // Non-required parameters disablePasswordAuthentication: true - publicKeys: [ - { - path: '/home/scaleSetAdmin/.ssh/authorized_keys' - keyData: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure' - } - ] nicConfigurations: [ { - nicSuffix: '-nic01' ipConfigurations: [ { name: 'ipconfig1' @@ -992,6 +919,13 @@ module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/depl } } ] + nicSuffix: '-nic01' + } + ] + publicKeys: [ + { + keyData: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure' + path: '/home/scaleSetAdmin/.ssh/authorized_keys' } ] } @@ -1001,205 +935,82 @@ module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/depl

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-scaleset-linux-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "vmNamePrefix": { - "value": "vmsslinvm" - }, - "skuName": { - "value": "Standard_B2s" - }, - "skuCapacity": { - "value": 1 - }, - "upgradePolicyMode": { - "value": "Manual" - }, - "vmPriority": { - "value": "Regular" - }, - "osDisk": { - "value": { - "createOption": "fromImage", - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" - } - } - }, - "availabilityZones": { - "value": [ - "2" - ] - }, - "scaleSetFaultDomain": { - "value": 1 - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "bootDiagnosticStorageAccountName": { - "value": "adp<>azsax001" - }, - "osType": { - "value": "Linux" - }, - "encryptionAtHost": { - "value": false - }, - "imageReference": { - "value": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18.04-LTS", - "version": "latest" - } - }, - "adminUsername": { - "value": "scaleSetAdmin" - }, - "disablePasswordAuthentication": { - "value": true - }, - "publicKeys": { - "value": [ - { - "path": "/home/scaleSetAdmin/.ssh/authorized_keys", - "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure" - } - ] - }, - "dataDisks": { - "value": [ - { - "caching": "ReadOnly", - "createOption": "Empty", - "diskSizeGB": "256", - "managedDisk": { - "storageAccountType": "Premium_LRS" - } - }, - { - "caching": "ReadOnly", - "createOption": "Empty", - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" - } - } - ] - }, - "nicConfigurations": { - "value": [ - { - "nicSuffix": "-nic01", - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "subnet": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-002" - } - } - } - ] - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "extensionMonitoringAgentConfig": { - "value": { - "enabled": true - } - }, - "extensionDependencyAgentConfig": { - "value": { - "enabled": true - } - }, - "extensionNetworkWatcherAgentConfig": { - "value": { - "enabled": true - } - }, - "extensionDiskEncryptionConfig": { - "value": { - "enabled": true, - "settings": { - "EncryptionOperation": "EnableEncryption", - "KeyVaultURL": "https://adp-<>-az-kv-x-001.vault.azure.net/", - "KeyVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", - "KeyEncryptionKeyURL": "https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5", // ID must be updated for new keys - "KekVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", - "KeyEncryptionAlgorithm": "RSA-OAEP", - "VolumeType": "All", - "ResizeOSDisk": "false" - } - } - }, - "extensionCustomScriptConfig": { - "value": { - "enabled": true, - "fileData": [ - { - "uri": "https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1", - "storageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - } - ], - "protectedSettings": { - "commandToExecute": "sudo apt-get update" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "adminUsername": { + "value": "scaleSetAdmin" + }, + "imageReference": { + "value": { + "offer": "UbuntuServer", + "publisher": "Canonical", + "sku": "18.04-LTS", + "version": "latest" + } + }, + "name": { + "value": "<>-scaleset-linux-min-001" + }, + "osDisk": { + "value": { + "createOption": "fromImage", + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + } + }, + "osType": { + "value": "Linux" + }, + "skuName": { + "value": "Standard_B2s" + }, + // Non-required parameters + "disablePasswordAuthentication": { + "value": true + }, + "nicConfigurations": { + "value": [ + { + "ipConfigurations": [ + { + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-002" } + } } + ], + "nicSuffix": "-nic01" + } + ] + }, + "publicKeys": { + "value": [ + { + "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure", + "path": "/home/scaleSetAdmin/.ssh/authorized_keys" } + ] } + } } ```
+

+ +

Example 2: Linux

@@ -1209,13 +1020,15 @@ module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/depl module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualMachineScaleSets' params: { + // Required parameters + adminUsername: 'scaleSetAdmin' + imageReference: { + offer: 'UbuntuServer' + publisher: 'Canonical' + sku: '18.04-LTS' + version: 'latest' + } name: '<>-scaleset-linux-001' - lock: 'CanNotDelete' - vmNamePrefix: 'vmsslinvm' - skuName: 'Standard_B2s' - skuCapacity: 1 - upgradePolicyMode: 'Manual' - vmPriority: 'Regular' osDisk: { createOption: 'fromImage' diskSizeGB: '128' @@ -1223,31 +1036,13 @@ module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/depl storageAccountType: 'Premium_LRS' } } + osType: 'Linux' + skuName: 'Standard_B2s' + // Non-required parameters availabilityZones: [ '2' ] - scaleSetFaultDomain: 1 - systemAssignedIdentity: true - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } bootDiagnosticStorageAccountName: 'adp<>azsax001' - osType: 'Linux' - encryptionAtHost: false - imageReference: { - publisher: 'Canonical' - offer: 'UbuntuServer' - sku: '18.04-LTS' - version: 'latest' - } - adminUsername: 'scaleSetAdmin' - disablePasswordAuthentication: true - publicKeys: [ - { - path: '/home/scaleSetAdmin/.ssh/authorized_keys' - keyData: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure' - } - ] dataDisks: [ { caching: 'ReadOnly' @@ -1266,9 +1061,50 @@ module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/depl } } ] + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + disablePasswordAuthentication: true + encryptionAtHost: false + extensionCustomScriptConfig: { + enabled: true + fileData: [ + { + storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + uri: 'https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1' + } + ] + protectedSettings: { + commandToExecute: 'sudo apt-get update' + } + } + extensionDependencyAgentConfig: { + enabled: true + } + extensionDiskEncryptionConfig: { + enabled: true + settings: { + EncryptionOperation: 'EnableEncryption' + KekVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' + KeyEncryptionAlgorithm: 'RSA-OAEP' + KeyEncryptionKeyURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5' + KeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' + KeyVaultURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/' + ResizeOSDisk: 'false' + VolumeType: 'All' + } + } + extensionMonitoringAgentConfig: { + enabled: true + } + extensionNetworkWatcherAgentConfig: { + enabled: true + } + lock: 'CanNotDelete' nicConfigurations: [ { - nicSuffix: '-nic01' ipConfigurations: [ { name: 'ipconfig1' @@ -1279,55 +1115,32 @@ module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/depl } } ] + nicSuffix: '-nic01' + } + ] + publicKeys: [ + { + keyData: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure' + path: '/home/scaleSetAdmin/.ssh/authorized_keys' } ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' - extensionMonitoringAgentConfig: { - enabled: true - } - extensionDependencyAgentConfig: { - enabled: true - } - extensionNetworkWatcherAgentConfig: { - enabled: true - } - extensionDiskEncryptionConfig: { - enabled: true - settings: { - EncryptionOperation: 'EnableEncryption' - KeyVaultURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/' - KeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' - KeyEncryptionKeyURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5' - KekVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' - KeyEncryptionAlgorithm: 'RSA-OAEP' - VolumeType: 'All' - ResizeOSDisk: 'false' - } - } - extensionCustomScriptConfig: { - enabled: true - fileData: [ - { - uri: 'https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1' - storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - } - ] - protectedSettings: { - commandToExecute: 'sudo apt-get update' - } + scaleSetFaultDomain: 1 + skuCapacity: 1 + systemAssignedIdentity: true + upgradePolicyMode: 'Manual' + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } + vmNamePrefix: 'vmsslinvm' + vmPriority: 'Regular' } } ``` @@ -1335,81 +1148,208 @@ module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/depl

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-scaleset-win-min-001" - }, - "skuName": { - "value": "Standard_B2s" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "adminUsername": { + "value": "scaleSetAdmin" + }, + "imageReference": { + "value": { + "offer": "UbuntuServer", + "publisher": "Canonical", + "sku": "18.04-LTS", + "version": "latest" + } + }, + "name": { + "value": "<>-scaleset-linux-001" + }, + "osDisk": { + "value": { + "createOption": "fromImage", + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + } + }, + "osType": { + "value": "Linux" + }, + "skuName": { + "value": "Standard_B2s" + }, + // Non-required parameters + "availabilityZones": { + "value": [ + "2" + ] + }, + "bootDiagnosticStorageAccountName": { + "value": "adp<>azsax001" + }, + "dataDisks": { + "value": [ + { + "caching": "ReadOnly", + "createOption": "Empty", + "diskSizeGB": "256", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } }, - "osDisk": { - "value": { - "createOption": "fromImage", - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" + { + "caching": "ReadOnly", + "createOption": "Empty", + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + } + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "disablePasswordAuthentication": { + "value": true + }, + "encryptionAtHost": { + "value": false + }, + "extensionCustomScriptConfig": { + "value": { + "enabled": true, + "fileData": [ + { + "storageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", + "uri": "https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1" + } + ], + "protectedSettings": { + "commandToExecute": "sudo apt-get update" + } + } + }, + "extensionDependencyAgentConfig": { + "value": { + "enabled": true + } + }, + "extensionDiskEncryptionConfig": { + "value": { + "enabled": true, + "settings": { + "EncryptionOperation": "EnableEncryption", + "KekVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", + "KeyEncryptionAlgorithm": "RSA-OAEP", + "KeyEncryptionKeyURL": "https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5", + "KeyVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", + "KeyVaultURL": "https://adp-<>-az-kv-x-001.vault.azure.net/", + "ResizeOSDisk": "false", + "VolumeType": "All" + } + } + }, + "extensionMonitoringAgentConfig": { + "value": { + "enabled": true + } + }, + "extensionNetworkWatcherAgentConfig": { + "value": { + "enabled": true + } + }, + "lock": { + "value": "CanNotDelete" + }, + "nicConfigurations": { + "value": [ + { + "ipConfigurations": [ + { + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-002" } + } } - }, - "osType": { - "value": "Windows" - }, - "imageReference": { - "value": { - "publisher": "MicrosoftWindowsServer", - "offer": "WindowsServer", - "sku": "2016-Datacenter", - "version": "latest" - } - }, - "adminUsername": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "adminUsername" - } - }, - "adminPassword": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "adminPassword" - } - }, - "nicConfigurations": { - "value": [ - { - "nicSuffix": "-nic01", - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "subnet": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-002" - } - } - } - ] - } - ] + ], + "nicSuffix": "-nic01" + } + ] + }, + "publicKeys": { + "value": [ + { + "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure", + "path": "/home/scaleSetAdmin/.ssh/authorized_keys" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] + }, + "scaleSetFaultDomain": { + "value": 1 + }, + "skuCapacity": { + "value": 1 + }, + "systemAssignedIdentity": { + "value": true + }, + "upgradePolicyMode": { + "value": "Manual" + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + }, + "vmNamePrefix": { + "value": "vmsslinvm" + }, + "vmPriority": { + "value": "Regular" } + } } ```
+

+ +

Example 3: Windows Min

@@ -1424,8 +1364,15 @@ resource kv1 'Microsoft.KeyVault/vaults@2019-09-01' existing = { module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualMachineScaleSets' params: { + // Required parameters + adminUsername: kv1.getSecret('adminUsername') + imageReference: { + offer: 'WindowsServer' + publisher: 'MicrosoftWindowsServer' + sku: '2016-Datacenter' + version: 'latest' + } name: '<>-scaleset-win-min-001' - skuName: 'Standard_B2s' osDisk: { createOption: 'fromImage' diskSizeGB: '128' @@ -1434,17 +1381,11 @@ module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/depl } } osType: 'Windows' - imageReference: { - publisher: 'MicrosoftWindowsServer' - offer: 'WindowsServer' - sku: '2016-Datacenter' - version: 'latest' - } - adminUsername: kv1.getSecret('adminUsername') + skuName: 'Standard_B2s' + // Non-required parameters adminPassword: kv1.getSecret('adminPassword') nicConfigurations: [ { - nicSuffix: '-nic01' ipConfigurations: [ { name: 'ipconfig1' @@ -1455,6 +1396,7 @@ module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/depl } } ] + nicSuffix: '-nic01' } ] } @@ -1464,201 +1406,84 @@ module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/depl

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-scaleset-win-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "vmNamePrefix": { - "value": "vmsswinvm" - }, - "skuName": { - "value": "Standard_B2s" - }, - "skuCapacity": { - "value": 1 - }, - "upgradePolicyMode": { - "value": "Manual" - }, - "vmPriority": { - "value": "Regular" - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "osDisk": { - "value": { - "createOption": "fromImage", - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" - } - } - }, - "osType": { - "value": "Windows" - }, - "encryptionAtHost": { - "value": false - }, - "imageReference": { - "value": { - "publisher": "MicrosoftWindowsServer", - "offer": "WindowsServer", - "sku": "2016-Datacenter", - "version": "latest" - } - }, - "adminUsername": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "adminUsername" - } - }, - "adminPassword": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "adminPassword" - } - }, - "nicConfigurations": { - "value": [ - { - "nicSuffix": "-nic01", - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "subnet": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-002" - } - } - } - ] - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "extensionAntiMalwareConfig": { - "value": { - "enabled": true, - "settings": { - "AntimalwareEnabled": true, - "Exclusions": { - "Extensions": ".log;.ldf", - "Paths": "D:\\IISlogs;D:\\DatabaseLogs", - "Processes": "mssence.svc" - }, - "RealtimeProtectionEnabled": true, - "ScheduledScanSettings": { - "isEnabled": "true", - "scanType": "Quick", - "day": "7", - "time": "120" - } - } - } - }, - "extensionMonitoringAgentConfig": { - "value": { - "enabled": true - } - }, - "extensionDependencyAgentConfig": { - "value": { - "enabled": true - } - }, - "extensionNetworkWatcherAgentConfig": { - "value": { - "enabled": true - } - }, - "extensionDiskEncryptionConfig": { - "value": { - "enabled": true, - "settings": { - "EncryptionOperation": "EnableEncryption", - "KeyVaultURL": "https://adp-<>-az-kv-x-001.vault.azure.net/", - "KeyVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", - "KeyEncryptionKeyURL": "https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5", // ID must be updated for new keys - "KekVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", - "KeyEncryptionAlgorithm": "RSA-OAEP", - "VolumeType": "All", - "ResizeOSDisk": "false" - } - } - }, - "extensionDSCConfig": { - "value": { - "enabled": true - } - }, - "extensionCustomScriptConfig": { - "value": { - "enabled": true, - "fileData": [ - { - "uri": "https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1", - "storageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - } - ], - "protectedSettings": { - "commandToExecute": "powershell -ExecutionPolicy Unrestricted -Command \"& .\\scriptExtensionMasterInstaller.ps1\"" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "adminUsername": { + "reference": { + "keyVault": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "secretName": "adminUsername" + } + }, + "imageReference": { + "value": { + "offer": "WindowsServer", + "publisher": "MicrosoftWindowsServer", + "sku": "2016-Datacenter", + "version": "latest" + } + }, + "name": { + "value": "<>-scaleset-win-min-001" + }, + "osDisk": { + "value": { + "createOption": "fromImage", + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + } + }, + "osType": { + "value": "Windows" + }, + "skuName": { + "value": "Standard_B2s" + }, + // Non-required parameters + "adminPassword": { + "reference": { + "keyVault": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "secretName": "adminPassword" + } + }, + "nicConfigurations": { + "value": [ + { + "ipConfigurations": [ + { + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-002" } + } } + ], + "nicSuffix": "-nic01" } + ] } + } } ```
+

+ +

Example 4: Windows

@@ -1673,17 +1498,15 @@ resource kv1 'Microsoft.KeyVault/vaults@2019-09-01' existing = { module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualMachineScaleSets' params: { - name: '<>-scaleset-win-001' - lock: 'CanNotDelete' - vmNamePrefix: 'vmsswinvm' - skuName: 'Standard_B2s' - skuCapacity: 1 - upgradePolicyMode: 'Manual' - vmPriority: 'Regular' - systemAssignedIdentity: true - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + // Required parameters + adminUsername: kv1.getSecret('adminUsername') + imageReference: { + offer: 'WindowsServer' + publisher: 'MicrosoftWindowsServer' + sku: '2016-Datacenter' + version: 'latest' } + name: '<>-scaleset-win-001' osDisk: { createOption: 'fromImage' diskSizeGB: '128' @@ -1692,43 +1515,15 @@ module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/depl } } osType: 'Windows' - encryptionAtHost: false - imageReference: { - publisher: 'MicrosoftWindowsServer' - offer: 'WindowsServer' - sku: '2016-Datacenter' - version: 'latest' - } - adminUsername: kv1.getSecret('adminUsername') + skuName: 'Standard_B2s' + // Non-required parameters adminPassword: kv1.getSecret('adminPassword') - nicConfigurations: [ - { - nicSuffix: '-nic01' - ipConfigurations: [ - { - name: 'ipconfig1' - properties: { - subnet: { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-002' - } - } - } - ] - } - ] - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' diagnosticLogsRetentionInDays: 7 diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + encryptionAtHost: false extensionAntiMalwareConfig: { enabled: true settings: { @@ -1740,49 +1535,278 @@ module virtualMachineScaleSets './Microsoft.Compute/virtualMachineScaleSets/depl } RealtimeProtectionEnabled: true ScheduledScanSettings: { + day: '7' isEnabled: 'true' scanType: 'Quick' - day: '7' time: '120' } } } - extensionMonitoringAgentConfig: { + extensionCustomScriptConfig: { enabled: true + fileData: [ + { + storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + uri: 'https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1' + } + ] + protectedSettings: { + commandToExecute: 'powershell -ExecutionPolicy Unrestricted -Command \'& .\\scriptExtensionMasterInstaller.ps1\'' + } } extensionDependencyAgentConfig: { enabled: true } - extensionNetworkWatcherAgentConfig: { - enabled: true - } extensionDiskEncryptionConfig: { enabled: true settings: { EncryptionOperation: 'EnableEncryption' - KeyVaultURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/' - KeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' - KeyEncryptionKeyURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5' KekVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' KeyEncryptionAlgorithm: 'RSA-OAEP' - VolumeType: 'All' + KeyEncryptionKeyURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5' + KeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' + KeyVaultURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/' ResizeOSDisk: 'false' + VolumeType: 'All' } } extensionDSCConfig: { enabled: true } - extensionCustomScriptConfig: { + extensionMonitoringAgentConfig: { enabled: true - fileData: [ + } + extensionNetworkWatcherAgentConfig: { + enabled: true + } + lock: 'CanNotDelete' + nicConfigurations: [ + { + ipConfigurations: [ + { + name: 'ipconfig1' + properties: { + subnet: { + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-002' + } + } + } + ] + nicSuffix: '-nic01' + } + ] + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + skuCapacity: 1 + systemAssignedIdentity: true + upgradePolicyMode: 'Manual' + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } + vmNamePrefix: 'vmsswinvm' + vmPriority: 'Regular' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "adminUsername": { + "reference": { + "keyVault": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "secretName": "adminUsername" + } + }, + "imageReference": { + "value": { + "offer": "WindowsServer", + "publisher": "MicrosoftWindowsServer", + "sku": "2016-Datacenter", + "version": "latest" + } + }, + "name": { + "value": "<>-scaleset-win-001" + }, + "osDisk": { + "value": { + "createOption": "fromImage", + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + } + }, + "osType": { + "value": "Windows" + }, + "skuName": { + "value": "Standard_B2s" + }, + // Non-required parameters + "adminPassword": { + "reference": { + "keyVault": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "secretName": "adminPassword" + } + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "encryptionAtHost": { + "value": false + }, + "extensionAntiMalwareConfig": { + "value": { + "enabled": true, + "settings": { + "AntimalwareEnabled": true, + "Exclusions": { + "Extensions": ".log;.ldf", + "Paths": "D:\\IISlogs;D:\\DatabaseLogs", + "Processes": "mssence.svc" + }, + "RealtimeProtectionEnabled": true, + "ScheduledScanSettings": { + "day": "7", + "isEnabled": "true", + "scanType": "Quick", + "time": "120" + } + } + } + }, + "extensionCustomScriptConfig": { + "value": { + "enabled": true, + "fileData": [ + { + "storageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", + "uri": "https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1" + } + ], + "protectedSettings": { + "commandToExecute": "powershell -ExecutionPolicy Unrestricted -Command \"& .\\scriptExtensionMasterInstaller.ps1\"" + } + } + }, + "extensionDependencyAgentConfig": { + "value": { + "enabled": true + } + }, + "extensionDiskEncryptionConfig": { + "value": { + "enabled": true, + "settings": { + "EncryptionOperation": "EnableEncryption", + "KekVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", + "KeyEncryptionAlgorithm": "RSA-OAEP", + "KeyEncryptionKeyURL": "https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5", + "KeyVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", + "KeyVaultURL": "https://adp-<>-az-kv-x-001.vault.azure.net/", + "ResizeOSDisk": "false", + "VolumeType": "All" + } + } + }, + "extensionDSCConfig": { + "value": { + "enabled": true + } + }, + "extensionMonitoringAgentConfig": { + "value": { + "enabled": true + } + }, + "extensionNetworkWatcherAgentConfig": { + "value": { + "enabled": true + } + }, + "lock": { + "value": "CanNotDelete" + }, + "nicConfigurations": { + "value": [ { - uri: 'https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1' - storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + "ipConfigurations": [ + { + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-002" + } + } + } + ], + "nicSuffix": "-nic01" } ] - protectedSettings: { - commandToExecute: 'powershell -ExecutionPolicy Unrestricted -Command \'& .\\scriptExtensionMasterInstaller.ps1\'' + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "skuCapacity": { + "value": 1 + }, + "systemAssignedIdentity": { + "value": true + }, + "upgradePolicyMode": { + "value": "Manual" + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} } + }, + "vmNamePrefix": { + "value": "vmsswinvm" + }, + "vmPriority": { + "value": "Regular" } } } diff --git a/modules/Microsoft.Compute/virtualMachines/readme.md b/modules/Microsoft.Compute/virtualMachines/readme.md index 9439d45942..2577539230 100644 --- a/modules/Microsoft.Compute/virtualMachines/readme.md +++ b/modules/Microsoft.Compute/virtualMachines/readme.md @@ -1000,80 +1000,11 @@ For further details on automanage please refer to [Automanage virtual machines]( ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-vm-linux-autmg-01" - }, - "osType": { - "value": "Linux" - }, - "imageReference": { - "value": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18.04-LTS", - "version": "latest" - } - }, - "osDisk": { - "value": { - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" - } - } - }, - "vmSize": { - "value": "Standard_B12ms" - }, - "adminUsername": { - "value": "localAdminUser" - }, - "disablePasswordAuthentication": { - "value": true - }, - "publicKeys": { - "value": [ - { - "path": "/home/localAdminUser/.ssh/authorized_keys", - "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure" - } - ] - }, - "nicConfigurations": { - "value": [ - { - "nicSuffix": "-nic-01", - "ipConfigurations": [ - { - "name": "ipconfig01", - "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001", - "pipConfiguration": { - "publicIpNameSuffix": "-pip-01" - } - } - ] - } - ] - }, - "configurationProfile": { - "value": "/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction" - } - } -} -``` - -
+

Example 1: Linux Autmg

@@ -1083,44 +1014,46 @@ For further details on automanage please refer to [Automanage virtual machines]( module virtualMachines './Microsoft.Compute/virtualMachines/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualMachines' params: { - name: '<>-vm-linux-autmg-01' - osType: 'Linux' + // Required parameters + adminUsername: 'localAdminUser' imageReference: { - publisher: 'Canonical' offer: 'UbuntuServer' + publisher: 'Canonical' sku: '18.04-LTS' version: 'latest' } - osDisk: { - diskSizeGB: '128' - managedDisk: { - storageAccountType: 'Premium_LRS' - } - } - vmSize: 'Standard_B12ms' - adminUsername: 'localAdminUser' - disablePasswordAuthentication: true - publicKeys: [ - { - path: '/home/localAdminUser/.ssh/authorized_keys' - keyData: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure' - } - ] nicConfigurations: [ { - nicSuffix: '-nic-01' ipConfigurations: [ { name: 'ipconfig01' - subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' pipConfiguration: { publicIpNameSuffix: '-pip-01' } + subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' } ] + nicSuffix: '-nic-01' } ] + osDisk: { + diskSizeGB: '128' + managedDisk: { + storageAccountType: 'Premium_LRS' + } + } + osType: 'Linux' + vmSize: 'Standard_B12ms' + // Non-required parameters configurationProfile: '/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction' + disablePasswordAuthentication: true + name: '<>-vm-linux-autmg-01' + publicKeys: [ + { + keyData: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure' + path: '/home/localAdminUser/.ssh/authorized_keys' + } + ] } } ``` @@ -1128,77 +1061,83 @@ module virtualMachines './Microsoft.Compute/virtualMachines/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-vm-linux-min-01" - }, - "osType": { - "value": "Linux" - }, - "imageReference": { - "value": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18.04-LTS", - "version": "latest" - } - }, - "osDisk": { - "value": { - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "adminUsername": { + "value": "localAdminUser" + }, + "imageReference": { + "value": { + "offer": "UbuntuServer", + "publisher": "Canonical", + "sku": "18.04-LTS", + "version": "latest" + } + }, + "nicConfigurations": { + "value": [ + { + "ipConfigurations": [ + { + "name": "ipconfig01", + "pipConfiguration": { + "publicIpNameSuffix": "-pip-01" + }, + "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" } - }, - "vmSize": { - "value": "Standard_B12ms" - }, - "adminUsername": { - "value": "localAdminUser" - }, - "disablePasswordAuthentication": { - "value": true - }, - "publicKeys": { - "value": [ - { - "path": "/home/localAdminUser/.ssh/authorized_keys", - "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure" - } - ] - }, - "nicConfigurations": { - "value": [ - { - "nicSuffix": "-nic-01", - "ipConfigurations": [ - { - "name": "ipconfig01", - "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001", - "pipConfiguration": { - "publicIpNameSuffix": "-pip-01" - } - } - ] - } - ] + ], + "nicSuffix": "-nic-01" + } + ] + }, + "osDisk": { + "value": { + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + } + }, + "osType": { + "value": "Linux" + }, + "vmSize": { + "value": "Standard_B12ms" + }, + // Non-required parameters + "configurationProfile": { + "value": "/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction" + }, + "disablePasswordAuthentication": { + "value": true + }, + "name": { + "value": "<>-vm-linux-autmg-01" + }, + "publicKeys": { + "value": [ + { + "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure", + "path": "/home/localAdminUser/.ssh/authorized_keys" } + ] } + } } ```
+

+ +

Example 2: Linux Min

@@ -1208,41 +1147,43 @@ module virtualMachines './Microsoft.Compute/virtualMachines/deploy.bicep' = { module virtualMachines './Microsoft.Compute/virtualMachines/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualMachines' params: { - name: '<>-vm-linux-min-01' - osType: 'Linux' + // Required parameters + adminUsername: 'localAdminUser' imageReference: { - publisher: 'Canonical' offer: 'UbuntuServer' + publisher: 'Canonical' sku: '18.04-LTS' version: 'latest' } + nicConfigurations: [ + { + ipConfigurations: [ + { + name: 'ipconfig01' + pipConfiguration: { + publicIpNameSuffix: '-pip-01' + } + subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' + } + ] + nicSuffix: '-nic-01' + } + ] osDisk: { diskSizeGB: '128' managedDisk: { storageAccountType: 'Premium_LRS' } } + osType: 'Linux' vmSize: 'Standard_B12ms' - adminUsername: 'localAdminUser' + // Non-required parameters disablePasswordAuthentication: true + name: '<>-vm-linux-min-01' publicKeys: [ { - path: '/home/localAdminUser/.ssh/authorized_keys' keyData: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure' - } - ] - nicConfigurations: [ - { - nicSuffix: '-nic-01' - ipConfigurations: [ - { - name: 'ipconfig01' - subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' - pipConfiguration: { - publicIpNameSuffix: '-pip-01' - } - } - ] + path: '/home/localAdminUser/.ssh/authorized_keys' } ] } @@ -1252,234 +1193,80 @@ module virtualMachines './Microsoft.Compute/virtualMachines/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-vm-linux-01" - }, - "lock": { - "value": "CanNotDelete" - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "osType": { - "value": "Linux" - }, - "encryptionAtHost": { - "value": false - }, - "availabilityZone": { - "value": 1 - }, - "vmSize": { - "value": "Standard_B12ms" - }, - "imageReference": { - "value": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18.04-LTS", - "version": "latest" - } - }, - "osDisk": { - "value": { - "createOption": "fromImage", - "deleteOption": "Delete", - "caching": "ReadOnly", - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" - } - } - }, - "dataDisks": { - "value": [ - { - "createOption": "Empty", - "deleteOption": "Delete", - "caching": "ReadWrite", - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" - } - }, - { - "createOption": "Empty", - "deleteOption": "Delete", - "caching": "ReadWrite", - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" - } - } - ] - }, - "adminUsername": { - "value": "localAdminUser" - }, - "disablePasswordAuthentication": { - "value": true - }, - "publicKeys": { - "value": [ - { - "path": "/home/localAdminUser/.ssh/authorized_keys", - "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure" - } - ] - }, - "nicConfigurations": { - "value": [ - { - "nicSuffix": "-nic-01", - "deleteOption": "Delete", - "ipConfigurations": [ - { - "name": "ipconfig01", - "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001", - "pipConfiguration": { - "publicIpNameSuffix": "-pip-01", - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "loadBalancerBackendAddressPools": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/loadBalancers/adp-<>-az-lb-internal-001/backendAddressPools/servers" - } - ], - "applicationSecurityGroups": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001" - } - ] - } - ], - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - ] - }, - "backupVaultName": { - "value": "adp-<>-az-rsv-x-001" - }, - "backupVaultResourceGroup": { - "value": "validation-rg" - }, - "backupPolicyName": { - "value": "VMpolicy" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "extensionMonitoringAgentConfig": { - "value": { - "enabled": true - } - }, - "monitoringWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "extensionDependencyAgentConfig": { - "value": { - "enabled": true - } - }, - "extensionNetworkWatcherAgentConfig": { - "value": { - "enabled": true - } - }, - "extensionDiskEncryptionConfig": { - "value": { - "enabled": true, - "settings": { - "EncryptionOperation": "EnableEncryption", - "KeyVaultURL": "https://adp-<>-az-kv-x-001.vault.azure.net/", - "KeyVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", - "KeyEncryptionKeyURL": "https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5", // ID must be updated for new keys - "KekVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", - "KeyEncryptionAlgorithm": "RSA-OAEP", - "VolumeType": "All", - "ResizeOSDisk": "false" - } - } - }, - "extensionDSCConfig": { - "value": { - "enabled": false - } - }, - "extensionCustomScriptConfig": { - "value": { - "enabled": true, - "fileData": [ - { - "uri": "https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1", - "storageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - } - ] - } - }, - "extensionCustomScriptProtectedSetting": { - "value": { - "commandToExecute": "sudo apt-get update" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "adminUsername": { + "value": "localAdminUser" + }, + "imageReference": { + "value": { + "offer": "UbuntuServer", + "publisher": "Canonical", + "sku": "18.04-LTS", + "version": "latest" + } + }, + "nicConfigurations": { + "value": [ + { + "ipConfigurations": [ + { + "name": "ipconfig01", + "pipConfiguration": { + "publicIpNameSuffix": "-pip-01" + }, + "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" } + ], + "nicSuffix": "-nic-01" + } + ] + }, + "osDisk": { + "value": { + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + } + }, + "osType": { + "value": "Linux" + }, + "vmSize": { + "value": "Standard_B12ms" + }, + // Non-required parameters + "disablePasswordAuthentication": { + "value": true + }, + "name": { + "value": "<>-vm-linux-min-01" + }, + "publicKeys": { + "value": [ + { + "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure", + "path": "/home/localAdminUser/.ssh/authorized_keys" } + ] } + } } ```
+

+ +

Example 3: Linux

@@ -1489,153 +1276,155 @@ module virtualMachines './Microsoft.Compute/virtualMachines/deploy.bicep' = { module virtualMachines './Microsoft.Compute/virtualMachines/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualMachines' params: { - name: '<>-vm-linux-01' - lock: 'CanNotDelete' - systemAssignedIdentity: true - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } - osType: 'Linux' - encryptionAtHost: false - availabilityZone: 1 - vmSize: 'Standard_B12ms' + // Required parameters + adminUsername: 'localAdminUser' imageReference: { - publisher: 'Canonical' offer: 'UbuntuServer' + publisher: 'Canonical' sku: '18.04-LTS' version: 'latest' } - osDisk: { - createOption: 'fromImage' - deleteOption: 'Delete' - caching: 'ReadOnly' - diskSizeGB: '128' - managedDisk: { - storageAccountType: 'Premium_LRS' - } - } - dataDisks: [ + nicConfigurations: [ { - createOption: 'Empty' - deleteOption: 'Delete' - caching: 'ReadWrite' - diskSizeGB: '128' - managedDisk: { - storageAccountType: 'Premium_LRS' - } - } - { - createOption: 'Empty' - deleteOption: 'Delete' - caching: 'ReadWrite' - diskSizeGB: '128' - managedDisk: { - storageAccountType: 'Premium_LRS' - } - } - ] - adminUsername: 'localAdminUser' - disablePasswordAuthentication: true - publicKeys: [ - { - path: '/home/localAdminUser/.ssh/authorized_keys' - keyData: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure' - } - ] - nicConfigurations: [ - { - nicSuffix: '-nic-01' deleteOption: 'Delete' ipConfigurations: [ { + applicationSecurityGroups: [ + { + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001' + } + ] + loadBalancerBackendAddressPools: [ + { + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/loadBalancers/adp-<>-az-lb-internal-001/backendAddressPools/servers' + } + ] name: 'ipconfig01' - subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' pipConfiguration: { publicIpNameSuffix: '-pip-01' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } - loadBalancerBackendAddressPools: [ - { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/loadBalancers/adp-<>-az-lb-internal-001/backendAddressPools/servers' - } - ] - applicationSecurityGroups: [ - { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001' - } - ] + subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' } ] + nicSuffix: '-nic-01' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } ] + osDisk: { + caching: 'ReadOnly' + createOption: 'fromImage' + deleteOption: 'Delete' + diskSizeGB: '128' + managedDisk: { + storageAccountType: 'Premium_LRS' + } + } + osType: 'Linux' + vmSize: 'Standard_B12ms' + // Non-required parameters + availabilityZone: 1 + backupPolicyName: 'VMpolicy' backupVaultName: 'adp-<>-az-rsv-x-001' backupVaultResourceGroup: 'validation-rg' - backupPolicyName: 'VMpolicy' - roleAssignments: [ + dataDisks: [ { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] + caching: 'ReadWrite' + createOption: 'Empty' + deleteOption: 'Delete' + diskSizeGB: '128' + managedDisk: { + storageAccountType: 'Premium_LRS' + } + } + { + caching: 'ReadWrite' + createOption: 'Empty' + deleteOption: 'Delete' + diskSizeGB: '128' + managedDisk: { + storageAccountType: 'Premium_LRS' + } } ] + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' diagnosticLogsRetentionInDays: 7 diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' - extensionMonitoringAgentConfig: { + disablePasswordAuthentication: true + encryptionAtHost: false + extensionCustomScriptConfig: { enabled: true + fileData: [ + { + storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + uri: 'https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1' + } + ] } - monitoringWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - extensionDependencyAgentConfig: { - enabled: true + extensionCustomScriptProtectedSetting: { + commandToExecute: 'sudo apt-get update' } - extensionNetworkWatcherAgentConfig: { + extensionDependencyAgentConfig: { enabled: true } extensionDiskEncryptionConfig: { enabled: true settings: { EncryptionOperation: 'EnableEncryption' - KeyVaultURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/' - KeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' - KeyEncryptionKeyURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5' KekVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' KeyEncryptionAlgorithm: 'RSA-OAEP' - VolumeType: 'All' + KeyEncryptionKeyURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5' + KeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' + KeyVaultURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/' ResizeOSDisk: 'false' + VolumeType: 'All' } } extensionDSCConfig: { enabled: false } - extensionCustomScriptConfig: { + extensionMonitoringAgentConfig: { enabled: true - fileData: [ - { - uri: 'https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1' - storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - } - ] } - extensionCustomScriptProtectedSetting: { - commandToExecute: 'sudo apt-get update' + extensionNetworkWatcherAgentConfig: { + enabled: true + } + lock: 'CanNotDelete' + monitoringWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + name: '<>-vm-linux-01' + publicKeys: [ + { + keyData: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure' + path: '/home/localAdminUser/.ssh/authorized_keys' + } + ] + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + systemAssignedIdentity: true + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } } } @@ -1644,74 +1433,237 @@ module virtualMachines './Microsoft.Compute/virtualMachines/deploy.bicep' = {

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-vm-win-03" - }, - "imageReference": { - "value": { - "publisher": "MicrosoftWindowsServer", - "offer": "WindowsServer", - "sku": "2019-Datacenter", - "version": "latest" - } - }, - "osType": { - "value": "Windows" - }, - "vmSize": { - "value": "Standard_B12ms" - }, - "osDisk": { - "value": { - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "adminUsername": { + "value": "localAdminUser" + }, + "imageReference": { + "value": { + "offer": "UbuntuServer", + "publisher": "Canonical", + "sku": "18.04-LTS", + "version": "latest" + } + }, + "nicConfigurations": { + "value": [ + { + "deleteOption": "Delete", + "ipConfigurations": [ + { + "applicationSecurityGroups": [ + { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001" } - } - }, - "adminUsername": { - "value": "localAdminUser" - }, - "adminPassword": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "adminPassword" - } - }, - "nicConfigurations": { - "value": [ + ], + "loadBalancerBackendAddressPools": [ { - "nicSuffix": "-nic-01", - "ipConfigurations": [ - { - "name": "ipconfig01", - "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" - } - ] + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/loadBalancers/adp-<>-az-lb-internal-001/backendAddressPools/servers" } - ] + ], + "name": "ipconfig01", + "pipConfiguration": { + "publicIpNameSuffix": "-pip-01", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" + } + ], + "nicSuffix": "-nic-01", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + ] + }, + "osDisk": { + "value": { + "caching": "ReadOnly", + "createOption": "fromImage", + "deleteOption": "Delete", + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + } + }, + "osType": { + "value": "Linux" + }, + "vmSize": { + "value": "Standard_B12ms" + }, + // Non-required parameters + "availabilityZone": { + "value": 1 + }, + "backupPolicyName": { + "value": "VMpolicy" + }, + "backupVaultName": { + "value": "adp-<>-az-rsv-x-001" + }, + "backupVaultResourceGroup": { + "value": "validation-rg" + }, + "dataDisks": { + "value": [ + { + "caching": "ReadWrite", + "createOption": "Empty", + "deleteOption": "Delete", + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } }, - "configurationProfile": { - "value": "/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction" + { + "caching": "ReadWrite", + "createOption": "Empty", + "deleteOption": "Delete", + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + } + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "disablePasswordAuthentication": { + "value": true + }, + "encryptionAtHost": { + "value": false + }, + "extensionCustomScriptConfig": { + "value": { + "enabled": true, + "fileData": [ + { + "storageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", + "uri": "https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1" + } + ] + } + }, + "extensionCustomScriptProtectedSetting": { + "value": { + "commandToExecute": "sudo apt-get update" + } + }, + "extensionDependencyAgentConfig": { + "value": { + "enabled": true + } + }, + "extensionDiskEncryptionConfig": { + "value": { + "enabled": true, + "settings": { + "EncryptionOperation": "EnableEncryption", + "KekVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", + "KeyEncryptionAlgorithm": "RSA-OAEP", + "KeyEncryptionKeyURL": "https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5", + "KeyVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", + "KeyVaultURL": "https://adp-<>-az-kv-x-001.vault.azure.net/", + "ResizeOSDisk": "false", + "VolumeType": "All" + } + } + }, + "extensionDSCConfig": { + "value": { + "enabled": false + } + }, + "extensionMonitoringAgentConfig": { + "value": { + "enabled": true + } + }, + "extensionNetworkWatcherAgentConfig": { + "value": { + "enabled": true + } + }, + "lock": { + "value": "CanNotDelete" + }, + "monitoringWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "name": { + "value": "<>-vm-linux-01" + }, + "publicKeys": { + "value": [ + { + "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDdOir5eO28EBwxU0Dyra7g9h0HUXDyMNFp2z8PhaTUQgHjrimkMxjYRwEOG/lxnYL7+TqZk+HcPTfbZOunHBw0Wx2CITzILt6531vmIYZGfq5YyYXbxZa5MON7L/PVivoRlPj5Z/t4RhqMhyfR7EPcZ516LJ8lXPTo8dE/bkOCS+kFBEYHvPEEKAyLs19sRcK37SeHjpX04zdg62nqtuRr00Tp7oeiTXA1xn5K5mxeAswotmd8CU0lWUcJuPBWQedo649b+L2cm52kTncOBI6YChAeyEc1PDF0Tn9FmpdOWKtI9efh+S3f8qkcVEtSTXoTeroBd31nzjAunMrZeM8Ut6dre+XeQQIjT7I8oEm+ZkIuIyq0x2fls8JXP2YJDWDqu8v1+yLGTQ3Z9XVt2lMti/7bIgYxS0JvwOr5n5L4IzKvhb4fm13LLDGFa3o7Nsfe3fPb882APE0bLFCmfyIeiPh7go70WqZHakpgIr6LCWTyePez9CsI/rfWDb6eAM8= generated-by-azure", + "path": "/home/localAdminUser/.ssh/authorized_keys" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] + }, + "systemAssignedIdentity": { + "value": true + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } } + } } ```
+

+ +

Example 4: Windows Autmg

@@ -1726,107 +1678,115 @@ resource kv1 'Microsoft.KeyVault/vaults@2019-09-01' existing = { module virtualMachines './Microsoft.Compute/virtualMachines/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualMachines' params: { - name: '<>-vm-win-03' + // Required parameters + adminUsername: 'localAdminUser' imageReference: { - publisher: 'MicrosoftWindowsServer' offer: 'WindowsServer' + publisher: 'MicrosoftWindowsServer' sku: '2019-Datacenter' version: 'latest' } - osType: 'Windows' - vmSize: 'Standard_B12ms' - osDisk: { - diskSizeGB: '128' - managedDisk: { - storageAccountType: 'Premium_LRS' - } - } - adminUsername: 'localAdminUser' - adminPassword: kv1.getSecret('adminPassword') nicConfigurations: [ { - nicSuffix: '-nic-01' ipConfigurations: [ { name: 'ipconfig01' subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' } ] + nicSuffix: '-nic-01' } ] - configurationProfile: '/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction' - } + osDisk: { + diskSizeGB: '128' + managedDisk: { + storageAccountType: 'Premium_LRS' + } + } + osType: 'Windows' + vmSize: 'Standard_B12ms' + // Non-required parameters + adminPassword: kv1.getSecret('adminPassword') + configurationProfile: '/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction' + name: '<>-vm-win-03' + } } ```

-

Example 5

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-vm-win-02" - }, - "imageReference": { - "value": { - "publisher": "MicrosoftWindowsServer", - "offer": "WindowsServer", - "sku": "2022-datacenter-azure-edition", - "version": "latest" - } - }, - "osType": { - "value": "Windows" - }, - "vmSize": { - "value": "Standard_B12ms" - }, - "osDisk": { - "value": { - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" - } - } - }, - "adminUsername": { - "value": "localAdminUser" - }, - "adminPassword": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "adminPassword" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "adminUsername": { + "value": "localAdminUser" + }, + "imageReference": { + "value": { + "offer": "WindowsServer", + "publisher": "MicrosoftWindowsServer", + "sku": "2019-Datacenter", + "version": "latest" + } + }, + "nicConfigurations": { + "value": [ + { + "ipConfigurations": [ + { + "name": "ipconfig01", + "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" } - }, - "nicConfigurations": { - "value": [ - { - "nicSuffix": "-nic-01", - "ipConfigurations": [ - { - "name": "ipconfig01", - "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" - } - ] - } - ] + ], + "nicSuffix": "-nic-01" } + ] + }, + "osDisk": { + "value": { + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + } + }, + "osType": { + "value": "Windows" + }, + "vmSize": { + "value": "Standard_B12ms" + }, + // Non-required parameters + "adminPassword": { + "reference": { + "keyVault": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "secretName": "adminPassword" + } + }, + "configurationProfile": { + "value": "/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction" + }, + "name": { + "value": "<>-vm-win-03" } + } } ```
+

+ +

Example 5: Windows Min

@@ -1841,34 +1801,36 @@ resource kv1 'Microsoft.KeyVault/vaults@2019-09-01' existing = { module virtualMachines './Microsoft.Compute/virtualMachines/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualMachines' params: { - name: '<>-vm-win-02' + // Required parameters + adminUsername: 'localAdminUser' imageReference: { - publisher: 'MicrosoftWindowsServer' offer: 'WindowsServer' + publisher: 'MicrosoftWindowsServer' sku: '2022-datacenter-azure-edition' version: 'latest' } - osType: 'Windows' - vmSize: 'Standard_B12ms' - osDisk: { - diskSizeGB: '128' - managedDisk: { - storageAccountType: 'Premium_LRS' - } - } - adminUsername: 'localAdminUser' - adminPassword: kv1.getSecret('adminPassword') nicConfigurations: [ { - nicSuffix: '-nic-01' ipConfigurations: [ { name: 'ipconfig01' subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' } ] + nicSuffix: '-nic-01' } ] + osDisk: { + diskSizeGB: '128' + managedDisk: { + storageAccountType: 'Premium_LRS' + } + } + osType: 'Windows' + vmSize: 'Standard_B12ms' + // Non-required parameters + adminPassword: kv1.getSecret('adminPassword') + name: '<>-vm-win-02' } } ``` @@ -1876,251 +1838,74 @@ module virtualMachines './Microsoft.Compute/virtualMachines/deploy.bicep' = {

-

Example 6

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-vm-win-01" - }, - "lock": { - "value": "CanNotDelete" - }, - "encryptionAtHost": { - "value": false - }, - "imageReference": { - "value": { - "publisher": "MicrosoftWindowsServer", - "offer": "WindowsServer", - "sku": "2019-Datacenter", - "version": "latest" - } - }, - "osType": { - "value": "Windows" - }, - "vmSize": { - "value": "Standard_B12ms" - }, - "osDisk": { - "value": { - "createOption": "fromImage", - "deleteOption": "Delete", - "caching": "None", - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" - } - } - }, - "dataDisks": { - "value": [ - { - "createOption": "Empty", - "deleteOption": "Delete", - "caching": "None", - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" - } - }, - { - "createOption": "Empty", - "deleteOption": "Delete", - "caching": "None", - "diskSizeGB": "128", - "managedDisk": { - "storageAccountType": "Premium_LRS" - } - } - ] - }, - "availabilityZone": { - "value": 2 - }, - "adminUsername": { - "value": "localAdminUser" - }, - "adminPassword": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "adminPassword" - } - }, - "nicConfigurations": { - "value": [ - { - "nicSuffix": "-nic-01", - "deleteOption": "Delete", - "ipConfigurations": [ - { - "name": "ipconfig01", - "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001", - "pipConfiguration": { - "publicIpNameSuffix": "-pip-01", - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "loadBalancerBackendAddressPools": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/loadBalancers/adp-<>-az-lb-internal-001/backendAddressPools/servers" - } - ], - "applicationSecurityGroups": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001" - } - ] - } - ], - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - ] - }, - "backupVaultName": { - "value": "adp-<>-az-rsv-x-001" - }, - "backupVaultResourceGroup": { - "value": "validation-rg" - }, - "backupPolicyName": { - "value": "VMpolicy" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "extensionAntiMalwareConfig": { - "value": { - "enabled": true, - "settings": { - "AntimalwareEnabled": "true", - "Exclusions": { - "Extensions": ".ext1;.ext2", - "Paths": "c:\\excluded-path-1;c:\\excluded-path-2", - "Processes": "excludedproc1.exe;excludedproc2.exe" - }, - "RealtimeProtectionEnabled": "true", - "ScheduledScanSettings": { - "isEnabled": "true", - "scanType": "Quick", - "day": "7", - "time": "120" - } - } - } - }, - "extensionMonitoringAgentConfig": { - "value": { - "enabled": true - } - }, - "monitoringWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "extensionDependencyAgentConfig": { - "value": { - "enabled": true - } - }, - "extensionNetworkWatcherAgentConfig": { - "value": { - "enabled": true - } - }, - "extensionDiskEncryptionConfig": { - "value": { - "enabled": true, - "settings": { - "EncryptionOperation": "EnableEncryption", - "KeyVaultURL": "https://adp-<>-az-kv-x-001.vault.azure.net/", - "KeyVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", - "KeyEncryptionKeyURL": "https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5", // ID must be updated for new keys - "KekVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", - "KeyEncryptionAlgorithm": "RSA-OAEP", - "VolumeType": "All", - "ResizeOSDisk": "false" - } - } - }, - "extensionDSCConfig": { - "value": { - "enabled": true - } - }, - "extensionCustomScriptConfig": { - "value": { - "enabled": true, - "fileData": [ - { - "uri": "https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1", - "storageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - } - ] - } - }, - "extensionCustomScriptProtectedSetting": { - "value": { - "commandToExecute": "powershell -ExecutionPolicy Unrestricted -Command \"& .\\scriptExtensionMasterInstaller.ps1\"" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "adminUsername": { + "value": "localAdminUser" + }, + "imageReference": { + "value": { + "offer": "WindowsServer", + "publisher": "MicrosoftWindowsServer", + "sku": "2022-datacenter-azure-edition", + "version": "latest" + } + }, + "nicConfigurations": { + "value": [ + { + "ipConfigurations": [ + { + "name": "ipconfig01", + "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" } + ], + "nicSuffix": "-nic-01" + } + ] + }, + "osDisk": { + "value": { + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" } + } + }, + "osType": { + "value": "Windows" + }, + "vmSize": { + "value": "Standard_B12ms" + }, + // Non-required parameters + "adminPassword": { + "reference": { + "keyVault": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "secretName": "adminPassword" + } + }, + "name": { + "value": "<>-vm-win-02" } + } } ```
+

+ +

Example 6: Windows

@@ -2135,110 +1920,98 @@ resource kv1 'Microsoft.KeyVault/vaults@2019-09-01' existing = { module virtualMachines './Microsoft.Compute/virtualMachines/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualMachines' params: { - name: '<>-vm-win-01' - lock: 'CanNotDelete' - encryptionAtHost: false + // Required parameters + adminUsername: 'localAdminUser' imageReference: { - publisher: 'MicrosoftWindowsServer' offer: 'WindowsServer' + publisher: 'MicrosoftWindowsServer' sku: '2019-Datacenter' version: 'latest' } - osType: 'Windows' - vmSize: 'Standard_B12ms' - osDisk: { - createOption: 'fromImage' - deleteOption: 'Delete' - caching: 'None' - diskSizeGB: '128' - managedDisk: { - storageAccountType: 'Premium_LRS' - } - } - dataDisks: [ - { - createOption: 'Empty' - deleteOption: 'Delete' - caching: 'None' - diskSizeGB: '128' - managedDisk: { - storageAccountType: 'Premium_LRS' - } - } - { - createOption: 'Empty' - deleteOption: 'Delete' - caching: 'None' - diskSizeGB: '128' - managedDisk: { - storageAccountType: 'Premium_LRS' - } - } - ] - availabilityZone: 2 - adminUsername: 'localAdminUser' - adminPassword: kv1.getSecret('adminPassword') nicConfigurations: [ { - nicSuffix: '-nic-01' deleteOption: 'Delete' ipConfigurations: [ { + applicationSecurityGroups: [ + { + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001' + } + ] + loadBalancerBackendAddressPools: [ + { + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/loadBalancers/adp-<>-az-lb-internal-001/backendAddressPools/servers' + } + ] name: 'ipconfig01' - subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' pipConfiguration: { publicIpNameSuffix: '-pip-01' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } - loadBalancerBackendAddressPools: [ - { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/loadBalancers/adp-<>-az-lb-internal-001/backendAddressPools/servers' - } - ] - applicationSecurityGroups: [ - { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001' - } - ] + subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' } ] + nicSuffix: '-nic-01' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } ] + osDisk: { + caching: 'None' + createOption: 'fromImage' + deleteOption: 'Delete' + diskSizeGB: '128' + managedDisk: { + storageAccountType: 'Premium_LRS' + } + } + osType: 'Windows' + vmSize: 'Standard_B12ms' + // Non-required parameters + adminPassword: kv1.getSecret('adminPassword') + availabilityZone: 2 + backupPolicyName: 'VMpolicy' backupVaultName: 'adp-<>-az-rsv-x-001' backupVaultResourceGroup: 'validation-rg' - backupPolicyName: 'VMpolicy' - roleAssignments: [ + dataDisks: [ { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] + caching: 'None' + createOption: 'Empty' + deleteOption: 'Delete' + diskSizeGB: '128' + managedDisk: { + storageAccountType: 'Premium_LRS' + } + } + { + caching: 'None' + createOption: 'Empty' + deleteOption: 'Delete' + diskSizeGB: '128' + managedDisk: { + storageAccountType: 'Premium_LRS' + } } ] + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' diagnosticLogsRetentionInDays: 7 diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' - systemAssignedIdentity: true - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } + encryptionAtHost: false extensionAntiMalwareConfig: { enabled: true settings: { @@ -2250,50 +2023,311 @@ module virtualMachines './Microsoft.Compute/virtualMachines/deploy.bicep' = { } RealtimeProtectionEnabled: 'true' ScheduledScanSettings: { + day: '7' isEnabled: 'true' scanType: 'Quick' - day: '7' time: '120' } } } - extensionMonitoringAgentConfig: { + extensionCustomScriptConfig: { enabled: true + fileData: [ + { + storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + uri: 'https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1' + } + ] } - monitoringWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - extensionDependencyAgentConfig: { - enabled: true + extensionCustomScriptProtectedSetting: { + commandToExecute: 'powershell -ExecutionPolicy Unrestricted -Command \'& .\\scriptExtensionMasterInstaller.ps1\'' } - extensionNetworkWatcherAgentConfig: { + extensionDependencyAgentConfig: { enabled: true } extensionDiskEncryptionConfig: { enabled: true settings: { EncryptionOperation: 'EnableEncryption' - KeyVaultURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/' - KeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' - KeyEncryptionKeyURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5' KekVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' KeyEncryptionAlgorithm: 'RSA-OAEP' - VolumeType: 'All' + KeyEncryptionKeyURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5' + KeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' + KeyVaultURL: 'https://adp-<>-az-kv-x-001.vault.azure.net/' ResizeOSDisk: 'false' + VolumeType: 'All' } } extensionDSCConfig: { enabled: true } - extensionCustomScriptConfig: { + extensionMonitoringAgentConfig: { enabled: true - fileData: [ + } + extensionNetworkWatcherAgentConfig: { + enabled: true + } + lock: 'CanNotDelete' + monitoringWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + name: '<>-vm-win-01' + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + systemAssignedIdentity: true + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "adminUsername": { + "value": "localAdminUser" + }, + "imageReference": { + "value": { + "offer": "WindowsServer", + "publisher": "MicrosoftWindowsServer", + "sku": "2019-Datacenter", + "version": "latest" + } + }, + "nicConfigurations": { + "value": [ { - uri: 'https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1' - storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + "deleteOption": "Delete", + "ipConfigurations": [ + { + "applicationSecurityGroups": [ + { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001" + } + ], + "loadBalancerBackendAddressPools": [ + { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/loadBalancers/adp-<>-az-lb-internal-001/backendAddressPools/servers" + } + ], + "name": "ipconfig01", + "pipConfiguration": { + "publicIpNameSuffix": "-pip-01", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" + } + ], + "nicSuffix": "-nic-01", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] } ] - } - extensionCustomScriptProtectedSetting: { - commandToExecute: 'powershell -ExecutionPolicy Unrestricted -Command \'& .\\scriptExtensionMasterInstaller.ps1\'' + }, + "osDisk": { + "value": { + "caching": "None", + "createOption": "fromImage", + "deleteOption": "Delete", + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + } + }, + "osType": { + "value": "Windows" + }, + "vmSize": { + "value": "Standard_B12ms" + }, + // Non-required parameters + "adminPassword": { + "reference": { + "keyVault": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "secretName": "adminPassword" + } + }, + "availabilityZone": { + "value": 2 + }, + "backupPolicyName": { + "value": "VMpolicy" + }, + "backupVaultName": { + "value": "adp-<>-az-rsv-x-001" + }, + "backupVaultResourceGroup": { + "value": "validation-rg" + }, + "dataDisks": { + "value": [ + { + "caching": "None", + "createOption": "Empty", + "deleteOption": "Delete", + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + }, + { + "caching": "None", + "createOption": "Empty", + "deleteOption": "Delete", + "diskSizeGB": "128", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + } + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "encryptionAtHost": { + "value": false + }, + "extensionAntiMalwareConfig": { + "value": { + "enabled": true, + "settings": { + "AntimalwareEnabled": "true", + "Exclusions": { + "Extensions": ".ext1;.ext2", + "Paths": "c:\\excluded-path-1;c:\\excluded-path-2", + "Processes": "excludedproc1.exe;excludedproc2.exe" + }, + "RealtimeProtectionEnabled": "true", + "ScheduledScanSettings": { + "day": "7", + "isEnabled": "true", + "scanType": "Quick", + "time": "120" + } + } + } + }, + "extensionCustomScriptConfig": { + "value": { + "enabled": true, + "fileData": [ + { + "storageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", + "uri": "https://adp<>azsax001.blob.core.windows.net/scripts/scriptExtensionMasterInstaller.ps1" + } + ] + } + }, + "extensionCustomScriptProtectedSetting": { + "value": { + "commandToExecute": "powershell -ExecutionPolicy Unrestricted -Command \"& .\\scriptExtensionMasterInstaller.ps1\"" + } + }, + "extensionDependencyAgentConfig": { + "value": { + "enabled": true + } + }, + "extensionDiskEncryptionConfig": { + "value": { + "enabled": true, + "settings": { + "EncryptionOperation": "EnableEncryption", + "KekVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", + "KeyEncryptionAlgorithm": "RSA-OAEP", + "KeyEncryptionKeyURL": "https://adp-<>-az-kv-x-001.vault.azure.net/keys/keyEncryptionKey/bc3bb46d95c64367975d722f473eeae5", + "KeyVaultResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", + "KeyVaultURL": "https://adp-<>-az-kv-x-001.vault.azure.net/", + "ResizeOSDisk": "false", + "VolumeType": "All" + } + } + }, + "extensionDSCConfig": { + "value": { + "enabled": true + } + }, + "extensionMonitoringAgentConfig": { + "value": { + "enabled": true + } + }, + "extensionNetworkWatcherAgentConfig": { + "value": { + "enabled": true + } + }, + "lock": { + "value": "CanNotDelete" + }, + "monitoringWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "name": { + "value": "<>-vm-win-01" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "systemAssignedIdentity": { + "value": true + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } } } } diff --git a/modules/Microsoft.Consumption/budgets/readme.md b/modules/Microsoft.Consumption/budgets/readme.md index 006419b774..5b38bd9e32 100644 --- a/modules/Microsoft.Consumption/budgets/readme.md +++ b/modules/Microsoft.Consumption/budgets/readme.md @@ -48,39 +48,11 @@ This module deploys budgets for subscriptions. ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "amount": { - "value": 500 - }, - "thresholds": { - "value": [ - 50, - 75, - 90, - 100, - 110 - ] - }, - "contactEmails": { - "value": [ - "dummy@contoso.com" - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -90,7 +62,12 @@ This module deploys budgets for subscriptions. module budgets './Microsoft.Consumption/budgets/deploy.bicep' = { name: '${uniqueString(deployment().name)}-budgets' params: { + // Required parameters amount: 500 + // Non-required parameters + contactEmails: [ + 'dummy@contoso.com' + ] thresholds: [ 50 75 @@ -98,9 +75,41 @@ module budgets './Microsoft.Consumption/budgets/deploy.bicep' = { 100 110 ] - contactEmails: [ - 'dummy@contoso.com' - ] + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "amount": { + "value": 500 + }, + // Non-required parameters + "contactEmails": { + "value": [ + "dummy@contoso.com" + ] + }, + "thresholds": { + "value": [ + 50, + 75, + 90, + 100, + 110 + ] + } } } ``` diff --git a/modules/Microsoft.ContainerInstance/containerGroups/readme.md b/modules/Microsoft.ContainerInstance/containerGroups/readme.md index aa5719fbd0..68eca6e97f 100644 --- a/modules/Microsoft.ContainerInstance/containerGroups/readme.md +++ b/modules/Microsoft.ContainerInstance/containerGroups/readme.md @@ -170,54 +170,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-acg-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "containerName": { - "value": "<>-az-aci-x-001" - }, - "image": { - "value": "mcr.microsoft.com/azuredocs/aci-helloworld" - }, - "ports": { - "value": [ - { - "protocol": "Tcp", - "port": "80" - }, - { - "protocol": "Tcp", - "port": "443" - } - ] - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - } - } -} -``` - -
+

Example 1: Parameters

@@ -227,18 +184,20 @@ userAssignedIdentities: { module containerGroups './Microsoft.ContainerInstance/containerGroups/deploy.bicep' = { name: '${uniqueString(deployment().name)}-containerGroups' params: { - name: '<>-az-acg-x-001' - lock: 'CanNotDelete' + // Required parameters containerName: '<>-az-aci-x-001' image: 'mcr.microsoft.com/azuredocs/aci-helloworld' + name: '<>-az-acg-x-001' + // Non-required parameters + lock: 'CanNotDelete' ports: [ { - protocol: 'Tcp' port: '80' + protocol: 'Tcp' } { - protocol: 'Tcp' port: '443' + protocol: 'Tcp' } ] systemAssignedIdentity: true @@ -251,3 +210,53 @@ module containerGroups './Microsoft.ContainerInstance/containerGroups/deploy.bic

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "containerName": { + "value": "<>-az-aci-x-001" + }, + "image": { + "value": "mcr.microsoft.com/azuredocs/aci-helloworld" + }, + "name": { + "value": "<>-az-acg-x-001" + }, + // Non-required parameters + "lock": { + "value": "CanNotDelete" + }, + "ports": { + "value": [ + { + "port": "80", + "protocol": "Tcp" + }, + { + "port": "443", + "protocol": "Tcp" + } + ] + }, + "systemAssignedIdentity": { + "value": true + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + } + } +} +``` + +
+

diff --git a/modules/Microsoft.ContainerRegistry/registries/readme.md b/modules/Microsoft.ContainerRegistry/registries/readme.md index 4c0037875c..93caccb677 100644 --- a/modules/Microsoft.ContainerRegistry/registries/readme.md +++ b/modules/Microsoft.ContainerRegistry/registries/readme.md @@ -331,45 +331,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>azacrencr001" - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "publicNetworkAccess": { - "value": "Disabled" - }, - "acrSku": { - "value": "Premium" - }, - "cMKUserAssignedIdentityResourceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" - }, - "cMKKeyVaultResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" - }, - "cMKKeyName": { - "value": "keyEncryptionKey" - } - } -} -``` - -
+

Example 1: Encr

@@ -379,15 +345,17 @@ userAssignedIdentities: { module registries './Microsoft.ContainerRegistry/registries/deploy.bicep' = { name: '${uniqueString(deployment().name)}-registries' params: { + // Required parameters name: '<>azacrencr001' + // Non-required parameters + acrSku: 'Premium' + cMKKeyName: 'keyEncryptionKey' + cMKKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002' + cMKUserAssignedIdentityResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' + publicNetworkAccess: 'Disabled' userAssignedIdentities: { '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } - publicNetworkAccess: 'Disabled' - acrSku: 'Premium' - cMKUserAssignedIdentityResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' - cMKKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002' - cMKKeyName: 'keyEncryptionKey' } } ``` @@ -395,25 +363,48 @@ module registries './Microsoft.ContainerRegistry/registries/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>azacrmin001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>azacrencr001" + }, + // Non-required parameters + "acrSku": { + "value": "Premium" + }, + "cMKKeyName": { + "value": "keyEncryptionKey" + }, + "cMKKeyVaultResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" + }, + "cMKUserAssignedIdentityResourceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" + }, + "publicNetworkAccess": { + "value": "Disabled" + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } } + } } ```
+

+ +

Example 2: Min

@@ -431,103 +422,26 @@ module registries './Microsoft.ContainerRegistry/registries/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>azacrx001" - }, - "lock": { - "value": "CanNotDelete" - }, - "acrAdminUserEnabled": { - "value": false - }, - "acrSku": { - "value": "Premium" - }, - "exportPolicyStatus": { - "value": "enabled" - }, - "quarantinePolicyStatus": { - "value": "enabled" - }, - "trustPolicyStatus": { - "value": "enabled" - }, - "replications": { - "value": [ - { - "name": "northeurope", - "location": "northeurope" - } - ] - }, - "webhooks": { - "value": [ - { - "name": "<>azacrx001webhook", - "serviceUri": "https://www.contoso.com/webhook" - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "publicNetworkAccess": { - "value": "Disabled" - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "registry" - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>azacrmin001" } + } } ```
+

+ +

Example 3: Parameters

@@ -537,47 +451,49 @@ module registries './Microsoft.ContainerRegistry/registries/deploy.bicep' = { module registries './Microsoft.ContainerRegistry/registries/deploy.bicep' = { name: '${uniqueString(deployment().name)}-registries' params: { + // Required parameters name: '<>azacrx001' - lock: 'CanNotDelete' + // Non-required parameters acrAdminUserEnabled: false acrSku: 'Premium' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' exportPolicyStatus: 'enabled' - quarantinePolicyStatus: 'enabled' - trustPolicyStatus: 'enabled' - replications: [ + lock: 'CanNotDelete' + privateEndpoints: [ { - name: 'northeurope' - location: 'northeurope' + service: 'registry' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' } ] - webhooks: [ + publicNetworkAccess: 'Disabled' + quarantinePolicyStatus: 'enabled' + replications: [ { - name: '<>azacrx001webhook' - serviceUri: 'https://www.contoso.com/webhook' + location: 'northeurope' + name: 'northeurope' } ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' systemAssignedIdentity: true + trustPolicyStatus: 'enabled' userAssignedIdentities: { '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } - publicNetworkAccess: 'Disabled' - privateEndpoints: [ + webhooks: [ { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'registry' + name: '<>azacrx001webhook' + serviceUri: 'https://www.contoso.com/webhook' } ] } @@ -586,3 +502,102 @@ module registries './Microsoft.ContainerRegistry/registries/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>azacrx001" + }, + // Non-required parameters + "acrAdminUserEnabled": { + "value": false + }, + "acrSku": { + "value": "Premium" + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "exportPolicyStatus": { + "value": "enabled" + }, + "lock": { + "value": "CanNotDelete" + }, + "privateEndpoints": { + "value": [ + { + "service": "registry", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "publicNetworkAccess": { + "value": "Disabled" + }, + "quarantinePolicyStatus": { + "value": "enabled" + }, + "replications": { + "value": [ + { + "location": "northeurope", + "name": "northeurope" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "systemAssignedIdentity": { + "value": true + }, + "trustPolicyStatus": { + "value": "enabled" + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + }, + "webhooks": { + "value": [ + { + "name": "<>azacrx001webhook", + "serviceUri": "https://www.contoso.com/webhook" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.ContainerService/managedClusters/readme.md b/modules/Microsoft.ContainerService/managedClusters/readme.md index 8b924369b1..4ae098bb0d 100644 --- a/modules/Microsoft.ContainerService/managedClusters/readme.md +++ b/modules/Microsoft.ContainerService/managedClusters/readme.md @@ -359,139 +359,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-aks-azure-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "diskEncryptionSetID": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/diskEncryptionSets/adp-<>-az-des-x-001" - }, - "primaryAgentPoolProfile": { - "value": [ - { - "name": "systempool", - "osDiskSizeGB": 0, - "count": 1, - "enableAutoScaling": true, - "minCount": 1, - "maxCount": 3, - "vmSize": "Standard_DS2_v2", - "osType": "Linux", - "storageProfile": "ManagedDisks", - "type": "VirtualMachineScaleSets", - "mode": "System", - "vnetSubnetID": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Primary", - "serviceCidr": "", - "maxPods": 30, - "availabilityZones": [ - "1" - ] - } - ] - }, - "aksClusterNetworkPlugin": { - "value": "azure" - }, - "agentPools": { - "value": [ - { - "name": "userpool1", - "vmSize": "Standard_DS2_v2", - "osDiskSizeGB": 128, - "count": 2, - "osType": "Linux", - "maxCount": 3, - "minCount": 1, - "enableAutoScaling": true, - "scaleSetPriority": "Regular", - "scaleSetEvictionPolicy": "Delete", - "nodeLabels": {}, - "nodeTaints": [ - "CriticalAddonsOnly=true:NoSchedule" - ], - "type": "VirtualMachineScaleSets", - "availabilityZones": [ - "1" - ], - "minPods": 2, - "maxPods": 30, - "storageProfile": "ManagedDisks", - "mode": "User", - "vnetSubnetID": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Secondary" - }, - { - "name": "userpool2", - "vmSize": "Standard_DS2_v2", - "osDiskSizeGB": 128, - "count": 2, - "osType": "Linux", - "maxCount": 3, - "minCount": 1, - "enableAutoScaling": true, - "scaleSetPriority": "Regular", - "scaleSetEvictionPolicy": "Delete", - "nodeLabels": {}, - "nodeTaints": [ - "CriticalAddonsOnly=true:NoSchedule" - ], - "type": "VirtualMachineScaleSets", - "availabilityZones": [ - "1" - ], - "minPods": 2, - "maxPods": 30, - "storageProfile": "ManagedDisks", - "mode": "User", - "vnetSubnetID": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Tertiary" - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "systemAssignedIdentity": { - "value": true - } - } -} -``` - -
+

Example 1: Azure

@@ -501,96 +373,98 @@ userAssignedIdentities: { module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bicep' = { name: '${uniqueString(deployment().name)}-managedClusters' params: { + // Required parameters name: '<>-az-aks-azure-001' - lock: 'CanNotDelete' - diskEncryptionSetID: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/diskEncryptionSets/adp-<>-az-des-x-001' primaryAgentPoolProfile: [ { - name: 'systempool' - osDiskSizeGB: 0 + availabilityZones: [ + '1' + ] count: 1 enableAutoScaling: true - minCount: 1 maxCount: 3 - vmSize: 'Standard_DS2_v2' + maxPods: 30 + minCount: 1 + mode: 'System' + name: 'systempool' + osDiskSizeGB: 0 osType: 'Linux' + serviceCidr: '' storageProfile: 'ManagedDisks' type: 'VirtualMachineScaleSets' - mode: 'System' + vmSize: 'Standard_DS2_v2' vnetSubnetID: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Primary' - serviceCidr: '' - maxPods: 30 - availabilityZones: [ - '1' - ] } ] - aksClusterNetworkPlugin: 'azure' + // Non-required parameters agentPools: [ { - name: 'userpool1' - vmSize: 'Standard_DS2_v2' - osDiskSizeGB: 128 + availabilityZones: [ + '1' + ] count: 2 - osType: 'Linux' + enableAutoScaling: true maxCount: 3 + maxPods: 30 minCount: 1 - enableAutoScaling: true - scaleSetPriority: 'Regular' - scaleSetEvictionPolicy: 'Delete' + minPods: 2 + mode: 'User' + name: 'userpool1' nodeLabels: {} nodeTaints: [ 'CriticalAddonsOnly=true:NoSchedule' ] - type: 'VirtualMachineScaleSets' - availabilityZones: [ - '1' - ] - minPods: 2 - maxPods: 30 + osDiskSizeGB: 128 + osType: 'Linux' + scaleSetEvictionPolicy: 'Delete' + scaleSetPriority: 'Regular' storageProfile: 'ManagedDisks' - mode: 'User' + type: 'VirtualMachineScaleSets' + vmSize: 'Standard_DS2_v2' vnetSubnetID: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Secondary' } { - name: 'userpool2' - vmSize: 'Standard_DS2_v2' - osDiskSizeGB: 128 + availabilityZones: [ + '1' + ] count: 2 - osType: 'Linux' + enableAutoScaling: true maxCount: 3 + maxPods: 30 minCount: 1 - enableAutoScaling: true - scaleSetPriority: 'Regular' - scaleSetEvictionPolicy: 'Delete' + minPods: 2 + mode: 'User' + name: 'userpool2' nodeLabels: {} nodeTaints: [ 'CriticalAddonsOnly=true:NoSchedule' ] - type: 'VirtualMachineScaleSets' - availabilityZones: [ - '1' - ] - minPods: 2 - maxPods: 30 + osDiskSizeGB: 128 + osType: 'Linux' + scaleSetEvictionPolicy: 'Delete' + scaleSetPriority: 'Regular' storageProfile: 'ManagedDisks' - mode: 'User' + type: 'VirtualMachineScaleSets' + vmSize: 'Standard_DS2_v2' vnetSubnetID: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Tertiary' } ] + aksClusterNetworkPlugin: 'azure' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + diskEncryptionSetID: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/diskEncryptionSets/adp-<>-az-des-x-001' + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' systemAssignedIdentity: true } } @@ -599,132 +473,142 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-aks-kubenet-001" - }, - "primaryAgentPoolProfile": { - "value": [ - { - "name": "systempool", - "osDiskSizeGB": 0, - "count": 1, - "enableAutoScaling": true, - "minCount": 1, - "maxCount": 3, - "vmSize": "Standard_DS2_v2", - "osType": "Linux", - "storageProfile": "ManagedDisks", - "type": "VirtualMachineScaleSets", - "mode": "System", - "serviceCidr": "", - "maxPods": 30, - "availabilityZones": [ - "1" - ] - } - ] - }, - "aksClusterNetworkPlugin": { - "value": "kubenet" - }, - "agentPools": { - "value": [ - { - "name": "userpool1", - "vmSize": "Standard_DS2_v2", - "osDiskSizeGB": 128, - "count": 2, - "osType": "Linux", - "maxCount": 3, - "minCount": 1, - "enableAutoScaling": true, - "scaleSetPriority": "Regular", - "scaleSetEvictionPolicy": "Delete", - "nodeLabels": {}, - "nodeTaints": [ - "CriticalAddonsOnly=true:NoSchedule" - ], - "type": "VirtualMachineScaleSets", - "availabilityZones": [ - "1" - ], - "minPods": 2, - "maxPods": 30, - "storageProfile": "ManagedDisks", - "mode": "User" - }, - { - "name": "userpool2", - "vmSize": "Standard_DS2_v2", - "osDiskSizeGB": 128, - "count": 2, - "osType": "Linux", - "maxCount": 3, - "minCount": 1, - "enableAutoScaling": true, - "scaleSetPriority": "Regular", - "scaleSetEvictionPolicy": "Delete", - "nodeLabels": {}, - "nodeTaints": [ - "CriticalAddonsOnly=true:NoSchedule" - ], - "type": "VirtualMachineScaleSets", - "availabilityZones": [ - "1" - ], - "minPods": 2, - "maxPods": 30, - "storageProfile": "ManagedDisks", - "mode": "User" - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-aks-azure-001" + }, + "primaryAgentPoolProfile": { + "value": [ + { + "availabilityZones": [ + "1" + ], + "count": 1, + "enableAutoScaling": true, + "maxCount": 3, + "maxPods": 30, + "minCount": 1, + "mode": "System", + "name": "systempool", + "osDiskSizeGB": 0, + "osType": "Linux", + "serviceCidr": "", + "storageProfile": "ManagedDisks", + "type": "VirtualMachineScaleSets", + "vmSize": "Standard_DS2_v2", + "vnetSubnetID": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Primary" + } + ] + }, + // Non-required parameters + "agentPools": { + "value": [ + { + "availabilityZones": [ + "1" + ], + "count": 2, + "enableAutoScaling": true, + "maxCount": 3, + "maxPods": 30, + "minCount": 1, + "minPods": 2, + "mode": "User", + "name": "userpool1", + "nodeLabels": {}, + "nodeTaints": [ + "CriticalAddonsOnly=true:NoSchedule" + ], + "osDiskSizeGB": 128, + "osType": "Linux", + "scaleSetEvictionPolicy": "Delete", + "scaleSetPriority": "Regular", + "storageProfile": "ManagedDisks", + "type": "VirtualMachineScaleSets", + "vmSize": "Standard_DS2_v2", + "vnetSubnetID": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Secondary" }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } + { + "availabilityZones": [ + "1" + ], + "count": 2, + "enableAutoScaling": true, + "maxCount": 3, + "maxPods": 30, + "minCount": 1, + "minPods": 2, + "mode": "User", + "name": "userpool2", + "nodeLabels": {}, + "nodeTaints": [ + "CriticalAddonsOnly=true:NoSchedule" + ], + "osDiskSizeGB": 128, + "osType": "Linux", + "scaleSetEvictionPolicy": "Delete", + "scaleSetPriority": "Regular", + "storageProfile": "ManagedDisks", + "type": "VirtualMachineScaleSets", + "vmSize": "Standard_DS2_v2", + "vnetSubnetID": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Tertiary" + } + ] + }, + "aksClusterNetworkPlugin": { + "value": "azure" + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "diskEncryptionSetID": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/diskEncryptionSets/adp-<>-az-des-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] + }, + "systemAssignedIdentity": { + "value": true } + } } ```
+

+ +

Example 2: Kubenet

@@ -734,91 +618,93 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bicep' = { name: '${uniqueString(deployment().name)}-managedClusters' params: { + // Required parameters name: '<>-az-aks-kubenet-001' primaryAgentPoolProfile: [ { - name: 'systempool' - osDiskSizeGB: 0 + availabilityZones: [ + '1' + ] count: 1 enableAutoScaling: true - minCount: 1 maxCount: 3 - vmSize: 'Standard_DS2_v2' + maxPods: 30 + minCount: 1 + mode: 'System' + name: 'systempool' + osDiskSizeGB: 0 osType: 'Linux' + serviceCidr: '' storageProfile: 'ManagedDisks' type: 'VirtualMachineScaleSets' - mode: 'System' - serviceCidr: '' - maxPods: 30 - availabilityZones: [ - '1' - ] + vmSize: 'Standard_DS2_v2' } ] - aksClusterNetworkPlugin: 'kubenet' + // Non-required parameters agentPools: [ { - name: 'userpool1' - vmSize: 'Standard_DS2_v2' - osDiskSizeGB: 128 + availabilityZones: [ + '1' + ] count: 2 - osType: 'Linux' + enableAutoScaling: true maxCount: 3 + maxPods: 30 minCount: 1 - enableAutoScaling: true - scaleSetPriority: 'Regular' - scaleSetEvictionPolicy: 'Delete' + minPods: 2 + mode: 'User' + name: 'userpool1' nodeLabels: {} nodeTaints: [ 'CriticalAddonsOnly=true:NoSchedule' ] + osDiskSizeGB: 128 + osType: 'Linux' + scaleSetEvictionPolicy: 'Delete' + scaleSetPriority: 'Regular' + storageProfile: 'ManagedDisks' type: 'VirtualMachineScaleSets' + vmSize: 'Standard_DS2_v2' + } + { availabilityZones: [ '1' ] - minPods: 2 - maxPods: 30 - storageProfile: 'ManagedDisks' - mode: 'User' - } - { - name: 'userpool2' - vmSize: 'Standard_DS2_v2' - osDiskSizeGB: 128 count: 2 - osType: 'Linux' + enableAutoScaling: true maxCount: 3 + maxPods: 30 minCount: 1 - enableAutoScaling: true - scaleSetPriority: 'Regular' - scaleSetEvictionPolicy: 'Delete' + minPods: 2 + mode: 'User' + name: 'userpool2' nodeLabels: {} nodeTaints: [ 'CriticalAddonsOnly=true:NoSchedule' ] - type: 'VirtualMachineScaleSets' - availabilityZones: [ - '1' - ] - minPods: 2 - maxPods: 30 + osDiskSizeGB: 128 + osType: 'Linux' + scaleSetEvictionPolicy: 'Delete' + scaleSetPriority: 'Regular' storageProfile: 'ManagedDisks' - mode: 'User' + type: 'VirtualMachineScaleSets' + vmSize: 'Standard_DS2_v2' } ] + aksClusterNetworkPlugin: 'kubenet' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' userAssignedIdentities: { '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } @@ -828,3 +714,131 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-aks-kubenet-001" + }, + "primaryAgentPoolProfile": { + "value": [ + { + "availabilityZones": [ + "1" + ], + "count": 1, + "enableAutoScaling": true, + "maxCount": 3, + "maxPods": 30, + "minCount": 1, + "mode": "System", + "name": "systempool", + "osDiskSizeGB": 0, + "osType": "Linux", + "serviceCidr": "", + "storageProfile": "ManagedDisks", + "type": "VirtualMachineScaleSets", + "vmSize": "Standard_DS2_v2" + } + ] + }, + // Non-required parameters + "agentPools": { + "value": [ + { + "availabilityZones": [ + "1" + ], + "count": 2, + "enableAutoScaling": true, + "maxCount": 3, + "maxPods": 30, + "minCount": 1, + "minPods": 2, + "mode": "User", + "name": "userpool1", + "nodeLabels": {}, + "nodeTaints": [ + "CriticalAddonsOnly=true:NoSchedule" + ], + "osDiskSizeGB": 128, + "osType": "Linux", + "scaleSetEvictionPolicy": "Delete", + "scaleSetPriority": "Regular", + "storageProfile": "ManagedDisks", + "type": "VirtualMachineScaleSets", + "vmSize": "Standard_DS2_v2" + }, + { + "availabilityZones": [ + "1" + ], + "count": 2, + "enableAutoScaling": true, + "maxCount": 3, + "maxPods": 30, + "minCount": 1, + "minPods": 2, + "mode": "User", + "name": "userpool2", + "nodeLabels": {}, + "nodeTaints": [ + "CriticalAddonsOnly=true:NoSchedule" + ], + "osDiskSizeGB": 128, + "osType": "Linux", + "scaleSetEvictionPolicy": "Delete", + "scaleSetPriority": "Regular", + "storageProfile": "ManagedDisks", + "type": "VirtualMachineScaleSets", + "vmSize": "Standard_DS2_v2" + } + ] + }, + "aksClusterNetworkPlugin": { + "value": "kubenet" + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + } + } +} +``` + +
+

diff --git a/modules/Microsoft.DataFactory/factories/readme.md b/modules/Microsoft.DataFactory/factories/readme.md index f66b2ccab7..9e0d58b7ca 100644 --- a/modules/Microsoft.DataFactory/factories/readme.md +++ b/modules/Microsoft.DataFactory/factories/readme.md @@ -282,99 +282,11 @@ privateEndpoints: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-adf-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "managedVirtualNetworkName": { - "value": "default" - }, - "integrationRuntime": { - "value": { - "name": "AutoResolveIntegrationRuntime", - "type": "Managed", - "managedVirtualNetworkName": "default", - "typeProperties": { - "computeProperties": { - "location": "AutoResolve" - } - } - } - }, - "publicNetworkAccess": { - "value": "Disabled" - }, - "gitConfigureLater": { - "value": true - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "dataFactory" - } - ] - }, - "cMKUserAssignedIdentityResourceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" - }, - "cMKKeyName": { - "value": "keyEncryptionKey" - }, - "cMKKeyVaultResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" - } - } -} -``` - -
+

Example 1: Parameters

@@ -384,47 +296,144 @@ privateEndpoints: [ module factories './Microsoft.DataFactory/factories/deploy.bicep' = { name: '${uniqueString(deployment().name)}-factories' params: { + // Required parameters name: '<>-adf-001' - lock: 'CanNotDelete' - managedVirtualNetworkName: 'default' + // Non-required parameters + cMKKeyName: 'keyEncryptionKey' + cMKKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002' + cMKUserAssignedIdentityResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + gitConfigureLater: true integrationRuntime: { + managedVirtualNetworkName: 'default' name: 'AutoResolveIntegrationRuntime' type: 'Managed' - managedVirtualNetworkName: 'default' typeProperties: { computeProperties: { location: 'AutoResolve' } } } + lock: 'CanNotDelete' + managedVirtualNetworkName: 'default' + privateEndpoints: [ + { + service: 'dataFactory' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + ] publicNetworkAccess: 'Disabled' - gitConfigureLater: true roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' systemAssignedIdentity: true userAssignedIdentities: { '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } - privateEndpoints: [ - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'dataFactory' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-adf-001" + }, + // Non-required parameters + "cMKKeyName": { + "value": "keyEncryptionKey" + }, + "cMKKeyVaultResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" + }, + "cMKUserAssignedIdentityResourceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "gitConfigureLater": { + "value": true + }, + "integrationRuntime": { + "value": { + "managedVirtualNetworkName": "default", + "name": "AutoResolveIntegrationRuntime", + "type": "Managed", + "typeProperties": { + "computeProperties": { + "location": "AutoResolve" + } + } } - ] - cMKUserAssignedIdentityResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' - cMKKeyName: 'keyEncryptionKey' - cMKKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002' + }, + "lock": { + "value": "CanNotDelete" + }, + "managedVirtualNetworkName": { + "value": "default" + }, + "privateEndpoints": { + "value": [ + { + "service": "dataFactory", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "publicNetworkAccess": { + "value": "Disabled" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "systemAssignedIdentity": { + "value": true + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + } } } ``` diff --git a/modules/Microsoft.DataProtection/backupVaults/readme.md b/modules/Microsoft.DataProtection/backupVaults/readme.md index edf22bb233..28e1a43376 100644 --- a/modules/Microsoft.DataProtection/backupVaults/readme.md +++ b/modules/Microsoft.DataProtection/backupVaults/readme.md @@ -332,25 +332,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-bv-min-001" - } - } -} -``` - -
+

Example 1: Min

@@ -368,92 +354,26 @@ module backupVaults './Microsoft.DataProtection/backupVaults/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-bv-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "backupPolicies": { - "value": [ - { - "name": "DefaultPolicy", - "properties": { - "policyRules": [ - { - "backupParameters": { - "backupType": "Incremental", - "objectType": "AzureBackupParams" - }, - "trigger": { - "schedule": { - "repeatingTimeIntervals": [ - "R/2022-05-31T23:30:00+01:00/P1D" - ], - "timeZone": "W. Europe Standard Time" - }, - "taggingCriteria": [ - { - "tagInfo": { - "tagName": "Default", - "id": "Default_" - }, - "taggingPriority": 99, - "isDefault": true - } - ], - "objectType": "ScheduleBasedTriggerContext" - }, - "dataStore": { - "dataStoreType": "OperationalStore", - "objectType": "DataStoreInfoBase" - }, - "name": "BackupDaily", - "objectType": "AzureBackupRule" - }, - { - "lifecycles": [ - { - "deleteAfter": { - "objectType": "AbsoluteDeleteOption", - "duration": "P7D" - }, - "targetDataStoreCopySettings": [], - "sourceDataStore": { - "dataStoreType": "OperationalStore", - "objectType": "DataStoreInfoBase" - } - } - ], - "isDefault": true, - "name": "Default", - "objectType": "AzureRetentionRule" - } - ], - "datasourceTypes": [ - "Microsoft.Compute/disks" - ], - "objectType": "BackupPolicy" - } - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>-az-bv-min-001" } + } } ```
+

+ +

Example 2: Parameters

@@ -463,19 +383,31 @@ module backupVaults './Microsoft.DataProtection/backupVaults/deploy.bicep' = { module backupVaults './Microsoft.DataProtection/backupVaults/deploy.bicep' = { name: '${uniqueString(deployment().name)}-backupVaults' params: { + // Required parameters name: '<>-az-bv-x-001' - lock: 'CanNotDelete' + // Non-required parameters backupPolicies: [ { name: 'DefaultPolicy' properties: { + datasourceTypes: [ + 'Microsoft.Compute/disks' + ] + objectType: 'BackupPolicy' policyRules: [ { backupParameters: { backupType: 'Incremental' objectType: 'AzureBackupParams' } + dataStore: { + dataStoreType: 'OperationalStore' + objectType: 'DataStoreInfoBase' + } + name: 'BackupDaily' + objectType: 'AzureBackupRule' trigger: { + objectType: 'ScheduleBasedTriggerContext' schedule: { repeatingTimeIntervals: [ 'R/2022-05-31T23:30:00+01:00/P1D' @@ -484,49 +416,127 @@ module backupVaults './Microsoft.DataProtection/backupVaults/deploy.bicep' = { } taggingCriteria: [ { + isDefault: true + taggingPriority: 99 tagInfo: { - tagName: 'Default' id: 'Default_' + tagName: 'Default' } - taggingPriority: 99 - isDefault: true } ] - objectType: 'ScheduleBasedTriggerContext' } - dataStore: { - dataStoreType: 'OperationalStore' - objectType: 'DataStoreInfoBase' - } - name: 'BackupDaily' - objectType: 'AzureBackupRule' } { + isDefault: true lifecycles: [ { deleteAfter: { - objectType: 'AbsoluteDeleteOption' duration: 'P7D' + objectType: 'AbsoluteDeleteOption' } - targetDataStoreCopySettings: [] sourceDataStore: { dataStoreType: 'OperationalStore' objectType: 'DataStoreInfoBase' } + targetDataStoreCopySettings: [] } ] - isDefault: true name: 'Default' objectType: 'AzureRetentionRule' } ] - datasourceTypes: [ - 'Microsoft.Compute/disks' - ] - objectType: 'BackupPolicy' } } ] + lock: 'CanNotDelete' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-bv-x-001" + }, + // Non-required parameters + "backupPolicies": { + "value": [ + { + "name": "DefaultPolicy", + "properties": { + "datasourceTypes": [ + "Microsoft.Compute/disks" + ], + "objectType": "BackupPolicy", + "policyRules": [ + { + "backupParameters": { + "backupType": "Incremental", + "objectType": "AzureBackupParams" + }, + "dataStore": { + "dataStoreType": "OperationalStore", + "objectType": "DataStoreInfoBase" + }, + "name": "BackupDaily", + "objectType": "AzureBackupRule", + "trigger": { + "objectType": "ScheduleBasedTriggerContext", + "schedule": { + "repeatingTimeIntervals": [ + "R/2022-05-31T23:30:00+01:00/P1D" + ], + "timeZone": "W. Europe Standard Time" + }, + "taggingCriteria": [ + { + "isDefault": true, + "taggingPriority": 99, + "tagInfo": { + "id": "Default_", + "tagName": "Default" + } + } + ] + } + }, + { + "isDefault": true, + "lifecycles": [ + { + "deleteAfter": { + "duration": "P7D", + "objectType": "AbsoluteDeleteOption" + }, + "sourceDataStore": { + "dataStoreType": "OperationalStore", + "objectType": "DataStoreInfoBase" + }, + "targetDataStoreCopySettings": [] + } + ], + "name": "Default", + "objectType": "AzureRetentionRule" + } + ] + } + } + ] + }, + "lock": { + "value": "CanNotDelete" + } } } ``` diff --git a/modules/Microsoft.Databricks/workspaces/readme.md b/modules/Microsoft.Databricks/workspaces/readme.md index 62d8ce9f44..5996e80911 100644 --- a/modules/Microsoft.Databricks/workspaces/readme.md +++ b/modules/Microsoft.Databricks/workspaces/readme.md @@ -219,53 +219,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-adb-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Parameters

@@ -275,21 +233,72 @@ tags: { module workspaces './Microsoft.Databricks/workspaces/deploy.bicep' = { name: '${uniqueString(deployment().name)}-workspaces' params: { + // Required parameters name: '<>-az-adb-x-001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-adb-x-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } } } ``` diff --git a/modules/Microsoft.DesktopVirtualization/applicationgroups/readme.md b/modules/Microsoft.DesktopVirtualization/applicationgroups/readme.md index 9a6d1250f1..28f232f079 100644 --- a/modules/Microsoft.DesktopVirtualization/applicationgroups/readme.md +++ b/modules/Microsoft.DesktopVirtualization/applicationgroups/readme.md @@ -159,31 +159,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-avdag-min-001" - }, - "applicationGroupType": { - "value": "RemoteApp" - }, - "hostpoolName": { - "value": "adp-<>-az-avdhp-x-001" - } - } -} -``` - -
+

Example 1: Min

@@ -193,9 +173,10 @@ tags: { module applicationgroups './Microsoft.DesktopVirtualization/applicationgroups/deploy.bicep' = { name: '${uniqueString(deployment().name)}-applicationgroups' params: { - name: '<>-az-avdag-min-001' + // Required parameters applicationGroupType: 'RemoteApp' hostpoolName: 'adp-<>-az-avdhp-x-001' + name: '<>-az-avdag-min-001' } } ``` @@ -203,88 +184,33 @@ module applicationgroups './Microsoft.DesktopVirtualization/applicationgroups/de

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-avdag-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "location": { - "value": "westeurope" - }, - "applicationGroupType": { - "value": "RemoteApp" - }, - "hostpoolName": { - "value": "adp-<>-az-avdhp-x-001" - }, - "friendlyName": { - "value": "Remote Applications 1" - }, - "description": { - "value": "This is my first Remote Applications bundle" - }, - "applications": { - "value": [ - { - "name": "notepad", - "description": "Notepad by ARM template", - "friendlyName": "Notepad", - "filePath": "C:\\Windows\\System32\\notepad.exe", - "commandLineSetting": "DoNotAllow", - "commandLineArguments": "", - "showInPortal": true, - "iconPath": "C:\\Windows\\System32\\notepad.exe", - "iconIndex": 0 - }, - { - "name": "wordpad", - "filePath": "C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe", - "friendlyName": "Wordpad" - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "applicationGroupType": { + "value": "RemoteApp" + }, + "hostpoolName": { + "value": "adp-<>-az-avdhp-x-001" + }, + "name": { + "value": "<>-az-avdag-min-001" } + } } ```
+

+ +

Example 2: Parameters

@@ -294,44 +220,130 @@ module applicationgroups './Microsoft.DesktopVirtualization/applicationgroups/de module applicationgroups './Microsoft.DesktopVirtualization/applicationgroups/deploy.bicep' = { name: '${uniqueString(deployment().name)}-applicationgroups' params: { - name: '<>-az-avdag-x-001' - lock: 'CanNotDelete' - location: 'westeurope' + // Required parameters applicationGroupType: 'RemoteApp' hostpoolName: 'adp-<>-az-avdhp-x-001' - friendlyName: 'Remote Applications 1' - description: 'This is my first Remote Applications bundle' + name: '<>-az-avdag-x-001' + // Non-required parameters applications: [ { - name: 'notepad' + commandLineArguments: '' + commandLineSetting: 'DoNotAllow' description: 'Notepad by ARM template' - friendlyName: 'Notepad' filePath: 'C:\\Windows\\System32\\notepad.exe' - commandLineSetting: 'DoNotAllow' - commandLineArguments: '' - showInPortal: true - iconPath: 'C:\\Windows\\System32\\notepad.exe' + friendlyName: 'Notepad' iconIndex: 0 + iconPath: 'C:\\Windows\\System32\\notepad.exe' + name: 'notepad' + showInPortal: true } { - name: 'wordpad' filePath: 'C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe' friendlyName: 'Wordpad' + name: 'wordpad' } ] + description: 'This is my first Remote Applications bundle' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + friendlyName: 'Remote Applications 1' + location: 'westeurope' + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "applicationGroupType": { + "value": "RemoteApp" + }, + "hostpoolName": { + "value": "adp-<>-az-avdhp-x-001" + }, + "name": { + "value": "<>-az-avdag-x-001" + }, + // Non-required parameters + "applications": { + "value": [ + { + "commandLineArguments": "", + "commandLineSetting": "DoNotAllow", + "description": "Notepad by ARM template", + "filePath": "C:\\Windows\\System32\\notepad.exe", + "friendlyName": "Notepad", + "iconIndex": 0, + "iconPath": "C:\\Windows\\System32\\notepad.exe", + "name": "notepad", + "showInPortal": true + }, + { + "filePath": "C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe", + "friendlyName": "Wordpad", + "name": "wordpad" + } + ] + }, + "description": { + "value": "This is my first Remote Applications bundle" + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "friendlyName": { + "value": "Remote Applications 1" + }, + "location": { + "value": "westeurope" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } } } ``` diff --git a/modules/Microsoft.DesktopVirtualization/hostpools/readme.md b/modules/Microsoft.DesktopVirtualization/hostpools/readme.md index bf7c03291f..c4ae64beaa 100644 --- a/modules/Microsoft.DesktopVirtualization/hostpools/readme.md +++ b/modules/Microsoft.DesktopVirtualization/hostpools/readme.md @@ -255,96 +255,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-avdhp-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "location": { - "value": "westeurope" - }, - "hostpoolFriendlyName": { - "value": "AVDv2" - }, - "hostpoolDescription": { - "value": "My first AVD Host Pool" - }, - "hostpoolType": { - "value": "Pooled" - }, - "personalDesktopAssignmentType": { - "value": "Automatic" - }, - "maxSessionLimit": { - "value": 99999 - }, - "loadBalancerType": { - "value": "BreadthFirst" - }, - "customRdpProperty": { - "value": "audiocapturemode:i:1;audiomode:i:0;drivestoredirect:s:;redirectclipboard:i:1;redirectcomports:i:1;redirectprinters:i:1;redirectsmartcards:i:1;screen mode id:i:2;" - }, - "vmTemplate": { - "value": { - "domain": "domainname.onmicrosoft.com", - "galleryImageOffer": "office-365", - "galleryImagePublisher": "microsoftwindowsdesktop", - "galleryImageSKU": "20h1-evd-o365pp", - "imageType": "Gallery", - "imageUri": null, - "customImageId": null, - "namePrefix": "avdv2", - "osDiskType": "StandardSSD_LRS", - "useManagedDisks": true, - "vmSize": { - "id": "Standard_D2s_v3", - "cores": 2, - "ram": 8 - } - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Parameters

@@ -354,46 +269,140 @@ tags: { module hostpools './Microsoft.DesktopVirtualization/hostpools/deploy.bicep' = { name: '${uniqueString(deployment().name)}-hostpools' params: { + // Required parameters name: '<>-az-avdhp-x-001' - lock: 'CanNotDelete' - location: 'westeurope' - hostpoolFriendlyName: 'AVDv2' + // Non-required parameters + customRdpProperty: 'audiocapturemode:i:1;audiomode:i:0;drivestoredirect:s:;redirectclipboard:i:1;redirectcomports:i:1;redirectprinters:i:1;redirectsmartcards:i:1;screen mode id:i:2;' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' hostpoolDescription: 'My first AVD Host Pool' + hostpoolFriendlyName: 'AVDv2' hostpoolType: 'Pooled' - personalDesktopAssignmentType: 'Automatic' - maxSessionLimit: 99999 loadBalancerType: 'BreadthFirst' - customRdpProperty: 'audiocapturemode:i:1;audiomode:i:0;drivestoredirect:s:;redirectclipboard:i:1;redirectcomports:i:1;redirectprinters:i:1;redirectsmartcards:i:1;screen mode id:i:2;' + location: 'westeurope' + lock: 'CanNotDelete' + maxSessionLimit: 99999 + personalDesktopAssignmentType: 'Automatic' + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] vmTemplate: { + customImageId: null domain: 'domainname.onmicrosoft.com' galleryImageOffer: 'office-365' galleryImagePublisher: 'microsoftwindowsdesktop' galleryImageSKU: '20h1-evd-o365pp' imageType: 'Gallery' imageUri: null - customImageId: null namePrefix: 'avdv2' osDiskType: 'StandardSSD_LRS' useManagedDisks: true vmSize: { - id: 'Standard_D2s_v3' cores: 2 + id: 'Standard_D2s_v3' ram: 8 } } - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-avdhp-x-001" + }, + // Non-required parameters + "customRdpProperty": { + "value": "audiocapturemode:i:1;audiomode:i:0;drivestoredirect:s:;redirectclipboard:i:1;redirectcomports:i:1;redirectprinters:i:1;redirectsmartcards:i:1;screen mode id:i:2;" + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "hostpoolDescription": { + "value": "My first AVD Host Pool" + }, + "hostpoolFriendlyName": { + "value": "AVDv2" + }, + "hostpoolType": { + "value": "Pooled" + }, + "loadBalancerType": { + "value": "BreadthFirst" + }, + "location": { + "value": "westeurope" + }, + "lock": { + "value": "CanNotDelete" + }, + "maxSessionLimit": { + "value": 99999 + }, + "personalDesktopAssignmentType": { + "value": "Automatic" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "vmTemplate": { + "value": { + "customImageId": null, + "domain": "domainname.onmicrosoft.com", + "galleryImageOffer": "office-365", + "galleryImagePublisher": "microsoftwindowsdesktop", + "galleryImageSKU": "20h1-evd-o365pp", + "imageType": "Gallery", + "imageUri": null, + "namePrefix": "avdv2", + "osDiskType": "StandardSSD_LRS", + "useManagedDisks": true, + "vmSize": { + "cores": 2, + "id": "Standard_D2s_v3", + "ram": 8 + } } - ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + } } } ``` diff --git a/modules/Microsoft.DesktopVirtualization/scalingplans/readme.md b/modules/Microsoft.DesktopVirtualization/scalingplans/readme.md index 9fe79b0076..67dde7adff 100644 --- a/modules/Microsoft.DesktopVirtualization/scalingplans/readme.md +++ b/modules/Microsoft.DesktopVirtualization/scalingplans/readme.md @@ -257,35 +257,40 @@ roleAssignments: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. + +

Example 1: Min

-via JSON Parameter file +via Bicep module -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-avdsp-x-001" - } - } +```bicep +module scalingplans './Microsoft.DesktopVirtualization/scalingplans/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-scalingplans' + params: { + name: '<>-az-avdsp-x-001' + } } ```
+

-via Bicep module +via JSON Parameter file -```bicep -module scalingplans './Microsoft.DesktopVirtualization/scalingplans/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-scalingplans' - params: { - name: '<>-az-avdsp-x-001' +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>-az-avdsp-x-001" + } } } ``` diff --git a/modules/Microsoft.DesktopVirtualization/workspaces/readme.md b/modules/Microsoft.DesktopVirtualization/workspaces/readme.md index 120180accc..e199764c2d 100644 --- a/modules/Microsoft.DesktopVirtualization/workspaces/readme.md +++ b/modules/Microsoft.DesktopVirtualization/workspaces/readme.md @@ -156,67 +156,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-avdws-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "location": { - "value": "westeurope" - }, - "appGroupResourceIds": { - "value": [ - "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.DesktopVirtualization/applicationgroups/adp-<>-az-avdag-x-001" - ] - }, - "workspaceFriendlyName": { - "value": "My first AVD Workspace" - }, - "workspaceDescription": { - "value": "This is my first AVD Workspace" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Parameters

@@ -226,27 +170,92 @@ tags: { module workspaces './Microsoft.DesktopVirtualization/workspaces/deploy.bicep' = { name: '${uniqueString(deployment().name)}-workspaces' params: { + // Required parameters name: '<>-az-avdws-x-001' - lock: 'CanNotDelete' - location: 'westeurope' + // Non-required parameters appGroupResourceIds: [ '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.DesktopVirtualization/applicationgroups/adp-<>-az-avdag-x-001' ] - workspaceFriendlyName: 'My first AVD Workspace' - workspaceDescription: 'This is my first AVD Workspace' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + location: 'westeurope' + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + workspaceDescription: 'This is my first AVD Workspace' + workspaceFriendlyName: 'My first AVD Workspace' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-avdws-x-001" + }, + // Non-required parameters + "appGroupResourceIds": { + "value": [ + "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.DesktopVirtualization/applicationgroups/adp-<>-az-avdag-x-001" + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "location": { + "value": "westeurope" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "workspaceDescription": { + "value": "This is my first AVD Workspace" + }, + "workspaceFriendlyName": { + "value": "My first AVD Workspace" + } } } ``` diff --git a/modules/Microsoft.DocumentDB/databaseAccounts/readme.md b/modules/Microsoft.DocumentDB/databaseAccounts/readme.md index 86f864d646..cea8d3fd7c 100644 --- a/modules/Microsoft.DocumentDB/databaseAccounts/readme.md +++ b/modules/Microsoft.DocumentDB/databaseAccounts/readme.md @@ -532,117 +532,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-cdb-gremlindb-001" - }, - "location": { - "value": "West Europe" - }, - "locations": { - "value": [ - { - "locationName": "West Europe", - "failoverPriority": 0, - "isZoneRedundant": false - }, - { - "locationName": "North Europe", - "failoverPriority": 1, - "isZoneRedundant": false - } - ] - }, - "capabilitiesToAdd": { - "value": [ - "EnableGremlin" - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "gremlinDatabases": { - "value": [ - { - "name": "<>-az-gdb-x-001", - "graphs": [ - { - "name": "car_collection", - "automaticIndexing": true, - "partitionKeyPaths": [ - "/car_id" - ] - }, - { - "name": "truck_collection", - "automaticIndexing": true, - "partitionKeyPaths": [ - "/truck_id" - ] - } - ] - }, - { - "name": "<>-az-gdb-x-002", - "collections": [ - { - "name": "bike_collection", - "automaticIndexing": true, - "partitionKeyPaths": [ - "/bike_id" - ] - }, - { - "name": "bicycle_collection", - "automaticIndexing": true, - "partitionKeyPaths": [ - "/bicycle_id" - ] - } - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "systemAssignedIdentity": { - "value": true - } - } -} -``` - -
+

Example 1: Gremlindb

@@ -652,76 +546,78 @@ userAssignedIdentities: { module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-databaseAccounts' params: { - name: '<>-az-cdb-gremlindb-001' - location: 'West Europe' + // Required parameters locations: [ { - locationName: 'West Europe' failoverPriority: 0 isZoneRedundant: false + locationName: 'West Europe' } { - locationName: 'North Europe' failoverPriority: 1 isZoneRedundant: false + locationName: 'North Europe' } ] + name: '<>-az-cdb-gremlindb-001' + // Non-required parameters capabilitiesToAdd: [ 'EnableGremlin' ] - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' gremlinDatabases: [ { - name: '<>-az-gdb-x-001' graphs: [ { - name: 'car_collection' automaticIndexing: true + name: 'car_collection' partitionKeyPaths: [ '/car_id' ] } { - name: 'truck_collection' automaticIndexing: true + name: 'truck_collection' partitionKeyPaths: [ '/truck_id' ] } ] + name: '<>-az-gdb-x-001' } { - name: '<>-az-gdb-x-002' collections: [ { - name: 'bike_collection' automaticIndexing: true + name: 'bike_collection' partitionKeyPaths: [ '/bike_id' ] } { - name: 'bicycle_collection' automaticIndexing: true + name: 'bicycle_collection' partitionKeyPaths: [ '/bicycle_id' ] } ] + name: '<>-az-gdb-x-002' + } + ] + location: 'West Europe' + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' systemAssignedIdentity: true } } @@ -730,256 +626,120 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' =

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-cdb-mongodb-001" - }, - "location": { - "value": "West Europe" - }, - "locations": { - "value": [ - { - "locationName": "West Europe", - "failoverPriority": 0, - "isZoneRedundant": false - }, - { - "locationName": "North Europe", - "failoverPriority": 1, - "isZoneRedundant": false - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "mongodbDatabases": { - "value": [ - { - "name": "<>-az-mdb-x-001", - "collections": [ - { - "name": "car_collection", - "indexes": [ - { - "key": { - "keys": [ - "_id" - ] - } - }, - { - "key": { - "keys": [ - "$**" - ] - } - }, - { - "key": { - "keys": [ - "car_id", - "car_model" - ] - }, - "options": { - "unique": true - } - }, - { - "key": { - "keys": [ - "_ts" - ] - }, - "options": { - "expireAfterSeconds": 2629746 - } - } - ], - "shardKey": { - "car_id": "Hash" - } - }, - { - "name": "truck_collection", - "indexes": [ - { - "key": { - "keys": [ - "_id" - ] - } - }, - { - "key": { - "keys": [ - "$**" - ] - } - }, - { - "key": { - "keys": [ - "truck_id", - "truck_model" - ] - }, - "options": { - "unique": true - } - }, - { - "key": { - "keys": [ - "_ts" - ] - }, - "options": { - "expireAfterSeconds": 2629746 - } - } - ], - "shardKey": { - "truck_id": "Hash" - } - } - ] - }, - { - "name": "<>-az-mdb-x-002", - "collections": [ - { - "name": "bike_collection", - "indexes": [ - { - "key": { - "keys": [ - "_id" - ] - } - }, - { - "key": { - "keys": [ - "$**" - ] - } - }, - { - "key": { - "keys": [ - "bike_id", - "bike_model" - ] - }, - "options": { - "unique": true - } - }, - { - "key": { - "keys": [ - "_ts" - ] - }, - "options": { - "expireAfterSeconds": 2629746 - } - } - ], - "shardKey": { - "bike_id": "Hash" - } - }, - { - "name": "bicycle_collection", - "indexes": [ - { - "key": { - "keys": [ - "_id" - ] - } - }, - { - "key": { - "keys": [ - "$**" - ] - } - }, - { - "key": { - "keys": [ - "bicycle_id", - "bicycle_model" - ] - }, - "options": { - "unique": true - } - }, - { - "key": { - "keys": [ - "_ts" - ] - }, - "options": { - "expireAfterSeconds": 2629746 - } - } - ], - "shardKey": { - "bicycle_id": "Hash" - } - } - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "locations": { + "value": [ + { + "failoverPriority": 0, + "isZoneRedundant": false, + "locationName": "West Europe" }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + { + "failoverPriority": 1, + "isZoneRedundant": false, + "locationName": "North Europe" + } + ] + }, + "name": { + "value": "<>-az-cdb-gremlindb-001" + }, + // Non-required parameters + "capabilitiesToAdd": { + "value": [ + "EnableGremlin" + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "gremlinDatabases": { + "value": [ + { + "graphs": [ + { + "automaticIndexing": true, + "name": "car_collection", + "partitionKeyPaths": [ + "/car_id" + ] + }, + { + "automaticIndexing": true, + "name": "truck_collection", + "partitionKeyPaths": [ + "/truck_id" + ] + } + ], + "name": "<>-az-gdb-x-001" }, - "systemAssignedIdentity": { - "value": true + { + "collections": [ + { + "automaticIndexing": true, + "name": "bike_collection", + "partitionKeyPaths": [ + "/bike_id" + ] + }, + { + "automaticIndexing": true, + "name": "bicycle_collection", + "partitionKeyPaths": [ + "/bicycle_id" + ] + } + ], + "name": "<>-az-gdb-x-002" } + ] + }, + "location": { + "value": "West Europe" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "systemAssignedIdentity": { + "value": true } + } } ```
+

+ +

Example 2: Mongodb

@@ -989,34 +749,31 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-databaseAccounts' params: { - name: '<>-az-cdb-mongodb-001' - location: 'West Europe' + // Required parameters locations: [ { - locationName: 'West Europe' failoverPriority: 0 isZoneRedundant: false + locationName: 'West Europe' } { - locationName: 'North Europe' failoverPriority: 1 isZoneRedundant: false + locationName: 'North Europe' } ] - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] + name: '<>-az-cdb-mongodb-001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + location: 'West Europe' mongodbDatabases: [ { - name: '<>-az-mdb-x-001' collections: [ { - name: 'car_collection' indexes: [ { key: { @@ -1054,12 +811,12 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = } } ] + name: 'car_collection' shardKey: { car_id: 'Hash' } } { - name: 'truck_collection' indexes: [ { key: { @@ -1097,17 +854,17 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = } } ] + name: 'truck_collection' shardKey: { truck_id: 'Hash' } } ] + name: '<>-az-mdb-x-001' } { - name: '<>-az-mdb-x-002' collections: [ { - name: 'bike_collection' indexes: [ { key: { @@ -1145,12 +902,12 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = } } ] + name: 'bike_collection' shardKey: { bike_id: 'Hash' } } { - name: 'bicycle_collection' indexes: [ { key: { @@ -1187,88 +944,285 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = expireAfterSeconds: 2629746 } } - ] - shardKey: { - bicycle_id: 'Hash' + ] + name: 'bicycle_collection' + shardKey: { + bicycle_id: 'Hash' + } + } + ] + name: '<>-az-mdb-x-002' + } + ] + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + systemAssignedIdentity: true + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "locations": { + "value": [ + { + "failoverPriority": 0, + "isZoneRedundant": false, + "locationName": "West Europe" + }, + { + "failoverPriority": 1, + "isZoneRedundant": false, + "locationName": "North Europe" + } + ] + }, + "name": { + "value": "<>-az-cdb-mongodb-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "location": { + "value": "West Europe" + }, + "mongodbDatabases": { + "value": [ + { + "collections": [ + { + "indexes": [ + { + "key": { + "keys": [ + "_id" + ] + } + }, + { + "key": { + "keys": [ + "$**" + ] + } + }, + { + "key": { + "keys": [ + "car_id", + "car_model" + ] + }, + "options": { + "unique": true + } + }, + { + "key": { + "keys": [ + "_ts" + ] + }, + "options": { + "expireAfterSeconds": 2629746 + } + } + ], + "name": "car_collection", + "shardKey": { + "car_id": "Hash" + } + }, + { + "indexes": [ + { + "key": { + "keys": [ + "_id" + ] + } + }, + { + "key": { + "keys": [ + "$**" + ] + } + }, + { + "key": { + "keys": [ + "truck_id", + "truck_model" + ] + }, + "options": { + "unique": true + } + }, + { + "key": { + "keys": [ + "_ts" + ] + }, + "options": { + "expireAfterSeconds": 2629746 + } + } + ], + "name": "truck_collection", + "shardKey": { + "truck_id": "Hash" + } } - } - ] - } - ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' - systemAssignedIdentity: true - } -} -``` - -
-

- -

Example 3

- -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-cdb-plain-001" + ], + "name": "<>-az-mdb-x-001" }, - "lock": { - "value": "CanNotDelete" - }, - "locations": { - "value": [ + { + "collections": [ + { + "indexes": [ { - "locationName": "West Europe", - "failoverPriority": 0, - "isZoneRedundant": false + "key": { + "keys": [ + "_id" + ] + } + }, + { + "key": { + "keys": [ + "$**" + ] + } }, { - "locationName": "North Europe", - "failoverPriority": 1, - "isZoneRedundant": false + "key": { + "keys": [ + "bike_id", + "bike_model" + ] + }, + "options": { + "unique": true + } + }, + { + "key": { + "keys": [ + "_ts" + ] + }, + "options": { + "expireAfterSeconds": 2629746 + } } - ] - }, - "roleAssignments": { - "value": [ + ], + "name": "bike_collection", + "shardKey": { + "bike_id": "Hash" + } + }, + { + "indexes": [ + { + "key": { + "keys": [ + "_id" + ] + } + }, + { + "key": { + "keys": [ + "$**" + ] + } + }, { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" + "key": { + "keys": [ + "bicycle_id", + "bicycle_model" ] + }, + "options": { + "unique": true + } + }, + { + "key": { + "keys": [ + "_ts" + ] + }, + "options": { + "expireAfterSeconds": 2629746 + } } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + ], + "name": "bicycle_collection", + "shardKey": { + "bicycle_id": "Hash" + } + } + ], + "name": "<>-az-mdb-x-002" } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "systemAssignedIdentity": { + "value": true } + } } ```
+

+ +

Example 3: Plain

@@ -1278,33 +1232,35 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-databaseAccounts' params: { - name: '<>-az-cdb-plain-001' - lock: 'CanNotDelete' + // Required parameters locations: [ { - locationName: 'West Europe' failoverPriority: 0 isZoneRedundant: false + locationName: 'West Europe' } { - locationName: 'North Europe' failoverPriority: 1 isZoneRedundant: false + locationName: 'North Europe' } ] + name: '<>-az-cdb-plain-001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' } } ``` @@ -1312,92 +1268,70 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' =

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-cdb-sqldb-001" - }, - "location": { - "value": "West Europe" - }, - "locations": { - "value": [ - { - "locationName": "West Europe", - "failoverPriority": 0, - "isZoneRedundant": false - }, - { - "locationName": "North Europe", - "failoverPriority": 1, - "isZoneRedundant": false - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "sqlDatabases": { - "value": [ - { - "name": "<>-az-sql-x-001", - "containers": [ - { - "name": "container-001", - "paths": [ - "/myPartitionKey" - ], - "kind": "Hash" - } - ] - }, - { - "name": "<>-az-sql-x-002", - "containers": [] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "locations": { + "value": [ + { + "failoverPriority": 0, + "isZoneRedundant": false, + "locationName": "West Europe" }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } + { + "failoverPriority": 1, + "isZoneRedundant": false, + "locationName": "North Europe" + } + ] + }, + "name": { + "value": "<>-az-cdb-plain-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] } + } } ```
+

+ +

Example 4: Sqldb

@@ -1407,51 +1341,53 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-databaseAccounts' params: { - name: '<>-az-cdb-sqldb-001' - location: 'West Europe' + // Required parameters locations: [ { - locationName: 'West Europe' failoverPriority: 0 isZoneRedundant: false + locationName: 'West Europe' } { - locationName: 'North Europe' failoverPriority: 1 isZoneRedundant: false + locationName: 'North Europe' } ] + name: '<>-az-cdb-sqldb-001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + location: 'West Europe' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] sqlDatabases: [ { - name: '<>-az-sql-x-001' containers: [ { + kind: 'Hash' name: 'container-001' paths: [ '/myPartitionKey' ] - kind: 'Hash' } ] + name: '<>-az-sql-x-001' } { - name: '<>-az-sql-x-002' containers: [] + name: '<>-az-sql-x-002' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' userAssignedIdentities: { '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } @@ -1461,3 +1397,91 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' =

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "locations": { + "value": [ + { + "failoverPriority": 0, + "isZoneRedundant": false, + "locationName": "West Europe" + }, + { + "failoverPriority": 1, + "isZoneRedundant": false, + "locationName": "North Europe" + } + ] + }, + "name": { + "value": "<>-az-cdb-sqldb-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "location": { + "value": "West Europe" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "sqlDatabases": { + "value": [ + { + "containers": [ + { + "kind": "Hash", + "name": "container-001", + "paths": [ + "/myPartitionKey" + ] + } + ], + "name": "<>-az-sql-x-001" + }, + { + "containers": [], + "name": "<>-az-sql-x-002" + } + ] + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + } + } +} +``` + +
+

diff --git a/modules/Microsoft.EventGrid/systemTopics/readme.md b/modules/Microsoft.EventGrid/systemTopics/readme.md index 6c96887d63..41f08a9ac4 100644 --- a/modules/Microsoft.EventGrid/systemTopics/readme.md +++ b/modules/Microsoft.EventGrid/systemTopics/readme.md @@ -269,31 +269,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-egstn-x-002" - }, - "source": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "topicType": { - "value": "Microsoft.Storage.StorageAccounts" - } - } -} -``` - -
+

Example 1: Min

@@ -303,6 +283,7 @@ userAssignedIdentities: { module systemTopics './Microsoft.EventGrid/systemTopics/deploy.bicep' = { name: '${uniqueString(deployment().name)}-systemTopics' params: { + // Required parameters name: '<>-az-egstn-x-002' source: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' topicType: 'Microsoft.Storage.StorageAccounts' @@ -313,59 +294,33 @@ module systemTopics './Microsoft.EventGrid/systemTopics/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-egstn-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "source": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "topicType": { - "value": "Microsoft.Storage.StorageAccounts" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-egstn-x-002" + }, + "source": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "topicType": { + "value": "Microsoft.Storage.StorageAccounts" } + } } ```
+

+ +

Example 2: Parameters

@@ -375,23 +330,80 @@ module systemTopics './Microsoft.EventGrid/systemTopics/deploy.bicep' = { module systemTopics './Microsoft.EventGrid/systemTopics/deploy.bicep' = { name: '${uniqueString(deployment().name)}-systemTopics' params: { + // Required parameters name: '<>-az-egstn-x-001' - lock: 'CanNotDelete' source: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' topicType: 'Microsoft.Storage.StorageAccounts' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-egstn-x-001" + }, + "source": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "topicType": { + "value": "Microsoft.Storage.StorageAccounts" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } } } ``` diff --git a/modules/Microsoft.EventGrid/topics/readme.md b/modules/Microsoft.EventGrid/topics/readme.md index c97ac5d2b6..2d51148e49 100644 --- a/modules/Microsoft.EventGrid/topics/readme.md +++ b/modules/Microsoft.EventGrid/topics/readme.md @@ -236,61 +236,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-egtn-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "topic" - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Parameters

@@ -300,27 +250,86 @@ tags: { module topics './Microsoft.EventGrid/topics/deploy.bicep' = { name: '${uniqueString(deployment().name)}-topics' params: { + // Required parameters name: '<>-az-egtn-x-001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' lock: 'CanNotDelete' + privateEndpoints: [ + { + service: 'topic' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - privateEndpoints: [ - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'topic' - } - ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-egtn-x-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "privateEndpoints": { + "value": [ + { + "service": "topic", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } } } ``` diff --git a/modules/Microsoft.EventHub/namespaces/readme.md b/modules/Microsoft.EventHub/namespaces/readme.md index 2c3b3c098a..d29240ade3 100644 --- a/modules/Microsoft.EventHub/namespaces/readme.md +++ b/modules/Microsoft.EventHub/namespaces/readme.md @@ -281,21 +281,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": {} -} -``` - -
+

Example 1: Min

@@ -313,161 +303,22 @@ module namespaces './Microsoft.EventHub/namespaces/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-evnsp-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "authorizationRules": { - "value": [ - { - "name": "RootManageSharedAccessKey", - "rights": [ - "Listen", - "Manage", - "Send" - ] - }, - { - "name": "SendListenAccess", - "rights": [ - "Listen", - "Send" - ] - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "eventHubs": { - "value": [ - { - "name": "<>-az-evh-x-001" - }, - { - "name": "<>-az-evh-x-002", - "authorizationRules": [ - { - "name": "RootManageSharedAccessKey", - "rights": [ - "Listen", - "Manage", - "Send" - ] - }, - { - "name": "SendListenAccess", - "rights": [ - "Listen", - "Send" - ] - } - ], - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ], - "messageRetentionInDays": 1, - "partitionCount": 2, - "status": "Active", - "captureDescriptionEnabled": true, - "captureDescriptionEncoding": "Avro", - "captureDescriptionIntervalInSeconds": 300, - "captureDescriptionSizeLimitInBytes": 314572800, - "captureDescriptionDestinationName": "EventHubArchive.AzureBlockBlob", - "captureDescriptionDestinationStorageAccountResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", - "captureDescriptionDestinationBlobContainer": "eventhub", - "captureDescriptionDestinationArchiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}", - "captureDescriptionSkipEmptyArchives": true, - "consumerGroups": [ - { - "name": "custom", - "userMetadata": "customMetadata" - } - ] - } - ] - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "namespace" - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "systemAssignedIdentity": { - "value": true - }, - "networkRuleSets": { - "value": { - "defaultAction": "Deny", - "ipRules": [ - { - "action": "Allow", - "ipMask": "10.10.10.10" - } - ], - "virtualNetworkRules": [ - { - "subnet": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" - }, - "ignoreMissingVnetServiceEndpoint": true - } - ], - "trustedServiceAccessEnabled": false - } - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - } - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": {} } ```
+

+ +

Example 2: Parameters

@@ -477,8 +328,6 @@ module namespaces './Microsoft.EventHub/namespaces/deploy.bicep' = { module namespaces './Microsoft.EventHub/namespaces/deploy.bicep' = { name: '${uniqueString(deployment().name)}-namespaces' params: { - name: '<>-az-evnsp-x-001' - lock: 'CanNotDelete' authorizationRules: [ { name: 'RootManageSharedAccessKey' @@ -496,20 +345,16 @@ module namespaces './Microsoft.EventHub/namespaces/deploy.bicep' = { ] } ] - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' eventHubs: [ { name: '<>-az-evh-x-001' } { - name: '<>-az-evh-x-002' authorizationRules: [ { name: 'RootManageSharedAccessKey' @@ -527,25 +372,14 @@ module namespaces './Microsoft.EventHub/namespaces/deploy.bicep' = { ] } ] - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] - messageRetentionInDays: 1 - partitionCount: 2 - status: 'Active' + captureDescriptionDestinationArchiveNameFormat: '{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}' + captureDescriptionDestinationBlobContainer: 'eventhub' + captureDescriptionDestinationName: 'EventHubArchive.AzureBlockBlob' + captureDescriptionDestinationStorageAccountResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' captureDescriptionEnabled: true captureDescriptionEncoding: 'Avro' captureDescriptionIntervalInSeconds: 300 captureDescriptionSizeLimitInBytes: 314572800 - captureDescriptionDestinationName: 'EventHubArchive.AzureBlockBlob' - captureDescriptionDestinationStorageAccountResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - captureDescriptionDestinationBlobContainer: 'eventhub' - captureDescriptionDestinationArchiveNameFormat: '{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}' captureDescriptionSkipEmptyArchives: true consumerGroups: [ { @@ -553,20 +387,22 @@ module namespaces './Microsoft.EventHub/namespaces/deploy.bicep' = { userMetadata: 'customMetadata' } ] + messageRetentionInDays: 1 + name: '<>-az-evh-x-002' + partitionCount: 2 + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + status: 'Active' } ] - privateEndpoints: [ - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'namespace' - } - ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' - systemAssignedIdentity: true + lock: 'CanNotDelete' + name: '<>-az-evnsp-x-001' networkRuleSets: { defaultAction: 'Deny' ipRules: [ @@ -575,16 +411,31 @@ module namespaces './Microsoft.EventHub/namespaces/deploy.bicep' = { ipMask: '10.10.10.10' } ] + trustedServiceAccessEnabled: false virtualNetworkRules: [ { + ignoreMissingVnetServiceEndpoint: true subnet: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' } - ignoreMissingVnetServiceEndpoint: true } ] - trustedServiceAccessEnabled: false } + privateEndpoints: [ + { + service: 'namespace' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + ] + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + systemAssignedIdentity: true userAssignedIdentities: { '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } @@ -594,3 +445,158 @@ module namespaces './Microsoft.EventHub/namespaces/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "authorizationRules": { + "value": [ + { + "name": "RootManageSharedAccessKey", + "rights": [ + "Listen", + "Manage", + "Send" + ] + }, + { + "name": "SendListenAccess", + "rights": [ + "Listen", + "Send" + ] + } + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "eventHubs": { + "value": [ + { + "name": "<>-az-evh-x-001" + }, + { + "authorizationRules": [ + { + "name": "RootManageSharedAccessKey", + "rights": [ + "Listen", + "Manage", + "Send" + ] + }, + { + "name": "SendListenAccess", + "rights": [ + "Listen", + "Send" + ] + } + ], + "captureDescriptionDestinationArchiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}", + "captureDescriptionDestinationBlobContainer": "eventhub", + "captureDescriptionDestinationName": "EventHubArchive.AzureBlockBlob", + "captureDescriptionDestinationStorageAccountResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", + "captureDescriptionEnabled": true, + "captureDescriptionEncoding": "Avro", + "captureDescriptionIntervalInSeconds": 300, + "captureDescriptionSizeLimitInBytes": 314572800, + "captureDescriptionSkipEmptyArchives": true, + "consumerGroups": [ + { + "name": "custom", + "userMetadata": "customMetadata" + } + ], + "messageRetentionInDays": 1, + "name": "<>-az-evh-x-002", + "partitionCount": 2, + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "status": "Active" + } + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "name": { + "value": "<>-az-evnsp-x-001" + }, + "networkRuleSets": { + "value": { + "defaultAction": "Deny", + "ipRules": [ + { + "action": "Allow", + "ipMask": "10.10.10.10" + } + ], + "trustedServiceAccessEnabled": false, + "virtualNetworkRules": [ + { + "ignoreMissingVnetServiceEndpoint": true, + "subnet": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" + } + } + ] + } + }, + "privateEndpoints": { + "value": [ + { + "service": "namespace", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "systemAssignedIdentity": { + "value": true + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + } + } +} +``` + +
+

diff --git a/modules/Microsoft.HealthBot/healthBots/readme.md b/modules/Microsoft.HealthBot/healthBots/readme.md index 7b1074bea1..5f9566f06e 100644 --- a/modules/Microsoft.HealthBot/healthBots/readme.md +++ b/modules/Microsoft.HealthBot/healthBots/readme.md @@ -146,38 +146,11 @@ roleAssignments: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-ahb-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -187,14 +160,16 @@ roleAssignments: [ module healthBots './Microsoft.HealthBot/healthBots/deploy.bicep' = { name: '${uniqueString(deployment().name)}-healthBots' params: { + // Required parameters name: '<>-az-ahb-x-001' + // Non-required parameters lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -203,3 +178,37 @@ module healthBots './Microsoft.HealthBot/healthBots/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-ahb-x-001" + }, + // Non-required parameters + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Insights/actionGroups/readme.md b/modules/Microsoft.Insights/actionGroups/readme.md index 5b8e41406c..9cc782cb56 100644 --- a/modules/Microsoft.Insights/actionGroups/readme.md +++ b/modules/Microsoft.Insights/actionGroups/readme.md @@ -232,61 +232,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-ag-x-001" - }, - "groupShortName": { - "value": "azagweux001" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "emailReceivers": { - "value": [ - { - "name": "TestUser_-EmailAction-", - "emailAddress": "test.user@testcompany.com", - "useCommonAlertSchema": true - }, - { - "name": "TestUser2", - "emailAddress": "test.user2@testcompany.com", - "useCommonAlertSchema": true - } - ] - }, - "smsReceivers": { - "value": [ - { - "name": "TestUser_-SMSAction-", - "countryCode": "1", - "phoneNumber": "2345678901" - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -296,32 +246,34 @@ tags: { module actionGroups './Microsoft.Insights/actionGroups/deploy.bicep' = { name: '${uniqueString(deployment().name)}-actionGroups' params: { - name: '<>-az-ag-x-001' + // Required parameters groupShortName: 'azagweux001' - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] + name: '<>-az-ag-x-001' + // Non-required parameters emailReceivers: [ { - name: 'TestUser_-EmailAction-' emailAddress: 'test.user@testcompany.com' + name: 'TestUser_-EmailAction-' useCommonAlertSchema: true } { - name: 'TestUser2' emailAddress: 'test.user2@testcompany.com' + name: 'TestUser2' useCommonAlertSchema: true } ] + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] smsReceivers: [ { - name: 'TestUser_-SMSAction-' countryCode: '1' + name: 'TestUser_-SMSAction-' phoneNumber: '2345678901' } ] @@ -331,3 +283,60 @@ module actionGroups './Microsoft.Insights/actionGroups/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "groupShortName": { + "value": "azagweux001" + }, + "name": { + "value": "<>-az-ag-x-001" + }, + // Non-required parameters + "emailReceivers": { + "value": [ + { + "emailAddress": "test.user@testcompany.com", + "name": "TestUser_-EmailAction-", + "useCommonAlertSchema": true + }, + { + "emailAddress": "test.user2@testcompany.com", + "name": "TestUser2", + "useCommonAlertSchema": true + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "smsReceivers": { + "value": [ + { + "countryCode": "1", + "name": "TestUser_-SMSAction-", + "phoneNumber": "2345678901" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Insights/activityLogAlerts/readme.md b/modules/Microsoft.Insights/activityLogAlerts/readme.md index a8a08e68b0..bd87abe007 100644 --- a/modules/Microsoft.Insights/activityLogAlerts/readme.md +++ b/modules/Microsoft.Insights/activityLogAlerts/readme.md @@ -394,63 +394,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-ala-x-001" - }, - "scopes": { - "value": [ - "/subscriptions/<>" - ] - }, - "conditions": { - "value": [ - { - "field": "category", - "equals": "Administrative" - }, - { - "field": "resourceType", - "equals": "microsoft.compute/virtualmachines" - }, - { - "field": "operationName", - "equals": "Microsoft.Compute/virtualMachines/performMaintenance/action" - } - ] - }, - "actions": { - "value": [ - { - "actionGroupId": "/subscriptions/<>/resourceGroups/validation-rg/providers/microsoft.insights/actiongroups/adp-<>-az-ag-x-001" - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -460,24 +408,23 @@ tags: { module activityLogAlerts './Microsoft.Insights/activityLogAlerts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-activityLogAlerts' params: { - name: '<>-az-ala-x-001' - scopes: [ - '/subscriptions/<>' - ] + // Required parameters conditions: [ { - field: 'category' equals: 'Administrative' + field: 'category' } { - field: 'resourceType' equals: 'microsoft.compute/virtualmachines' + field: 'resourceType' } { - field: 'operationName' equals: 'Microsoft.Compute/virtualMachines/performMaintenance/action' + field: 'operationName' } ] + name: '<>-az-ala-x-001' + // Non-required parameters actions: [ { actionGroupId: '/subscriptions/<>/resourceGroups/validation-rg/providers/microsoft.insights/actiongroups/adp-<>-az-ag-x-001' @@ -485,12 +432,74 @@ module activityLogAlerts './Microsoft.Insights/activityLogAlerts/deploy.bicep' = ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + scopes: [ + '/subscriptions/<>' + ] + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "conditions": { + "value": [ + { + "equals": "Administrative", + "field": "category" + }, + { + "equals": "microsoft.compute/virtualmachines", + "field": "resourceType" + }, + { + "equals": "Microsoft.Compute/virtualMachines/performMaintenance/action", + "field": "operationName" + } + ] + }, + "name": { + "value": "<>-az-ala-x-001" + }, + // Non-required parameters + "actions": { + "value": [ + { + "actionGroupId": "/subscriptions/<>/resourceGroups/validation-rg/providers/microsoft.insights/actiongroups/adp-<>-az-ag-x-001" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "scopes": { + "value": [ + "/subscriptions/<>" + ] + } } } ``` diff --git a/modules/Microsoft.Insights/components/readme.md b/modules/Microsoft.Insights/components/readme.md index 0a42f4eda2..3003a89aaf 100644 --- a/modules/Microsoft.Insights/components/readme.md +++ b/modules/Microsoft.Insights/components/readme.md @@ -150,38 +150,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-appi-x-001" - }, - "workspaceResourceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-appi-001" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -191,14 +164,16 @@ tags: { module components './Microsoft.Insights/components/deploy.bicep' = { name: '${uniqueString(deployment().name)}-components' params: { + // Required parameters name: '<>-az-appi-x-001' workspaceResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-appi-001' + // Non-required parameters roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -207,3 +182,37 @@ module components './Microsoft.Insights/components/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-appi-x-001" + }, + "workspaceResourceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-appi-001" + }, + // Non-required parameters + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Insights/diagnosticSettings/readme.md b/modules/Microsoft.Insights/diagnosticSettings/readme.md index 23fedd6bec..07b7c8c8c3 100644 --- a/modules/Microsoft.Insights/diagnosticSettings/readme.md +++ b/modules/Microsoft.Insights/diagnosticSettings/readme.md @@ -41,40 +41,11 @@ This module deploys a subscription wide export of the activity log. ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-diag-x-001" - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Parameters

@@ -84,12 +55,46 @@ This module deploys a subscription wide export of the activity log. module diagnosticSettings './Microsoft.Insights/diagnosticSettings/deploy.bicep' = { name: '${uniqueString(deployment().name)}-diagnosticSettings' params: { - name: '<>-az-diag-x-001' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' diagnosticLogsRetentionInDays: 7 diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + name: '<>-az-diag-x-001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "name": { + "value": "<>-az-diag-x-001" + } } } ``` diff --git a/modules/Microsoft.Insights/metricAlerts/readme.md b/modules/Microsoft.Insights/metricAlerts/readme.md index 21e7b39971..d0f49b2c27 100644 --- a/modules/Microsoft.Insights/metricAlerts/readme.md +++ b/modules/Microsoft.Insights/metricAlerts/readme.md @@ -375,65 +375,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-ma-x-001" - }, - "windowSize": { - "value": "PT15M" - }, - "actions": { - "value": [ - "/subscriptions/<>/resourceGroups/validation-rg/providers/microsoft.insights/actiongroups/adp-<>-az-ag-x-001" - ] - }, - "targetResourceType": { - "value": "microsoft.compute/virtualmachines" - }, - "targetResourceRegion": { - "value": "westeurope" - }, - "criterias": { - "value": [ - { - "criterionType": "StaticThresholdCriterion", - "metricName": "Percentage CPU", - "metricNamespace": "microsoft.compute/virtualmachines", - "name": "HighCPU", - "operator": "GreaterThan", - "threshold": "90", - "timeAggregation": "Average" - } - ] - }, - "alertCriteriaType": { - "value": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -443,13 +389,7 @@ tags: { module metricAlerts './Microsoft.Insights/metricAlerts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-metricAlerts' params: { - name: '<>-az-ma-x-001' - windowSize: 'PT15M' - actions: [ - '/subscriptions/<>/resourceGroups/validation-rg/providers/microsoft.insights/actiongroups/adp-<>-az-ag-x-001' - ] - targetResourceType: 'microsoft.compute/virtualmachines' - targetResourceRegion: 'westeurope' + // Required parameters criterias: [ { criterionType: 'StaticThresholdCriterion' @@ -461,15 +401,84 @@ module metricAlerts './Microsoft.Insights/metricAlerts/deploy.bicep' = { timeAggregation: 'Average' } ] + name: '<>-az-ma-x-001' + // Non-required parameters + actions: [ + '/subscriptions/<>/resourceGroups/validation-rg/providers/microsoft.insights/actiongroups/adp-<>-az-ag-x-001' + ] alertCriteriaType: 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + targetResourceRegion: 'westeurope' + targetResourceType: 'microsoft.compute/virtualmachines' + windowSize: 'PT15M' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "criterias": { + "value": [ + { + "criterionType": "StaticThresholdCriterion", + "metricName": "Percentage CPU", + "metricNamespace": "microsoft.compute/virtualmachines", + "name": "HighCPU", + "operator": "GreaterThan", + "threshold": "90", + "timeAggregation": "Average" + } + ] + }, + "name": { + "value": "<>-az-ma-x-001" + }, + // Non-required parameters + "actions": { + "value": [ + "/subscriptions/<>/resourceGroups/validation-rg/providers/microsoft.insights/actiongroups/adp-<>-az-ag-x-001" + ] + }, + "alertCriteriaType": { + "value": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "targetResourceRegion": { + "value": "westeurope" + }, + "targetResourceType": { + "value": "microsoft.compute/virtualmachines" + }, + "windowSize": { + "value": "PT15M" + } } } ``` diff --git a/modules/Microsoft.Insights/privateLinkScopes/readme.md b/modules/Microsoft.Insights/privateLinkScopes/readme.md index ca6d07e531..0283d9b727 100644 --- a/modules/Microsoft.Insights/privateLinkScopes/readme.md +++ b/modules/Microsoft.Insights/privateLinkScopes/readme.md @@ -227,54 +227,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-pls-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "scopedResources": { - "value": [ - { - "name": "scoped1", - "linkedResourceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "azuremonitor" - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -284,26 +241,28 @@ tags: { module privateLinkScopes './Microsoft.Insights/privateLinkScopes/deploy.bicep' = { name: '${uniqueString(deployment().name)}-privateLinkScopes' params: { + // Required parameters name: '<>-az-pls-x-001' + // Non-required parameters lock: 'CanNotDelete' - scopedResources: [ + privateEndpoints: [ { - name: 'scoped1' - linkedResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + service: 'azuremonitor' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' } ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - privateEndpoints: [ + scopedResources: [ { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'azuremonitor' + linkedResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + name: 'scoped1' } ] } @@ -312,3 +271,53 @@ module privateLinkScopes './Microsoft.Insights/privateLinkScopes/deploy.bicep' =

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-pls-x-001" + }, + // Non-required parameters + "lock": { + "value": "CanNotDelete" + }, + "privateEndpoints": { + "value": [ + { + "service": "azuremonitor", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "scopedResources": { + "value": [ + { + "linkedResourceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001", + "name": "scoped1" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Insights/scheduledQueryRules/readme.md b/modules/Microsoft.Insights/scheduledQueryRules/readme.md index 304ae9217d..73e477eea2 100644 --- a/modules/Microsoft.Insights/scheduledQueryRules/readme.md +++ b/modules/Microsoft.Insights/scheduledQueryRules/readme.md @@ -157,87 +157,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "myAlert01" - }, - "alertDescription": { - "value": "My sample Alert" - }, - "scopes": { - "value": [ - "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - ] - }, - "evaluationFrequency": { - "value": "PT5M" - }, - "windowSize": { - "value": "PT5M" - }, - "suppressForMinutes": { - "value": "PT5M" - }, - "queryTimeRange": { - "value": "PT5M" - }, - "autoMitigate": { - "value": false - }, - "criterias": { - "value": { - "allOf": [ - { - "query": "Perf | where ObjectName == \"LogicalDisk\" | where CounterName == \"% Free Space\" | where InstanceName <> \"HarddiskVolume1\" and InstanceName <> \"_Total\" | summarize AggregatedValue = min(CounterValue) by Computer, InstanceName, bin(TimeGenerated,5m)", - "timeAggregation": "Average", - "metricMeasureColumn": "AggregatedValue", - "dimensions": [ - { - "name": "Computer", - "operator": "Include", - "values": [ - "*" - ] - }, - { - "name": "InstanceName", - "operator": "Include", - "values": [ - "*" - ] - } - ], - "operator": "GreaterThan", - "threshold": 0 - } - ] - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -247,22 +171,14 @@ tags: { module scheduledQueryRules './Microsoft.Insights/scheduledQueryRules/deploy.bicep' = { name: '${uniqueString(deployment().name)}-scheduledQueryRules' params: { + // Required parameters name: 'myAlert01' + // Non-required parameters alertDescription: 'My sample Alert' - scopes: [ - '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - ] - evaluationFrequency: 'PT5M' - windowSize: 'PT5M' - suppressForMinutes: 'PT5M' - queryTimeRange: 'PT5M' autoMitigate: false criterias: { allOf: [ { - query: 'Perf | where ObjectName == \'LogicalDisk\' | where CounterName == \'% Free Space\' | where InstanceName <> \'HarddiskVolume1\' and InstanceName <> \'_Total\' | summarize AggregatedValue = min(CounterValue) by Computer InstanceName bin(TimeGenerated5m)' - timeAggregation: 'Average' - metricMeasureColumn: 'AggregatedValue' dimensions: [ { name: 'Computer' @@ -279,19 +195,112 @@ module scheduledQueryRules './Microsoft.Insights/scheduledQueryRules/deploy.bice ] } ] + metricMeasureColumn: 'AggregatedValue' operator: 'GreaterThan' + query: 'Perf | where ObjectName == \'LogicalDisk\' | where CounterName == \'% Free Space\' | where InstanceName <> \'HarddiskVolume1\' and InstanceName <> \'_Total\' | summarize AggregatedValue = min(CounterValue) by Computer InstanceName bin(TimeGenerated5m)' threshold: 0 + timeAggregation: 'Average' } ] } + evaluationFrequency: 'PT5M' + queryTimeRange: 'PT5M' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + scopes: [ + '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + ] + suppressForMinutes: 'PT5M' + windowSize: 'PT5M' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "myAlert01" + }, + // Non-required parameters + "alertDescription": { + "value": "My sample Alert" + }, + "autoMitigate": { + "value": false + }, + "criterias": { + "value": { + "allOf": [ + { + "dimensions": [ + { + "name": "Computer", + "operator": "Include", + "values": [ + "*" + ] + }, + { + "name": "InstanceName", + "operator": "Include", + "values": [ + "*" + ] + } + ], + "metricMeasureColumn": "AggregatedValue", + "operator": "GreaterThan", + "query": "Perf | where ObjectName == \"LogicalDisk\" | where CounterName == \"% Free Space\" | where InstanceName <> \"HarddiskVolume1\" and InstanceName <> \"_Total\" | summarize AggregatedValue = min(CounterValue) by Computer, InstanceName, bin(TimeGenerated,5m)", + "threshold": 0, + "timeAggregation": "Average" + } + ] + } + }, + "evaluationFrequency": { + "value": "PT5M" + }, + "queryTimeRange": { + "value": "PT5M" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "scopes": { + "value": [ + "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + ] + }, + "suppressForMinutes": { + "value": "PT5M" + }, + "windowSize": { + "value": "PT5M" + } } } ``` diff --git a/modules/Microsoft.KeyVault/vaults/readme.md b/modules/Microsoft.KeyVault/vaults/readme.md index f8230f843f..0352b3f857 100644 --- a/modules/Microsoft.KeyVault/vaults/readme.md +++ b/modules/Microsoft.KeyVault/vaults/readme.md @@ -380,21 +380,11 @@ privateEndpoints: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": {} -} -``` - -
+

Example 1: Min

@@ -412,156 +402,22 @@ module vaults './Microsoft.KeyVault/vaults/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-kv-x-002" - }, - "lock": { - "value": "CanNotDelete" - }, - "softDeleteRetentionInDays": { - "value": 7 - }, - "enableRbacAuthorization": { - "value": false - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "vault", - "privateDnsZoneGroups": [ - { - "privateDNSResourceIds": [ - "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/privatelink.vaultcore.azure.net" - ] - } - ] - } - ] - }, - "networkAcls": { - "value": { - "bypass": "AzureServices", - "defaultAction": "Deny", - "virtualNetworkRules": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001", - "action": "Allow" - } - ], - "ipRules": [] - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "secrets": { - "value": { - "secureList": [ - { - "name": "secretName", - "value": "secretValue", - "contentType": "Something", - "attributesExp": 1702648632, - "attributesNbf": 10000, - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - ] - } - }, - "keys": { - "value": [ - { - "name": "keyName", - "attributesExp": 1702648632, - "attributesNbf": 10000, - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - ] - }, - "accessPolicies": { - "value": [ - { - "objectId": "<>", - "permissions": { - "keys": [ - "get", - "list", - "update" - ], - "secrets": [ - "all" - ] - }, - "tenantId": "<>" - }, - { - "objectId": "<>", - "permissions": { - "certificates": [ - "backup", - "create", - "delete" - ], - "secrets": [ - "all" - ] - } - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": {} } ```
+

+ +

Example 2: Parameters

@@ -571,110 +427,260 @@ module vaults './Microsoft.KeyVault/vaults/deploy.bicep' = { module vaults './Microsoft.KeyVault/vaults/deploy.bicep' = { name: '${uniqueString(deployment().name)}-vaults' params: { - name: '<>-az-kv-x-002' - lock: 'CanNotDelete' - softDeleteRetentionInDays: 7 + accessPolicies: [ + { + objectId: '<>' + permissions: { + keys: [ + 'get' + 'list' + 'update' + ] + secrets: [ + 'all' + ] + } + tenantId: '<>' + } + { + objectId: '<>' + permissions: { + certificates: [ + 'backup' + 'create' + 'delete' + ] + secrets: [ + 'all' + ] + } + } + ] + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' enableRbacAuthorization: false - privateEndpoints: [ + keys: [ { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'vault' - privateDnsZoneGroups: [ + attributesExp: 1702648632 + attributesNbf: 10000 + name: 'keyName' + roleAssignments: [ { - privateDNSResourceIds: [ - '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/privatelink.vaultcore.azure.net' + principalIds: [ + '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } ] + lock: 'CanNotDelete' + name: '<>-az-kv-x-002' networkAcls: { bypass: 'AzureServices' defaultAction: 'Deny' + ipRules: [] virtualNetworkRules: [ { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' action: 'Allow' + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' } ] - ipRules: [] } + privateEndpoints: [ + { + privateDnsZoneGroups: [ + { + privateDNSResourceIds: [ + '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/privatelink.vaultcore.azure.net' + ] + } + ] + service: 'vault' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] secrets: { secureList: [ { - name: 'secretName' - value: 'secretValue' - contentType: 'Something' attributesExp: 1702648632 attributesNbf: 10000 + contentType: 'Something' + name: 'secretName' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + value: 'secretValue' } ] } - keys: [ - { - name: 'keyName' - attributesExp: 1702648632 - attributesNbf: 10000 - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' + softDeleteRetentionInDays: 7 + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "accessPolicies": { + "value": [ + { + "objectId": "<>", + "permissions": { + "keys": [ + "get", + "list", + "update" + ], + "secrets": [ + "all" + ] + }, + "tenantId": "<>" + }, + { + "objectId": "<>", + "permissions": { + "certificates": [ + "backup", + "create", + "delete" + ], + "secrets": [ + "all" ] } - ] - } - ] - accessPolicies: [ - { - objectId: '<>' - permissions: { - keys: [ - 'get' - 'list' - 'update' - ] - secrets: [ - 'all' + } + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "enableRbacAuthorization": { + "value": false + }, + "keys": { + "value": [ + { + "attributesExp": 1702648632, + "attributesNbf": 10000, + "name": "keyName", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } ] } - tenantId: '<>' + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "name": { + "value": "<>-az-kv-x-002" + }, + "networkAcls": { + "value": { + "bypass": "AzureServices", + "defaultAction": "Deny", + "ipRules": [], + "virtualNetworkRules": [ + { + "action": "Allow", + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" + } + ] } - { - objectId: '<>' - permissions: { - certificates: [ - 'backup' - 'create' - 'delete' - ] - secrets: [ - 'all' - ] + }, + "privateEndpoints": { + "value": [ + { + "privateDnsZoneGroups": [ + { + "privateDNSResourceIds": [ + "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/privatelink.vaultcore.azure.net" + ] + } + ], + "service": "vault", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] + }, + "secrets": { + "value": { + "secureList": [ + { + "attributesExp": 1702648632, + "attributesNbf": 10000, + "contentType": "Something", + "name": "secretName", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "value": "secretValue" + } + ] } - ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + }, + "softDeleteRetentionInDays": { + "value": 7 + } } } ``` diff --git a/modules/Microsoft.KubernetesConfiguration/extensions/readme.md b/modules/Microsoft.KubernetesConfiguration/extensions/readme.md index b82481be34..d96da6628c 100644 --- a/modules/Microsoft.KubernetesConfiguration/extensions/readme.md +++ b/modules/Microsoft.KubernetesConfiguration/extensions/readme.md @@ -65,37 +65,11 @@ For Details see [Prerequisites](https://docs.microsoft.com/en-us/azure/azure-arc ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "flux" - }, - "extensionType": { - "value": "microsoft.flux" - }, - "clusterName": { - "value": "<>-az-aks-kubenet-001" - }, - "releaseTrain": { - "value": "Stable" - }, - "releaseNamespace": { - "value": "flux-system" - } - } -} -``` - -
+

Example 1: Min

@@ -105,11 +79,13 @@ For Details see [Prerequisites](https://docs.microsoft.com/en-us/azure/azure-arc module extensions './Microsoft.KubernetesConfiguration/extensions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-extensions' params: { - name: 'flux' - extensionType: 'microsoft.flux' + // Required parameters clusterName: '<>-az-aks-kubenet-001' - releaseTrain: 'Stable' + extensionType: 'microsoft.flux' + name: 'flux' + // Non-required parameters releaseNamespace: 'flux-system' + releaseTrain: 'Stable' } } ``` @@ -117,50 +93,40 @@ module extensions './Microsoft.KubernetesConfiguration/extensions/deploy.bicep'

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "flux" - }, - "extensionType": { - "value": "microsoft.flux" - }, - "clusterName": { - "value": "<>-az-aks-kubenet-001" - }, - "releaseTrain": { - "value": "Stable" - }, - "releaseNamespace": { - "value": "flux-system" - }, - "version": { - "value": "0.5.2" - }, - "configurationSettings": { - "value": { - // "helm-controller.enabled": "false", - "source-controller.enabled": "true", - "kustomize-controller.enabled": "true", - "notification-controller.enabled": "false", - "image-automation-controller.enabled": "false", - "image-reflector-controller.enabled": "false" - } - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "clusterName": { + "value": "<>-az-aks-kubenet-001" + }, + "extensionType": { + "value": "microsoft.flux" + }, + "name": { + "value": "flux" + }, + // Non-required parameters + "releaseNamespace": { + "value": "flux-system" + }, + "releaseTrain": { + "value": "Stable" } + } } ```
+

+ +

Example 2: Parameters

@@ -170,18 +136,65 @@ module extensions './Microsoft.KubernetesConfiguration/extensions/deploy.bicep' module extensions './Microsoft.KubernetesConfiguration/extensions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-extensions' params: { - name: 'flux' - extensionType: 'microsoft.flux' + // Required parameters clusterName: '<>-az-aks-kubenet-001' - releaseTrain: 'Stable' - releaseNamespace: 'flux-system' - version: '0.5.2' + extensionType: 'microsoft.flux' + name: 'flux' + // Non-required parameters configurationSettings: { - 'source-controller.enabled': 'true' - 'kustomize-controller.enabled': 'true' - 'notification-controller.enabled': 'false' 'image-automation-controller.enabled': 'false' 'image-reflector-controller.enabled': 'false' + 'kustomize-controller.enabled': 'true' + 'notification-controller.enabled': 'false' + 'source-controller.enabled': 'true' + } + releaseNamespace: 'flux-system' + releaseTrain: 'Stable' + version: '0.5.2' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "clusterName": { + "value": "<>-az-aks-kubenet-001" + }, + "extensionType": { + "value": "microsoft.flux" + }, + "name": { + "value": "flux" + }, + // Non-required parameters + "configurationSettings": { + "value": { + "image-automation-controller.enabled": "false", + "image-reflector-controller.enabled": "false", + "kustomize-controller.enabled": "true", + "notification-controller.enabled": "false", + "source-controller.enabled": "true" + } + }, + "releaseNamespace": { + "value": "flux-system" + }, + "releaseTrain": { + "value": "Stable" + }, + "version": { + "value": "0.5.2" } } } diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md index 76e5b93f61..709a59fa78 100644 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md @@ -67,48 +67,11 @@ For Details see [Prerequisites](https://docs.microsoft.com/en-us/azure/azure-arc ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "flux2" - }, - "scope": { - "value": "cluster" - }, - "clusterName": { - "value": "<>-az-aks-kubenet-001" - }, - "namespace": { - "value": "flux-system" - }, - "sourceKind": { - "value": "GitRepository" - }, - "gitRepository": { - "value": { - "url": "https://github.com/mspnp/aks-baseline", - "timeoutInSeconds": 180, - "syncIntervalInSeconds": 300, - "repositoryRef": { - "branch": "main" - }, - "sshKnownHosts": "" - } - } - } -} -``` - -
+

Example 1: Min

@@ -118,19 +81,21 @@ For Details see [Prerequisites](https://docs.microsoft.com/en-us/azure/azure-arc module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfigurations/deploy.bicep' = { name: '${uniqueString(deployment().name)}-fluxConfigurations' params: { - name: 'flux2' - scope: 'cluster' + // Required parameters clusterName: '<>-az-aks-kubenet-001' + name: 'flux2' namespace: 'flux-system' + scope: 'cluster' sourceKind: 'GitRepository' + // Non-required parameters gitRepository: { - url: 'https://github.com/mspnp/aks-baseline' - timeoutInSeconds: 180 - syncIntervalInSeconds: 300 repositoryRef: { branch: 'main' } sshKnownHosts: '' + syncIntervalInSeconds: 300 + timeoutInSeconds: 180 + url: 'https://github.com/mspnp/aks-baseline' } } } @@ -139,60 +104,51 @@ module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfiguration

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "flux2" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "clusterName": { + "value": "<>-az-aks-kubenet-001" + }, + "name": { + "value": "flux2" + }, + "namespace": { + "value": "flux-system" + }, + "scope": { + "value": "cluster" + }, + "sourceKind": { + "value": "GitRepository" + }, + // Non-required parameters + "gitRepository": { + "value": { + "repositoryRef": { + "branch": "main" }, - "scope": { - "value": "cluster" - }, - "clusterName": { - "value": "<>-az-aks-kubenet-001" - }, - "namespace": { - "value": "flux-system" - }, - "sourceKind": { - "value": "GitRepository" - }, - "gitRepository": { - "value": { - "url": "https://github.com/mspnp/aks-baseline", - "timeoutInSeconds": 180, - "syncIntervalInSeconds": 300, - "repositoryRef": { - "branch": "main" - }, - "sshKnownHosts": "" - } - }, - "kustomizations": { - "value": { - "unified": { - "path": "./cluster-manifests", - "dependsOn": [], - "timeoutInSeconds": 300, - "syncIntervalInSeconds": 300, - "prune": true, - "force": false - } - } - } + "sshKnownHosts": "", + "syncIntervalInSeconds": 300, + "timeoutInSeconds": 180, + "url": "https://github.com/mspnp/aks-baseline" + } } + } } ```
+

+ +

Example 2: Parameters

@@ -202,28 +158,86 @@ module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfiguration module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfigurations/deploy.bicep' = { name: '${uniqueString(deployment().name)}-fluxConfigurations' params: { - name: 'flux2' - scope: 'cluster' + // Required parameters clusterName: '<>-az-aks-kubenet-001' + name: 'flux2' namespace: 'flux-system' + scope: 'cluster' sourceKind: 'GitRepository' + // Non-required parameters gitRepository: { - url: 'https://github.com/mspnp/aks-baseline' - timeoutInSeconds: 180 - syncIntervalInSeconds: 300 repositoryRef: { branch: 'main' } sshKnownHosts: '' + syncIntervalInSeconds: 300 + timeoutInSeconds: 180 + url: 'https://github.com/mspnp/aks-baseline' } kustomizations: { unified: { - path: './cluster-manifests' dependsOn: [] - timeoutInSeconds: 300 - syncIntervalInSeconds: 300 - prune: true force: false + path: './cluster-manifests' + prune: true + syncIntervalInSeconds: 300 + timeoutInSeconds: 300 + } + } + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "clusterName": { + "value": "<>-az-aks-kubenet-001" + }, + "name": { + "value": "flux2" + }, + "namespace": { + "value": "flux-system" + }, + "scope": { + "value": "cluster" + }, + "sourceKind": { + "value": "GitRepository" + }, + // Non-required parameters + "gitRepository": { + "value": { + "repositoryRef": { + "branch": "main" + }, + "sshKnownHosts": "", + "syncIntervalInSeconds": 300, + "timeoutInSeconds": 180, + "url": "https://github.com/mspnp/aks-baseline" + } + }, + "kustomizations": { + "value": { + "unified": { + "dependsOn": [], + "force": false, + "path": "./cluster-manifests", + "prune": true, + "syncIntervalInSeconds": 300, + "timeoutInSeconds": 300 + } } } } diff --git a/modules/Microsoft.Logic/workflows/readme.md b/modules/Microsoft.Logic/workflows/readme.md index 5eb088778f..934ffee62d 100644 --- a/modules/Microsoft.Logic/workflows/readme.md +++ b/modules/Microsoft.Logic/workflows/readme.md @@ -313,94 +313,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-lga-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "tags": { - "value": {} - }, - "workflowActions": { - "value": { - "HTTP": { - "type": "Http", - "inputs": { - "method": "POST", - "uri": "https://testStringForValidation.com", - "body": { - "HostPoolName": "[HostPoolName]", - "LAWorkspaceName": "[LAWorkspaceName]", - "LimitSecondsToForceLogOffUser": "[LimitSecondsToForceLogOffUser]", - "EndPeakTime": "[EndPeakTime]", - "BeginPeakTime": "[BeginPeakTime]", - "UtcOffset": "[UtcOffset]", - "LogOffMessageBody": "[LogOffMessageBody]", - "LogOffMessageTitle": "[LogOffMessageTitle]", - "MinimumNumberOfRDSH": 1, - "SessionThresholdPerCPU": 1, - "ResourceGroupName": "[ResourceGroupName]" - } - } - } - } - }, - "workflowTriggers": { - "value": { - "Recurrence": { - "recurrence": { - "frequency": "Minute", - "interval": 15 - }, - "type": "Recurrence" - } - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "systemAssignedIdentity": { - "value": true - } - } -} -``` - -
+

Example 1: Parameters

@@ -410,29 +327,45 @@ userAssignedIdentities: { module workflows './Microsoft.Logic/workflows/deploy.bicep' = { name: '${uniqueString(deployment().name)}-workflows' params: { + // Required parameters name: '<>-az-lga-x-001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' lock: 'CanNotDelete' + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + systemAssignedIdentity: true tags: {} workflowActions: { HTTP: { - type: 'Http' inputs: { - method: 'POST' - uri: 'https://testStringForValidation.com' body: { + BeginPeakTime: '[BeginPeakTime]' + EndPeakTime: '[EndPeakTime]' HostPoolName: '[HostPoolName]' LAWorkspaceName: '[LAWorkspaceName]' LimitSecondsToForceLogOffUser: '[LimitSecondsToForceLogOffUser]' - EndPeakTime: '[EndPeakTime]' - BeginPeakTime: '[BeginPeakTime]' - UtcOffset: '[UtcOffset]' LogOffMessageBody: '[LogOffMessageBody]' LogOffMessageTitle: '[LogOffMessageTitle]' MinimumNumberOfRDSH: 1 - SessionThresholdPerCPU: 1 ResourceGroupName: '[ResourceGroupName]' + SessionThresholdPerCPU: 1 + UtcOffset: '[UtcOffset]' } + method: 'POST' + uri: 'https://testStringForValidation.com' } + type: 'Http' } } workflowTriggers: { @@ -444,20 +377,96 @@ module workflows './Microsoft.Logic/workflows/deploy.bicep' = { type: 'Recurrence' } } - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-lga-x-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "systemAssignedIdentity": { + "value": true + }, + "tags": { + "value": {} + }, + "workflowActions": { + "value": { + "HTTP": { + "inputs": { + "body": { + "BeginPeakTime": "[BeginPeakTime]", + "EndPeakTime": "[EndPeakTime]", + "HostPoolName": "[HostPoolName]", + "LAWorkspaceName": "[LAWorkspaceName]", + "LimitSecondsToForceLogOffUser": "[LimitSecondsToForceLogOffUser]", + "LogOffMessageBody": "[LogOffMessageBody]", + "LogOffMessageTitle": "[LogOffMessageTitle]", + "MinimumNumberOfRDSH": 1, + "ResourceGroupName": "[ResourceGroupName]", + "SessionThresholdPerCPU": 1, + "UtcOffset": "[UtcOffset]" + }, + "method": "POST", + "uri": "https://testStringForValidation.com" + }, + "type": "Http" + } } - ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' - systemAssignedIdentity: true + }, + "workflowTriggers": { + "value": { + "Recurrence": { + "recurrence": { + "frequency": "Minute", + "interval": 15 + }, + "type": "Recurrence" + } + } + } } } ``` diff --git a/modules/Microsoft.MachineLearningServices/workspaces/readme.md b/modules/Microsoft.MachineLearningServices/workspaces/readme.md index 1b85a98404..e635a71ac4 100644 --- a/modules/Microsoft.MachineLearningServices/workspaces/readme.md +++ b/modules/Microsoft.MachineLearningServices/workspaces/readme.md @@ -398,65 +398,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-mls-encr-001" - }, - "sku": { - "value": "Basic" - }, - "associatedStorageAccountResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "associatedKeyVaultResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "associatedApplicationInsightsResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001" - }, - "cMKUserAssignedIdentityResourceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" - }, - "cMKKeyName": { - "value": "keyEncryptionKey" - }, - "cMKKeyVaultResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" - }, - "systemAssignedIdentity": { - "value": false // Must be false if `primaryUserAssignedIdentity` is provided - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "primaryUserAssignedIdentity": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "amlworkspace" - } - ] - } - } -} -``` - -
+

Example 1: Encr

@@ -466,25 +412,27 @@ userAssignedIdentities: { module workspaces './Microsoft.MachineLearningServices/workspaces/deploy.bicep' = { name: '${uniqueString(deployment().name)}-workspaces' params: { + // Required parameters + associatedApplicationInsightsResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001' + associatedKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' + associatedStorageAccountResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' name: '<>-az-mls-encr-001' sku: 'Basic' - associatedStorageAccountResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - associatedKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' - associatedApplicationInsightsResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001' - cMKUserAssignedIdentityResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' + // Non-required parameters cMKKeyName: 'keyEncryptionKey' cMKKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002' - systemAssignedIdentity: false - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } + cMKUserAssignedIdentityResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' primaryUserAssignedIdentity: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' privateEndpoints: [ { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' service: 'amlworkspace' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' } ] + systemAssignedIdentity: false + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } } } ``` @@ -492,40 +440,68 @@ module workspaces './Microsoft.MachineLearningServices/workspaces/deploy.bicep'

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-mls-min-001" - }, - "sku": { - "value": "Basic" - }, - "associatedStorageAccountResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "associatedKeyVaultResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "associatedApplicationInsightsResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001" - }, - "systemAssignedIdentity": { - "value": true + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "associatedApplicationInsightsResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001" + }, + "associatedKeyVaultResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "associatedStorageAccountResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "name": { + "value": "<>-az-mls-encr-001" + }, + "sku": { + "value": "Basic" + }, + // Non-required parameters + "cMKKeyName": { + "value": "keyEncryptionKey" + }, + "cMKKeyVaultResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" + }, + "cMKUserAssignedIdentityResourceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" + }, + "primaryUserAssignedIdentity": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" + }, + "privateEndpoints": { + "value": [ + { + "service": "amlworkspace", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" } + ] + }, + "systemAssignedIdentity": { + "value": false + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } } + } } ```
+

+ +

Example 2: Min

@@ -535,11 +511,13 @@ module workspaces './Microsoft.MachineLearningServices/workspaces/deploy.bicep' module workspaces './Microsoft.MachineLearningServices/workspaces/deploy.bicep' = { name: '${uniqueString(deployment().name)}-workspaces' params: { + // Required parameters + associatedApplicationInsightsResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001' + associatedKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' + associatedStorageAccountResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' name: '<>-az-mls-min-001' sku: 'Basic' - associatedStorageAccountResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - associatedKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' - associatedApplicationInsightsResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001' + // Non-required parameters systemAssignedIdentity: true } } @@ -548,126 +526,43 @@ module workspaces './Microsoft.MachineLearningServices/workspaces/deploy.bicep'

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-mls-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "sku": { - "value": "Basic" - }, - "associatedStorageAccountResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "associatedKeyVaultResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "associatedApplicationInsightsResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001" - }, - "systemAssignedIdentity": { - "value": false // Must be false if `primaryUserAssignedIdentity` is provided - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "description": { - "value": "The cake is a lie." - }, - "discoveryUrl": { - "value": "http://example.com" - }, - "imageBuildCompute": { - "value": "testcompute" - }, - "publicNetworkAccess": { - "value": "Enabled" - }, - "primaryUserAssignedIdentity": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" - }, - "computes": { - "value": [ - { - "name": "DefaultCPU", - "location": "westeurope", - "computeLocation": "westeurope", - "sku": "Basic", - "systemAssignedIdentity": false, - "userAssignedIdentities": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - }, - "description": "Default CPU Cluster", - "disableLocalAuth": false, - "computeType": "AmlCompute", - "properties": { - "enableNodePublicIp": true, - "isolatedNetwork": false, - "osType": "Linux", - "remoteLoginPortPublicAccess": "Disabled", - "scaleSettings": { - "maxNodeCount": 3, - "minNodeCount": 0, - "nodeIdleTimeBeforeScaleDown": "PT5M" - }, - "vmPriority": "Dedicated", - "vmSize": "STANDARD_DS11_V2" - } - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "amlworkspace" - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "associatedApplicationInsightsResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001" + }, + "associatedKeyVaultResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "associatedStorageAccountResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "name": { + "value": "<>-az-mls-min-001" + }, + "sku": { + "value": "Basic" + }, + // Non-required parameters + "systemAssignedIdentity": { + "value": true } + } } ```
+

+ +

Example 3: Parameters

@@ -677,34 +572,21 @@ module workspaces './Microsoft.MachineLearningServices/workspaces/deploy.bicep' module workspaces './Microsoft.MachineLearningServices/workspaces/deploy.bicep' = { name: '${uniqueString(deployment().name)}-workspaces' params: { + // Required parameters + associatedApplicationInsightsResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001' + associatedKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' + associatedStorageAccountResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' name: '<>-az-mls-x-001' - lock: 'CanNotDelete' sku: 'Basic' - associatedStorageAccountResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - associatedKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' - associatedApplicationInsightsResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001' - systemAssignedIdentity: false - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } - description: 'The cake is a lie.' - discoveryUrl: 'http://example.com' - imageBuildCompute: 'testcompute' - publicNetworkAccess: 'Enabled' - primaryUserAssignedIdentity: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' + // Non-required parameters computes: [ { - name: 'DefaultCPU' - location: 'westeurope' computeLocation: 'westeurope' - sku: 'Basic' - systemAssignedIdentity: false - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } + computeType: 'AmlCompute' description: 'Default CPU Cluster' disableLocalAuth: false - computeType: 'AmlCompute' + location: 'westeurope' + name: 'DefaultCPU' properties: { enableNodePublicIp: true isolatedNetwork: false @@ -718,27 +600,164 @@ module workspaces './Microsoft.MachineLearningServices/workspaces/deploy.bicep' vmPriority: 'Dedicated' vmSize: 'STANDARD_DS11_V2' } + sku: 'Basic' + systemAssignedIdentity: false + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } } ] - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] + description: 'The cake is a lie.' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' diagnosticLogsRetentionInDays: 7 diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + discoveryUrl: 'http://example.com' + imageBuildCompute: 'testcompute' + lock: 'CanNotDelete' + primaryUserAssignedIdentity: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' privateEndpoints: [ { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' service: 'amlworkspace' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' } ] + publicNetworkAccess: 'Enabled' + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + systemAssignedIdentity: false + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "associatedApplicationInsightsResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001" + }, + "associatedKeyVaultResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "associatedStorageAccountResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "name": { + "value": "<>-az-mls-x-001" + }, + "sku": { + "value": "Basic" + }, + // Non-required parameters + "computes": { + "value": [ + { + "computeLocation": "westeurope", + "computeType": "AmlCompute", + "description": "Default CPU Cluster", + "disableLocalAuth": false, + "location": "westeurope", + "name": "DefaultCPU", + "properties": { + "enableNodePublicIp": true, + "isolatedNetwork": false, + "osType": "Linux", + "remoteLoginPortPublicAccess": "Disabled", + "scaleSettings": { + "maxNodeCount": 3, + "minNodeCount": 0, + "nodeIdleTimeBeforeScaleDown": "PT5M" + }, + "vmPriority": "Dedicated", + "vmSize": "STANDARD_DS11_V2" + }, + "sku": "Basic", + "systemAssignedIdentity": false, + "userAssignedIdentities": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + } + ] + }, + "description": { + "value": "The cake is a lie." + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "discoveryUrl": { + "value": "http://example.com" + }, + "imageBuildCompute": { + "value": "testcompute" + }, + "lock": { + "value": "CanNotDelete" + }, + "primaryUserAssignedIdentity": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" + }, + "privateEndpoints": { + "value": [ + { + "service": "amlworkspace", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "publicNetworkAccess": { + "value": "Enabled" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "systemAssignedIdentity": { + "value": false + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + } } } ``` diff --git a/modules/Microsoft.ManagedIdentity/userAssignedIdentities/readme.md b/modules/Microsoft.ManagedIdentity/userAssignedIdentities/readme.md index 3331846f2e..1cbc5e0cdb 100644 --- a/modules/Microsoft.ManagedIdentity/userAssignedIdentities/readme.md +++ b/modules/Microsoft.ManagedIdentity/userAssignedIdentities/readme.md @@ -142,38 +142,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-msi-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -183,14 +156,14 @@ tags: { module userAssignedIdentities './Microsoft.ManagedIdentity/userAssignedIdentities/deploy.bicep' = { name: '${uniqueString(deployment().name)}-userAssignedIdentities' params: { - name: '<>-az-msi-x-001' lock: 'CanNotDelete' + name: '<>-az-msi-x-001' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -199,3 +172,35 @@ module userAssignedIdentities './Microsoft.ManagedIdentity/userAssignedIdentitie

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "lock": { + "value": "CanNotDelete" + }, + "name": { + "value": "<>-az-msi-x-001" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.ManagedServices/registrationDefinitions/readme.md b/modules/Microsoft.ManagedServices/registrationDefinitions/readme.md index 7b3c262e66..8dc3356fa0 100644 --- a/modules/Microsoft.ManagedServices/registrationDefinitions/readme.md +++ b/modules/Microsoft.ManagedServices/registrationDefinitions/readme.md @@ -165,50 +165,11 @@ There are a couple of limitations that you should be aware of with Lighthouse: ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "Component Validation - Subscription assignment" - }, - "registrationDescription": { - "value": "Managed by Lighthouse" - }, - "managedByTenantId": { - "value": "195ee85d-2f10-4764-8352-a3c99aa772fb" - }, - "authorizations": { - "value": [ - { - "principalId": "e87a249c-b53b-4685-94fe-863af522e4ee", - "principalIdDisplayName": "ResourceModules-Reader", - "roleDefinitionId": "acdd72a7-3385-48ef-bd42-f606fba81ae7" - }, - { - "principalId": "e2f126a7-136e-443f-b39f-f73ddfd146b1", - "principalIdDisplayName": "ResourceModules-Contributor", - "roleDefinitionId": "b24988ac-6180-42a0-ab88-20f7382dd24c" - }, - { - "principalId": "87813317-fb25-4c76-91fe-783af429d109", - "principalIdDisplayName": "ResourceModules-LHManagement", - "roleDefinitionId": "91c1777a-f3dc-4fae-b103-61d183457e46" - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -218,9 +179,7 @@ There are a couple of limitations that you should be aware of with Lighthouse: module registrationDefinitions './Microsoft.ManagedServices/registrationDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-registrationDefinitions' params: { - name: 'Component Validation - Subscription assignment' - registrationDescription: 'Managed by Lighthouse' - managedByTenantId: '195ee85d-2f10-4764-8352-a3c99aa772fb' + // Required parameters authorizations: [ { principalId: 'e87a249c-b53b-4685-94fe-863af522e4ee' @@ -238,6 +197,9 @@ module registrationDefinitions './Microsoft.ManagedServices/registrationDefiniti roleDefinitionId: '91c1777a-f3dc-4fae-b103-61d183457e46' } ] + managedByTenantId: '195ee85d-2f10-4764-8352-a3c99aa772fb' + name: 'Component Validation - Subscription assignment' + registrationDescription: 'Managed by Lighthouse' } } ``` @@ -245,53 +207,52 @@ module registrationDefinitions './Microsoft.ManagedServices/registrationDefiniti

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "Component Validation - Resource group assignment" - }, - "registrationDescription": { - "value": "Managed by Lighthouse" - }, - "managedByTenantId": { - "value": "195ee85d-2f10-4764-8352-a3c99aa772fb" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "authorizations": { + "value": [ + { + "principalId": "e87a249c-b53b-4685-94fe-863af522e4ee", + "principalIdDisplayName": "ResourceModules-Reader", + "roleDefinitionId": "acdd72a7-3385-48ef-bd42-f606fba81ae7" }, - "resourceGroupName": { - "value": "validation-rg" + { + "principalId": "e2f126a7-136e-443f-b39f-f73ddfd146b1", + "principalIdDisplayName": "ResourceModules-Contributor", + "roleDefinitionId": "b24988ac-6180-42a0-ab88-20f7382dd24c" }, - "authorizations": { - "value": [ - { - "principalId": "e87a249c-b53b-4685-94fe-863af522e4ee", - "principalIdDisplayName": "ResourceModules-Reader", - "roleDefinitionId": "acdd72a7-3385-48ef-bd42-f606fba81ae7" - }, - { - "principalId": "e2f126a7-136e-443f-b39f-f73ddfd146b1", - "principalIdDisplayName": "ResourceModules-Contributor", - "roleDefinitionId": "b24988ac-6180-42a0-ab88-20f7382dd24c" - }, - { - "principalId": "87813317-fb25-4c76-91fe-783af429d109", - "principalIdDisplayName": "ResourceModules-LHManagement", - "roleDefinitionId": "91c1777a-f3dc-4fae-b103-61d183457e46" - } - ] + { + "principalId": "87813317-fb25-4c76-91fe-783af429d109", + "principalIdDisplayName": "ResourceModules-LHManagement", + "roleDefinitionId": "91c1777a-f3dc-4fae-b103-61d183457e46" } + ] + }, + "managedByTenantId": { + "value": "195ee85d-2f10-4764-8352-a3c99aa772fb" + }, + "name": { + "value": "Component Validation - Subscription assignment" + }, + "registrationDescription": { + "value": "Managed by Lighthouse" } + } } ```
+

+ +

Example 2: Rg

@@ -301,10 +262,7 @@ module registrationDefinitions './Microsoft.ManagedServices/registrationDefiniti module registrationDefinitions './Microsoft.ManagedServices/registrationDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-registrationDefinitions' params: { - name: 'Component Validation - Resource group assignment' - registrationDescription: 'Managed by Lighthouse' - managedByTenantId: '195ee85d-2f10-4764-8352-a3c99aa772fb' - resourceGroupName: 'validation-rg' + // Required parameters authorizations: [ { principalId: 'e87a249c-b53b-4685-94fe-863af522e4ee' @@ -322,6 +280,60 @@ module registrationDefinitions './Microsoft.ManagedServices/registrationDefiniti roleDefinitionId: '91c1777a-f3dc-4fae-b103-61d183457e46' } ] + managedByTenantId: '195ee85d-2f10-4764-8352-a3c99aa772fb' + name: 'Component Validation - Resource group assignment' + registrationDescription: 'Managed by Lighthouse' + // Non-required parameters + resourceGroupName: 'validation-rg' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "authorizations": { + "value": [ + { + "principalId": "e87a249c-b53b-4685-94fe-863af522e4ee", + "principalIdDisplayName": "ResourceModules-Reader", + "roleDefinitionId": "acdd72a7-3385-48ef-bd42-f606fba81ae7" + }, + { + "principalId": "e2f126a7-136e-443f-b39f-f73ddfd146b1", + "principalIdDisplayName": "ResourceModules-Contributor", + "roleDefinitionId": "b24988ac-6180-42a0-ab88-20f7382dd24c" + }, + { + "principalId": "87813317-fb25-4c76-91fe-783af429d109", + "principalIdDisplayName": "ResourceModules-LHManagement", + "roleDefinitionId": "91c1777a-f3dc-4fae-b103-61d183457e46" + } + ] + }, + "managedByTenantId": { + "value": "195ee85d-2f10-4764-8352-a3c99aa772fb" + }, + "name": { + "value": "Component Validation - Resource group assignment" + }, + "registrationDescription": { + "value": "Managed by Lighthouse" + }, + // Non-required parameters + "resourceGroupName": { + "value": "validation-rg" + } } } ``` diff --git a/modules/Microsoft.Management/managementGroups/readme.md b/modules/Microsoft.Management/managementGroups/readme.md index 8af733d99c..de679c08a6 100644 --- a/modules/Microsoft.Management/managementGroups/readme.md +++ b/modules/Microsoft.Management/managementGroups/readme.md @@ -123,31 +123,11 @@ New-AzRoleAssignment -ObjectId $PrincipalID -Scope "/providers/Microsoft.Managem ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "testMG" - }, - "displayName": { - "value": "Test MG" - }, - "parentId": { - "value": "<>" - } - } -} -``` - -
+

Example 1: Parameters

@@ -157,7 +137,9 @@ New-AzRoleAssignment -ObjectId $PrincipalID -Scope "/providers/Microsoft.Managem module managementGroups './Microsoft.Management/managementGroups/deploy.bicep' = { name: '${uniqueString(deployment().name)}-managementGroups' params: { + // Required parameters name: 'testMG' + // Non-required parameters displayName: 'Test MG' parentId: '<>' } @@ -166,3 +148,30 @@ module managementGroups './Microsoft.Management/managementGroups/deploy.bicep' =

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "testMG" + }, + // Non-required parameters + "displayName": { + "value": "Test MG" + }, + "parentId": { + "value": "<>" + } + } +} +``` + +
+

diff --git a/modules/Microsoft.NetApp/netAppAccounts/readme.md b/modules/Microsoft.NetApp/netAppAccounts/readme.md index 63d2cd3b74..6300c1527c 100644 --- a/modules/Microsoft.NetApp/netAppAccounts/readme.md +++ b/modules/Microsoft.NetApp/netAppAccounts/readme.md @@ -154,25 +154,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-anf-min-001" - } - } -} -``` - -
+

Example 1: Min

@@ -190,115 +176,26 @@ module netAppAccounts './Microsoft.NetApp/netAppAccounts/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-anf-nfs3-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "capacityPools": { - "value": [ - { - "name": "<>-az-anfcp-x-001", - "serviceLevel": "Premium", - "size": 4398046511104, - "volumes": [ - { - "name": "anf3-vol01-nfsv3", - "usageThreshold": 107374182400, - "protocolTypes": [ - "NFSv3" - ], - "exportPolicyRules": [ - { - "ruleIndex": 1, - "unixReadOnly": false, - "unixReadWrite": true, - "nfsv3": true, - "nfsv41": false, - "allowedClients": "0.0.0.0/0" - } - ], - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004", - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - { - "name": "anf3-vol02-nfsv3", - "usageThreshold": 107374182400, - "protocolTypes": [ - "NFSv3" - ], - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004" - } - ], - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - { - "name": "<>-az-anfcp-x-002", - "serviceLevel": "Premium", - "size": 4398046511104, - "volumes": [], - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "tags": { - "value": { - "Environment": "Non-Prod", - "Contact": "test.user@testcompany.com", - "PurchaseOrder": "1234", - "CostCenter": "7890", - "ServiceName": "DeploymentValidation", - "Role": "DeploymentValidation" - } - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>-az-anf-min-001" } + } } ```
+

+ +

Example 2: Nfs3

@@ -308,88 +205,90 @@ module netAppAccounts './Microsoft.NetApp/netAppAccounts/deploy.bicep' = { module netAppAccounts './Microsoft.NetApp/netAppAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-netAppAccounts' params: { + // Required parameters name: '<>-az-anf-nfs3-001' - lock: 'CanNotDelete' + // Non-required parameters capacityPools: [ { name: '<>-az-anfcp-x-001' + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] serviceLevel: 'Premium' size: 4398046511104 volumes: [ { - name: 'anf3-vol01-nfsv3' - usageThreshold: 107374182400 - protocolTypes: [ - 'NFSv3' - ] exportPolicyRules: [ { + allowedClients: '0.0.0.0/0' + nfsv3: true + nfsv41: false ruleIndex: 1 unixReadOnly: false unixReadWrite: true - nfsv3: true - nfsv41: false - allowedClients: '0.0.0.0/0' } ] - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004' + name: 'anf3-vol01-nfsv3' + protocolTypes: [ + 'NFSv3' + ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004' + usageThreshold: 107374182400 } { name: 'anf3-vol02-nfsv3' - usageThreshold: 107374182400 protocolTypes: [ 'NFSv3' ] subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004' - } - ] - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] + usageThreshold: 107374182400 } ] } { name: '<>-az-anfcp-x-002' - serviceLevel: 'Premium' - size: 4398046511104 - volumes: [] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + serviceLevel: 'Premium' + size: 4398046511104 + volumes: [] } ] + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] tags: { - Environment: 'Non-Prod' Contact: 'test.user@testcompany.com' - PurchaseOrder: '1234' CostCenter: '7890' - ServiceName: 'DeploymentValidation' + Environment: 'Non-Prod' + PurchaseOrder: '1234' Role: 'DeploymentValidation' + ServiceName: 'DeploymentValidation' } } } @@ -398,122 +297,118 @@ module netAppAccounts './Microsoft.NetApp/netAppAccounts/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-anf-nfs41-001" - }, - "capacityPools": { - "value": [ - { - "name": "<>-az-anfcp-x-001", - "serviceLevel": "Premium", - "size": 4398046511104, - "volumes": [ - { - "name": "anf4-vol01-nfsv41", - "usageThreshold": 107374182400, - "protocolTypes": [ - "NFSv4.1" - ], - "exportPolicyRules": [ - { - "ruleIndex": 1, - "unixReadOnly": false, - "unixReadWrite": true, - "nfsv3": false, - "nfsv41": true, - "allowedClients": "0.0.0.0/0" - } - ], - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004", - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - { - "name": "anf4-vol02-nfsv41", - "usageThreshold": 107374182400, - "protocolTypes": [ - "NFSv4.1" - ], - "exportPolicyRules": [ - { - "ruleIndex": 1, - "unixReadOnly": false, - "unixReadWrite": true, - "nfsv3": false, - "nfsv41": true, - "allowedClients": "0.0.0.0/0" - } - ], - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004" - } - ], - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-anf-nfs3-001" + }, + // Non-required parameters + "capacityPools": { + "value": [ + { + "name": "<>-az-anfcp-x-001", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "serviceLevel": "Premium", + "size": 4398046511104, + "volumes": [ + { + "exportPolicyRules": [ { - "name": "<>-az-anfcp-x-002", - "serviceLevel": "Premium", - "size": 4398046511104, - "volumes": [], - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] + "allowedClients": "0.0.0.0/0", + "nfsv3": true, + "nfsv41": false, + "ruleIndex": 1, + "unixReadOnly": false, + "unixReadWrite": true } - ] - }, - "roleAssignments": { - "value": [ + ], + "name": "anf3-vol01-nfsv3", + "protocolTypes": [ + "NFSv3" + ], + "roleAssignments": [ { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } - ] + ], + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004", + "usageThreshold": 107374182400 + }, + { + "name": "anf3-vol02-nfsv3", + "protocolTypes": [ + "NFSv3" + ], + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004", + "usageThreshold": 107374182400 + } + ] }, - "tags": { - "value": { - "Environment": "Non-Prod", - "Contact": "test.user@testcompany.com", - "PurchaseOrder": "1234", - "CostCenter": "7890", - "ServiceName": "DeploymentValidation", - "Role": "DeploymentValidation" + { + "name": "<>-az-anfcp-x-002", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ], + "serviceLevel": "Premium", + "size": 4398046511104, + "volumes": [] } + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "tags": { + "value": { + "Contact": "test.user@testcompany.com", + "CostCenter": "7890", + "Environment": "Non-Prod", + "PurchaseOrder": "1234", + "Role": "DeploymentValidation", + "ServiceName": "DeploymentValidation" + } } + } } ```
+

+ +

Example 3: Nfs41

@@ -523,97 +418,217 @@ module netAppAccounts './Microsoft.NetApp/netAppAccounts/deploy.bicep' = { module netAppAccounts './Microsoft.NetApp/netAppAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-netAppAccounts' params: { + // Required parameters name: '<>-az-anf-nfs41-001' + // Non-required parameters capacityPools: [ { name: '<>-az-anfcp-x-001' + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] serviceLevel: 'Premium' size: 4398046511104 volumes: [ { - name: 'anf4-vol01-nfsv41' - usageThreshold: 107374182400 - protocolTypes: [ - 'NFSv4.1' - ] exportPolicyRules: [ { + allowedClients: '0.0.0.0/0' + nfsv3: false + nfsv41: true ruleIndex: 1 unixReadOnly: false unixReadWrite: true - nfsv3: false - nfsv41: true - allowedClients: '0.0.0.0/0' } ] - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004' + name: 'anf4-vol01-nfsv41' + protocolTypes: [ + 'NFSv4.1' + ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004' + usageThreshold: 107374182400 } { - name: 'anf4-vol02-nfsv41' - usageThreshold: 107374182400 - protocolTypes: [ - 'NFSv4.1' - ] exportPolicyRules: [ { + allowedClients: '0.0.0.0/0' + nfsv3: false + nfsv41: true ruleIndex: 1 unixReadOnly: false unixReadWrite: true - nfsv3: false - nfsv41: true - allowedClients: '0.0.0.0/0' } ] - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004' - } - ] - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' + name: 'anf4-vol02-nfsv41' + protocolTypes: [ + 'NFSv4.1' ] + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004' + usageThreshold: 107374182400 } ] } { name: '<>-az-anfcp-x-002' - serviceLevel: 'Premium' - size: 4398046511104 - volumes: [] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + serviceLevel: 'Premium' + size: 4398046511104 + volumes: [] } ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] tags: { - Environment: 'Non-Prod' Contact: 'test.user@testcompany.com' - PurchaseOrder: '1234' CostCenter: '7890' - ServiceName: 'DeploymentValidation' + Environment: 'Non-Prod' + PurchaseOrder: '1234' Role: 'DeploymentValidation' + ServiceName: 'DeploymentValidation' + } + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-anf-nfs41-001" + }, + // Non-required parameters + "capacityPools": { + "value": [ + { + "name": "<>-az-anfcp-x-001", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "serviceLevel": "Premium", + "size": 4398046511104, + "volumes": [ + { + "exportPolicyRules": [ + { + "allowedClients": "0.0.0.0/0", + "nfsv3": false, + "nfsv41": true, + "ruleIndex": 1, + "unixReadOnly": false, + "unixReadWrite": true + } + ], + "name": "anf4-vol01-nfsv41", + "protocolTypes": [ + "NFSv4.1" + ], + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004", + "usageThreshold": 107374182400 + }, + { + "exportPolicyRules": [ + { + "allowedClients": "0.0.0.0/0", + "nfsv3": false, + "nfsv41": true, + "ruleIndex": 1, + "unixReadOnly": false, + "unixReadWrite": true + } + ], + "name": "anf4-vol02-nfsv41", + "protocolTypes": [ + "NFSv4.1" + ], + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-004", + "usageThreshold": 107374182400 + } + ] + }, + { + "name": "<>-az-anfcp-x-002", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "serviceLevel": "Premium", + "size": 4398046511104, + "volumes": [] + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "tags": { + "value": { + "Contact": "test.user@testcompany.com", + "CostCenter": "7890", + "Environment": "Non-Prod", + "PurchaseOrder": "1234", + "Role": "DeploymentValidation", + "ServiceName": "DeploymentValidation" + } } } } diff --git a/modules/Microsoft.Network/applicationGateways/readme.md b/modules/Microsoft.Network/applicationGateways/readme.md index 9bc35c2f10..16ee9a95ef 100644 --- a/modules/Microsoft.Network/applicationGateways/readme.md +++ b/modules/Microsoft.Network/applicationGateways/readme.md @@ -222,383 +222,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-apgw-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "webApplicationFirewallConfiguration": { - "value": { - "enabled": true, - "firewallMode": "Detection", - "ruleSetType": "OWASP", - "ruleSetVersion": "3.0", - "disabledRuleGroups": [], - "requestBodyCheck": true, - "maxRequestBodySizeInKb": 128, - "fileUploadLimitInMb": 100 - } - }, - "enableHttp2": { - "value": true - }, - "backendAddressPools": { - "value": [ - { - "name": "appServiceBackendPool", - "properties": { - "backendAddresses": [ - { - "fqdn": "aghapp.azurewebsites.net" - } - ] - } - }, - { - "name": "privateVmBackendPool", - "properties": { - "backendAddresses": [ - { - "ipAddress": "10.0.0.4" - } - ] - } - } - ] - }, - "backendHttpSettingsCollection": { - "value": [ - { - "name": "appServiceBackendHttpsSetting", - "properties": { - "port": 443, - "protocol": "Https", - "cookieBasedAffinity": "Disabled", - "pickHostNameFromBackendAddress": true, - "requestTimeout": 30 - } - }, - { - "name": "privateVmHttpSetting", - "properties": { - "port": 80, - "protocol": "Http", - "cookieBasedAffinity": "Disabled", - "pickHostNameFromBackendAddress": false, - "requestTimeout": 30, - "probe": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/probes/privateVmHttpSettingProbe" - } - } - } - ] - }, - "frontendIPConfigurations": { - "value": [ - { - "name": "private", - "properties": { - "privateIPAddress": "10.0.8.6", - "privateIPAllocationMethod": "Static", - "subnet": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-007" - } - } - }, - { - "name": "public", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-x-apgw" - } - } - } - ] - }, - "frontendPorts": { - "value": [ - { - "name": "port443", - "properties": { - "port": 443 - } - }, - { - "name": "port4433", - "properties": { - "port": 4433 - } - }, - { - "name": "port80", - "properties": { - "port": 80 - } - }, - { - "name": "port8080", - "properties": { - "port": 8080 - } - } - ] - }, - "httpListeners": { - "value": [ - { - "name": "public443", - "properties": { - "frontendIPConfiguration": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendIPConfigurations/public" - }, - "frontendPort": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendPorts/port443" - }, - "sslCertificate": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/sslCertificates/<>-az-apgw-x-001-ssl-certificate" - }, - "protocol": "https", - "hostNames": [], - "requireServerNameIndication": false - } - }, - { - "name": "private4433", - "properties": { - "frontendIPConfiguration": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendIPConfigurations/private" - }, - "frontendPort": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendPorts/port4433" - }, - "sslCertificate": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/sslCertificates/<>-az-apgw-x-001-ssl-certificate" - }, - "protocol": "https", - "hostNames": [], - "requireServerNameIndication": false - } - }, - { - "name": "httpRedirect80", - "properties": { - "frontendIPConfiguration": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendIPConfigurations/public" - }, - "frontendPort": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendPorts/port80" - }, - "protocol": "Http", - "hostNames": [], - "requireServerNameIndication": false - } - }, - { - "name": "httpRedirect8080", - "properties": { - "frontendIPConfiguration": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendIPConfigurations/private" - }, - "frontendPort": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendPorts/port8080" - }, - "protocol": "Http", - "hostNames": [], - "requireServerNameIndication": false - } - } - ] - }, - "gatewayIPConfigurations": { - "value": [ - { - "name": "apw-ip-configuration", - "properties": { - "subnet": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-007" - } - } - } - ] - }, - "probes": { - "value": [ - { - "name": "privateVmHttpSettingProbe", - "properties": { - "protocol": "Http", - "host": "10.0.0.4", - "path": "/", - "interval": 60, - "timeout": 15, - "unhealthyThreshold": 5, - "pickHostNameFromBackendHttpSettings": false, - "minServers": 3, - "match": { - "statusCodes": [ - "200", - "401" - ] - } - } - } - ] - }, - "redirectConfigurations": { - "value": [ - { - "name": "httpRedirect80", - "properties": { - "redirectType": "Permanent", - "targetListener": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/public443" - }, - "includePath": true, - "includeQueryString": true, - "requestRoutingRules": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/requestRoutingRules/httpRedirect80-public443" - } - ] - } - }, - { - "name": "httpRedirect8080", - "properties": { - "redirectType": "Permanent", - "targetListener": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/private4433" - }, - "includePath": true, - "includeQueryString": true, - "requestRoutingRules": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/requestRoutingRules/httpRedirect8080-private4433" - } - ] - } - } - ] - }, - "requestRoutingRules": { - "value": [ - { - "name": "public443-appServiceBackendHttpsSetting-appServiceBackendHttpsSetting", - "properties": { - "ruleType": "Basic", - "httpListener": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/public443" - }, - "backendAddressPool": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/backendAddressPools/appServiceBackendPool" - }, - "backendHttpSettings": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/backendHttpSettingsCollection/appServiceBackendHttpsSetting" - } - } - }, - { - "name": "private4433-privateVmHttpSetting-privateVmHttpSetting", - "properties": { - "ruleType": "Basic", - "httpListener": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/private4433" - }, - "backendAddressPool": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/backendAddressPools/privateVmBackendPool" - }, - "backendHttpSettings": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/backendHttpSettingsCollection/privateVmHttpSetting" - } - } - }, - { - "name": "httpRedirect80-public443", - "properties": { - "ruleType": "Basic", - "httpListener": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/httpRedirect80" - }, - "redirectConfiguration": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/redirectConfigurations/httpRedirect80" - } - } - }, - { - "name": "httpRedirect8080-private4433", - "properties": { - "ruleType": "Basic", - "httpListener": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/httpRedirect8080" - }, - "redirectConfiguration": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/redirectConfigurations/httpRedirect8080" - } - } - } - ] - }, - "sku": { - "value": "WAF_v2" - }, - "sslCertificates": { - "value": [ - { - "name": "<>-az-apgw-x-001-ssl-certificate", - "properties": { - "keyVaultSecretId": "https://adp-<>-az-kv-x-001.vault.azure.net/secrets/applicationGatewaySslCertificate" - } - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -608,22 +236,9 @@ userAssignedIdentities: { module applicationGateways './Microsoft.Network/applicationGateways/deploy.bicep' = { name: '${uniqueString(deployment().name)}-applicationGateways' params: { + // Required parameters name: '<>-az-apgw-x-001' - lock: 'CanNotDelete' - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } - webApplicationFirewallConfiguration: { - enabled: true - firewallMode: 'Detection' - ruleSetType: 'OWASP' - ruleSetVersion: '3.0' - disabledRuleGroups: [] - requestBodyCheck: true - maxRequestBodySizeInKb: 128 - fileUploadLimitInMb: 100 - } - enableHttp2: true + // Non-required parameters backendAddressPools: [ { name: 'appServiceBackendPool' @@ -650,27 +265,33 @@ module applicationGateways './Microsoft.Network/applicationGateways/deploy.bicep { name: 'appServiceBackendHttpsSetting' properties: { - port: 443 - protocol: 'Https' cookieBasedAffinity: 'Disabled' pickHostNameFromBackendAddress: true + port: 443 + protocol: 'Https' requestTimeout: 30 } } { name: 'privateVmHttpSetting' properties: { - port: 80 - protocol: 'Http' cookieBasedAffinity: 'Disabled' pickHostNameFromBackendAddress: false - requestTimeout: 30 + port: 80 probe: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/probes/privateVmHttpSettingProbe' } + protocol: 'Http' + requestTimeout: 30 } } ] + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + enableHttp2: true frontendIPConfigurations: [ { name: 'private' @@ -718,6 +339,16 @@ module applicationGateways './Microsoft.Network/applicationGateways/deploy.bicep } } ] + gatewayIPConfigurations: [ + { + name: 'apw-ip-configuration' + properties: { + subnet: { + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-007' + } + } + } + ] httpListeners: [ { name: 'public443' @@ -728,12 +359,12 @@ module applicationGateways './Microsoft.Network/applicationGateways/deploy.bicep frontendPort: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendPorts/port443' } + hostNames: [] + protocol: 'https' + requireServerNameIndication: false sslCertificate: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/sslCertificates/<>-az-apgw-x-001-ssl-certificate' } - protocol: 'https' - hostNames: [] - requireServerNameIndication: false } } { @@ -745,12 +376,12 @@ module applicationGateways './Microsoft.Network/applicationGateways/deploy.bicep frontendPort: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendPorts/port4433' } + hostNames: [] + protocol: 'https' + requireServerNameIndication: false sslCertificate: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/sslCertificates/<>-az-apgw-x-001-ssl-certificate' } - protocol: 'https' - hostNames: [] - requireServerNameIndication: false } } { @@ -762,8 +393,8 @@ module applicationGateways './Microsoft.Network/applicationGateways/deploy.bicep frontendPort: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendPorts/port80' } - protocol: 'Http' hostNames: [] + protocol: 'Http' requireServerNameIndication: false } } @@ -776,40 +407,31 @@ module applicationGateways './Microsoft.Network/applicationGateways/deploy.bicep frontendPort: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendPorts/port8080' } - protocol: 'Http' hostNames: [] + protocol: 'Http' requireServerNameIndication: false } } ] - gatewayIPConfigurations: [ - { - name: 'apw-ip-configuration' - properties: { - subnet: { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-007' - } - } - } - ] + lock: 'CanNotDelete' probes: [ { name: 'privateVmHttpSettingProbe' properties: { - protocol: 'Http' host: '10.0.0.4' - path: '/' interval: 60 - timeout: 15 - unhealthyThreshold: 5 - pickHostNameFromBackendHttpSettings: false - minServers: 3 match: { statusCodes: [ '200' '401' ] } + minServers: 3 + path: '/' + pickHostNameFromBackendHttpSettings: false + protocol: 'Http' + timeout: 15 + unhealthyThreshold: 5 } } ] @@ -817,33 +439,33 @@ module applicationGateways './Microsoft.Network/applicationGateways/deploy.bicep { name: 'httpRedirect80' properties: { - redirectType: 'Permanent' - targetListener: { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/public443' - } includePath: true includeQueryString: true + redirectType: 'Permanent' requestRoutingRules: [ { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/requestRoutingRules/httpRedirect80-public443' } ] + targetListener: { + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/public443' + } } } { name: 'httpRedirect8080' properties: { - redirectType: 'Permanent' - targetListener: { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/private4433' - } includePath: true includeQueryString: true + redirectType: 'Permanent' requestRoutingRules: [ { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/requestRoutingRules/httpRedirect8080-private4433' } ] + targetListener: { + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/private4433' + } } } ] @@ -851,58 +473,66 @@ module applicationGateways './Microsoft.Network/applicationGateways/deploy.bicep { name: 'public443-appServiceBackendHttpsSetting-appServiceBackendHttpsSetting' properties: { - ruleType: 'Basic' - httpListener: { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/public443' - } backendAddressPool: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/backendAddressPools/appServiceBackendPool' } backendHttpSettings: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/backendHttpSettingsCollection/appServiceBackendHttpsSetting' } + httpListener: { + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/public443' + } + ruleType: 'Basic' } } { name: 'private4433-privateVmHttpSetting-privateVmHttpSetting' properties: { - ruleType: 'Basic' - httpListener: { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/private4433' - } backendAddressPool: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/backendAddressPools/privateVmBackendPool' } backendHttpSettings: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/backendHttpSettingsCollection/privateVmHttpSetting' } + httpListener: { + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/private4433' + } + ruleType: 'Basic' } } { name: 'httpRedirect80-public443' properties: { - ruleType: 'Basic' httpListener: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/httpRedirect80' } redirectConfiguration: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/redirectConfigurations/httpRedirect80' } + ruleType: 'Basic' } } { name: 'httpRedirect8080-private4433' properties: { - ruleType: 'Basic' httpListener: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/httpRedirect8080' } redirectConfiguration: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/redirectConfigurations/httpRedirect8080' } + ruleType: 'Basic' } } ] + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] sku: 'WAF_v2' sslCertificates: [ { @@ -912,19 +542,398 @@ module applicationGateways './Microsoft.Network/applicationGateways/deploy.bicep } } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } + webApplicationFirewallConfiguration: { + disabledRuleGroups: [] + enabled: true + fileUploadLimitInMb: 100 + firewallMode: 'Detection' + maxRequestBodySizeInKb: 128 + requestBodyCheck: true + ruleSetType: 'OWASP' + ruleSetVersion: '3.0' + } + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-apgw-x-001" + }, + // Non-required parameters + "backendAddressPools": { + "value": [ + { + "name": "appServiceBackendPool", + "properties": { + "backendAddresses": [ + { + "fqdn": "aghapp.azurewebsites.net" + } + ] + } + }, + { + "name": "privateVmBackendPool", + "properties": { + "backendAddresses": [ + { + "ipAddress": "10.0.0.4" + } + ] + } + } + ] + }, + "backendHttpSettingsCollection": { + "value": [ + { + "name": "appServiceBackendHttpsSetting", + "properties": { + "cookieBasedAffinity": "Disabled", + "pickHostNameFromBackendAddress": true, + "port": 443, + "protocol": "Https", + "requestTimeout": 30 + } + }, + { + "name": "privateVmHttpSetting", + "properties": { + "cookieBasedAffinity": "Disabled", + "pickHostNameFromBackendAddress": false, + "port": 80, + "probe": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/probes/privateVmHttpSettingProbe" + }, + "protocol": "Http", + "requestTimeout": 30 + } + } + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "enableHttp2": { + "value": true + }, + "frontendIPConfigurations": { + "value": [ + { + "name": "private", + "properties": { + "privateIPAddress": "10.0.8.6", + "privateIPAllocationMethod": "Static", + "subnet": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-007" + } + } + }, + { + "name": "public", + "properties": { + "privateIPAllocationMethod": "Dynamic", + "publicIPAddress": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-x-apgw" + } + } + } + ] + }, + "frontendPorts": { + "value": [ + { + "name": "port443", + "properties": { + "port": 443 + } + }, + { + "name": "port4433", + "properties": { + "port": 4433 + } + }, + { + "name": "port80", + "properties": { + "port": 80 + } + }, + { + "name": "port8080", + "properties": { + "port": 8080 + } + } + ] + }, + "gatewayIPConfigurations": { + "value": [ + { + "name": "apw-ip-configuration", + "properties": { + "subnet": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-007" + } + } + } + ] + }, + "httpListeners": { + "value": [ + { + "name": "public443", + "properties": { + "frontendIPConfiguration": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendIPConfigurations/public" + }, + "frontendPort": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendPorts/port443" + }, + "hostNames": [], + "protocol": "https", + "requireServerNameIndication": false, + "sslCertificate": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/sslCertificates/<>-az-apgw-x-001-ssl-certificate" + } + } + }, + { + "name": "private4433", + "properties": { + "frontendIPConfiguration": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendIPConfigurations/private" + }, + "frontendPort": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendPorts/port4433" + }, + "hostNames": [], + "protocol": "https", + "requireServerNameIndication": false, + "sslCertificate": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/sslCertificates/<>-az-apgw-x-001-ssl-certificate" + } + } + }, + { + "name": "httpRedirect80", + "properties": { + "frontendIPConfiguration": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendIPConfigurations/public" + }, + "frontendPort": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendPorts/port80" + }, + "hostNames": [], + "protocol": "Http", + "requireServerNameIndication": false + } + }, + { + "name": "httpRedirect8080", + "properties": { + "frontendIPConfiguration": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendIPConfigurations/private" + }, + "frontendPort": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/frontendPorts/port8080" + }, + "hostNames": [], + "protocol": "Http", + "requireServerNameIndication": false + } + } + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "probes": { + "value": [ + { + "name": "privateVmHttpSettingProbe", + "properties": { + "host": "10.0.0.4", + "interval": 60, + "match": { + "statusCodes": [ + "200", + "401" + ] + }, + "minServers": 3, + "path": "/", + "pickHostNameFromBackendHttpSettings": false, + "protocol": "Http", + "timeout": 15, + "unhealthyThreshold": 5 + } + } + ] + }, + "redirectConfigurations": { + "value": [ + { + "name": "httpRedirect80", + "properties": { + "includePath": true, + "includeQueryString": true, + "redirectType": "Permanent", + "requestRoutingRules": [ + { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/requestRoutingRules/httpRedirect80-public443" + } + ], + "targetListener": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/public443" + } + } + }, + { + "name": "httpRedirect8080", + "properties": { + "includePath": true, + "includeQueryString": true, + "redirectType": "Permanent", + "requestRoutingRules": [ + { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/requestRoutingRules/httpRedirect8080-private4433" + } + ], + "targetListener": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/private4433" + } + } + } + ] + }, + "requestRoutingRules": { + "value": [ + { + "name": "public443-appServiceBackendHttpsSetting-appServiceBackendHttpsSetting", + "properties": { + "backendAddressPool": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/backendAddressPools/appServiceBackendPool" + }, + "backendHttpSettings": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/backendHttpSettingsCollection/appServiceBackendHttpsSetting" + }, + "httpListener": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/public443" + }, + "ruleType": "Basic" + } + }, + { + "name": "private4433-privateVmHttpSetting-privateVmHttpSetting", + "properties": { + "backendAddressPool": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/backendAddressPools/privateVmBackendPool" + }, + "backendHttpSettings": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/backendHttpSettingsCollection/privateVmHttpSetting" + }, + "httpListener": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/private4433" + }, + "ruleType": "Basic" + } + }, + { + "name": "httpRedirect80-public443", + "properties": { + "httpListener": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/httpRedirect80" + }, + "redirectConfiguration": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/redirectConfigurations/httpRedirect80" + }, + "ruleType": "Basic" + } + }, + { + "name": "httpRedirect8080-private4433", + "properties": { + "httpListener": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/httpListeners/httpRedirect8080" + }, + "redirectConfiguration": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationGateways/<>-az-apgw-x-001/redirectConfigurations/httpRedirect8080" + }, + "ruleType": "Basic" + } + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "sku": { + "value": "WAF_v2" + }, + "sslCertificates": { + "value": [ + { + "name": "<>-az-apgw-x-001-ssl-certificate", + "properties": { + "keyVaultSecretId": "https://adp-<>-az-kv-x-001.vault.azure.net/secrets/applicationGatewaySslCertificate" + } + } + ] + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} } - ] + }, + "webApplicationFirewallConfiguration": { + "value": { + "disabledRuleGroups": [], + "enabled": true, + "fileUploadLimitInMb": 100, + "firewallMode": "Detection", + "maxRequestBodySizeInKb": 128, + "requestBodyCheck": true, + "ruleSetType": "OWASP", + "ruleSetVersion": "3.0" + } + } } } ``` diff --git a/modules/Microsoft.Network/applicationSecurityGroups/readme.md b/modules/Microsoft.Network/applicationSecurityGroups/readme.md index 045a885b8a..dcf3abc53c 100644 --- a/modules/Microsoft.Network/applicationSecurityGroups/readme.md +++ b/modules/Microsoft.Network/applicationSecurityGroups/readme.md @@ -145,38 +145,11 @@ roleAssignments: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-asg-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -186,14 +159,16 @@ roleAssignments: [ module applicationSecurityGroups './Microsoft.Network/applicationSecurityGroups/deploy.bicep' = { name: '${uniqueString(deployment().name)}-applicationSecurityGroups' params: { + // Required parameters name: '<>-az-asg-x-001' + // Non-required parameters lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -202,3 +177,37 @@ module applicationSecurityGroups './Microsoft.Network/applicationSecurityGroups/

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-asg-x-001" + }, + // Non-required parameters + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Network/azureFirewalls/readme.md b/modules/Microsoft.Network/azureFirewalls/readme.md index 5425e61026..01e64beae9 100644 --- a/modules/Microsoft.Network/azureFirewalls/readme.md +++ b/modules/Microsoft.Network/azureFirewalls/readme.md @@ -299,36 +299,11 @@ The `networkRuleCollections` parameter accepts a JSON Array of AzureFirewallNetw ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-fw-add-001" - }, - "vNetId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-add-azfw" - }, - "additionalPublicIpConfigurations": { - "value": [ - { - "name": "ipConfig01", - "publicIPAddressResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-additional-fw" - } - ] - } - } -} -``` - -
+

Example 1: Addpip

@@ -338,8 +313,10 @@ The `networkRuleCollections` parameter accepts a JSON Array of AzureFirewallNetw module azureFirewalls './Microsoft.Network/azureFirewalls/deploy.bicep' = { name: '${uniqueString(deployment().name)}-azureFirewalls' params: { + // Required parameters name: '<>-az-fw-add-001' vNetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-add-azfw' + // Non-required parameters additionalPublicIpConfigurations: [ { name: 'ipConfig01' @@ -353,53 +330,39 @@ module azureFirewalls './Microsoft.Network/azureFirewalls/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-fw-custompip-001" - }, - "vNetId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-custompip-azfw" - }, - "publicIPAddressObject": { - "value": { - "name": "adp-<>-az-pip-custom-x-fw", - "publicIPPrefixResourceId": "", - "publicIPAllocationMethod": "Static", - "skuName": "Standard", - "skuTier": "Regional", - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ], - "diagnosticMetricsToEnable": [ - "AllMetrics" - ], - "diagnosticLogCategoriesToEnable": [ - "DDoSProtectionNotifications", - "DDoSMitigationFlowLogs", - "DDoSMitigationReports" - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-fw-add-001" + }, + "vNetId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-add-azfw" + }, + // Non-required parameters + "additionalPublicIpConfigurations": { + "value": [ + { + "name": "ipConfig01", + "publicIPAddressResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-additional-fw" } + ] } + } } ```
+

+ +

Example 2: Custompip

@@ -409,30 +372,32 @@ module azureFirewalls './Microsoft.Network/azureFirewalls/deploy.bicep' = { module azureFirewalls './Microsoft.Network/azureFirewalls/deploy.bicep' = { name: '${uniqueString(deployment().name)}-azureFirewalls' params: { + // Required parameters name: '<>-az-fw-custompip-001' vNetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-custompip-azfw' + // Non-required parameters publicIPAddressObject: { + diagnosticLogCategoriesToEnable: [ + 'DDoSMitigationFlowLogs' + 'DDoSMitigationReports' + 'DDoSProtectionNotifications' + ] + diagnosticMetricsToEnable: [ + 'AllMetrics' + ] name: 'adp-<>-az-pip-custom-x-fw' - publicIPPrefixResourceId: '' publicIPAllocationMethod: 'Static' - skuName: 'Standard' - skuTier: 'Regional' + publicIPPrefixResourceId: '' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticMetricsToEnable: [ - 'AllMetrics' - ] - diagnosticLogCategoriesToEnable: [ - 'DDoSProtectionNotifications' - 'DDoSMitigationFlowLogs' - 'DDoSMitigationReports' - ] + skuName: 'Standard' + skuTier: 'Regional' } } } @@ -441,28 +406,56 @@ module azureFirewalls './Microsoft.Network/azureFirewalls/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-fw-min-001" - }, - "vNetId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-min-azfw" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-fw-custompip-001" + }, + "vNetId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-custompip-azfw" + }, + // Non-required parameters + "publicIPAddressObject": { + "value": { + "diagnosticLogCategoriesToEnable": [ + "DDoSMitigationFlowLogs", + "DDoSMitigationReports", + "DDoSProtectionNotifications" + ], + "diagnosticMetricsToEnable": [ + "AllMetrics" + ], + "name": "adp-<>-az-pip-custom-x-fw", + "publicIPAllocationMethod": "Static", + "publicIPPrefixResourceId": "", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "skuName": "Standard", + "skuTier": "Regional" + } } + } } ```
+

+ +

Example 3: Min

@@ -472,6 +465,7 @@ module azureFirewalls './Microsoft.Network/azureFirewalls/deploy.bicep' = { module azureFirewalls './Microsoft.Network/azureFirewalls/deploy.bicep' = { name: '${uniqueString(deployment().name)}-azureFirewalls' params: { + // Required parameters name: '<>-az-fw-min-001' vNetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-min-azfw' } @@ -481,151 +475,30 @@ module azureFirewalls './Microsoft.Network/azureFirewalls/deploy.bicep' = {

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-fw-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "zones": { - "value": [ - "1", - "2", - "3" - ] - }, - "vNetId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-azfw" - }, - "azureFirewallSubnetPublicIpId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-x-fw" - }, - "applicationRuleCollections": { - "value": [ - { - "name": "allow-app-rules", - "properties": { - "priority": 100, - "action": { - "type": "allow" - }, - "rules": [ - { - "name": "allow-ase-tags", - "sourceAddresses": [ - "*" - ], - "protocols": [ - { - "protocolType": "HTTP", - "port": "80" - }, - { - "protocolType": "HTTPS", - "port": "443" - } - ], - "fqdnTags": [ - "AppServiceEnvironment", - "WindowsUpdate" - ] - }, - { - "name": "allow-ase-management", - "sourceAddresses": [ - "*" - ], - "protocols": [ - { - "protocolType": "HTTP", - "port": "80" - }, - { - "protocolType": "HTTPS", - "port": "443" - } - ], - "targetFqdns": [ - "management.azure.com" - ] - } - ] - } - } - ] - }, - "networkRuleCollections": { - "value": [ - { - "name": "allow-network-rules", - "properties": { - "priority": 100, - "action": { - "type": "allow" - }, - "rules": [ - { - "name": "allow-ntp", - "sourceAddresses": [ - "*" - ], - "destinationAddresses": [ - "*" - ], - "destinationPorts": [ - "123", - "12000" - ], - "protocols": [ - "Any" - ] - } - ] - } - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-fw-min-001" + }, + "vNetId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-min-azfw" } + } } ```
+

+ +

Example 4: Parameters

@@ -635,59 +508,54 @@ module azureFirewalls './Microsoft.Network/azureFirewalls/deploy.bicep' = { module azureFirewalls './Microsoft.Network/azureFirewalls/deploy.bicep' = { name: '${uniqueString(deployment().name)}-azureFirewalls' params: { + // Required parameters name: '<>-az-fw-x-001' - lock: 'CanNotDelete' - zones: [ - '1' - '2' - '3' - ] vNetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-azfw' - azureFirewallSubnetPublicIpId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-x-fw' + // Non-required parameters applicationRuleCollections: [ { name: 'allow-app-rules' properties: { - priority: 100 action: { type: 'allow' } + priority: 100 rules: [ { - name: 'allow-ase-tags' - sourceAddresses: [ - '*' + fqdnTags: [ + 'AppServiceEnvironment' + 'WindowsUpdate' ] + name: 'allow-ase-tags' protocols: [ { - protocolType: 'HTTP' port: '80' + protocolType: 'HTTP' } { - protocolType: 'HTTPS' port: '443' + protocolType: 'HTTPS' } ] - fqdnTags: [ - 'AppServiceEnvironment' - 'WindowsUpdate' + sourceAddresses: [ + '*' ] } { name: 'allow-ase-management' - sourceAddresses: [ - '*' - ] protocols: [ { - protocolType: 'HTTP' port: '80' + protocolType: 'HTTP' } { - protocolType: 'HTTPS' port: '443' + protocolType: 'HTTPS' } ] + sourceAddresses: [ + '*' + ] targetFqdns: [ 'management.azure.com' ] @@ -696,30 +564,37 @@ module azureFirewalls './Microsoft.Network/azureFirewalls/deploy.bicep' = { } } ] + azureFirewallSubnetPublicIpId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-x-fw' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + lock: 'CanNotDelete' networkRuleCollections: [ { name: 'allow-network-rules' properties: { - priority: 100 action: { type: 'allow' } + priority: 100 rules: [ { - name: 'allow-ntp' - sourceAddresses: [ - '*' - ] destinationAddresses: [ '*' ] destinationPorts: [ - '123' '12000' + '123' ] + name: 'allow-ntp' protocols: [ 'Any' ] + sourceAddresses: [ + '*' + ] } ] } @@ -727,17 +602,164 @@ module azureFirewalls './Microsoft.Network/azureFirewalls/deploy.bicep' = { ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + zones: [ + '1' + '2' + '3' + ] + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-fw-x-001" + }, + "vNetId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-azfw" + }, + // Non-required parameters + "applicationRuleCollections": { + "value": [ + { + "name": "allow-app-rules", + "properties": { + "action": { + "type": "allow" + }, + "priority": 100, + "rules": [ + { + "fqdnTags": [ + "AppServiceEnvironment", + "WindowsUpdate" + ], + "name": "allow-ase-tags", + "protocols": [ + { + "port": "80", + "protocolType": "HTTP" + }, + { + "port": "443", + "protocolType": "HTTPS" + } + ], + "sourceAddresses": [ + "*" + ] + }, + { + "name": "allow-ase-management", + "protocols": [ + { + "port": "80", + "protocolType": "HTTP" + }, + { + "port": "443", + "protocolType": "HTTPS" + } + ], + "sourceAddresses": [ + "*" + ], + "targetFqdns": [ + "management.azure.com" + ] + } + ] + } + } + ] + }, + "azureFirewallSubnetPublicIpId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-x-fw" + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "networkRuleCollections": { + "value": [ + { + "name": "allow-network-rules", + "properties": { + "action": { + "type": "allow" + }, + "priority": 100, + "rules": [ + { + "destinationAddresses": [ + "*" + ], + "destinationPorts": [ + "12000", + "123" + ], + "name": "allow-ntp", + "protocols": [ + "Any" + ], + "sourceAddresses": [ + "*" + ] + } + ] + } + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "zones": { + "value": [ + "1", + "2", + "3" + ] + } } } ``` diff --git a/modules/Microsoft.Network/bastionHosts/readme.md b/modules/Microsoft.Network/bastionHosts/readme.md index b9bc848c0f..3969ebb6c5 100644 --- a/modules/Microsoft.Network/bastionHosts/readme.md +++ b/modules/Microsoft.Network/bastionHosts/readme.md @@ -283,36 +283,11 @@ roleAssignments: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-bas-add-001" - }, - "vNetId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-add-bas" - }, - "additionalPublicIpConfigurations": { - "value": [ - { - "name": "ipConfig01", - "publicIPAddressResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-additional-bas" - } - ] - } - } -} -``` - -
+

Example 1: Addpip

@@ -322,8 +297,10 @@ roleAssignments: [ module bastionHosts './Microsoft.Network/bastionHosts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-bastionHosts' params: { + // Required parameters name: '<>-az-bas-add-001' vNetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-add-bas' + // Non-required parameters additionalPublicIpConfigurations: [ { name: 'ipConfig01' @@ -337,53 +314,39 @@ module bastionHosts './Microsoft.Network/bastionHosts/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-bas-custompip-001" - }, - "vNetId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-custompip-bas" - }, - "publicIPAddressObject": { - "value": { - "name": "adp-<>-az-pip-custom-x-bas", - "publicIPPrefixResourceId": "", - "publicIPAllocationMethod": "Static", - "skuName": "Standard", - "skuTier": "Regional", - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ], - "diagnosticMetricsToEnable": [ - "AllMetrics" - ], - "diagnosticLogCategoriesToEnable": [ - "DDoSProtectionNotifications", - "DDoSMitigationFlowLogs", - "DDoSMitigationReports" - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-bas-add-001" + }, + "vNetId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-add-bas" + }, + // Non-required parameters + "additionalPublicIpConfigurations": { + "value": [ + { + "name": "ipConfig01", + "publicIPAddressResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-additional-bas" } + ] } + } } ```
+

+ +

Example 2: Custompip

@@ -393,30 +356,32 @@ module bastionHosts './Microsoft.Network/bastionHosts/deploy.bicep' = { module bastionHosts './Microsoft.Network/bastionHosts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-bastionHosts' params: { + // Required parameters name: '<>-az-bas-custompip-001' vNetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-custompip-bas' + // Non-required parameters publicIPAddressObject: { + diagnosticLogCategoriesToEnable: [ + 'DDoSMitigationFlowLogs' + 'DDoSMitigationReports' + 'DDoSProtectionNotifications' + ] + diagnosticMetricsToEnable: [ + 'AllMetrics' + ] name: 'adp-<>-az-pip-custom-x-bas' - publicIPPrefixResourceId: '' publicIPAllocationMethod: 'Static' - skuName: 'Standard' - skuTier: 'Regional' + publicIPPrefixResourceId: '' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticMetricsToEnable: [ - 'AllMetrics' - ] - diagnosticLogCategoriesToEnable: [ - 'DDoSProtectionNotifications' - 'DDoSMitigationFlowLogs' - 'DDoSMitigationReports' - ] + skuName: 'Standard' + skuTier: 'Regional' } } } @@ -425,28 +390,56 @@ module bastionHosts './Microsoft.Network/bastionHosts/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-bas-min-001" - }, - "vNetId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-002" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-bas-custompip-001" + }, + "vNetId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-custompip-bas" + }, + // Non-required parameters + "publicIPAddressObject": { + "value": { + "diagnosticLogCategoriesToEnable": [ + "DDoSMitigationFlowLogs", + "DDoSMitigationReports", + "DDoSProtectionNotifications" + ], + "diagnosticMetricsToEnable": [ + "AllMetrics" + ], + "name": "adp-<>-az-pip-custom-x-bas", + "publicIPAllocationMethod": "Static", + "publicIPPrefixResourceId": "", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "skuName": "Standard", + "skuTier": "Regional" + } } + } } ```
+

+ +

Example 3: Min

@@ -456,6 +449,7 @@ module bastionHosts './Microsoft.Network/bastionHosts/deploy.bicep' = { module bastionHosts './Microsoft.Network/bastionHosts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-bastionHosts' params: { + // Required parameters name: '<>-az-bas-min-001' vNetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-002' } @@ -465,65 +459,30 @@ module bastionHosts './Microsoft.Network/bastionHosts/deploy.bicep' = {

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-bas-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "vNetId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001" - }, - "azureBastionSubnetPublicIpId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-x-bas" - }, - "skuType": { - "value": "Standard" - }, - "scaleUnits": { - "value": 4 - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-bas-min-001" + }, + "vNetId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-002" } + } } ```
+

+ +

Example 4: Parameters

@@ -533,25 +492,88 @@ module bastionHosts './Microsoft.Network/bastionHosts/deploy.bicep' = { module bastionHosts './Microsoft.Network/bastionHosts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-bastionHosts' params: { + // Required parameters name: '<>-az-bas-x-001' - lock: 'CanNotDelete' vNetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001' + // Non-required parameters azureBastionSubnetPublicIpId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-x-bas' - skuType: 'Standard' - scaleUnits: 4 + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + scaleUnits: 4 + skuType: 'Standard' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-bas-x-001" + }, + "vNetId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001" + }, + // Non-required parameters + "azureBastionSubnetPublicIpId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-x-bas" + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "scaleUnits": { + "value": 4 + }, + "skuType": { + "value": "Standard" + } } } ``` diff --git a/modules/Microsoft.Network/connections/readme.md b/modules/Microsoft.Network/connections/readme.md index bd5c52509e..ce3518c498 100644 --- a/modules/Microsoft.Network/connections/readme.md +++ b/modules/Microsoft.Network/connections/readme.md @@ -304,55 +304,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-vnetgwc-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "virtualNetworkGateway1": { - "value": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworkGateways/<>-az-vnet-vpn-gw-p-001" - } - }, - "virtualNetworkGateway2": { - "value": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworkGateways/<>-az-vnet-vpn-gw-p-002" - } - }, - "vpnSharedKey": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "vpnSharedKey" - } - }, - "virtualNetworkGatewayConnectionType": { - "value": "Vnet2Vnet" - }, - "enableBgp": { - "value": false - }, - "location": { - "value": "eastus" - } - } -} -``` - -
+

Example 1: Vnet2vnet

@@ -367,18 +323,71 @@ resource kv1 'Microsoft.KeyVault/vaults@2019-09-01' existing = { module connections './Microsoft.Network/connections/deploy.bicep' = { name: '${uniqueString(deployment().name)}-connections' params: { + // Required parameters name: '<>-az-vnetgwc-x-001' - lock: 'CanNotDelete' virtualNetworkGateway1: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworkGateways/<>-az-vnet-vpn-gw-p-001' } + // Non-required parameters + enableBgp: false + location: 'eastus' + lock: 'CanNotDelete' virtualNetworkGateway2: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworkGateways/<>-az-vnet-vpn-gw-p-002' } - vpnSharedKey: kv1.getSecret('vpnSharedKey') virtualNetworkGatewayConnectionType: 'Vnet2Vnet' - enableBgp: false - location: 'eastus' + vpnSharedKey: kv1.getSecret('vpnSharedKey') + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-vnetgwc-x-001" + }, + "virtualNetworkGateway1": { + "value": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworkGateways/<>-az-vnet-vpn-gw-p-001" + } + }, + // Non-required parameters + "enableBgp": { + "value": false + }, + "location": { + "value": "eastus" + }, + "lock": { + "value": "CanNotDelete" + }, + "virtualNetworkGateway2": { + "value": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworkGateways/<>-az-vnet-vpn-gw-p-002" + } + }, + "virtualNetworkGatewayConnectionType": { + "value": "Vnet2Vnet" + }, + "vpnSharedKey": { + "reference": { + "keyVault": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "secretName": "vpnSharedKey" + } + } } } ``` diff --git a/modules/Microsoft.Network/ddosProtectionPlans/readme.md b/modules/Microsoft.Network/ddosProtectionPlans/readme.md index 3d33168d71..7986af249e 100644 --- a/modules/Microsoft.Network/ddosProtectionPlans/readme.md +++ b/modules/Microsoft.Network/ddosProtectionPlans/readme.md @@ -145,38 +145,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-ddos-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -186,14 +159,14 @@ tags: { module ddosProtectionPlans './Microsoft.Network/ddosProtectionPlans/deploy.bicep' = { name: '${uniqueString(deployment().name)}-ddosProtectionPlans' params: { - name: '<>-az-ddos-x-001' lock: 'CanNotDelete' + name: '<>-az-ddos-x-001' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -202,3 +175,35 @@ module ddosProtectionPlans './Microsoft.Network/ddosProtectionPlans/deploy.bicep

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "lock": { + "value": "CanNotDelete" + }, + "name": { + "value": "<>-az-ddos-x-001" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Network/expressRouteCircuits/readme.md b/modules/Microsoft.Network/expressRouteCircuits/readme.md index 2597635ebe..8695896385 100644 --- a/modules/Microsoft.Network/expressRouteCircuits/readme.md +++ b/modules/Microsoft.Network/expressRouteCircuits/readme.md @@ -167,68 +167,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-erc-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "serviceProviderName": { - "value": "Equinix" - }, - "peeringLocation": { - "value": "Amsterdam" - }, - "bandwidthInMbps": { - "value": 50 - }, - "skuTier": { - "value": "Standard" - }, - "skuFamily": { - "value": "MeteredData" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Parameters

@@ -238,26 +181,92 @@ tags: { module expressRouteCircuits './Microsoft.Network/expressRouteCircuits/deploy.bicep' = { name: '${uniqueString(deployment().name)}-expressRouteCircuits' params: { + // Required parameters + bandwidthInMbps: 50 name: '<>-az-erc-x-001' - lock: 'CanNotDelete' - serviceProviderName: 'Equinix' peeringLocation: 'Amsterdam' - bandwidthInMbps: 50 - skuTier: 'Standard' - skuFamily: 'MeteredData' + serviceProviderName: 'Equinix' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + skuFamily: 'MeteredData' + skuTier: 'Standard' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "bandwidthInMbps": { + "value": 50 + }, + "name": { + "value": "<>-az-erc-x-001" + }, + "peeringLocation": { + "value": "Amsterdam" + }, + "serviceProviderName": { + "value": "Equinix" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "skuFamily": { + "value": "MeteredData" + }, + "skuTier": { + "value": "Standard" + } } } ``` diff --git a/modules/Microsoft.Network/firewallPolicies/readme.md b/modules/Microsoft.Network/firewallPolicies/readme.md index 2e74768d85..90ddc6651c 100644 --- a/modules/Microsoft.Network/firewallPolicies/readme.md +++ b/modules/Microsoft.Network/firewallPolicies/readme.md @@ -136,25 +136,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-fwpol-min-001" - } - } -} -``` - -
+

Example 1: Min

@@ -172,65 +158,26 @@ module firewallPolicies './Microsoft.Network/firewallPolicies/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-fwpol-x-002" - }, - "ruleCollectionGroups": { - "value": [ - { - "name": "<>-rule-001", - "priority": 5000, - "ruleCollections": [ - { - "name": "collection002", - "priority": 5555, - "action": { - "type": "Allow" - }, - "rules": [ - { - "name": "rule002", - "ipProtocols": [ - "TCP", - "UDP" - ], - "destinationPorts": [ - "80" - ], - "sourceAddresses": [ - "*" - ], - "sourceIpGroups": [], - "ruleType": "NetworkRule", - "destinationIpGroups": [], - "destinationAddresses": [ - "*" - ], - "destinationFqdns": [] - } - ], - "ruleCollectionType": "FirewallPolicyFilterRuleCollection" - } - ] - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>-az-fwpol-min-001" } + } } ```
+

+ +

Example 2: Parameters

@@ -240,41 +187,43 @@ module firewallPolicies './Microsoft.Network/firewallPolicies/deploy.bicep' = { module firewallPolicies './Microsoft.Network/firewallPolicies/deploy.bicep' = { name: '${uniqueString(deployment().name)}-firewallPolicies' params: { + // Required parameters name: '<>-az-fwpol-x-002' + // Non-required parameters ruleCollectionGroups: [ { name: '<>-rule-001' priority: 5000 ruleCollections: [ { - name: 'collection002' - priority: 5555 action: { type: 'Allow' } + name: 'collection002' + priority: 5555 + ruleCollectionType: 'FirewallPolicyFilterRuleCollection' rules: [ { - name: 'rule002' - ipProtocols: [ - 'TCP' - 'UDP' + destinationAddresses: [ + '*' ] + destinationFqdns: [] + destinationIpGroups: [] destinationPorts: [ '80' ] - sourceAddresses: [ - '*' + ipProtocols: [ + 'TCP' + 'UDP' ] - sourceIpGroups: [] + name: 'rule002' ruleType: 'NetworkRule' - destinationIpGroups: [] - destinationAddresses: [ + sourceAddresses: [ '*' ] - destinationFqdns: [] + sourceIpGroups: [] } ] - ruleCollectionType: 'FirewallPolicyFilterRuleCollection' } ] } @@ -285,3 +234,64 @@ module firewallPolicies './Microsoft.Network/firewallPolicies/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-fwpol-x-002" + }, + // Non-required parameters + "ruleCollectionGroups": { + "value": [ + { + "name": "<>-rule-001", + "priority": 5000, + "ruleCollections": [ + { + "action": { + "type": "Allow" + }, + "name": "collection002", + "priority": 5555, + "ruleCollectionType": "FirewallPolicyFilterRuleCollection", + "rules": [ + { + "destinationAddresses": [ + "*" + ], + "destinationFqdns": [], + "destinationIpGroups": [], + "destinationPorts": [ + "80" + ], + "ipProtocols": [ + "TCP", + "UDP" + ], + "name": "rule002", + "ruleType": "NetworkRule", + "sourceAddresses": [ + "*" + ], + "sourceIpGroups": [] + } + ] + } + ] + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Network/frontDoors/readme.md b/modules/Microsoft.Network/frontDoors/readme.md index f3784be4d1..134fb53191 100644 --- a/modules/Microsoft.Network/frontDoors/readme.md +++ b/modules/Microsoft.Network/frontDoors/readme.md @@ -162,131 +162,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-fd-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "backendPools": { - "value": [ - { - "name": "backendPool", - "properties": { - "backends": [ - { - "address": "biceptest.local", - "backendHostHeader": "backendAddress", - "httpPort": 80, - "httpsPort": 443, - "weight": 50, - "priority": 1, - "enabledState": "Enabled", - "privateLinkAlias": "", - "privateLinkApprovalMessage": "", - "privateLinkLocation": "", - "privateLinkResourceId": "" - } - ], - "LoadBalancingSettings": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/LoadBalancingSettings/loadBalancer" - }, - "HealthProbeSettings": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/HealthProbeSettings/heathProbe" - } - } - } - ] - }, - "enforceCertificateNameCheck": { - "value": "Disabled" - }, - "sendRecvTimeoutSeconds": { - "value": 10 - }, - "frontendEndpoints": { - "value": [ - { - "name": "frontEnd", - "properties": { - "hostName": "<>-az-fd-x-001.azurefd.net", - "sessionAffinityEnabledState": "Disabled", - "sessionAffinityTtlSeconds": 60 - } - } - ] - }, - "healthProbeSettings": { - "value": [ - { - "name": "heathProbe", - "properties": { - "enabledState": "", - "healthProbeMethod": "", - "intervalInSeconds": 60, - "path": "/", - "protocol": "Https" - } - } - ] - }, - "loadBalancingSettings": { - "value": [ - { - "name": "loadBalancer", - "properties": { - "additionalLatencyMilliseconds": 0, - "sampleSize": 50, - "successfulSamplesRequired": 1 - } - } - ] - }, - "routingRules": { - "value": [ - { - "name": "routingRule", - "properties": { - "acceptedProtocols": [ - "Http", - "Https" - ], - "enabledState": "Enabled", - "frontendEndpoints": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/FrontendEndpoints/frontEnd" - } - ], - "patternsToMatch": [ - "/*" - ], - "routeConfiguration": { - "@odata.type": "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration", - "forwardingProtocol": "MatchRequest", - "backendPool": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/BackendPools/backendPool" - } - } - } - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -296,8 +176,9 @@ tags: { module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { name: '${uniqueString(deployment().name)}-frontDoors' params: { + // Required parameters name: '<>-az-fd-x-001' - lock: 'CanNotDelete' + // Non-required parameters backendPools: [ { name: 'backendPool' @@ -306,28 +187,27 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { { address: 'biceptest.local' backendHostHeader: 'backendAddress' + enabledState: 'Enabled' httpPort: 80 httpsPort: 443 - weight: 50 priority: 1 - enabledState: 'Enabled' privateLinkAlias: '' privateLinkApprovalMessage: '' privateLinkLocation: '' privateLinkResourceId: '' + weight: 50 } ] - LoadBalancingSettings: { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/LoadBalancingSettings/loadBalancer' - } HealthProbeSettings: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/HealthProbeSettings/heathProbe' } + LoadBalancingSettings: { + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/LoadBalancingSettings/loadBalancer' + } } } ] enforceCertificateNameCheck: 'Disabled' - sendRecvTimeoutSeconds: 10 frontendEndpoints: [ { name: 'frontEnd' @@ -360,6 +240,7 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { } } ] + lock: 'CanNotDelete' routingRules: [ { name: 'routingRule' @@ -379,14 +260,142 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { ] routeConfiguration: { '@odata.type': '#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration' - forwardingProtocol: 'MatchRequest' backendPool: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/BackendPools/backendPool' } + forwardingProtocol: 'MatchRequest' } } } ] + sendRecvTimeoutSeconds: 10 + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-fd-x-001" + }, + // Non-required parameters + "backendPools": { + "value": [ + { + "name": "backendPool", + "properties": { + "backends": [ + { + "address": "biceptest.local", + "backendHostHeader": "backendAddress", + "enabledState": "Enabled", + "httpPort": 80, + "httpsPort": 443, + "priority": 1, + "privateLinkAlias": "", + "privateLinkApprovalMessage": "", + "privateLinkLocation": "", + "privateLinkResourceId": "", + "weight": 50 + } + ], + "HealthProbeSettings": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/HealthProbeSettings/heathProbe" + }, + "LoadBalancingSettings": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/LoadBalancingSettings/loadBalancer" + } + } + } + ] + }, + "enforceCertificateNameCheck": { + "value": "Disabled" + }, + "frontendEndpoints": { + "value": [ + { + "name": "frontEnd", + "properties": { + "hostName": "<>-az-fd-x-001.azurefd.net", + "sessionAffinityEnabledState": "Disabled", + "sessionAffinityTtlSeconds": 60 + } + } + ] + }, + "healthProbeSettings": { + "value": [ + { + "name": "heathProbe", + "properties": { + "enabledState": "", + "healthProbeMethod": "", + "intervalInSeconds": 60, + "path": "/", + "protocol": "Https" + } + } + ] + }, + "loadBalancingSettings": { + "value": [ + { + "name": "loadBalancer", + "properties": { + "additionalLatencyMilliseconds": 0, + "sampleSize": 50, + "successfulSamplesRequired": 1 + } + } + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "routingRules": { + "value": [ + { + "name": "routingRule", + "properties": { + "acceptedProtocols": [ + "Http", + "Https" + ], + "enabledState": "Enabled", + "frontendEndpoints": [ + { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/FrontendEndpoints/frontEnd" + } + ], + "patternsToMatch": [ + "/*" + ], + "routeConfiguration": { + "@odata.type": "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration", + "backendPool": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/BackendPools/backendPool" + }, + "forwardingProtocol": "MatchRequest" + } + } + } + ] + }, + "sendRecvTimeoutSeconds": { + "value": 10 + } } } ``` diff --git a/modules/Microsoft.Network/ipGroups/readme.md b/modules/Microsoft.Network/ipGroups/readme.md index 9a185fe6b9..7490a87ba1 100644 --- a/modules/Microsoft.Network/ipGroups/readme.md +++ b/modules/Microsoft.Network/ipGroups/readme.md @@ -146,44 +146,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "iacsGroup-servers" - }, - "lock": { - "value": "CanNotDelete" - }, - "ipAddresses": { - "value": [ - "10.0.0.1", - "10.0.0.2" - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -193,18 +160,20 @@ tags: { module ipGroups './Microsoft.Network/ipGroups/deploy.bicep' = { name: '${uniqueString(deployment().name)}-ipGroups' params: { + // Required parameters name: 'iacsGroup-servers' - lock: 'CanNotDelete' + // Non-required parameters ipAddresses: [ '10.0.0.1' '10.0.0.2' ] + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -213,3 +182,43 @@ module ipGroups './Microsoft.Network/ipGroups/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "iacsGroup-servers" + }, + // Non-required parameters + "ipAddresses": { + "value": [ + "10.0.0.1", + "10.0.0.2" + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Network/loadBalancers/readme.md b/modules/Microsoft.Network/loadBalancers/readme.md index dc3386a169..56b7d1cc3f 100644 --- a/modules/Microsoft.Network/loadBalancers/readme.md +++ b/modules/Microsoft.Network/loadBalancers/readme.md @@ -459,117 +459,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-lb-internal-001" - }, - "loadBalancerSku": { - "value": "Standard" - }, - "frontendIPConfigurations": { - "value": [ - { - "name": "privateIPConfig1", - "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" - } - ] - }, - "backendAddressPools": { - "value": [ - { - "name": "servers" - } - ] - }, - "probes": { - "value": [ - { - "name": "probe1", - "protocol": "Tcp", - "port": "62000", - "intervalInSeconds": 5, - "numberOfProbes": 2 - } - ] - }, - "loadBalancingRules": { - "value": [ - { - "name": "privateIPLBRule1", - "frontendIPConfigurationName": "privateIPConfig1", - "frontendPort": 0, - "backendPort": 0, - "enableFloatingIP": true, - "idleTimeoutInMinutes": 4, - "protocol": "All", - "loadDistribution": "Default", - "probeName": "probe1", - "disableOutboundSnat": true, - "enableTcpReset": false, - "backendAddressPoolName": "servers" - } - ] - }, - "inboundNatRules": { - "value": [ - { - "name": "inboundNatRule1", - "frontendIPConfigurationName": "privateIPConfig1", - "frontendPort": 443, - "backendPort": 443, - "enableFloatingIP": false, - "idleTimeoutInMinutes": 4, - "protocol": "Tcp", - "enableTcpReset": false - }, - { - "name": "inboundNatRule2", - "frontendIPConfigurationName": "privateIPConfig1", - "frontendPort": 3389, - "backendPort": 3389 - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Internal

@@ -579,75 +473,77 @@ tags: { module loadBalancers './Microsoft.Network/loadBalancers/deploy.bicep' = { name: '${uniqueString(deployment().name)}-loadBalancers' params: { - name: '<>-az-lb-internal-001' - loadBalancerSku: 'Standard' + // Required parameters frontendIPConfigurations: [ { name: 'privateIPConfig1' subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' } ] + name: '<>-az-lb-internal-001' + // Non-required parameters backendAddressPools: [ { name: 'servers' } ] - probes: [ + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + inboundNatRules: [ { - name: 'probe1' + backendPort: 443 + enableFloatingIP: false + enableTcpReset: false + frontendIPConfigurationName: 'privateIPConfig1' + frontendPort: 443 + idleTimeoutInMinutes: 4 + name: 'inboundNatRule1' protocol: 'Tcp' - port: '62000' - intervalInSeconds: 5 - numberOfProbes: 2 + } + { + backendPort: 3389 + frontendIPConfigurationName: 'privateIPConfig1' + frontendPort: 3389 + name: 'inboundNatRule2' } ] + loadBalancerSku: 'Standard' loadBalancingRules: [ { - name: 'privateIPLBRule1' - frontendIPConfigurationName: 'privateIPConfig1' - frontendPort: 0 + backendAddressPoolName: 'servers' backendPort: 0 + disableOutboundSnat: true enableFloatingIP: true + enableTcpReset: false + frontendIPConfigurationName: 'privateIPConfig1' + frontendPort: 0 idleTimeoutInMinutes: 4 - protocol: 'All' loadDistribution: 'Default' + name: 'privateIPLBRule1' probeName: 'probe1' - disableOutboundSnat: true - enableTcpReset: false - backendAddressPoolName: 'servers' + protocol: 'All' } ] - inboundNatRules: [ + probes: [ { - name: 'inboundNatRule1' - frontendIPConfigurationName: 'privateIPConfig1' - frontendPort: 443 - backendPort: 443 - enableFloatingIP: false - idleTimeoutInMinutes: 4 + intervalInSeconds: 5 + name: 'probe1' + numberOfProbes: 2 + port: '62000' protocol: 'Tcp' - enableTcpReset: false - } - { - name: 'inboundNatRule2' - frontendIPConfigurationName: 'privateIPConfig1' - frontendPort: 3389 - backendPort: 3389 } ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' } } ``` @@ -655,33 +551,120 @@ module loadBalancers './Microsoft.Network/loadBalancers/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-lb-min-001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "frontendIPConfigurations": { + "value": [ + { + "name": "privateIPConfig1", + "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" + } + ] + }, + "name": { + "value": "<>-az-lb-internal-001" + }, + // Non-required parameters + "backendAddressPools": { + "value": [ + { + "name": "servers" + } + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "inboundNatRules": { + "value": [ + { + "backendPort": 443, + "enableFloatingIP": false, + "enableTcpReset": false, + "frontendIPConfigurationName": "privateIPConfig1", + "frontendPort": 443, + "idleTimeoutInMinutes": 4, + "name": "inboundNatRule1", + "protocol": "Tcp" }, - "frontendIPConfigurations": { - "value": [ - { - "name": "publicIPConfig1", - "publicIPAddressId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-min-lb" - } - ] + { + "backendPort": 3389, + "frontendIPConfigurationName": "privateIPConfig1", + "frontendPort": 3389, + "name": "inboundNatRule2" } + ] + }, + "loadBalancerSku": { + "value": "Standard" + }, + "loadBalancingRules": { + "value": [ + { + "backendAddressPoolName": "servers", + "backendPort": 0, + "disableOutboundSnat": true, + "enableFloatingIP": true, + "enableTcpReset": false, + "frontendIPConfigurationName": "privateIPConfig1", + "frontendPort": 0, + "idleTimeoutInMinutes": 4, + "loadDistribution": "Default", + "name": "privateIPLBRule1", + "probeName": "probe1", + "protocol": "All" + } + ] + }, + "probes": { + "value": [ + { + "intervalInSeconds": 5, + "name": "probe1", + "numberOfProbes": 2, + "port": "62000", + "protocol": "Tcp" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] } + } } ```
+

+ +

Example 2: Min

@@ -691,13 +674,14 @@ module loadBalancers './Microsoft.Network/loadBalancers/deploy.bicep' = { module loadBalancers './Microsoft.Network/loadBalancers/deploy.bicep' = { name: '${uniqueString(deployment().name)}-loadBalancers' params: { - name: '<>-az-lb-min-001' + // Required parameters frontendIPConfigurations: [ { name: 'publicIPConfig1' publicIPAddressId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-min-lb' } ] + name: '<>-az-lb-min-001' } } ``` @@ -705,145 +689,35 @@ module loadBalancers './Microsoft.Network/loadBalancers/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-lb-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "frontendIPConfigurations": { - "value": [ - { - "name": "publicIPConfig1", - "publicIPAddressId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-x-lb" - } - ] - }, - "backendAddressPools": { - "value": [ - { - "name": "backendAddressPool1" - }, - { - "name": "backendAddressPool2" - } - ] - }, - "loadBalancingRules": { - "value": [ - { - "name": "publicIPLBRule1", - "frontendIPConfigurationName": "publicIPConfig1", - "frontendPort": 80, - "backendPort": 80, - "enableFloatingIP": false, - "idleTimeoutInMinutes": 5, - "protocol": "Tcp", - "enableTcpReset": false, - "loadDistribution": "Default", - "disableOutboundSnat": true, - "probeName": "probe1", - "backendAddressPoolName": "backendAddressPool1" - }, - { - "name": "publicIPLBRule2", - "frontendIPConfigurationName": "publicIPConfig1", - "frontendPort": 8080, - "backendPort": 8080, - "loadDistribution": "Default", - "probeName": "probe2", - "backendAddressPoolName": "backendAddressPool2" - } - ] - }, - "inboundNatRules": { - "value": [ - { - "name": "inboundNatRule1", - "frontendIPConfigurationName": "publicIPConfig1", - "frontendPort": 443, - "backendPort": 443, - "enableFloatingIP": false, - "idleTimeoutInMinutes": 4, - "protocol": "Tcp", - "enableTcpReset": false - }, - { - "name": "inboundNatRule2", - "frontendIPConfigurationName": "publicIPConfig1", - "frontendPort": 3389, - "backendPort": 3389 - } - ] - }, - "outboundRules": { - "value": [ - { - "name": "outboundRule1", - "frontendIPConfigurationName": "publicIPConfig1", - "backendAddressPoolName": "backendAddressPool1", - "allocatedOutboundPorts": 63984 - } - ] - }, - "probes": { - "value": [ - { - "name": "probe1", - "protocol": "Tcp", - "port": 80, - "intervalInSeconds": 10, - "numberOfProbes": 5 - }, - { - "name": "probe2", - "protocol": "Https", - "port": 443, - "requestPath": "/" - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "frontendIPConfigurations": { + "value": [ + { + "name": "publicIPConfig1", + "publicIPAddressId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-min-lb" } + ] + }, + "name": { + "value": "<>-az-lb-min-001" } + } } ```
+

+ +

Example 3: Parameters

@@ -853,14 +727,15 @@ module loadBalancers './Microsoft.Network/loadBalancers/deploy.bicep' = { module loadBalancers './Microsoft.Network/loadBalancers/deploy.bicep' = { name: '${uniqueString(deployment().name)}-loadBalancers' params: { - name: '<>-az-lb-x-001' - lock: 'CanNotDelete' + // Required parameters frontendIPConfigurations: [ { name: 'publicIPConfig1' publicIPAddressId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-x-lb' } ] + name: '<>-az-lb-x-001' + // Non-required parameters backendAddressPools: [ { name: 'backendAddressPool1' @@ -869,85 +744,227 @@ module loadBalancers './Microsoft.Network/loadBalancers/deploy.bicep' = { name: 'backendAddressPool2' } ] - loadBalancingRules: [ + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + inboundNatRules: [ { - name: 'publicIPLBRule1' - frontendIPConfigurationName: 'publicIPConfig1' - frontendPort: 80 - backendPort: 80 + backendPort: 443 enableFloatingIP: false - idleTimeoutInMinutes: 5 - protocol: 'Tcp' enableTcpReset: false - loadDistribution: 'Default' - disableOutboundSnat: true - probeName: 'probe1' - backendAddressPoolName: 'backendAddressPool1' + frontendIPConfigurationName: 'publicIPConfig1' + frontendPort: 443 + idleTimeoutInMinutes: 4 + name: 'inboundNatRule1' + protocol: 'Tcp' } { - name: 'publicIPLBRule2' + backendPort: 3389 frontendIPConfigurationName: 'publicIPConfig1' - frontendPort: 8080 - backendPort: 8080 - loadDistribution: 'Default' - probeName: 'probe2' - backendAddressPoolName: 'backendAddressPool2' + frontendPort: 3389 + name: 'inboundNatRule2' } ] - inboundNatRules: [ + loadBalancingRules: [ { - name: 'inboundNatRule1' - frontendIPConfigurationName: 'publicIPConfig1' - frontendPort: 443 - backendPort: 443 + backendAddressPoolName: 'backendAddressPool1' + backendPort: 80 + disableOutboundSnat: true enableFloatingIP: false - idleTimeoutInMinutes: 4 - protocol: 'Tcp' enableTcpReset: false + frontendIPConfigurationName: 'publicIPConfig1' + frontendPort: 80 + idleTimeoutInMinutes: 5 + loadDistribution: 'Default' + name: 'publicIPLBRule1' + probeName: 'probe1' + protocol: 'Tcp' } { - name: 'inboundNatRule2' + backendAddressPoolName: 'backendAddressPool2' + backendPort: 8080 frontendIPConfigurationName: 'publicIPConfig1' - frontendPort: 3389 - backendPort: 3389 + frontendPort: 8080 + loadDistribution: 'Default' + name: 'publicIPLBRule2' + probeName: 'probe2' } ] + lock: 'CanNotDelete' outboundRules: [ { - name: 'outboundRule1' - frontendIPConfigurationName: 'publicIPConfig1' - backendAddressPoolName: 'backendAddressPool1' allocatedOutboundPorts: 63984 + backendAddressPoolName: 'backendAddressPool1' + frontendIPConfigurationName: 'publicIPConfig1' + name: 'outboundRule1' } ] probes: [ { - name: 'probe1' - protocol: 'Tcp' - port: 80 intervalInSeconds: 10 + name: 'probe1' numberOfProbes: 5 + port: 80 + protocol: 'Tcp' } { name: 'probe2' - protocol: 'Https' port: 443 + protocol: 'Https' requestPath: '/' } ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "frontendIPConfigurations": { + "value": [ + { + "name": "publicIPConfig1", + "publicIPAddressId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/publicIPAddresses/adp-<>-az-pip-x-lb" + } + ] + }, + "name": { + "value": "<>-az-lb-x-001" + }, + // Non-required parameters + "backendAddressPools": { + "value": [ + { + "name": "backendAddressPool1" + }, + { + "name": "backendAddressPool2" + } + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "inboundNatRules": { + "value": [ + { + "backendPort": 443, + "enableFloatingIP": false, + "enableTcpReset": false, + "frontendIPConfigurationName": "publicIPConfig1", + "frontendPort": 443, + "idleTimeoutInMinutes": 4, + "name": "inboundNatRule1", + "protocol": "Tcp" + }, + { + "backendPort": 3389, + "frontendIPConfigurationName": "publicIPConfig1", + "frontendPort": 3389, + "name": "inboundNatRule2" + } + ] + }, + "loadBalancingRules": { + "value": [ + { + "backendAddressPoolName": "backendAddressPool1", + "backendPort": 80, + "disableOutboundSnat": true, + "enableFloatingIP": false, + "enableTcpReset": false, + "frontendIPConfigurationName": "publicIPConfig1", + "frontendPort": 80, + "idleTimeoutInMinutes": 5, + "loadDistribution": "Default", + "name": "publicIPLBRule1", + "probeName": "probe1", + "protocol": "Tcp" + }, + { + "backendAddressPoolName": "backendAddressPool2", + "backendPort": 8080, + "frontendIPConfigurationName": "publicIPConfig1", + "frontendPort": 8080, + "loadDistribution": "Default", + "name": "publicIPLBRule2", + "probeName": "probe2" + } + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "outboundRules": { + "value": [ + { + "allocatedOutboundPorts": 63984, + "backendAddressPoolName": "backendAddressPool1", + "frontendIPConfigurationName": "publicIPConfig1", + "name": "outboundRule1" + } + ] + }, + "probes": { + "value": [ + { + "intervalInSeconds": 10, + "name": "probe1", + "numberOfProbes": 5, + "port": 80, + "protocol": "Tcp" + }, + { + "name": "probe2", + "port": 443, + "protocol": "Https", + "requestPath": "/" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } } } ``` diff --git a/modules/Microsoft.Network/localNetworkGateways/readme.md b/modules/Microsoft.Network/localNetworkGateways/readme.md index 51276b735a..8fdf70588c 100644 --- a/modules/Microsoft.Network/localNetworkGateways/readme.md +++ b/modules/Microsoft.Network/localNetworkGateways/readme.md @@ -151,52 +151,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-lng-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "localAddressPrefixes": { - "value": [ - "192.168.1.0/24" - ] - }, - "localGatewayPublicIpAddress": { - "value": "8.8.8.8" - }, - "localAsn": { - "value": "65123" - }, - "localBgpPeeringAddress": { - "value": "192.168.1.5" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -206,20 +165,22 @@ tags: { module localNetworkGateways './Microsoft.Network/localNetworkGateways/deploy.bicep' = { name: '${uniqueString(deployment().name)}-localNetworkGateways' params: { - name: '<>-az-lng-x-001' - lock: 'CanNotDelete' + // Required parameters localAddressPrefixes: [ '192.168.1.0/24' ] localGatewayPublicIpAddress: '8.8.8.8' + name: '<>-az-lng-x-001' + // Non-required parameters localAsn: '65123' localBgpPeeringAddress: '192.168.1.5' + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -228,3 +189,51 @@ module localNetworkGateways './Microsoft.Network/localNetworkGateways/deploy.bic

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "localAddressPrefixes": { + "value": [ + "192.168.1.0/24" + ] + }, + "localGatewayPublicIpAddress": { + "value": "8.8.8.8" + }, + "name": { + "value": "<>-az-lng-x-001" + }, + // Non-required parameters + "localAsn": { + "value": "65123" + }, + "localBgpPeeringAddress": { + "value": "192.168.1.5" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Network/natGateways/readme.md b/modules/Microsoft.Network/natGateways/readme.md index 4dabc5b9b2..fb038120fc 100644 --- a/modules/Microsoft.Network/natGateways/readme.md +++ b/modules/Microsoft.Network/natGateways/readme.md @@ -163,56 +163,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-ngw-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "natGatewayPublicIpAddress": { - "value": true - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Parameters

@@ -222,22 +177,76 @@ tags: { module natGateways './Microsoft.Network/natGateways/deploy.bicep' = { name: '${uniqueString(deployment().name)}-natGateways' params: { + // Required parameters name: '<>-az-ngw-x-001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' lock: 'CanNotDelete' natGatewayPublicIpAddress: true roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-ngw-x-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "natGatewayPublicIpAddress": { + "value": true + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } } } ``` diff --git a/modules/Microsoft.Network/networkInterfaces/readme.md b/modules/Microsoft.Network/networkInterfaces/readme.md index cf9e430624..9374302e10 100644 --- a/modules/Microsoft.Network/networkInterfaces/readme.md +++ b/modules/Microsoft.Network/networkInterfaces/readme.md @@ -179,33 +179,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-nic-min-001" - }, - "ipConfigurations": { - "value": [ - { - "name": "ipconfig01", - "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" - } - ] - } - } -} -``` - -
+

Example 1: Min

@@ -215,13 +193,14 @@ tags: { module networkInterfaces './Microsoft.Network/networkInterfaces/deploy.bicep' = { name: '${uniqueString(deployment().name)}-networkInterfaces' params: { - name: '<>-az-nic-min-001' + // Required parameters ipConfigurations: [ { name: 'ipconfig01' subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' } ] + name: '<>-az-nic-min-001' } } ``` @@ -229,71 +208,35 @@ module networkInterfaces './Microsoft.Network/networkInterfaces/deploy.bicep' =

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-nic-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "ipConfigurations": { - "value": [ - { - "name": "ipconfig01", - "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001", - "loadBalancerBackendAddressPools": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/loadBalancers/adp-<>-az-lb-internal-001/backendAddressPools/servers" - } - ], - "applicationSecurityGroups": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001" - } - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "ipConfigurations": { + "value": [ + { + "name": "ipconfig01", + "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" } + ] + }, + "name": { + "value": "<>-az-nic-min-001" } + } } ```
+

+ +

Example 2: Parameters

@@ -303,37 +246,106 @@ module networkInterfaces './Microsoft.Network/networkInterfaces/deploy.bicep' = module networkInterfaces './Microsoft.Network/networkInterfaces/deploy.bicep' = { name: '${uniqueString(deployment().name)}-networkInterfaces' params: { - name: '<>-az-nic-x-001' - lock: 'CanNotDelete' - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] + // Required parameters ipConfigurations: [ { - name: 'ipconfig01' - subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' - loadBalancerBackendAddressPools: [ + applicationSecurityGroups: [ { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/loadBalancers/adp-<>-az-lb-internal-001/backendAddressPools/servers' + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001' } ] - applicationSecurityGroups: [ + loadBalancerBackendAddressPools: [ { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001' + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/loadBalancers/adp-<>-az-lb-internal-001/backendAddressPools/servers' } ] + name: 'ipconfig01' + subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' } ] + name: '<>-az-nic-x-001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' diagnosticLogsRetentionInDays: 7 diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + lock: 'CanNotDelete' + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "ipConfigurations": { + "value": [ + { + "applicationSecurityGroups": [ + { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001" + } + ], + "loadBalancerBackendAddressPools": [ + { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/loadBalancers/adp-<>-az-lb-internal-001/backendAddressPools/servers" + } + ], + "name": "ipconfig01", + "subnetId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" + } + ] + }, + "name": { + "value": "<>-az-nic-x-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } } } ``` diff --git a/modules/Microsoft.Network/networkSecurityGroups/readme.md b/modules/Microsoft.Network/networkSecurityGroups/readme.md index f7676a388f..6b38ab7a44 100644 --- a/modules/Microsoft.Network/networkSecurityGroups/readme.md +++ b/modules/Microsoft.Network/networkSecurityGroups/readme.md @@ -155,25 +155,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-nsg-min-001" - } - } -} -``` - -
+

Example 1: Min

@@ -191,119 +177,26 @@ module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.b

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-nsg-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "securityRules": { - "value": [ - { - "name": "Specific", - "properties": { - "description": "Tests specific IPs and ports", - "protocol": "*", - "sourcePortRange": "*", - "destinationPortRange": "8080", - "sourceAddressPrefix": "*", - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 100, - "direction": "Inbound" - } - }, - { - "name": "Ranges", - "properties": { - "description": "Tests Ranges", - "protocol": "*", - "access": "Allow", - "priority": 101, - "direction": "Inbound", - "sourcePortRanges": [ - "80", - "81" - ], - "destinationPortRanges": [ - "90", - "91" - ], - "sourceAddressPrefixes": [ - "10.0.0.0/16", - "10.1.0.0/16" - ], - "destinationAddressPrefixes": [ - "10.2.0.0/16", - "10.3.0.0/16" - ] - } - }, - { - "name": "Port_8082", - "properties": { - "description": "Allow inbound access on TCP 8082", - "protocol": "*", - "sourcePortRange": "*", - "destinationPortRange": "8082", - "access": "Allow", - "priority": 102, - "direction": "Inbound", - "sourceApplicationSecurityGroups": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001" - } - ], - "destinationApplicationSecurityGroups": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001" - } - ] - } - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>-az-nsg-min-001" } + } } ```
+

+ +

Example 2: Parameters

@@ -313,85 +206,202 @@ module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.b module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.bicep' = { name: '${uniqueString(deployment().name)}-networkSecurityGroups' params: { + // Required parameters name: '<>-az-nsg-x-001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' lock: 'CanNotDelete' + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] securityRules: [ { name: 'Specific' properties: { + access: 'Allow' description: 'Tests specific IPs and ports' - protocol: '*' - sourcePortRange: '*' - destinationPortRange: '8080' - sourceAddressPrefix: '*' destinationAddressPrefix: '*' - access: 'Allow' - priority: 100 + destinationPortRange: '8080' direction: 'Inbound' + priority: 100 + protocol: '*' + sourceAddressPrefix: '*' + sourcePortRange: '*' } } { name: 'Ranges' properties: { - description: 'Tests Ranges' - protocol: '*' access: 'Allow' - priority: 101 - direction: 'Inbound' - sourcePortRanges: [ - '80' - '81' + description: 'Tests Ranges' + destinationAddressPrefixes: [ + '10.2.0.0/16' + '10.3.0.0/16' ] destinationPortRanges: [ '90' '91' ] + direction: 'Inbound' + priority: 101 + protocol: '*' sourceAddressPrefixes: [ '10.0.0.0/16' '10.1.0.0/16' ] - destinationAddressPrefixes: [ - '10.2.0.0/16' - '10.3.0.0/16' + sourcePortRanges: [ + '80' + '81' ] } } { name: 'Port_8082' properties: { - description: 'Allow inbound access on TCP 8082' - protocol: '*' - sourcePortRange: '*' - destinationPortRange: '8082' access: 'Allow' - priority: 102 - direction: 'Inbound' - sourceApplicationSecurityGroups: [ + description: 'Allow inbound access on TCP 8082' + destinationApplicationSecurityGroups: [ { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001' } ] - destinationApplicationSecurityGroups: [ + destinationPortRange: '8082' + direction: 'Inbound' + priority: 102 + protocol: '*' + sourceApplicationSecurityGroups: [ { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001' } ] + sourcePortRange: '*' } } ] - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-nsg-x-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "securityRules": { + "value": [ + { + "name": "Specific", + "properties": { + "access": "Allow", + "description": "Tests specific IPs and ports", + "destinationAddressPrefix": "*", + "destinationPortRange": "8080", + "direction": "Inbound", + "priority": 100, + "protocol": "*", + "sourceAddressPrefix": "*", + "sourcePortRange": "*" + } + }, + { + "name": "Ranges", + "properties": { + "access": "Allow", + "description": "Tests Ranges", + "destinationAddressPrefixes": [ + "10.2.0.0/16", + "10.3.0.0/16" + ], + "destinationPortRanges": [ + "90", + "91" + ], + "direction": "Inbound", + "priority": 101, + "protocol": "*", + "sourceAddressPrefixes": [ + "10.0.0.0/16", + "10.1.0.0/16" + ], + "sourcePortRanges": [ + "80", + "81" + ] + } + }, + { + "name": "Port_8082", + "properties": { + "access": "Allow", + "description": "Allow inbound access on TCP 8082", + "destinationApplicationSecurityGroups": [ + { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001" + } + ], + "destinationPortRange": "8082", + "direction": "Inbound", + "priority": 102, + "protocol": "*", + "sourceApplicationSecurityGroups": [ + { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001" + } + ], + "sourcePortRange": "*" + } + } + ] + } } } ``` diff --git a/modules/Microsoft.Network/networkWatchers/readme.md b/modules/Microsoft.Network/networkWatchers/readme.md index 05a8e2d91c..fbb830fb09 100644 --- a/modules/Microsoft.Network/networkWatchers/readme.md +++ b/modules/Microsoft.Network/networkWatchers/readme.md @@ -149,25 +149,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "location": { - "value": "northeurope" - } - } -} -``` - -
+

Example 1: Min

@@ -185,108 +171,26 @@ module networkWatchers './Microsoft.Network/networkWatchers/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "adp-<>-az-nw-x-001" - }, - "flowLogs": { - "value": [ - { - "targetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/networkSecurityGroups/adp-<>-az-nsg-x-001", - "storageId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", - "enabled": false - }, - { - "name": "adp-<>-az-nsg-x-apgw-flowlog", - "targetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/networkSecurityGroups/adp-<>-az-nsg-x-apgw", - "storageId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", - "workspaceResourceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001", - "formatVersion": 1, - "trafficAnalyticsInterval": 10, - "retentionInDays": 8 - } - ] - }, - "connectionMonitors": { - "value": [ - { - "name": "adp-<>-az-conn-mon-x-001", - "endpoints": [ - { - "name": "<>-az-subnet-x-001(validation-rg)", - "type": "AzureVM", - "resourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/virtualMachines/adp-<>-vm-01" - }, - { - "name": "Office Portal", - "type": "ExternalAddress", - "address": "www.office.com" - } - ], - "testConfigurations": [ - { - "name": "HTTP Test", - "testFrequencySec": 30, - "protocol": "Http", - "httpConfiguration": { - "port": 80, - "method": "Get", - "requestHeaders": [], - "validStatusCodeRanges": [ - "200" - ], - "preferHTTPS": false - }, - "successThreshold": { - "checksFailedPercent": 5, - "roundTripTimeMs": 100 - } - } - ], - "testGroups": [ - { - "name": "TestHTTPBing", - "disable": false, - "testConfigurations": [ - "HTTP Test" - ], - "sources": [ - "<>-az-subnet-x-001(validation-rg)" - ], - "destinations": [ - "Office Portal" - ] - } - ], - "workspaceResourceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "location": { + "value": "northeurope" } + } } ```
+

+ +

Example 2: Parameters

@@ -296,82 +200,82 @@ module networkWatchers './Microsoft.Network/networkWatchers/deploy.bicep' = { module networkWatchers './Microsoft.Network/networkWatchers/deploy.bicep' = { name: '${uniqueString(deployment().name)}-networkWatchers' params: { - name: 'adp-<>-az-nw-x-001' - flowLogs: [ - { - targetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/networkSecurityGroups/adp-<>-az-nsg-x-001' - storageId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - enabled: false - } - { - name: 'adp-<>-az-nsg-x-apgw-flowlog' - targetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/networkSecurityGroups/adp-<>-az-nsg-x-apgw' - storageId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - workspaceResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - formatVersion: 1 - trafficAnalyticsInterval: 10 - retentionInDays: 8 - } - ] connectionMonitors: [ { - name: 'adp-<>-az-conn-mon-x-001' endpoints: [ { name: '<>-az-subnet-x-001(validation-rg)' - type: 'AzureVM' resourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/virtualMachines/adp-<>-vm-01' + type: 'AzureVM' } { + address: 'www.office.com' name: 'Office Portal' type: 'ExternalAddress' - address: 'www.office.com' } ] + name: 'adp-<>-az-conn-mon-x-001' testConfigurations: [ { - name: 'HTTP Test' - testFrequencySec: 30 - protocol: 'Http' httpConfiguration: { - port: 80 method: 'Get' + port: 80 + preferHTTPS: false requestHeaders: [] validStatusCodeRanges: [ '200' ] - preferHTTPS: false } + name: 'HTTP Test' + protocol: 'Http' successThreshold: { checksFailedPercent: 5 roundTripTimeMs: 100 } + testFrequencySec: 30 } ] testGroups: [ { - name: 'TestHTTPBing' - disable: false - testConfigurations: [ - 'HTTP Test' + destinations: [ + 'Office Portal' ] + disable: false + name: 'TestHTTPBing' sources: [ '<>-az-subnet-x-001(validation-rg)' ] - destinations: [ - 'Office Portal' + testConfigurations: [ + 'HTTP Test' ] } ] workspaceResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' } ] + flowLogs: [ + { + enabled: false + storageId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + targetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/networkSecurityGroups/adp-<>-az-nsg-x-001' + } + { + formatVersion: 1 + name: 'adp-<>-az-nsg-x-apgw-flowlog' + retentionInDays: 8 + storageId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + targetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/networkSecurityGroups/adp-<>-az-nsg-x-apgw' + trafficAnalyticsInterval: 10 + workspaceResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + } + ] + name: 'adp-<>-az-nw-x-001' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -380,3 +284,105 @@ module networkWatchers './Microsoft.Network/networkWatchers/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "connectionMonitors": { + "value": [ + { + "endpoints": [ + { + "name": "<>-az-subnet-x-001(validation-rg)", + "resourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/virtualMachines/adp-<>-vm-01", + "type": "AzureVM" + }, + { + "address": "www.office.com", + "name": "Office Portal", + "type": "ExternalAddress" + } + ], + "name": "adp-<>-az-conn-mon-x-001", + "testConfigurations": [ + { + "httpConfiguration": { + "method": "Get", + "port": 80, + "preferHTTPS": false, + "requestHeaders": [], + "validStatusCodeRanges": [ + "200" + ] + }, + "name": "HTTP Test", + "protocol": "Http", + "successThreshold": { + "checksFailedPercent": 5, + "roundTripTimeMs": 100 + }, + "testFrequencySec": 30 + } + ], + "testGroups": [ + { + "destinations": [ + "Office Portal" + ], + "disable": false, + "name": "TestHTTPBing", + "sources": [ + "<>-az-subnet-x-001(validation-rg)" + ], + "testConfigurations": [ + "HTTP Test" + ] + } + ], + "workspaceResourceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + } + ] + }, + "flowLogs": { + "value": [ + { + "enabled": false, + "storageId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", + "targetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/networkSecurityGroups/adp-<>-az-nsg-x-001" + }, + { + "formatVersion": 1, + "name": "adp-<>-az-nsg-x-apgw-flowlog", + "retentionInDays": 8, + "storageId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", + "targetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/networkSecurityGroups/adp-<>-az-nsg-x-apgw", + "trafficAnalyticsInterval": 10, + "workspaceResourceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + } + ] + }, + "name": { + "value": "adp-<>-az-nw-x-001" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Network/privateDnsZones/readme.md b/modules/Microsoft.Network/privateDnsZones/readme.md index 17fe8f45ba..4d598a6899 100644 --- a/modules/Microsoft.Network/privateDnsZones/readme.md +++ b/modules/Microsoft.Network/privateDnsZones/readme.md @@ -163,25 +163,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-privdns-x-001.com" - } - } -} -``` - -
+

Example 1: Min

@@ -199,214 +185,26 @@ module privateDnsZones './Microsoft.Network/privateDnsZones/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-privdns-x-002.com" - }, - "lock": { - "value": "CanNotDelete" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "AAAA": { - "value": [ - { - "name": "AAAA_2001_0db8_85a3_0000_0000_8a2e_0370_7334", - "ttl": 3600, - "aaaaRecords": [ - { - "ipv6Address": "2001:0db8:85a3:0000:0000:8a2e:0370:7334" - } - ] - } - ] - }, - "A": { - "value": [ - { - "name": "A_10.240.4.4", - "ttl": 3600, - "aRecords": [ - { - "ipv4Address": "10.240.4.4" - } - ], - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - ] - }, - "CNAME": { - "value": [ - { - "name": "CNAME_test", - "ttl": 3600, - "cnameRecord": { - "cname": "test" - }, - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - ] - }, - "MX": { - "value": [ - { - "name": "MX_contoso", - "ttl": 3600, - "mxRecords": [ - { - "exchange": "contoso.com", - "preference": 100 - } - ], - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - ] - }, - "PTR": { - "value": [ - { - "name": "PTR_contoso", - "ttl": 3600, - "ptrRecords": [ - { - "ptrdname": "contoso.com" - } - ], - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - ] - }, - "SOA": { - "value": [ - { - "name": "@", - "ttl": 3600, - "soaRecord": { - "email": "azureprivatedns-host.microsoft.com", - "expireTime": 2419200, - "host": "azureprivatedns.net", - "minimumTtl": 10, - "refreshTime": 3600, - "retryTime": 300, - "serialNumber": "1" - }, - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - ] - }, - "SRV": { - "value": [ - { - "name": "SRV_contoso", - "ttl": 3600, - "srvRecords": [ - { - "port": 9332, - "priority": 0, - "target": "test.contoso.com", - "weight": 0 - } - ], - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - ] - }, - "TXT": { - "value": [ - { - "name": "TXT_test", - "ttl": 3600, - "txtRecords": [ - { - "value": [ - "test" - ] - } - ], - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - ] - }, - "virtualNetworkLinks": { - "value": [ - { - "virtualNetworkResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001", - "registrationEnabled": true - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>-az-privdns-x-001.com" } + } } ```
+

+ +

Example 2: Parameters

@@ -416,87 +214,80 @@ module privateDnsZones './Microsoft.Network/privateDnsZones/deploy.bicep' = { module privateDnsZones './Microsoft.Network/privateDnsZones/deploy.bicep' = { name: '${uniqueString(deployment().name)}-privateDnsZones' params: { + // Required parameters name: '<>-az-privdns-x-002.com' - lock: 'CanNotDelete' - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] - AAAA: [ - { - name: 'AAAA_2001_0db8_85a3_0000_0000_8a2e_0370_7334' - ttl: 3600 - aaaaRecords: [ - { - ipv6Address: '2001:0db8:85a3:0000:0000:8a2e:0370:7334' - } - ] - } - ] + // Non-required parameters A: [ { - name: 'A_10.240.4.4' - ttl: 3600 aRecords: [ { ipv4Address: '10.240.4.4' } ] + name: 'A_10.240.4.4' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + ttl: 3600 } ] - CNAME: [ + AAAA: [ { - name: 'CNAME_test' + aaaaRecords: [ + { + ipv6Address: '2001:0db8:85a3:0000:0000:8a2e:0370:7334' + } + ] + name: 'AAAA_2001_0db8_85a3_0000_0000_8a2e_0370_7334' ttl: 3600 + } + ] + CNAME: [ + { cnameRecord: { cname: 'test' } + name: 'CNAME_test' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + ttl: 3600 } ] + lock: 'CanNotDelete' MX: [ { - name: 'MX_contoso' - ttl: 3600 mxRecords: [ { exchange: 'contoso.com' preference: 100 } ] + name: 'MX_contoso' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + ttl: 3600 } ] PTR: [ { name: 'PTR_contoso' - ttl: 3600 ptrRecords: [ { ptrdname: 'contoso.com' @@ -504,18 +295,34 @@ module privateDnsZones './Microsoft.Network/privateDnsZones/deploy.bicep' = { ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + ttl: 3600 + } + ] + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' } ] SOA: [ { name: '@' - ttl: 3600 + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] soaRecord: { email: 'azureprivatedns-host.microsoft.com' expireTime: 2419200 @@ -525,20 +332,20 @@ module privateDnsZones './Microsoft.Network/privateDnsZones/deploy.bicep' = { retryTime: 300 serialNumber: '1' } + ttl: 3600 + } + ] + SRV: [ + { + name: 'SRV_contoso' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - } - ] - SRV: [ - { - name: 'SRV_contoso' - ttl: 3600 srvRecords: [ { port: 9332 @@ -547,19 +354,20 @@ module privateDnsZones './Microsoft.Network/privateDnsZones/deploy.bicep' = { weight: 0 } ] + ttl: 3600 + } + ] + TXT: [ + { + name: 'TXT_test' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - } - ] - TXT: [ - { - name: 'TXT_test' ttl: 3600 txtRecords: [ { @@ -568,20 +376,12 @@ module privateDnsZones './Microsoft.Network/privateDnsZones/deploy.bicep' = { ] } ] - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] } ] virtualNetworkLinks: [ { - virtualNetworkResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001' registrationEnabled: true + virtualNetworkResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001' } ] } @@ -590,3 +390,213 @@ module privateDnsZones './Microsoft.Network/privateDnsZones/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-privdns-x-002.com" + }, + // Non-required parameters + "A": { + "value": [ + { + "aRecords": [ + { + "ipv4Address": "10.240.4.4" + } + ], + "name": "A_10.240.4.4", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "ttl": 3600 + } + ] + }, + "AAAA": { + "value": [ + { + "aaaaRecords": [ + { + "ipv6Address": "2001:0db8:85a3:0000:0000:8a2e:0370:7334" + } + ], + "name": "AAAA_2001_0db8_85a3_0000_0000_8a2e_0370_7334", + "ttl": 3600 + } + ] + }, + "CNAME": { + "value": [ + { + "cnameRecord": { + "cname": "test" + }, + "name": "CNAME_test", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "ttl": 3600 + } + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "MX": { + "value": [ + { + "mxRecords": [ + { + "exchange": "contoso.com", + "preference": 100 + } + ], + "name": "MX_contoso", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "ttl": 3600 + } + ] + }, + "PTR": { + "value": [ + { + "name": "PTR_contoso", + "ptrRecords": [ + { + "ptrdname": "contoso.com" + } + ], + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "ttl": 3600 + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "SOA": { + "value": [ + { + "name": "@", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "soaRecord": { + "email": "azureprivatedns-host.microsoft.com", + "expireTime": 2419200, + "host": "azureprivatedns.net", + "minimumTtl": 10, + "refreshTime": 3600, + "retryTime": 300, + "serialNumber": "1" + }, + "ttl": 3600 + } + ] + }, + "SRV": { + "value": [ + { + "name": "SRV_contoso", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "srvRecords": [ + { + "port": 9332, + "priority": 0, + "target": "test.contoso.com", + "weight": 0 + } + ], + "ttl": 3600 + } + ] + }, + "TXT": { + "value": [ + { + "name": "TXT_test", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "ttl": 3600, + "txtRecords": [ + { + "value": [ + "test" + ] + } + ] + } + ] + }, + "virtualNetworkLinks": { + "value": [ + { + "registrationEnabled": true, + "virtualNetworkResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Network/privateEndpoints/readme.md b/modules/Microsoft.Network/privateEndpoints/readme.md index 66b5e836ff..f4967ba666 100644 --- a/modules/Microsoft.Network/privateEndpoints/readme.md +++ b/modules/Microsoft.Network/privateEndpoints/readme.md @@ -162,36 +162,11 @@ roleAssignments: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-pe-kvlt-min-001" - }, - "subnetResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" - }, - "serviceResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-pe" - }, - "groupIds": { - "value": [ - "vault" - ] - } - } -} -``` - -
+

Example 1: Min

@@ -201,12 +176,13 @@ roleAssignments: [ module privateEndpoints './Microsoft.Network/privateEndpoints/deploy.bicep' = { name: '${uniqueString(deployment().name)}-privateEndpoints' params: { - name: '<>-az-pe-kvlt-min-001' - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - serviceResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-pe' + // Required parameters groupIds: [ 'vault' ] + name: '<>-az-pe-kvlt-min-001' + serviceResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-pe' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' } } ``` @@ -214,58 +190,38 @@ module privateEndpoints './Microsoft.Network/privateEndpoints/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-pe-kvlt-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "subnetResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" - }, - "serviceResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-pe" - }, - "groupIds": { - "value": [ - "vault" - ] - }, - "privateDnsZoneGroups": { - "value": [ - { - "privateDNSResourceIds": [ - "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/privatelink.vaultcore.azure.net" - ] - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "groupIds": { + "value": [ + "vault" + ] + }, + "name": { + "value": "<>-az-pe-kvlt-min-001" + }, + "serviceResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-pe" + }, + "subnetResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" } + } } ```
+

+ +

Example 2: Parameters

@@ -275,13 +231,15 @@ module privateEndpoints './Microsoft.Network/privateEndpoints/deploy.bicep' = { module privateEndpoints './Microsoft.Network/privateEndpoints/deploy.bicep' = { name: '${uniqueString(deployment().name)}-privateEndpoints' params: { - name: '<>-az-pe-kvlt-001' - lock: 'CanNotDelete' - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - serviceResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-pe' + // Required parameters groupIds: [ 'vault' ] + name: '<>-az-pe-kvlt-001' + serviceResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-pe' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + // Non-required parameters + lock: 'CanNotDelete' privateDnsZoneGroups: [ { privateDNSResourceIds: [ @@ -291,10 +249,10 @@ module privateEndpoints './Microsoft.Network/privateEndpoints/deploy.bicep' = { ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -303,3 +261,57 @@ module privateEndpoints './Microsoft.Network/privateEndpoints/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "groupIds": { + "value": [ + "vault" + ] + }, + "name": { + "value": "<>-az-pe-kvlt-001" + }, + "serviceResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-pe" + }, + "subnetResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + }, + // Non-required parameters + "lock": { + "value": "CanNotDelete" + }, + "privateDnsZoneGroups": { + "value": [ + { + "privateDNSResourceIds": [ + "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/privatelink.vaultcore.azure.net" + ] + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Network/publicIPAddresses/readme.md b/modules/Microsoft.Network/publicIPAddresses/readme.md index a8cd9907eb..540b76a554 100644 --- a/modules/Microsoft.Network/publicIPAddresses/readme.md +++ b/modules/Microsoft.Network/publicIPAddresses/readme.md @@ -159,66 +159,11 @@ roleAssignments: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-pip-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "skuName": { - "value": "Standard" - }, - "publicIPAllocationMethod": { - "value": "Static" - }, - "zones": { - "value": [ - "1", - "2", - "3" - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Parameters

@@ -228,28 +173,92 @@ roleAssignments: [ module publicIPAddresses './Microsoft.Network/publicIPAddresses/deploy.bicep' = { name: '${uniqueString(deployment().name)}-publicIPAddresses' params: { + // Required parameters name: '<>-az-pip-x-001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' lock: 'CanNotDelete' - skuName: 'Standard' publicIPAllocationMethod: 'Static' - zones: [ - '1' - '2' - '3' - ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + skuName: 'Standard' + zones: [ + '1' + '2' + '3' + ] + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-pip-x-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "publicIPAllocationMethod": { + "value": "Static" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "skuName": { + "value": "Standard" + }, + "zones": { + "value": [ + "1", + "2", + "3" + ] + } } } ``` diff --git a/modules/Microsoft.Network/publicIPPrefixes/readme.md b/modules/Microsoft.Network/publicIPPrefixes/readme.md index 32881b7905..e2995bfc42 100644 --- a/modules/Microsoft.Network/publicIPPrefixes/readme.md +++ b/modules/Microsoft.Network/publicIPPrefixes/readme.md @@ -146,41 +146,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-pippfx-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "prefixLength": { - "value": 28 - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -190,15 +160,17 @@ tags: { module publicIPPrefixes './Microsoft.Network/publicIPPrefixes/deploy.bicep' = { name: '${uniqueString(deployment().name)}-publicIPPrefixes' params: { + // Required parameters name: '<>-az-pippfx-x-001' - lock: 'CanNotDelete' prefixLength: 28 + // Non-required parameters + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -207,3 +179,40 @@ module publicIPPrefixes './Microsoft.Network/publicIPPrefixes/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-pippfx-x-001" + }, + "prefixLength": { + "value": 28 + }, + // Non-required parameters + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Network/routeTables/readme.md b/modules/Microsoft.Network/routeTables/readme.md index 7bbf95c725..c514bae1e3 100644 --- a/modules/Microsoft.Network/routeTables/readme.md +++ b/modules/Microsoft.Network/routeTables/readme.md @@ -236,50 +236,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-udr-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "routes": { - "value": [ - { - "name": "default", - "properties": { - "addressPrefix": "0.0.0.0/0", - "nextHopType": "VirtualAppliance", - "nextHopIpAddress": "172.16.0.20" - } - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -289,26 +250,74 @@ tags: { module routeTables './Microsoft.Network/routeTables/deploy.bicep' = { name: '${uniqueString(deployment().name)}-routeTables' params: { + // Required parameters name: '<>-az-udr-x-001' + // Non-required parameters lock: 'CanNotDelete' + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] routes: [ { name: 'default' properties: { addressPrefix: '0.0.0.0/0' - nextHopType: 'VirtualAppliance' nextHopIpAddress: '172.16.0.20' + nextHopType: 'VirtualAppliance' } } ] - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-udr-x-001" + }, + // Non-required parameters + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "routes": { + "value": [ + { + "name": "default", + "properties": { + "addressPrefix": "0.0.0.0/0", + "nextHopIpAddress": "172.16.0.20", + "nextHopType": "VirtualAppliance" + } + } + ] + } } } ``` diff --git a/modules/Microsoft.Network/trafficmanagerprofiles/readme.md b/modules/Microsoft.Network/trafficmanagerprofiles/readme.md index 884cf361cb..21d7c698d4 100644 --- a/modules/Microsoft.Network/trafficmanagerprofiles/readme.md +++ b/modules/Microsoft.Network/trafficmanagerprofiles/readme.md @@ -250,56 +250,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "tm-000001" - }, - "lock": { - "value": "CanNotDelete" - }, - "relativeName": { - "value": "tm-000001" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Parameters

@@ -309,22 +264,76 @@ tags: { module trafficmanagerprofiles './Microsoft.Network/trafficmanagerprofiles/deploy.bicep' = { name: '${uniqueString(deployment().name)}-trafficmanagerprofiles' params: { + // Required parameters name: 'tm-000001' - lock: 'CanNotDelete' relativeName: 'tm-000001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "tm-000001" + }, + "relativeName": { + "value": "tm-000001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } } } ``` diff --git a/modules/Microsoft.Network/virtualHubs/readme.md b/modules/Microsoft.Network/virtualHubs/readme.md index 9d3449bbc6..2a77e2378a 100644 --- a/modules/Microsoft.Network/virtualHubs/readme.md +++ b/modules/Microsoft.Network/virtualHubs/readme.md @@ -103,31 +103,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-vhub-min-001" - }, - "addressPrefix": { - "value": "10.0.0.0/16" - }, - "virtualWanId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualWans/adp-<>-az-vw-x-001" - } - } -} -``` - -
+

Example 1: Min

@@ -137,8 +117,9 @@ tags: { module virtualHubs './Microsoft.Network/virtualHubs/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualHubs' params: { - name: '<>-az-vhub-min-001' + // Required parameters addressPrefix: '10.0.0.0/16' + name: '<>-az-vhub-min-001' virtualWanId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualWans/adp-<>-az-vw-x-001' } } @@ -147,64 +128,33 @@ module virtualHubs './Microsoft.Network/virtualHubs/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-vhub-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "addressPrefix": { - "value": "10.1.0.0/16" - }, - "virtualWanId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualWans/adp-<>-az-vw-x-001" - }, - "hubRouteTables": { - "value": [ - { - "name": "routeTable1" - } - ] - }, - "hubVirtualNetworkConnections": { - "value": [ - { - "name": "connection1", - "remoteVirtualNetworkId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-vhub", - "routingConfiguration": { - "associatedRouteTable": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vHub-x-001/hubRouteTables/routeTable1" - }, - "propagatedRouteTables": { - "ids": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vHub-x-001/hubRouteTables/routeTable1" - } - ], - "labels": [ - "none" - ] - } - } - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "addressPrefix": { + "value": "10.0.0.0/16" + }, + "name": { + "value": "<>-az-vhub-min-001" + }, + "virtualWanId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualWans/adp-<>-az-vw-x-001" } + } } ```
+

+ +

Example 2: Parameters

@@ -214,10 +164,11 @@ module virtualHubs './Microsoft.Network/virtualHubs/deploy.bicep' = { module virtualHubs './Microsoft.Network/virtualHubs/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualHubs' params: { - name: '<>-az-vhub-x-001' - lock: 'CanNotDelete' + // Required parameters addressPrefix: '10.1.0.0/16' + name: '<>-az-vhub-x-001' virtualWanId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualWans/adp-<>-az-vw-x-001' + // Non-required parameters hubRouteTables: [ { name: 'routeTable1' @@ -244,6 +195,67 @@ module virtualHubs './Microsoft.Network/virtualHubs/deploy.bicep' = { } } ] + lock: 'CanNotDelete' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "addressPrefix": { + "value": "10.1.0.0/16" + }, + "name": { + "value": "<>-az-vhub-x-001" + }, + "virtualWanId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualWans/adp-<>-az-vw-x-001" + }, + // Non-required parameters + "hubRouteTables": { + "value": [ + { + "name": "routeTable1" + } + ] + }, + "hubVirtualNetworkConnections": { + "value": [ + { + "name": "connection1", + "remoteVirtualNetworkId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-vhub", + "routingConfiguration": { + "associatedRouteTable": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vHub-x-001/hubRouteTables/routeTable1" + }, + "propagatedRouteTables": { + "ids": [ + { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vHub-x-001/hubRouteTables/routeTable1" + } + ], + "labels": [ + "none" + ] + } + } + } + ] + }, + "lock": { + "value": "CanNotDelete" + } } } ``` diff --git a/modules/Microsoft.Network/virtualNetworkGateways/readme.md b/modules/Microsoft.Network/virtualNetworkGateways/readme.md index 7324b614d0..c5d65bcc83 100644 --- a/modules/Microsoft.Network/virtualNetworkGateways/readme.md +++ b/modules/Microsoft.Network/virtualNetworkGateways/readme.md @@ -240,77 +240,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-gw-er-001" - }, - "gatewayPipName": { - "value": "<>-az-gw-er-001-pip" - }, - "domainNameLabel": { - "value": [ - "<>-az-gw-er-dm-001" - ] - }, - "virtualNetworkGatewayType": { - "value": "ExpressRoute" - }, - "virtualNetworkGatewaySku": { - "value": "ErGw1AZ" - }, - "vNetResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001" - }, - "tags": { - "value": { - "Environment": "Validation", - "Contact": "test.user@testcompany.com", - "PurchaseOrder": "", - "CostCenter": "", - "ServiceName": "DeploymentValidation", - "Role": "DeploymentValidation" - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Expressroute

@@ -320,35 +254,37 @@ tags: { module virtualNetworkGateways './Microsoft.Network/virtualNetworkGateways/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualNetworkGateways' params: { + // Required parameters name: '<>-az-gw-er-001' - gatewayPipName: '<>-az-gw-er-001-pip' + virtualNetworkGatewaySku: 'ErGw1AZ' + virtualNetworkGatewayType: 'ExpressRoute' + vNetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' domainNameLabel: [ '<>-az-gw-er-dm-001' ] - virtualNetworkGatewayType: 'ExpressRoute' - virtualNetworkGatewaySku: 'ErGw1AZ' - vNetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001' - tags: { - Environment: 'Validation' - Contact: 'test.user@testcompany.com' - PurchaseOrder: '' - CostCenter: '' - ServiceName: 'DeploymentValidation' - Role: 'DeploymentValidation' - } + gatewayPipName: '<>-az-gw-er-001-pip' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + tags: { + Contact: 'test.user@testcompany.com' + CostCenter: '' + Environment: 'Validation' + PurchaseOrder: '' + Role: 'DeploymentValidation' + ServiceName: 'DeploymentValidation' + } } } ``` @@ -356,78 +292,80 @@ module virtualNetworkGateways './Microsoft.Network/virtualNetworkGateways/deploy

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-gw-vpn-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "domainNameLabel": { - "value": [ - "<>-az-gw-vpn-dm-001" - ] - }, - "virtualNetworkGatewayType": { - "value": "Vpn" - }, - "virtualNetworkGatewaySku": { - "value": "VpnGw1AZ" - }, - "publicIpZones": { - "value": [ - "1" - ] - }, - "vpnType": { - "value": "RouteBased" - }, - "activeActive": { - "value": true - }, - "vNetResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-gw-er-001" + }, + "virtualNetworkGatewaySku": { + "value": "ErGw1AZ" + }, + "virtualNetworkGatewayType": { + "value": "ExpressRoute" + }, + "vNetResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "domainNameLabel": { + "value": [ + "<>-az-gw-er-dm-001" + ] + }, + "gatewayPipName": { + "value": "<>-az-gw-er-001-pip" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] + }, + "tags": { + "value": { + "Contact": "test.user@testcompany.com", + "CostCenter": "", + "Environment": "Validation", + "PurchaseOrder": "", + "Role": "DeploymentValidation", + "ServiceName": "DeploymentValidation" + } } + } } ```
+

+ +

Example 2: Vpn

@@ -437,32 +375,108 @@ module virtualNetworkGateways './Microsoft.Network/virtualNetworkGateways/deploy module virtualNetworkGateways './Microsoft.Network/virtualNetworkGateways/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualNetworkGateways' params: { + // Required parameters name: '<>-az-gw-vpn-001' - lock: 'CanNotDelete' + virtualNetworkGatewaySku: 'VpnGw1AZ' + virtualNetworkGatewayType: 'Vpn' + vNetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001' + // Non-required parameters + activeActive: true + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' domainNameLabel: [ '<>-az-gw-vpn-dm-001' ] - virtualNetworkGatewayType: 'Vpn' - virtualNetworkGatewaySku: 'VpnGw1AZ' + lock: 'CanNotDelete' publicIpZones: [ '1' ] - vpnType: 'RouteBased' - activeActive: true - vNetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + vpnType: 'RouteBased' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-gw-vpn-001" + }, + "virtualNetworkGatewaySku": { + "value": "VpnGw1AZ" + }, + "virtualNetworkGatewayType": { + "value": "Vpn" + }, + "vNetResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001" + }, + // Non-required parameters + "activeActive": { + "value": true + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "domainNameLabel": { + "value": [ + "<>-az-gw-vpn-dm-001" + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "publicIpZones": { + "value": [ + "1" + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "vpnType": { + "value": "RouteBased" + } } } ``` diff --git a/modules/Microsoft.Network/virtualNetworks/readme.md b/modules/Microsoft.Network/virtualNetworks/readme.md index 9e5d73bf64..f0131b4a4e 100644 --- a/modules/Microsoft.Network/virtualNetworks/readme.md +++ b/modules/Microsoft.Network/virtualNetworks/readme.md @@ -348,30 +348,11 @@ The network security group and route table resources must reside in the same res ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-vnet-min-001" - }, - "addressPrefixes": { - "value": [ - "10.0.0.0/16" - ] - } - } -} -``` - -
+

Example 1: Min

@@ -381,10 +362,11 @@ The network security group and route table resources must reside in the same res module virtualNetworks './Microsoft.Network/virtualNetworks/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualNetworks' params: { - name: '<>-az-vnet-min-001' + // Required parameters addressPrefixes: [ '10.0.0.0/16' ] + name: '<>-az-vnet-min-001' } } ``` @@ -392,112 +374,32 @@ module virtualNetworks './Microsoft.Network/virtualNetworks/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-vnet-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "addressPrefixes": { - "value": [ - "10.0.0.0/16" - ] - }, - "subnets": { - "value": [ - { - "name": "GatewaySubnet", - "addressPrefix": "10.0.255.0/24" - }, - { - "name": "<>-az-subnet-x-001", - "addressPrefix": "10.0.0.0/24", - "networkSecurityGroupId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/networkSecurityGroups/adp-<>-az-nsg-x-001", - "serviceEndpoints": [ - { - "service": "Microsoft.Storage" - }, - { - "service": "Microsoft.Sql" - } - ], - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ], - "routeTableId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/routeTables/adp-<>-az-udr-x-001" - }, - { - "name": "<>-az-subnet-x-002", - "addressPrefix": "10.0.3.0/24", - "delegations": [ - { - "name": "netappDel", - "properties": { - "serviceName": "Microsoft.Netapp/volumes" - } - } - ] - }, - { - "name": "<>-az-subnet-x-003", - "addressPrefix": "10.0.6.0/24", - "privateEndpointNetworkPolicies": "Disabled", - "privateLinkServiceNetworkPolicies": "Enabled" - } - ] - }, - "dnsServers": { - "value": [ - "10.0.1.4", - "10.0.1.5" - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "addressPrefixes": { + "value": [ + "10.0.0.0/16" + ] + }, + "name": { + "value": "<>-az-vnet-min-001" } + } } ```
+

+ +

Example 2: Parameters

@@ -507,40 +409,58 @@ module virtualNetworks './Microsoft.Network/virtualNetworks/deploy.bicep' = { module virtualNetworks './Microsoft.Network/virtualNetworks/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualNetworks' params: { - name: '<>-az-vnet-x-001' - lock: 'CanNotDelete' + // Required parameters addressPrefixes: [ '10.0.0.0/16' ] + name: '<>-az-vnet-x-001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + dnsServers: [ + '10.0.1.4' + '10.0.1.5' + ] + lock: 'CanNotDelete' + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] subnets: [ { - name: 'GatewaySubnet' addressPrefix: '10.0.255.0/24' + name: 'GatewaySubnet' } { - name: '<>-az-subnet-x-001' addressPrefix: '10.0.0.0/24' + name: '<>-az-subnet-x-001' networkSecurityGroupId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/networkSecurityGroups/adp-<>-az-nsg-x-001' - serviceEndpoints: [ - { - service: 'Microsoft.Storage' - } - { - service: 'Microsoft.Sql' - } - ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] routeTableId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/routeTables/adp-<>-az-udr-x-001' + serviceEndpoints: [ + { + service: 'Microsoft.Storage' + } + { + service: 'Microsoft.Sql' + } + ] } { - name: '<>-az-subnet-x-002' addressPrefix: '10.0.3.0/24' delegations: [ { @@ -550,31 +470,15 @@ module virtualNetworks './Microsoft.Network/virtualNetworks/deploy.bicep' = { } } ] + name: '<>-az-subnet-x-002' } { - name: '<>-az-subnet-x-003' addressPrefix: '10.0.6.0/24' + name: '<>-az-subnet-x-003' privateEndpointNetworkPolicies: 'Disabled' privateLinkServiceNetworkPolicies: 'Enabled' } ] - dnsServers: [ - '10.0.1.4' - '10.0.1.5' - ] - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' } } ``` @@ -582,68 +486,115 @@ module virtualNetworks './Microsoft.Network/virtualNetworks/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-vnet-peer-001" - }, - "addressPrefixes": { - "value": [ - "10.0.0.0/24" - ] - }, - "subnets": { - "value": [ - { - "name": "GatewaySubnet", - "addressPrefix": "10.0.0.0/26" - } - ] - }, - "virtualNetworkPeerings": { - "value": [ - { - "remoteVirtualNetworkId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-peer01", - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "allowVirtualNetworkAccess": true, - "useRemoteGateways": false, - "remotePeeringEnabled": true, - "remotePeeringName": "customName", - "remotePeeringAllowVirtualNetworkAccess": true, - "remotePeeringAllowForwardedTraffic": true - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "addressPrefixes": { + "value": [ + "10.0.0.0/16" + ] + }, + "name": { + "value": "<>-az-vnet-x-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "dnsServers": { + "value": [ + "10.0.1.4", + "10.0.1.5" + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "subnets": { + "value": [ + { + "addressPrefix": "10.0.255.0/24", + "name": "GatewaySubnet" }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + { + "addressPrefix": "10.0.0.0/24", + "name": "<>-az-subnet-x-001", + "networkSecurityGroupId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/networkSecurityGroups/adp-<>-az-nsg-x-001", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "routeTableId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/routeTables/adp-<>-az-udr-x-001", + "serviceEndpoints": [ + { + "service": "Microsoft.Storage" + }, + { + "service": "Microsoft.Sql" + } + ] }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + { + "addressPrefix": "10.0.3.0/24", + "delegations": [ + { + "name": "netappDel", + "properties": { + "serviceName": "Microsoft.Netapp/volumes" + } + } + ], + "name": "<>-az-subnet-x-002" }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + { + "addressPrefix": "10.0.6.0/24", + "name": "<>-az-subnet-x-003", + "privateEndpointNetworkPolicies": "Disabled", + "privateLinkServiceNetworkPolicies": "Enabled" } + ] } + } } ```
+

+ +

Example 3: Vnetpeering

@@ -653,34 +604,100 @@ module virtualNetworks './Microsoft.Network/virtualNetworks/deploy.bicep' = { module virtualNetworks './Microsoft.Network/virtualNetworks/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualNetworks' params: { - name: '<>-az-vnet-peer-001' + // Required parameters addressPrefixes: [ '10.0.0.0/24' ] + name: '<>-az-vnet-peer-001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' subnets: [ { - name: 'GatewaySubnet' addressPrefix: '10.0.0.0/26' + name: 'GatewaySubnet' } ] virtualNetworkPeerings: [ { - remoteVirtualNetworkId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-peer01' allowForwardedTraffic: true allowGatewayTransit: false allowVirtualNetworkAccess: true - useRemoteGateways: false + remotePeeringAllowForwardedTraffic: true + remotePeeringAllowVirtualNetworkAccess: true remotePeeringEnabled: true remotePeeringName: 'customName' - remotePeeringAllowVirtualNetworkAccess: true - remotePeeringAllowForwardedTraffic: true + remoteVirtualNetworkId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-peer01' + useRemoteGateways: false } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "addressPrefixes": { + "value": [ + "10.0.0.0/24" + ] + }, + "name": { + "value": "<>-az-vnet-peer-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "subnets": { + "value": [ + { + "addressPrefix": "10.0.0.0/26", + "name": "GatewaySubnet" + } + ] + }, + "virtualNetworkPeerings": { + "value": [ + { + "allowForwardedTraffic": true, + "allowGatewayTransit": false, + "allowVirtualNetworkAccess": true, + "remotePeeringAllowForwardedTraffic": true, + "remotePeeringAllowVirtualNetworkAccess": true, + "remotePeeringEnabled": true, + "remotePeeringName": "customName", + "remoteVirtualNetworkId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-peer01", + "useRemoteGateways": false + } + ] + } } } ``` diff --git a/modules/Microsoft.Network/virtualWans/readme.md b/modules/Microsoft.Network/virtualWans/readme.md index f081449087..a3304de210 100644 --- a/modules/Microsoft.Network/virtualWans/readme.md +++ b/modules/Microsoft.Network/virtualWans/readme.md @@ -149,25 +149,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-vw-min-001" - } - } -} -``` - -
+

Example 1: Min

@@ -185,50 +171,26 @@ module virtualWans './Microsoft.Network/virtualWans/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-vw-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "type": { - "value": "Basic" - }, - "allowBranchToBranchTraffic": { - "value": true - }, - "allowVnetToVnetTraffic": { - "value": true - }, - "disableVpnEncryption": { - "value": true - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>-az-vw-min-001" } + } } ```
+

+ +

Example 2: Parameters

@@ -238,20 +200,68 @@ module virtualWans './Microsoft.Network/virtualWans/deploy.bicep' = { module virtualWans './Microsoft.Network/virtualWans/deploy.bicep' = { name: '${uniqueString(deployment().name)}-virtualWans' params: { + // Required parameters name: '<>-az-vw-x-001' - lock: 'CanNotDelete' - type: 'Basic' + // Non-required parameters allowBranchToBranchTraffic: true allowVnetToVnetTraffic: true disableVpnEncryption: true + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + type: 'Basic' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-vw-x-001" + }, + // Non-required parameters + "allowBranchToBranchTraffic": { + "value": true + }, + "allowVnetToVnetTraffic": { + "value": true + }, + "disableVpnEncryption": { + "value": true + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "type": { + "value": "Basic" + } } } ``` diff --git a/modules/Microsoft.Network/vpnGateways/readme.md b/modules/Microsoft.Network/vpnGateways/readme.md index 5f162f0fd3..24ac26d0e7 100644 --- a/modules/Microsoft.Network/vpnGateways/readme.md +++ b/modules/Microsoft.Network/vpnGateways/readme.md @@ -170,28 +170,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-vpngw-min-001" - }, - "virtualHubResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vhub-min-001" - } - } -} -``` - -
+

Example 1: Min

@@ -201,6 +184,7 @@ tags: { module vpnGateways './Microsoft.Network/vpnGateways/deploy.bicep' = { name: '${uniqueString(deployment().name)}-vpnGateways' params: { + // Required parameters name: '<>-az-vpngw-min-001' virtualHubResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vhub-min-001' } @@ -210,84 +194,30 @@ module vpnGateways './Microsoft.Network/vpnGateways/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-vpngw-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "virtualHubResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vhub-x-001" - }, - "bgpSettings": { - "value": { - "asn": 65515, - "peerWeight": 0 - } - }, - "connections": { - "value": [ - { - "name": "Connection-<>-az-vsite-x-001", - "connectionBandwidth": 10, - "enableBgp": true, - "routingConfiguration": { - "associatedRouteTable": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vhub-x-001/hubRouteTables/defaultRouteTable" - }, - "propagatedRouteTables": { - "labels": [ - "default" - ], - "ids": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vhub-x-001/hubRouteTables/defaultRouteTable" - } - ] - }, - "vnetRoutes": { - "staticRoutes": [] - } - }, - "remoteVpnSiteResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/vpnSites/<>-az-vsite-x-001" - } - ] - }, - "natRules": { - "value": [ - { - "name": "natRule1", - "internalMappings": [ - { - "addressSpace": "10.4.0.0/24" - } - ], - "externalMappings": [ - { - "addressSpace": "192.168.21.0/24" - } - ], - "type": "Static", - "mode": "EgressSnat" - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-vpngw-min-001" + }, + "virtualHubResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vhub-min-001" } + } } ```
+

+ +

Example 2: Parameters

@@ -297,54 +227,56 @@ module vpnGateways './Microsoft.Network/vpnGateways/deploy.bicep' = { module vpnGateways './Microsoft.Network/vpnGateways/deploy.bicep' = { name: '${uniqueString(deployment().name)}-vpnGateways' params: { + // Required parameters name: '<>-az-vpngw-x-001' - lock: 'CanNotDelete' virtualHubResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vhub-x-001' + // Non-required parameters bgpSettings: { asn: 65515 peerWeight: 0 } connections: [ { - name: 'Connection-<>-az-vsite-x-001' connectionBandwidth: 10 enableBgp: true + name: 'Connection-<>-az-vsite-x-001' + remoteVpnSiteResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/vpnSites/<>-az-vsite-x-001' routingConfiguration: { associatedRouteTable: { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vhub-x-001/hubRouteTables/defaultRouteTable' } propagatedRouteTables: { - labels: [ - 'default' - ] ids: [ { id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vhub-x-001/hubRouteTables/defaultRouteTable' } ] + labels: [ + 'default' + ] } vnetRoutes: { staticRoutes: [] } } - remoteVpnSiteResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/vpnSites/<>-az-vsite-x-001' } ] + lock: 'CanNotDelete' natRules: [ { - name: 'natRule1' - internalMappings: [ + externalMappings: [ { - addressSpace: '10.4.0.0/24' + addressSpace: '192.168.21.0/24' } ] - externalMappings: [ + internalMappings: [ { - addressSpace: '192.168.21.0/24' + addressSpace: '10.4.0.0/24' } ] - type: 'Static' mode: 'EgressSnat' + name: 'natRule1' + type: 'Static' } ] } @@ -353,3 +285,83 @@ module vpnGateways './Microsoft.Network/vpnGateways/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-vpngw-x-001" + }, + "virtualHubResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vhub-x-001" + }, + // Non-required parameters + "bgpSettings": { + "value": { + "asn": 65515, + "peerWeight": 0 + } + }, + "connections": { + "value": [ + { + "connectionBandwidth": 10, + "enableBgp": true, + "name": "Connection-<>-az-vsite-x-001", + "remoteVpnSiteResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/vpnSites/<>-az-vsite-x-001", + "routingConfiguration": { + "associatedRouteTable": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vhub-x-001/hubRouteTables/defaultRouteTable" + }, + "propagatedRouteTables": { + "ids": [ + { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<>-az-vhub-x-001/hubRouteTables/defaultRouteTable" + } + ], + "labels": [ + "default" + ] + }, + "vnetRoutes": { + "staticRoutes": [] + } + } + } + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "natRules": { + "value": [ + { + "externalMappings": [ + { + "addressSpace": "192.168.21.0/24" + } + ], + "internalMappings": [ + { + "addressSpace": "10.4.0.0/24" + } + ], + "mode": "EgressSnat", + "name": "natRule1", + "type": "Static" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Network/vpnSites/readme.md b/modules/Microsoft.Network/vpnSites/readme.md index 05d815968d..dfec6ffdeb 100644 --- a/modules/Microsoft.Network/vpnSites/readme.md +++ b/modules/Microsoft.Network/vpnSites/readme.md @@ -318,36 +318,11 @@ roleAssignments: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-vSite-min-001" - }, - "addressPrefixes": { - "value": [ - "10.0.0.0/16" - ] - }, - "ipAddress": { - "value": "1.2.3.4" - }, - "virtualWanId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualWans/apd-<>-az-vw-x-001" - } - } -} -``` - -
+

Example 1: Min

@@ -357,12 +332,14 @@ roleAssignments: [ module vpnSites './Microsoft.Network/vpnSites/deploy.bicep' = { name: '${uniqueString(deployment().name)}-vpnSites' params: { + // Required parameters name: '<>-az-vSite-min-001' + virtualWanId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualWans/apd-<>-az-vw-x-001' + // Non-required parameters addressPrefixes: [ '10.0.0.0/16' ] ipAddress: '1.2.3.4' - virtualWanId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualWans/apd-<>-az-vw-x-001' } } ``` @@ -370,93 +347,39 @@ module vpnSites './Microsoft.Network/vpnSites/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-vSite-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "tags": { - "value": { - "tagA": "valueA", - "tagB": "valueB" - } - }, - "deviceProperties": { - "value": { - "linkSpeedInMbps": 0 - } - }, - "virtualWanId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualWans/apd-<>-az-vw-x-001" - }, - "vpnSiteLinks": { - "value": [ - { - "name": "<>-az-vSite-x-001", - "properties": { - "bgpProperties": { - "asn": 65010, - "bgpPeeringAddress": "1.1.1.1" - }, - "ipAddress": "1.2.3.4", - "linkProperties": { - "linkProviderName": "contoso", - "linkSpeedInMbps": 5 - } - } - }, - { - "name": "Link1", - "properties": { - "bgpProperties": { - "asn": 65020, - "bgpPeeringAddress": "192.168.1.0" - }, - "ipAddress": "2.2.2.2", - "linkProperties": { - "linkProviderName": "contoso", - "linkSpeedInMbps": 5 - } - } - } - ] - }, - "o365Policy": { - "value": { - "breakOutCategories": { - "optimize": true, - "allow": true, - "default": true - } - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-vSite-min-001" + }, + "virtualWanId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualWans/apd-<>-az-vw-x-001" + }, + // Non-required parameters + "addressPrefixes": { + "value": [ + "10.0.0.0/16" + ] + }, + "ipAddress": { + "value": "1.2.3.4" } + } } ```
+

+ +

Example 2: Parameters

@@ -466,16 +389,33 @@ module vpnSites './Microsoft.Network/vpnSites/deploy.bicep' = { module vpnSites './Microsoft.Network/vpnSites/deploy.bicep' = { name: '${uniqueString(deployment().name)}-vpnSites' params: { + // Required parameters name: '<>-az-vSite-x-001' + virtualWanId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualWans/apd-<>-az-vw-x-001' + // Non-required parameters + deviceProperties: { + linkSpeedInMbps: 0 + } lock: 'CanNotDelete' + o365Policy: { + breakOutCategories: { + allow: true + default: true + optimize: true + } + } + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] tags: { tagA: 'valueA' tagB: 'valueB' } - deviceProperties: { - linkSpeedInMbps: 0 - } - virtualWanId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualWans/apd-<>-az-vw-x-001' vpnSiteLinks: [ { name: '<>-az-vSite-x-001' @@ -506,21 +446,95 @@ module vpnSites './Microsoft.Network/vpnSites/deploy.bicep' = { } } ] - o365Policy: { - breakOutCategories: { - optimize: true - allow: true - default: true + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-vSite-x-001" + }, + "virtualWanId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualWans/apd-<>-az-vw-x-001" + }, + // Non-required parameters + "deviceProperties": { + "value": { + "linkSpeedInMbps": 0 } - } - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] + }, + "lock": { + "value": "CanNotDelete" + }, + "o365Policy": { + "value": { + "breakOutCategories": { + "allow": true, + "default": true, + "optimize": true + } } - ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "tags": { + "value": { + "tagA": "valueA", + "tagB": "valueB" + } + }, + "vpnSiteLinks": { + "value": [ + { + "name": "<>-az-vSite-x-001", + "properties": { + "bgpProperties": { + "asn": 65010, + "bgpPeeringAddress": "1.1.1.1" + }, + "ipAddress": "1.2.3.4", + "linkProperties": { + "linkProviderName": "contoso", + "linkSpeedInMbps": 5 + } + } + }, + { + "name": "Link1", + "properties": { + "bgpProperties": { + "asn": 65020, + "bgpPeeringAddress": "192.168.1.0" + }, + "ipAddress": "2.2.2.2", + "linkProperties": { + "linkProviderName": "contoso", + "linkSpeedInMbps": 5 + } + } + } + ] + } } } ``` diff --git a/modules/Microsoft.OperationalInsights/workspaces/readme.md b/modules/Microsoft.OperationalInsights/workspaces/readme.md index 320444d097..06ead99a9a 100644 --- a/modules/Microsoft.OperationalInsights/workspaces/readme.md +++ b/modules/Microsoft.OperationalInsights/workspaces/readme.md @@ -447,25 +447,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-law-min-001" - } - } -} -``` - -
+

Example 1: Min

@@ -483,195 +469,26 @@ module workspaces './Microsoft.OperationalInsights/workspaces/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-law-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "publicNetworkAccessForIngestion": { - "value": "Disabled" - }, - "publicNetworkAccessForQuery": { - "value": "Disabled" - }, - "dailyQuotaGb": { - "value": 10 - }, - "storageInsightsConfigs": { - "value": [ - { - "storageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsalaw001", - "tables": [ - "WADWindowsEventLogsTable", - "WADETWEventTable", - "WADServiceFabric*EventTable", - "LinuxsyslogVer2v0" - ] - } - ] - }, - "linkedServices": { - "value": [ - { - "name": "Automation", - "resourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Automation/automationAccounts/adp-<>-az-aut-x-001" - } - ] - }, - "linkedStorageAccounts": { - "value": [ - { - "name": "Query", - "resourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsalaw001" - } - ] - }, - "savedSearches": { - "value": [ - { - "name": "VMSSQueries", - "displayName": "VMSS Instance Count2", - "category": "VDC Saved Searches", - "query": "Event | where Source == 'ServiceFabricNodeBootstrapAgent' | summarize AggregatedValue = count() by Computer" - } - ] - }, - "dataSources": { - "value": [ - { - "name": "applicationEvent", - "kind": "WindowsEvent", - "eventLogName": "Application", - "eventTypes": [ - { - "eventType": "Error" - }, - { - "eventType": "Warning" - }, - { - "eventType": "Information" - } - ] - }, - { - "name": "windowsPerfCounter1", - "kind": "WindowsPerformanceCounter", - "objectName": "Processor", - "instanceName": "*", - "intervalSeconds": 60, - "counterName": "% Processor Time" - }, - { - "name": "sampleIISLog1", - "kind": "IISLogs", - "state": "OnPremiseEnabled" - }, - { - "name": "sampleSyslog1", - "kind": "LinuxSyslog", - "syslogName": "kern", - "syslogSeverities": [ - { - "severity": "emerg" - }, - { - "severity": "alert" - }, - { - "severity": "crit" - }, - { - "severity": "err" - }, - { - "severity": "warning" - } - ] - }, - { - "name": "sampleSyslogCollection1", - "kind": "LinuxSyslogCollection", - "state": "Enabled" - }, - { - "name": "sampleLinuxPerf1", - "kind": "LinuxPerformanceObject", - "syslogSeverities": [ - { - "counterName": "% Used Inodes" - }, - { - "counterName": "Free Megabytes" - }, - { - "counterName": "% Used Space" - }, - { - "counterName": "Disk Transfers/sec" - }, - { - "counterName": "Disk Reads/sec" - }, - { - "counterName": "Disk Writes/sec" - } - ], - "objectName": "Logical Disk", - "instanceName": "*", - "intervalSeconds": 10 - }, - { - "name": "sampleLinuxPerfCollection1", - "kind": "LinuxPerformanceCollection", - "state": "Enabled" - } - ] - }, - "gallerySolutions": { - "value": [ - { - "name": "AzureAutomation", - "product": "OMSGallery", - "publisher": "Microsoft" - } - ] - }, - "useResourcePermissions": { - "value": true - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>-az-law-min-001" } + } } ```
+

+ +

Example 2: Parameters

@@ -681,46 +498,12 @@ module workspaces './Microsoft.OperationalInsights/workspaces/deploy.bicep' = { module workspaces './Microsoft.OperationalInsights/workspaces/deploy.bicep' = { name: '${uniqueString(deployment().name)}-workspaces' params: { + // Required parameters name: '<>-az-law-x-001' - lock: 'CanNotDelete' - publicNetworkAccessForIngestion: 'Disabled' - publicNetworkAccessForQuery: 'Disabled' + // Non-required parameters dailyQuotaGb: 10 - storageInsightsConfigs: [ - { - storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsalaw001' - tables: [ - 'WADWindowsEventLogsTable' - 'WADETWEventTable' - 'WADServiceFabric*EventTable' - 'LinuxsyslogVer2v0' - ] - } - ] - linkedServices: [ - { - name: 'Automation' - resourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Automation/automationAccounts/adp-<>-az-aut-x-001' - } - ] - linkedStorageAccounts: [ - { - name: 'Query' - resourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsalaw001' - } - ] - savedSearches: [ - { - name: 'VMSSQueries' - displayName: 'VMSS Instance Count2' - category: 'VDC Saved Searches' - query: 'Event | where Source == 'ServiceFabricNodeBootstrapAgent' | summarize AggregatedValue = count() by Computer' - } - ] dataSources: [ { - name: 'applicationEvent' - kind: 'WindowsEvent' eventLogName: 'Application' eventTypes: [ { @@ -733,23 +516,25 @@ module workspaces './Microsoft.OperationalInsights/workspaces/deploy.bicep' = { eventType: 'Information' } ] + kind: 'WindowsEvent' + name: 'applicationEvent' } { - name: 'windowsPerfCounter1' - kind: 'WindowsPerformanceCounter' - objectName: 'Processor' + counterName: '% Processor Time' instanceName: '*' intervalSeconds: 60 - counterName: '% Processor Time' + kind: 'WindowsPerformanceCounter' + name: 'windowsPerfCounter1' + objectName: 'Processor' } { - name: 'sampleIISLog1' kind: 'IISLogs' + name: 'sampleIISLog1' state: 'OnPremiseEnabled' } { - name: 'sampleSyslog1' kind: 'LinuxSyslog' + name: 'sampleSyslog1' syslogName: 'kern' syslogSeverities: [ { @@ -770,13 +555,16 @@ module workspaces './Microsoft.OperationalInsights/workspaces/deploy.bicep' = { ] } { - name: 'sampleSyslogCollection1' kind: 'LinuxSyslogCollection' + name: 'sampleSyslogCollection1' state: 'Enabled' } { - name: 'sampleLinuxPerf1' + instanceName: '*' + intervalSeconds: 10 kind: 'LinuxPerformanceObject' + name: 'sampleLinuxPerf1' + objectName: 'Logical Disk' syslogSeverities: [ { counterName: '% Used Inodes' @@ -797,16 +585,18 @@ module workspaces './Microsoft.OperationalInsights/workspaces/deploy.bicep' = { counterName: 'Disk Writes/sec' } ] - objectName: 'Logical Disk' - instanceName: '*' - intervalSeconds: 10 } { - name: 'sampleLinuxPerfCollection1' kind: 'LinuxPerformanceCollection' + name: 'sampleLinuxPerfCollection1' state: 'Enabled' } ] + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' gallerySolutions: [ { name: 'AzureAutomation' @@ -814,12 +604,232 @@ module workspaces './Microsoft.OperationalInsights/workspaces/deploy.bicep' = { publisher: 'Microsoft' } ] + linkedServices: [ + { + name: 'Automation' + resourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Automation/automationAccounts/adp-<>-az-aut-x-001' + } + ] + linkedStorageAccounts: [ + { + name: 'Query' + resourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsalaw001' + } + ] + lock: 'CanNotDelete' + publicNetworkAccessForIngestion: 'Disabled' + publicNetworkAccessForQuery: 'Disabled' + savedSearches: [ + { + category: 'VDC Saved Searches' + displayName: 'VMSS Instance Count2' + name: 'VMSSQueries' + query: 'Event | where Source == 'ServiceFabricNodeBootstrapAgent' | summarize AggregatedValue = count() by Computer' + } + ] + storageInsightsConfigs: [ + { + storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsalaw001' + tables: [ + 'LinuxsyslogVer2v0' + 'WADETWEventTable' + 'WADServiceFabric*EventTable' + 'WADWindowsEventLogsTable' + ] + } + ] useResourcePermissions: true - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-law-x-001" + }, + // Non-required parameters + "dailyQuotaGb": { + "value": 10 + }, + "dataSources": { + "value": [ + { + "eventLogName": "Application", + "eventTypes": [ + { + "eventType": "Error" + }, + { + "eventType": "Warning" + }, + { + "eventType": "Information" + } + ], + "kind": "WindowsEvent", + "name": "applicationEvent" + }, + { + "counterName": "% Processor Time", + "instanceName": "*", + "intervalSeconds": 60, + "kind": "WindowsPerformanceCounter", + "name": "windowsPerfCounter1", + "objectName": "Processor" + }, + { + "kind": "IISLogs", + "name": "sampleIISLog1", + "state": "OnPremiseEnabled" + }, + { + "kind": "LinuxSyslog", + "name": "sampleSyslog1", + "syslogName": "kern", + "syslogSeverities": [ + { + "severity": "emerg" + }, + { + "severity": "alert" + }, + { + "severity": "crit" + }, + { + "severity": "err" + }, + { + "severity": "warning" + } + ] + }, + { + "kind": "LinuxSyslogCollection", + "name": "sampleSyslogCollection1", + "state": "Enabled" + }, + { + "instanceName": "*", + "intervalSeconds": 10, + "kind": "LinuxPerformanceObject", + "name": "sampleLinuxPerf1", + "objectName": "Logical Disk", + "syslogSeverities": [ + { + "counterName": "% Used Inodes" + }, + { + "counterName": "Free Megabytes" + }, + { + "counterName": "% Used Space" + }, + { + "counterName": "Disk Transfers/sec" + }, + { + "counterName": "Disk Reads/sec" + }, + { + "counterName": "Disk Writes/sec" + } + ] + }, + { + "kind": "LinuxPerformanceCollection", + "name": "sampleLinuxPerfCollection1", + "state": "Enabled" + } + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "gallerySolutions": { + "value": [ + { + "name": "AzureAutomation", + "product": "OMSGallery", + "publisher": "Microsoft" + } + ] + }, + "linkedServices": { + "value": [ + { + "name": "Automation", + "resourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Automation/automationAccounts/adp-<>-az-aut-x-001" + } + ] + }, + "linkedStorageAccounts": { + "value": [ + { + "name": "Query", + "resourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsalaw001" + } + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "publicNetworkAccessForIngestion": { + "value": "Disabled" + }, + "publicNetworkAccessForQuery": { + "value": "Disabled" + }, + "savedSearches": { + "value": [ + { + "category": "VDC Saved Searches", + "displayName": "VMSS Instance Count2", + "name": "VMSSQueries", + "query": "Event | where Source == 'ServiceFabricNodeBootstrapAgent' | summarize AggregatedValue = count() by Computer" + } + ] + }, + "storageInsightsConfigs": { + "value": [ + { + "storageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsalaw001", + "tables": [ + "LinuxsyslogVer2v0", + "WADETWEventTable", + "WADServiceFabric*EventTable", + "WADWindowsEventLogsTable" + ] + } + ] + }, + "useResourcePermissions": { + "value": true + } } } ``` diff --git a/modules/Microsoft.OperationsManagement/solutions/readme.md b/modules/Microsoft.OperationsManagement/solutions/readme.md index f3f67ea393..35609fc8a2 100644 --- a/modules/Microsoft.OperationsManagement/solutions/readme.md +++ b/modules/Microsoft.OperationsManagement/solutions/readme.md @@ -43,28 +43,11 @@ This module deploys OperationsManagement Solutions. ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "Updates" - }, - "logAnalyticsWorkspaceName": { - "value": "adp-<>-az-law-sol-001" - } - } -} -``` - -
+

Example 1: Min

@@ -74,8 +57,9 @@ This module deploys OperationsManagement Solutions. module solutions './Microsoft.OperationsManagement/solutions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-solutions' params: { - name: 'Updates' + // Required parameters logAnalyticsWorkspaceName: 'adp-<>-az-law-sol-001' + name: 'Updates' } } ``` @@ -83,34 +67,30 @@ module solutions './Microsoft.OperationsManagement/solutions/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "AzureAutomation" - }, - "logAnalyticsWorkspaceName": { - "value": "adp-<>-az-law-sol-001" - }, - "product": { - "value": "OMSGallery" - }, - "publisher": { - "value": "Microsoft" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "logAnalyticsWorkspaceName": { + "value": "adp-<>-az-law-sol-001" + }, + "name": { + "value": "Updates" } + } } ```
+

+ +

Example 2: Ms

@@ -120,8 +100,10 @@ module solutions './Microsoft.OperationsManagement/solutions/deploy.bicep' = { module solutions './Microsoft.OperationsManagement/solutions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-solutions' params: { - name: 'AzureAutomation' + // Required parameters logAnalyticsWorkspaceName: 'adp-<>-az-law-sol-001' + name: 'AzureAutomation' + // Non-required parameters product: 'OMSGallery' publisher: 'Microsoft' } @@ -131,34 +113,37 @@ module solutions './Microsoft.OperationsManagement/solutions/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "nonmsTestSolution" - }, - "logAnalyticsWorkspaceName": { - "value": "adp-<>-az-law-sol-001" - }, - "product": { - "value": "nonmsTestSolutionProduct" - }, - "publisher": { - "value": "nonmsTestSolutionPublisher" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "logAnalyticsWorkspaceName": { + "value": "adp-<>-az-law-sol-001" + }, + "name": { + "value": "AzureAutomation" + }, + // Non-required parameters + "product": { + "value": "OMSGallery" + }, + "publisher": { + "value": "Microsoft" } + } } ```
+

+ +

Example 3: Nonms

@@ -168,8 +153,10 @@ module solutions './Microsoft.OperationsManagement/solutions/deploy.bicep' = { module solutions './Microsoft.OperationsManagement/solutions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-solutions' params: { - name: 'nonmsTestSolution' + // Required parameters logAnalyticsWorkspaceName: 'adp-<>-az-law-sol-001' + name: 'nonmsTestSolution' + // Non-required parameters product: 'nonmsTestSolutionProduct' publisher: 'nonmsTestSolutionPublisher' } @@ -178,3 +165,33 @@ module solutions './Microsoft.OperationsManagement/solutions/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "logAnalyticsWorkspaceName": { + "value": "adp-<>-az-law-sol-001" + }, + "name": { + "value": "nonmsTestSolution" + }, + // Non-required parameters + "product": { + "value": "nonmsTestSolutionProduct" + }, + "publisher": { + "value": "nonmsTestSolutionPublisher" + } + } +} +``` + +
+

diff --git a/modules/Microsoft.RecoveryServices/vaults/readme.md b/modules/Microsoft.RecoveryServices/vaults/readme.md index 3cb742fb2b..c4dd23e0fd 100644 --- a/modules/Microsoft.RecoveryServices/vaults/readme.md +++ b/modules/Microsoft.RecoveryServices/vaults/readme.md @@ -893,84 +893,11 @@ privateEndpoints: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-rsv-dr-001" - }, - "replicationFabrics": { - "value": [ - { - "location": "NorthEurope", - "replicationContainers": [ - { - "name": "ne-container1", - "replicationContainerMappings": [ - { - "targetProtectionContainerId": "/Subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.RecoveryServices/vaults/<>-az-rsv-min-001/replicationFabrics/NorthEurope/replicationProtectionContainers/ne-container2", - "policyName": "Default_values", - "targetContainerName": "pluto" - } - ] - }, - { - "name": "ne-container2", - "replicationContainerMappings": [ - { - "policyName": "Default_values", - "targetContainerFabricName": "WE-2", - "targetContainerName": "we-container1" - } - ] - } - ] - }, - { - "name": "WE-2", - "location": "WestEurope", - "replicationContainers": [ - { - "name": "we-container1", - "replicationContainerMappings": [ - { - "policyName": "Default_values", - "targetContainerFabricName": "NorthEurope", - "targetContainerName": "ne-container2" - } - ] - } - ] - } - ] - }, - "replicationPolicies": { - "value": [ - { - "name": "Default_values" - }, - { - "name": "Custom_values", - "appConsistentFrequencyInMinutes": 240, - "crashConsistentFrequencyInMinutes": 7, - "multiVmSyncStatus": "Disable", - "recoveryPointHistory": 2880 - } - ] - } - } -} -``` - -
+

Example 1: Dr

@@ -980,7 +907,9 @@ privateEndpoints: [ module vaults './Microsoft.RecoveryServices/vaults/deploy.bicep' = { name: '${uniqueString(deployment().name)}-vaults' params: { + // Required parameters name: '<>-az-rsv-dr-001' + // Non-required parameters replicationFabrics: [ { location: 'NorthEurope' @@ -989,9 +918,9 @@ module vaults './Microsoft.RecoveryServices/vaults/deploy.bicep' = { name: 'ne-container1' replicationContainerMappings: [ { - targetProtectionContainerId: '/Subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.RecoveryServices/vaults/<>-az-rsv-min-001/replicationFabrics/NorthEurope/replicationProtectionContainers/ne-container2' policyName: 'Default_values' targetContainerName: 'pluto' + targetProtectionContainerId: '/Subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.RecoveryServices/vaults/<>-az-rsv-min-001/replicationFabrics/NorthEurope/replicationProtectionContainers/ne-container2' } ] } @@ -1008,8 +937,8 @@ module vaults './Microsoft.RecoveryServices/vaults/deploy.bicep' = { ] } { - name: 'WE-2' location: 'WestEurope' + name: 'WE-2' replicationContainers: [ { name: 'we-container1' @@ -1029,10 +958,10 @@ module vaults './Microsoft.RecoveryServices/vaults/deploy.bicep' = { name: 'Default_values' } { - name: 'Custom_values' appConsistentFrequencyInMinutes: 240 crashConsistentFrequencyInMinutes: 7 multiVmSyncStatus: 'Disable' + name: 'Custom_values' recoveryPointHistory: 2880 } ] @@ -1043,25 +972,87 @@ module vaults './Microsoft.RecoveryServices/vaults/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-rsv-min-001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-rsv-dr-001" + }, + // Non-required parameters + "replicationFabrics": { + "value": [ + { + "location": "NorthEurope", + "replicationContainers": [ + { + "name": "ne-container1", + "replicationContainerMappings": [ + { + "policyName": "Default_values", + "targetContainerName": "pluto", + "targetProtectionContainerId": "/Subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.RecoveryServices/vaults/<>-az-rsv-min-001/replicationFabrics/NorthEurope/replicationProtectionContainers/ne-container2" + } + ] + }, + { + "name": "ne-container2", + "replicationContainerMappings": [ + { + "policyName": "Default_values", + "targetContainerFabricName": "WE-2", + "targetContainerName": "we-container1" + } + ] + } + ] + }, + { + "location": "WestEurope", + "name": "WE-2", + "replicationContainers": [ + { + "name": "we-container1", + "replicationContainerMappings": [ + { + "policyName": "Default_values", + "targetContainerFabricName": "NorthEurope", + "targetContainerName": "ne-container2" + } + ] + } + ] + } + ] + }, + "replicationPolicies": { + "value": [ + { + "name": "Default_values" + }, + { + "appConsistentFrequencyInMinutes": 240, + "crashConsistentFrequencyInMinutes": 7, + "multiVmSyncStatus": "Disable", + "name": "Custom_values", + "recoveryPointHistory": 2880 } + ] } + } } ```
+

+ +

Example 2: Min

@@ -1079,8 +1070,6 @@ module vaults './Microsoft.RecoveryServices/vaults/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file @@ -1091,218 +1080,560 @@ module vaults './Microsoft.RecoveryServices/vaults/deploy.bicep' = { "contentVersion": "1.0.0.0", "parameters": { "name": { - "value": "<>-az-rsv-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "backupConfig": { - "value": { - "enhancedSecurityState": "Disabled", - "softDeleteFeatureState": "Disabled" + "value": "<>-az-rsv-min-001" + } + } +} +``` + +
+

+ +

Example 3: Parameters

+ +
+ +via Bicep module + +```bicep +module vaults './Microsoft.RecoveryServices/vaults/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-vaults' + params: { + // Required parameters + name: '<>-az-rsv-x-001' + // Non-required parameters + backupConfig: { + enhancedSecurityState: 'Disabled' + softDeleteFeatureState: 'Disabled' + } + backupPolicies: [ + { + name: 'VMpolicy' + properties: { + backupManagementType: 'AzureIaasVM' + instantRPDetails: {} + instantRpRetentionRangeInDays: 2 + protectedItemsCount: 0 + retentionPolicy: { + dailySchedule: { + retentionDuration: { + count: 180 + durationType: 'Days' + } + retentionTimes: [ + '2019-11-07T07:00:00Z' + ] + } + monthlySchedule: { + retentionDuration: { + count: 60 + durationType: 'Months' + } + retentionScheduleFormatType: 'Weekly' + retentionScheduleWeekly: { + daysOfTheWeek: [ + 'Sunday' + ] + weeksOfTheMonth: [ + 'First' + ] + } + retentionTimes: [ + '2019-11-07T07:00:00Z' + ] + } + retentionPolicyType: 'LongTermRetentionPolicy' + weeklySchedule: { + daysOfTheWeek: [ + 'Sunday' + ] + retentionDuration: { + count: 12 + durationType: 'Weeks' + } + retentionTimes: [ + '2019-11-07T07:00:00Z' + ] + } + yearlySchedule: { + monthsOfYear: [ + 'January' + ] + retentionDuration: { + count: 10 + durationType: 'Years' + } + retentionScheduleFormatType: 'Weekly' + retentionScheduleWeekly: { + daysOfTheWeek: [ + 'Sunday' + ] + weeksOfTheMonth: [ + 'First' + ] + } + retentionTimes: [ + '2019-11-07T07:00:00Z' + ] + } + } + schedulePolicy: { + schedulePolicyType: 'SimpleSchedulePolicy' + scheduleRunFrequency: 'Daily' + scheduleRunTimes: [ + '2019-11-07T07:00:00Z' + ] + scheduleWeeklyFrequency: 0 + } + timeZone: 'UTC' + } } - }, - "backupPolicies": { - "value": [ - { - "name": "VMpolicy", - "properties": { - "backupManagementType": "AzureIaasVM", - "instantRPDetails": {}, - "schedulePolicy": { - "schedulePolicyType": "SimpleSchedulePolicy", - "scheduleRunFrequency": "Daily", - "scheduleRunTimes": ["2019-11-07T07:00:00Z"], - "scheduleWeeklyFrequency": 0 - }, - "retentionPolicy": { - "retentionPolicyType": "LongTermRetentionPolicy", - "dailySchedule": { - "retentionTimes": ["2019-11-07T07:00:00Z"], - "retentionDuration": { - "count": 180, - "durationType": "Days" + { + name: 'sqlpolicy' + properties: { + backupManagementType: 'AzureWorkload' + protectedItemsCount: 0 + settings: { + isCompression: true + issqlcompression: true + timeZone: 'UTC' + } + subProtectionPolicy: [ + { + policyType: 'Full' + retentionPolicy: { + monthlySchedule: { + retentionDuration: { + count: 60 + durationType: 'Months' + } + retentionScheduleFormatType: 'Weekly' + retentionScheduleWeekly: { + daysOfTheWeek: [ + 'Sunday' + ] + weeksOfTheMonth: [ + 'First' + ] + } + retentionTimes: [ + '2019-11-07T22:00:00Z' + ] } - }, - "weeklySchedule": { - "daysOfTheWeek": ["Sunday"], - "retentionTimes": ["2019-11-07T07:00:00Z"], - "retentionDuration": { - "count": 12, - "durationType": "Weeks" + retentionPolicyType: 'LongTermRetentionPolicy' + weeklySchedule: { + daysOfTheWeek: [ + 'Sunday' + ] + retentionDuration: { + count: 104 + durationType: 'Weeks' + } + retentionTimes: [ + '2019-11-07T22:00:00Z' + ] } - }, - "monthlySchedule": { - "retentionScheduleFormatType": "Weekly", - "retentionScheduleWeekly": { - "daysOfTheWeek": ["Sunday"], - "weeksOfTheMonth": ["First"] + yearlySchedule: { + monthsOfYear: [ + 'January' + ] + retentionDuration: { + count: 10 + durationType: 'Years' + } + retentionScheduleFormatType: 'Weekly' + retentionScheduleWeekly: { + daysOfTheWeek: [ + 'Sunday' + ] + weeksOfTheMonth: [ + 'First' + ] + } + retentionTimes: [ + '2019-11-07T22:00:00Z' + ] + } + } + schedulePolicy: { + schedulePolicyType: 'SimpleSchedulePolicy' + scheduleRunDays: [ + 'Sunday' + ] + scheduleRunFrequency: 'Weekly' + scheduleRunTimes: [ + '2019-11-07T22:00:00Z' + ] + scheduleWeeklyFrequency: 0 + } + } + { + policyType: 'Differential' + retentionPolicy: { + retentionDuration: { + count: 30 + durationType: 'Days' + } + retentionPolicyType: 'SimpleRetentionPolicy' + } + schedulePolicy: { + schedulePolicyType: 'SimpleSchedulePolicy' + scheduleRunDays: [ + 'Monday' + ] + scheduleRunFrequency: 'Weekly' + scheduleRunTimes: [ + '2017-03-07T02:00:00Z' + ] + scheduleWeeklyFrequency: 0 + } + } + { + policyType: 'Log' + retentionPolicy: { + retentionDuration: { + count: 15 + durationType: 'Days' + } + retentionPolicyType: 'SimpleRetentionPolicy' + } + schedulePolicy: { + scheduleFrequencyInMins: 120 + schedulePolicyType: 'LogSchedulePolicy' + } + } + ] + workLoadType: 'SQLDataBase' + } + } + { + name: 'filesharepolicy' + properties: { + backupManagementType: 'AzureStorage' + protectedItemsCount: 0 + retentionPolicy: { + dailySchedule: { + retentionDuration: { + count: 30 + durationType: 'Days' + } + retentionTimes: [ + '2019-11-07T04:30:00Z' + ] + } + retentionPolicyType: 'LongTermRetentionPolicy' + } + schedulePolicy: { + schedulePolicyType: 'SimpleSchedulePolicy' + scheduleRunFrequency: 'Daily' + scheduleRunTimes: [ + '2019-11-07T04:30:00Z' + ] + scheduleWeeklyFrequency: 0 + } + timeZone: 'UTC' + workloadType: 'AzureFileShare' + } + } + ] + backupStorageConfig: { + crossRegionRestoreFlag: true + storageModelType: 'GeoRedundant' + } + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + lock: 'CanNotDelete' + privateEndpoints: [ + { + service: 'AzureSiteRecovery' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + ] + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + systemAssignedIdentity: true + userAssignedIdentities: { + '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-rsv-x-001" + }, + // Non-required parameters + "backupConfig": { + "value": { + "enhancedSecurityState": "Disabled", + "softDeleteFeatureState": "Disabled" + } + }, + "backupPolicies": { + "value": [ + { + "name": "VMpolicy", + "properties": { + "backupManagementType": "AzureIaasVM", + "instantRPDetails": {}, + "instantRpRetentionRangeInDays": 2, + "protectedItemsCount": 0, + "retentionPolicy": { + "dailySchedule": { + "retentionDuration": { + "count": 180, + "durationType": "Days" }, - "retentionTimes": ["2019-11-07T07:00:00Z"], + "retentionTimes": [ + "2019-11-07T07:00:00Z" + ] + }, + "monthlySchedule": { "retentionDuration": { "count": 60, "durationType": "Months" - } - }, - "yearlySchedule": { + }, "retentionScheduleFormatType": "Weekly", - "monthsOfYear": ["January"], "retentionScheduleWeekly": { - "daysOfTheWeek": ["Sunday"], - "weeksOfTheMonth": ["First"] + "daysOfTheWeek": [ + "Sunday" + ], + "weeksOfTheMonth": [ + "First" + ] + }, + "retentionTimes": [ + "2019-11-07T07:00:00Z" + ] + }, + "retentionPolicyType": "LongTermRetentionPolicy", + "weeklySchedule": { + "daysOfTheWeek": [ + "Sunday" + ], + "retentionDuration": { + "count": 12, + "durationType": "Weeks" }, - "retentionTimes": ["2019-11-07T07:00:00Z"], + "retentionTimes": [ + "2019-11-07T07:00:00Z" + ] + }, + "yearlySchedule": { + "monthsOfYear": [ + "January" + ], "retentionDuration": { "count": 10, "durationType": "Years" - } + }, + "retentionScheduleFormatType": "Weekly", + "retentionScheduleWeekly": { + "daysOfTheWeek": [ + "Sunday" + ], + "weeksOfTheMonth": [ + "First" + ] + }, + "retentionTimes": [ + "2019-11-07T07:00:00Z" + ] } }, - "instantRpRetentionRangeInDays": 2, - "timeZone": "UTC", - "protectedItemsCount": 0 + "schedulePolicy": { + "schedulePolicyType": "SimpleSchedulePolicy", + "scheduleRunFrequency": "Daily", + "scheduleRunTimes": [ + "2019-11-07T07:00:00Z" + ], + "scheduleWeeklyFrequency": 0 + }, + "timeZone": "UTC" } }, { "name": "sqlpolicy", "properties": { "backupManagementType": "AzureWorkload", - "workLoadType": "SQLDataBase", + "protectedItemsCount": 0, "settings": { - "timeZone": "UTC", + "isCompression": true, "issqlcompression": true, - "isCompression": true + "timeZone": "UTC" }, "subProtectionPolicy": [ { "policyType": "Full", - "schedulePolicy": { - "schedulePolicyType": "SimpleSchedulePolicy", - "scheduleRunFrequency": "Weekly", - "scheduleRunDays": ["Sunday"], - "scheduleRunTimes": ["2019-11-07T22:00:00Z"], - "scheduleWeeklyFrequency": 0 - }, "retentionPolicy": { + "monthlySchedule": { + "retentionDuration": { + "count": 60, + "durationType": "Months" + }, + "retentionScheduleFormatType": "Weekly", + "retentionScheduleWeekly": { + "daysOfTheWeek": [ + "Sunday" + ], + "weeksOfTheMonth": [ + "First" + ] + }, + "retentionTimes": [ + "2019-11-07T22:00:00Z" + ] + }, "retentionPolicyType": "LongTermRetentionPolicy", "weeklySchedule": { - "daysOfTheWeek": ["Sunday"], - "retentionTimes": ["2019-11-07T22:00:00Z"], + "daysOfTheWeek": [ + "Sunday" + ], "retentionDuration": { "count": 104, "durationType": "Weeks" - } - }, - "monthlySchedule": { - "retentionScheduleFormatType": "Weekly", - "retentionScheduleWeekly": { - "daysOfTheWeek": ["Sunday"], - "weeksOfTheMonth": ["First"] }, - "retentionTimes": ["2019-11-07T22:00:00Z"], - "retentionDuration": { - "count": 60, - "durationType": "Months" - } + "retentionTimes": [ + "2019-11-07T22:00:00Z" + ] }, "yearlySchedule": { - "retentionScheduleFormatType": "Weekly", - "monthsOfYear": ["January"], - "retentionScheduleWeekly": { - "daysOfTheWeek": ["Sunday"], - "weeksOfTheMonth": ["First"] - }, - "retentionTimes": ["2019-11-07T22:00:00Z"], + "monthsOfYear": [ + "January" + ], "retentionDuration": { "count": 10, "durationType": "Years" - } - } - } - }, - { - "policyType": "Differential", + }, + "retentionScheduleFormatType": "Weekly", + "retentionScheduleWeekly": { + "daysOfTheWeek": [ + "Sunday" + ], + "weeksOfTheMonth": [ + "First" + ] + }, + "retentionTimes": [ + "2019-11-07T22:00:00Z" + ] + } + }, "schedulePolicy": { "schedulePolicyType": "SimpleSchedulePolicy", + "scheduleRunDays": [ + "Sunday" + ], "scheduleRunFrequency": "Weekly", - "scheduleRunDays": ["Monday"], - "scheduleRunTimes": ["2017-03-07T02:00:00Z"], + "scheduleRunTimes": [ + "2019-11-07T22:00:00Z" + ], "scheduleWeeklyFrequency": 0 - }, + } + }, + { + "policyType": "Differential", "retentionPolicy": { - "retentionPolicyType": "SimpleRetentionPolicy", "retentionDuration": { "count": 30, "durationType": "Days" - } + }, + "retentionPolicyType": "SimpleRetentionPolicy" + }, + "schedulePolicy": { + "schedulePolicyType": "SimpleSchedulePolicy", + "scheduleRunDays": [ + "Monday" + ], + "scheduleRunFrequency": "Weekly", + "scheduleRunTimes": [ + "2017-03-07T02:00:00Z" + ], + "scheduleWeeklyFrequency": 0 } }, { "policyType": "Log", - "schedulePolicy": { - "schedulePolicyType": "LogSchedulePolicy", - "scheduleFrequencyInMins": 120 - }, "retentionPolicy": { - "retentionPolicyType": "SimpleRetentionPolicy", "retentionDuration": { "count": 15, "durationType": "Days" - } + }, + "retentionPolicyType": "SimpleRetentionPolicy" + }, + "schedulePolicy": { + "scheduleFrequencyInMins": 120, + "schedulePolicyType": "LogSchedulePolicy" } } ], - "protectedItemsCount": 0 + "workLoadType": "SQLDataBase" } }, { "name": "filesharepolicy", "properties": { "backupManagementType": "AzureStorage", - "workloadType": "AzureFileShare", - "schedulePolicy": { - "schedulePolicyType": "SimpleSchedulePolicy", - "scheduleRunFrequency": "Daily", - "scheduleRunTimes": ["2019-11-07T04:30:00Z"], - "scheduleWeeklyFrequency": 0 - }, + "protectedItemsCount": 0, "retentionPolicy": { - "retentionPolicyType": "LongTermRetentionPolicy", "dailySchedule": { - "retentionTimes": ["2019-11-07T04:30:00Z"], "retentionDuration": { "count": 30, "durationType": "Days" - } - } + }, + "retentionTimes": [ + "2019-11-07T04:30:00Z" + ] + }, + "retentionPolicyType": "LongTermRetentionPolicy" + }, + "schedulePolicy": { + "schedulePolicyType": "SimpleSchedulePolicy", + "scheduleRunFrequency": "Daily", + "scheduleRunTimes": [ + "2019-11-07T04:30:00Z" + ], + "scheduleWeeklyFrequency": 0 }, "timeZone": "UTC", - "protectedItemsCount": 0 + "workloadType": "AzureFileShare" } } ] }, "backupStorageConfig": { "value": { - "storageModelType": "GeoRedundant", - "crossRegionRestoreFlag": true + "crossRegionRestoreFlag": true, + "storageModelType": "GeoRedundant" } }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "AzureSiteRecovery" - } - ] + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": ["<>"] - } - ] + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" }, "diagnosticLogsRetentionInDays": { "value": 7 @@ -1313,11 +1644,26 @@ module vaults './Microsoft.RecoveryServices/vaults/deploy.bicep' = { "diagnosticWorkspaceId": { "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + "lock": { + "value": "CanNotDelete" }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + "privateEndpoints": { + "value": [ + { + "service": "AzureSiteRecovery", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] }, "systemAssignedIdentity": { "value": true @@ -1331,282 +1677,5 @@ module vaults './Microsoft.RecoveryServices/vaults/deploy.bicep' = { } ``` -
- -
- -via Bicep module - -```bicep -module vaults './Microsoft.RecoveryServices/vaults/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-vaults' - params: { - name: '<>-az-rsv-x-001' - lock: 'CanNotDelete' - backupConfig: { - enhancedSecurityState: 'Disabled' - softDeleteFeatureState: 'Disabled' - } - backupPolicies: [ - { - name: 'VMpolicy' - properties: { - backupManagementType: 'AzureIaasVM' - instantRPDetails: {} - schedulePolicy: { - schedulePolicyType: 'SimpleSchedulePolicy' - scheduleRunFrequency: 'Daily' - scheduleRunTimes: [ - '2019-11-07T07:00:00Z' - ] - scheduleWeeklyFrequency: 0 - } - retentionPolicy: { - retentionPolicyType: 'LongTermRetentionPolicy' - dailySchedule: { - retentionTimes: [ - '2019-11-07T07:00:00Z' - ] - retentionDuration: { - count: 180 - durationType: 'Days' - } - } - weeklySchedule: { - daysOfTheWeek: [ - 'Sunday' - ] - retentionTimes: [ - '2019-11-07T07:00:00Z' - ] - retentionDuration: { - count: 12 - durationType: 'Weeks' - } - } - monthlySchedule: { - retentionScheduleFormatType: 'Weekly' - retentionScheduleWeekly: { - daysOfTheWeek: [ - 'Sunday' - ] - weeksOfTheMonth: [ - 'First' - ] - } - retentionTimes: [ - '2019-11-07T07:00:00Z' - ] - retentionDuration: { - count: 60 - durationType: 'Months' - } - } - yearlySchedule: { - retentionScheduleFormatType: 'Weekly' - monthsOfYear: [ - 'January' - ] - retentionScheduleWeekly: { - daysOfTheWeek: [ - 'Sunday' - ] - weeksOfTheMonth: [ - 'First' - ] - } - retentionTimes: [ - '2019-11-07T07:00:00Z' - ] - retentionDuration: { - count: 10 - durationType: 'Years' - } - } - } - instantRpRetentionRangeInDays: 2 - timeZone: 'UTC' - protectedItemsCount: 0 - } - } - { - name: 'sqlpolicy' - properties: { - backupManagementType: 'AzureWorkload' - workLoadType: 'SQLDataBase' - settings: { - timeZone: 'UTC' - issqlcompression: true - isCompression: true - } - subProtectionPolicy: [ - { - policyType: 'Full' - schedulePolicy: { - schedulePolicyType: 'SimpleSchedulePolicy' - scheduleRunFrequency: 'Weekly' - scheduleRunDays: [ - 'Sunday' - ] - scheduleRunTimes: [ - '2019-11-07T22:00:00Z' - ] - scheduleWeeklyFrequency: 0 - } - retentionPolicy: { - retentionPolicyType: 'LongTermRetentionPolicy' - weeklySchedule: { - daysOfTheWeek: [ - 'Sunday' - ] - retentionTimes: [ - '2019-11-07T22:00:00Z' - ] - retentionDuration: { - count: 104 - durationType: 'Weeks' - } - } - monthlySchedule: { - retentionScheduleFormatType: 'Weekly' - retentionScheduleWeekly: { - daysOfTheWeek: [ - 'Sunday' - ] - weeksOfTheMonth: [ - 'First' - ] - } - retentionTimes: [ - '2019-11-07T22:00:00Z' - ] - retentionDuration: { - count: 60 - durationType: 'Months' - } - } - yearlySchedule: { - retentionScheduleFormatType: 'Weekly' - monthsOfYear: [ - 'January' - ] - retentionScheduleWeekly: { - daysOfTheWeek: [ - 'Sunday' - ] - weeksOfTheMonth: [ - 'First' - ] - } - retentionTimes: [ - '2019-11-07T22:00:00Z' - ] - retentionDuration: { - count: 10 - durationType: 'Years' - } - } - } - } - { - policyType: 'Differential' - schedulePolicy: { - schedulePolicyType: 'SimpleSchedulePolicy' - scheduleRunFrequency: 'Weekly' - scheduleRunDays: [ - 'Monday' - ] - scheduleRunTimes: [ - '2017-03-07T02:00:00Z' - ] - scheduleWeeklyFrequency: 0 - } - retentionPolicy: { - retentionPolicyType: 'SimpleRetentionPolicy' - retentionDuration: { - count: 30 - durationType: 'Days' - } - } - } - { - policyType: 'Log' - schedulePolicy: { - schedulePolicyType: 'LogSchedulePolicy' - scheduleFrequencyInMins: 120 - } - retentionPolicy: { - retentionPolicyType: 'SimpleRetentionPolicy' - retentionDuration: { - count: 15 - durationType: 'Days' - } - } - } - ] - protectedItemsCount: 0 - } - } - { - name: 'filesharepolicy' - properties: { - backupManagementType: 'AzureStorage' - workloadType: 'AzureFileShare' - schedulePolicy: { - schedulePolicyType: 'SimpleSchedulePolicy' - scheduleRunFrequency: 'Daily' - scheduleRunTimes: [ - '2019-11-07T04:30:00Z' - ] - scheduleWeeklyFrequency: 0 - } - retentionPolicy: { - retentionPolicyType: 'LongTermRetentionPolicy' - dailySchedule: { - retentionTimes: [ - '2019-11-07T04:30:00Z' - ] - retentionDuration: { - count: 30 - durationType: 'Days' - } - } - } - timeZone: 'UTC' - protectedItemsCount: 0 - } - } - ] - backupStorageConfig: { - storageModelType: 'GeoRedundant' - crossRegionRestoreFlag: true - } - privateEndpoints: [ - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'AzureSiteRecovery' - } - ] - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' - systemAssignedIdentity: true - userAssignedIdentities: { - '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } - } -} -``` -

diff --git a/modules/Microsoft.Resources/deploymentScripts/readme.md b/modules/Microsoft.Resources/deploymentScripts/readme.md index 781e5dbb21..5dcbad69c2 100644 --- a/modules/Microsoft.Resources/deploymentScripts/readme.md +++ b/modules/Microsoft.Resources/deploymentScripts/readme.md @@ -141,51 +141,11 @@ This module requires a User Assigned Identity (MSI, managed service identity) to ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-ds-cli-001" - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "kind": { - "value": "AzureCLI" - }, - "azCliVersion": { - "value": "2.15.0" - }, - "scriptContent": { - "value": "echo \"Hello from inside the script\"" - }, - "retentionInterval": { - "value": "P1D" - }, - "runOnce": { - "value": false - }, - "cleanupPreference": { - "value": "Always" - }, - "timeout": { - "value": "PT30M" - } - } -} -``` - -
+

Example 1: Cli

@@ -195,17 +155,19 @@ This module requires a User Assigned Identity (MSI, managed service identity) to module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-deploymentScripts' params: { + // Required parameters name: '<>-az-ds-cli-001' - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } - kind: 'AzureCLI' + // Non-required parameters azCliVersion: '2.15.0' - scriptContent: 'echo \'Hello from inside the script\'' + cleanupPreference: 'Always' + kind: 'AzureCLI' retentionInterval: 'P1D' runOnce: false - cleanupPreference: 'Always' + scriptContent: 'echo \'Hello from inside the script\'' timeout: 'PT30M' + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } } } ``` @@ -213,54 +175,54 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep'

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-ds-ps-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "kind": { - "value": "AzurePowerShell" - }, - "azPowerShellVersion": { - "value": "3.0" - }, - "scriptContent": { - "value": "Write-Host 'Running PowerShell from template'" - }, - "retentionInterval": { - "value": "P1D" - }, - "runOnce": { - "value": false - }, - "cleanupPreference": { - "value": "Always" - }, - "timeout": { - "value": "PT30M" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-ds-cli-001" + }, + // Non-required parameters + "azCliVersion": { + "value": "2.15.0" + }, + "cleanupPreference": { + "value": "Always" + }, + "kind": { + "value": "AzureCLI" + }, + "retentionInterval": { + "value": "P1D" + }, + "runOnce": { + "value": false + }, + "scriptContent": { + "value": "echo \"Hello from inside the script\"" + }, + "timeout": { + "value": "PT30M" + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } } + } } ```
+

+ +

Example 2: Ps

@@ -270,18 +232,70 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-deploymentScripts' params: { + // Required parameters name: '<>-az-ds-ps-001' - lock: 'CanNotDelete' - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } - kind: 'AzurePowerShell' + // Non-required parameters azPowerShellVersion: '3.0' - scriptContent: 'Write-Host 'Running PowerShell from template'' + cleanupPreference: 'Always' + kind: 'AzurePowerShell' + lock: 'CanNotDelete' retentionInterval: 'P1D' runOnce: false - cleanupPreference: 'Always' + scriptContent: 'Write-Host 'Running PowerShell from template'' timeout: 'PT30M' + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-ds-ps-001" + }, + // Non-required parameters + "azPowerShellVersion": { + "value": "3.0" + }, + "cleanupPreference": { + "value": "Always" + }, + "kind": { + "value": "AzurePowerShell" + }, + "lock": { + "value": "CanNotDelete" + }, + "retentionInterval": { + "value": "P1D" + }, + "runOnce": { + "value": false + }, + "scriptContent": { + "value": "Write-Host 'Running PowerShell from template'" + }, + "timeout": { + "value": "PT30M" + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + } } } ``` diff --git a/modules/Microsoft.Resources/resourceGroups/readme.md b/modules/Microsoft.Resources/resourceGroups/readme.md index 730f5ce040..ac8932ca7a 100644 --- a/modules/Microsoft.Resources/resourceGroups/readme.md +++ b/modules/Microsoft.Resources/resourceGroups/readme.md @@ -149,43 +149,11 @@ This module requires a User Assigned Identity (MSI, managed service identity) to ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-rg-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "tags": { - "value": { - "Test": "Yes" - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -195,19 +163,60 @@ This module requires a User Assigned Identity (MSI, managed service identity) to module resourceGroups './Microsoft.Resources/resourceGroups/deploy.bicep' = { name: '${uniqueString(deployment().name)}-resourceGroups' params: { + // Required parameters name: '<>-az-rg-x-001' + // Non-required parameters lock: 'CanNotDelete' - tags: { - Test: 'Yes' - } roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + tags: { + Test: 'Yes' + } + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-rg-x-001" + }, + // Non-required parameters + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "tags": { + "value": { + "Test": "Yes" + } + } } } ``` diff --git a/modules/Microsoft.Resources/tags/readme.md b/modules/Microsoft.Resources/tags/readme.md index 92510e3730..30277ded10 100644 --- a/modules/Microsoft.Resources/tags/readme.md +++ b/modules/Microsoft.Resources/tags/readme.md @@ -79,21 +79,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": {} -} -``` - -
+

Example 1: Min

@@ -111,34 +101,22 @@ module tags './Microsoft.Resources/tags/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "onlyUpdate": { - "value": false - }, - "tags": { - "value": { - "Test": "Yes", - "TestToo": "No" - } - }, - "resourceGroupName": { - "value": "validation-rg" - } - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": {} } ```
+

+ +

Example 2: Rg

@@ -149,11 +127,11 @@ module tags './Microsoft.Resources/tags/deploy.bicep' = { name: '${uniqueString(deployment().name)}-tags' params: { onlyUpdate: false + resourceGroupName: 'validation-rg' tags: { Test: 'Yes' TestToo: 'No' } - resourceGroupName: 'validation-rg' } } ``` @@ -161,31 +139,35 @@ module tags './Microsoft.Resources/tags/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "onlyUpdate": { - "value": true - }, - "tags": { - "value": { - "Test": "Yes", - "TestToo": "No" - } - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "onlyUpdate": { + "value": false + }, + "resourceGroupName": { + "value": "validation-rg" + }, + "tags": { + "value": { + "Test": "Yes", + "TestToo": "No" + } } + } } ```
+

+ +

Example 3: Sub

@@ -206,3 +188,28 @@ module tags './Microsoft.Resources/tags/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "onlyUpdate": { + "value": true + }, + "tags": { + "value": { + "Test": "Yes", + "TestToo": "No" + } + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Security/azureSecurityCenter/readme.md b/modules/Microsoft.Security/azureSecurityCenter/readme.md index 6696f1c3a3..c1afbb6e33 100644 --- a/modules/Microsoft.Security/azureSecurityCenter/readme.md +++ b/modules/Microsoft.Security/azureSecurityCenter/readme.md @@ -96,36 +96,11 @@ securityContactProperties: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "scope": { - "value": "/subscriptions/<>" - }, - "securityContactProperties": { - "value": { - "email": "foo@contoso.com", - "phone": "+12345678", - "alertNotifications": "Off", - "alertsToAdmins": "Off" - } - }, - "workspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - } - } -} -``` - -
+

Example 1: Parameters

@@ -135,14 +110,48 @@ securityContactProperties: { module azureSecurityCenter './Microsoft.Security/azureSecurityCenter/deploy.bicep' = { name: '${uniqueString(deployment().name)}-azureSecurityCenter' params: { + // Required parameters scope: '/subscriptions/<>' + workspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + // Non-required parameters securityContactProperties: { - email: 'foo@contoso.com' - phone: '+12345678' alertNotifications: 'Off' alertsToAdmins: 'Off' + email: 'foo@contoso.com' + phone: '+12345678' + } + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "scope": { + "value": "/subscriptions/<>" + }, + "workspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + // Non-required parameters + "securityContactProperties": { + "value": { + "alertNotifications": "Off", + "alertsToAdmins": "Off", + "email": "foo@contoso.com", + "phone": "+12345678" + } } - workspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' } } ``` diff --git a/modules/Microsoft.ServiceBus/namespaces/readme.md b/modules/Microsoft.ServiceBus/namespaces/readme.md index 1908f4b255..f3b72e8564 100644 --- a/modules/Microsoft.ServiceBus/namespaces/readme.md +++ b/modules/Microsoft.ServiceBus/namespaces/readme.md @@ -336,21 +336,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": {} -} -``` - -
+

Example 1: Min

@@ -368,192 +358,22 @@ module namespaces './Microsoft.ServiceBus/namespaces/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-sbn-x-002" - }, - "lock": { - "value": "CanNotDelete" - }, - "skuName": { - "value": "Premium" - }, - "tags": { - "value": {} - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "disasterRecoveryConfigs": { - "value": {} - }, - "migrationConfigurations": { - "value": {} - }, - "virtualNetworkRules": { - "value": [ - "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-003" - ] - }, - "ipFilterRules": { - "value": [ - { - "filterName": "ipFilter1", - "ipMask": "10.0.1.0/32", - "action": "Accept" - }, - { - "filterName": "ipFilter2", - "ipMask": "10.0.2.0/32", - "action": "Accept" - } - ] - }, - "authorizationRules": { - "value": [ - { - "name": "RootManageSharedAccessKey", - "rights": [ - "Listen", - "Manage", - "Send" - ] - }, - { - "name": "AnotherKey", - "rights": [ - "Listen", - "Send" - ] - } - ] - }, - "queues": { - "value": [ - { - "name": "<>-az-sbq-x-002", - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ], - "authorizationRules": [ - { - "name": "RootManageSharedAccessKey", - "rights": [ - "Listen", - "Manage", - "Send" - ] - }, - { - "name": "AnotherKey", - "rights": [ - "Listen", - "Send" - ] - } - ] - } - ] - }, - "topics": { - "value": [ - { - "name": "<>-az-sbt-x-001", - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ], - "authorizationRules": [ - { - "name": "RootManageSharedAccessKey", - "rights": [ - "Listen", - "Manage", - "Send" - ] - }, - { - "name": "AnotherKey", - "rights": [ - "Listen", - "Send" - ] - } - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "namespace" - } - ] - }, - "cMKUserAssignedIdentityResourceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" - }, - "cMKKeyName": { - "value": "keyEncryptionKey" - }, - "cMKKeyVaultResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" - } - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": {} } ```
+

+ +

Example 2: Parameters

@@ -563,63 +383,55 @@ module namespaces './Microsoft.ServiceBus/namespaces/deploy.bicep' = { module namespaces './Microsoft.ServiceBus/namespaces/deploy.bicep' = { name: '${uniqueString(deployment().name)}-namespaces' params: { - name: '<>-az-sbn-x-002' - lock: 'CanNotDelete' - skuName: 'Premium' - tags: {} - roleAssignments: [ + authorizationRules: [ { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' + name: 'RootManageSharedAccessKey' + rights: [ + 'Listen' + 'Manage' + 'Send' + ] + } + { + name: 'AnotherKey' + rights: [ + 'Listen' + 'Send' ] } ] + cMKKeyName: 'keyEncryptionKey' + cMKKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002' + cMKUserAssignedIdentityResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' disasterRecoveryConfigs: {} - migrationConfigurations: {} - virtualNetworkRules: [ - '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-003' - ] ipFilterRules: [ { + action: 'Accept' filterName: 'ipFilter1' ipMask: '10.0.1.0/32' - action: 'Accept' } { + action: 'Accept' filterName: 'ipFilter2' ipMask: '10.0.2.0/32' - action: 'Accept' } ] - authorizationRules: [ - { - name: 'RootManageSharedAccessKey' - rights: [ - 'Listen' - 'Manage' - 'Send' - ] - } + lock: 'CanNotDelete' + migrationConfigurations: {} + name: '<>-az-sbn-x-002' + privateEndpoints: [ { - name: 'AnotherKey' - rights: [ - 'Listen' - 'Send' - ] + service: 'namespace' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' } ] queues: [ { - name: '<>-az-sbq-x-002' - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] authorizationRules: [ { name: 'RootManageSharedAccessKey' @@ -637,19 +449,30 @@ module namespaces './Microsoft.ServiceBus/namespaces/deploy.bicep' = { ] } ] - } - ] - topics: [ - { - name: '<>-az-sbt-x-001' + name: '<>-az-sbq-x-002' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + } + ] + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + skuName: 'Premium' + systemAssignedIdentity: true + tags: {} + topics: [ + { authorizationRules: [ { name: 'RootManageSharedAccessKey' @@ -667,26 +490,209 @@ module namespaces './Microsoft.ServiceBus/namespaces/deploy.bicep' = { ] } ] + name: '<>-az-sbt-x-001' + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' - systemAssignedIdentity: true userAssignedIdentities: { '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } - privateEndpoints: [ - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'namespace' - } + virtualNetworkRules: [ + '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-003' ] - cMKUserAssignedIdentityResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' - cMKKeyName: 'keyEncryptionKey' - cMKKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "authorizationRules": { + "value": [ + { + "name": "RootManageSharedAccessKey", + "rights": [ + "Listen", + "Manage", + "Send" + ] + }, + { + "name": "AnotherKey", + "rights": [ + "Listen", + "Send" + ] + } + ] + }, + "cMKKeyName": { + "value": "keyEncryptionKey" + }, + "cMKKeyVaultResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" + }, + "cMKUserAssignedIdentityResourceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "disasterRecoveryConfigs": { + "value": {} + }, + "ipFilterRules": { + "value": [ + { + "action": "Accept", + "filterName": "ipFilter1", + "ipMask": "10.0.1.0/32" + }, + { + "action": "Accept", + "filterName": "ipFilter2", + "ipMask": "10.0.2.0/32" + } + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "migrationConfigurations": { + "value": {} + }, + "name": { + "value": "<>-az-sbn-x-002" + }, + "privateEndpoints": { + "value": [ + { + "service": "namespace", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "queues": { + "value": [ + { + "authorizationRules": [ + { + "name": "RootManageSharedAccessKey", + "rights": [ + "Listen", + "Manage", + "Send" + ] + }, + { + "name": "AnotherKey", + "rights": [ + "Listen", + "Send" + ] + } + ], + "name": "<>-az-sbq-x-002", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "skuName": { + "value": "Premium" + }, + "systemAssignedIdentity": { + "value": true + }, + "tags": { + "value": {} + }, + "topics": { + "value": [ + { + "authorizationRules": [ + { + "name": "RootManageSharedAccessKey", + "rights": [ + "Listen", + "Manage", + "Send" + ] + }, + { + "name": "AnotherKey", + "rights": [ + "Listen", + "Send" + ] + } + ], + "name": "<>-az-sbt-x-001", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + ] + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + }, + "virtualNetworkRules": { + "value": [ + "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-003" + ] + } } } ``` diff --git a/modules/Microsoft.ServiceFabric/clusters/readme.md b/modules/Microsoft.ServiceFabric/clusters/readme.md index 49f09ce508..ecf1dab3ab 100644 --- a/modules/Microsoft.ServiceFabric/clusters/readme.md +++ b/modules/Microsoft.ServiceFabric/clusters/readme.md @@ -228,56 +228,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-sfc-cert-001" - }, - "managementEndpoint": { - "value": "https://<>-az-sfc-cert-001.westeurope.cloudapp.azure.com:19080" - }, - "reliabilityLevel": { - "value": "None" - }, - "certificate": { - "value": { - "thumbprint": "0AC113D5E1D94C401DDEB0EE2B1B96CC130", // Mutual exclusive with the other cert specs - "x509StoreName": "My" - } - }, - "nodeTypes": { - "value": [ - { - "applicationPorts": { - "endPort": 30000, - "startPort": 20000 - }, - "clientConnectionEndpointPort": 19000, - "durabilityLevel": "Bronze", - "ephemeralPorts": { - "endPort": 65534, - "startPort": 49152 - }, - "httpGatewayEndpointPort": 19080, - "isPrimary": true, - "name": "Node01" - } - ] - } - } -} -``` - -
+

Example 1: Cert

@@ -287,13 +242,15 @@ tags: { module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = { name: '${uniqueString(deployment().name)}-clusters' params: { - name: '<>-az-sfc-cert-001' + // Required parameters managementEndpoint: 'https://<>-az-sfc-cert-001.westeurope.cloudapp.azure.com:19080' reliabilityLevel: 'None' + // Non-required parameters certificate: { thumbprint: '0AC113D5E1D94C401DDEB0EE2B1B96CC130' x509StoreName: 'My' } + name: '<>-az-sfc-cert-001' nodeTypes: [ { applicationPorts: { @@ -318,224 +275,59 @@ module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-sfc-full-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "tags": { - "value": { - "resourceType": "Service Fabric", - "clusterName": "<>-az-sfc-full-001" - } - }, - "addOnFeatures": { - "value": [ - "RepairManager", - "DnsService", - "BackupRestoreService", - "ResourceMonitorService" - ] - }, - "maxUnusedVersionsToKeep": { - "value": 2 - }, - "azureActiveDirectory": { - "value": { - "clientApplication": "<>", - "clusterApplication": "cf33fea8-b30f-424f-ab73-c48d99e0b222", - "tenantId": "<>" - } - }, - "certificateCommonNames": { - "value": { - "commonNames": [ - { - "certificateCommonName": "certcommon", - "certificateIssuerThumbprint": "0AC113D5E1D94C401DDEB0EE2B1B96CC130" - } - ], - "x509StoreName": "" - } - }, - "clientCertificateCommonNames": { - "value": [ - { - "certificateCommonName": "clientcommoncert1", - "certificateIssuerThumbprint": "0AC113D5E1D94C401DDEB0EE2B1B96CC130", - "isAdmin": false - }, - { - "certificateCommonName": "clientcommoncert2", - "certificateIssuerThumbprint": "0AC113D5E1D94C401DDEB0EE2B1B96CC131", - "isAdmin": false - } - ] - }, - "clientCertificateThumbprints": { - "value": [ - { - "certificateThumbprint": "0AC113D5E1D94C401DDEB0EE2B1B96CC130", - "isAdmin": false - }, - { - "certificateThumbprint": "0AC113D5E1D94C401DDEB0EE2B1B96CC131", - "isAdmin": false - } - ] - }, - "diagnosticsStorageAccountConfig": { - "value": { - "blobEndpoint": "https://adp<>azsaweux001.blob.core.windows.net/", - "protectedAccountKeyName": "StorageAccountKey1", - "queueEndpoint": "https://adp<>azsaweux001.queue.core.windows.net/", - "storageAccountName": "adp<>azsaweux001", - "tableEndpoint": "https://adp<>azsaweux001.table.core.windows.net/" - } - }, - "fabricSettings": { - "value": [ - { - "name": "Security", - "parameters": [ - { - "name": "ClusterProtectionLevel", - "value": "EncryptAndSign" - } - ] - }, - { - "name": "UpgradeService", - "parameters": [ - { - "name": "AppPollIntervalInSeconds", - "value": "60" - } - ] - } - ] - }, - "managementEndpoint": { - "value": "https://<>-az-sfc-full-001.westeurope.cloudapp.azure.com:19080" - }, - "nodeTypes": { - "value": [ - { - "applicationPorts": { - "endPort": 30000, - "startPort": 20000 - }, - "capacities": {}, - "clientConnectionEndpointPort": 19000, - "durabilityLevel": "Silver", - "ephemeralPorts": { - "endPort": 65534, - "startPort": 49152 - }, - "httpGatewayEndpointPort": 19080, - "isPrimary": true, - "isStateless": false, - "multipleAvailabilityZones": false, - "name": "Node01", - "placementProperties": {}, - "reverseProxyEndpointPort": "", - "vmInstanceCount": 5 - }, - { - "applicationPorts": { - "endPort": 30000, - "startPort": 20000 - }, - "clientConnectionEndpointPort": 19000, - "durabilityLevel": "Bronze", - "ephemeralPorts": { - "endPort": 64000, - "startPort": 49000 - }, - "httpGatewayEndpointPort": 19007, - "isPrimary": true, - "name": "Node02", - "vmInstanceCount": 5 - } - ] - }, - "notifications": { - "value": [ - { - "isEnabled": true, - "notificationCategory": "WaveProgress", - "notificationLevel": "Critical", - "notificationTargets": [ - { - "notificationChannel": "EmailUser", - "receivers": [ - "SomeReceiver" - ] - } - ] - } - ] - }, - "upgradeDescription": { - "value": { - "forceRestart": false, - "upgradeReplicaSetCheckTimeout": "1.00:00:00", - "healthCheckWaitDuration": "00:00:30", - "healthCheckStableDuration": "00:01:00", - "healthCheckRetryTimeout": "00:45:00", - "upgradeTimeout": "02:00:00", - "upgradeDomainTimeout": "02:00:00", - "healthPolicy": { - "maxPercentUnhealthyNodes": 0, - "maxPercentUnhealthyApplications": 0 - }, - "deltaHealthPolicy": { - "maxPercentDeltaUnhealthyNodes": 0, - "maxPercentUpgradeDomainDeltaUnhealthyNodes": 0, - "maxPercentDeltaUnhealthyApplications": 0 - } - } - }, - "reliabilityLevel": { - "value": "Silver" - }, - "vmImage": { - "value": "Linux" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "applicationTypes": { - "value": [ - { - "name": "WordCount" // not idempotent - } - ] + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "managementEndpoint": { + "value": "https://<>-az-sfc-cert-001.westeurope.cloudapp.azure.com:19080" + }, + "reliabilityLevel": { + "value": "None" + }, + // Non-required parameters + "certificate": { + "value": { + "thumbprint": "0AC113D5E1D94C401DDEB0EE2B1B96CC130", + "x509StoreName": "My" + } + }, + "name": { + "value": "<>-az-sfc-cert-001" + }, + "nodeTypes": { + "value": [ + { + "applicationPorts": { + "endPort": 30000, + "startPort": 20000 + }, + "clientConnectionEndpointPort": 19000, + "durabilityLevel": "Bronze", + "ephemeralPorts": { + "endPort": 65534, + "startPort": 49152 + }, + "httpGatewayEndpointPort": 19080, + "isPrimary": true, + "name": "Node01" } + ] } + } } ```
+

+ +

Example 2: Full

@@ -545,19 +337,21 @@ module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = { module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = { name: '${uniqueString(deployment().name)}-clusters' params: { - name: '<>-az-sfc-full-001' - lock: 'CanNotDelete' - tags: { - resourceType: 'Service Fabric' - clusterName: '<>-az-sfc-full-001' - } + // Required parameters + managementEndpoint: 'https://<>-az-sfc-full-001.westeurope.cloudapp.azure.com:19080' + reliabilityLevel: 'Silver' + // Non-required parameters addOnFeatures: [ - 'RepairManager' - 'DnsService' 'BackupRestoreService' + 'DnsService' + 'RepairManager' 'ResourceMonitorService' ] - maxUnusedVersionsToKeep: 2 + applicationTypes: [ + { + name: 'WordCount' + } + ] azureActiveDirectory: { clientApplication: '<>' clusterApplication: 'cf33fea8-b30f-424f-ab73-c48d99e0b222' @@ -621,7 +415,9 @@ module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = { ] } ] - managementEndpoint: 'https://<>-az-sfc-full-001.westeurope.cloudapp.azure.com:19080' + lock: 'CanNotDelete' + maxUnusedVersionsToKeep: 2 + name: '<>-az-sfc-full-001' nodeTypes: [ { applicationPorts: { @@ -676,39 +472,37 @@ module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = { ] } ] - upgradeDescription: { - forceRestart: false - upgradeReplicaSetCheckTimeout: '1.00:00:00' - healthCheckWaitDuration: '00:00:30' - healthCheckStableDuration: '00:01:00' - healthCheckRetryTimeout: '00:45:00' - upgradeTimeout: '02:00:00' - upgradeDomainTimeout: '02:00:00' - healthPolicy: { - maxPercentUnhealthyNodes: 0 - maxPercentUnhealthyApplications: 0 - } - deltaHealthPolicy: { - maxPercentDeltaUnhealthyNodes: 0 - maxPercentUpgradeDomainDeltaUnhealthyNodes: 0 - maxPercentDeltaUnhealthyApplications: 0 - } - } - reliabilityLevel: 'Silver' - vmImage: 'Linux' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - applicationTypes: [ - { - name: 'WordCount' + tags: { + clusterName: '<>-az-sfc-full-001' + resourceType: 'Service Fabric' + } + upgradeDescription: { + deltaHealthPolicy: { + maxPercentDeltaUnhealthyApplications: 0 + maxPercentDeltaUnhealthyNodes: 0 + maxPercentUpgradeDomainDeltaUnhealthyNodes: 0 } - ] + forceRestart: false + healthCheckRetryTimeout: '00:45:00' + healthCheckStableDuration: '00:01:00' + healthCheckWaitDuration: '00:00:30' + healthPolicy: { + maxPercentUnhealthyApplications: 0 + maxPercentUnhealthyNodes: 0 + } + upgradeDomainTimeout: '02:00:00' + upgradeReplicaSetCheckTimeout: '1.00:00:00' + upgradeTimeout: '02:00:00' + } + vmImage: 'Linux' } } ``` @@ -716,50 +510,227 @@ module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-sfc-min-001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "managementEndpoint": { + "value": "https://<>-az-sfc-full-001.westeurope.cloudapp.azure.com:19080" + }, + "reliabilityLevel": { + "value": "Silver" + }, + // Non-required parameters + "addOnFeatures": { + "value": [ + "BackupRestoreService", + "DnsService", + "RepairManager", + "ResourceMonitorService" + ] + }, + "applicationTypes": { + "value": [ + { + "name": "WordCount" + } + ] + }, + "azureActiveDirectory": { + "value": { + "clientApplication": "<>", + "clusterApplication": "cf33fea8-b30f-424f-ab73-c48d99e0b222", + "tenantId": "<>" + } + }, + "certificateCommonNames": { + "value": { + "commonNames": [ + { + "certificateCommonName": "certcommon", + "certificateIssuerThumbprint": "0AC113D5E1D94C401DDEB0EE2B1B96CC130" + } + ], + "x509StoreName": "" + } + }, + "clientCertificateCommonNames": { + "value": [ + { + "certificateCommonName": "clientcommoncert1", + "certificateIssuerThumbprint": "0AC113D5E1D94C401DDEB0EE2B1B96CC130", + "isAdmin": false + }, + { + "certificateCommonName": "clientcommoncert2", + "certificateIssuerThumbprint": "0AC113D5E1D94C401DDEB0EE2B1B96CC131", + "isAdmin": false + } + ] + }, + "clientCertificateThumbprints": { + "value": [ + { + "certificateThumbprint": "0AC113D5E1D94C401DDEB0EE2B1B96CC130", + "isAdmin": false }, - "managementEndpoint": { - "value": "https://<>-az-sfc-min-001.westeurope.cloudapp.azure.com:19080" + { + "certificateThumbprint": "0AC113D5E1D94C401DDEB0EE2B1B96CC131", + "isAdmin": false + } + ] + }, + "diagnosticsStorageAccountConfig": { + "value": { + "blobEndpoint": "https://adp<>azsaweux001.blob.core.windows.net/", + "protectedAccountKeyName": "StorageAccountKey1", + "queueEndpoint": "https://adp<>azsaweux001.queue.core.windows.net/", + "storageAccountName": "adp<>azsaweux001", + "tableEndpoint": "https://adp<>azsaweux001.table.core.windows.net/" + } + }, + "fabricSettings": { + "value": [ + { + "name": "Security", + "parameters": [ + { + "name": "ClusterProtectionLevel", + "value": "EncryptAndSign" + } + ] }, - "reliabilityLevel": { - "value": "None" + { + "name": "UpgradeService", + "parameters": [ + { + "name": "AppPollIntervalInSeconds", + "value": "60" + } + ] + } + ] + }, + "lock": { + "value": "CanNotDelete" + }, + "maxUnusedVersionsToKeep": { + "value": 2 + }, + "name": { + "value": "<>-az-sfc-full-001" + }, + "nodeTypes": { + "value": [ + { + "applicationPorts": { + "endPort": 30000, + "startPort": 20000 + }, + "capacities": {}, + "clientConnectionEndpointPort": 19000, + "durabilityLevel": "Silver", + "ephemeralPorts": { + "endPort": 65534, + "startPort": 49152 + }, + "httpGatewayEndpointPort": 19080, + "isPrimary": true, + "isStateless": false, + "multipleAvailabilityZones": false, + "name": "Node01", + "placementProperties": {}, + "reverseProxyEndpointPort": "", + "vmInstanceCount": 5 }, - "nodeTypes": { - "value": [ - { - "applicationPorts": { - "endPort": 30000, - "startPort": 20000 - }, - "clientConnectionEndpointPort": 19000, - "durabilityLevel": "Bronze", - "ephemeralPorts": { - "endPort": 65534, - "startPort": 49152 - }, - "httpGatewayEndpointPort": 19080, - "isPrimary": true, - "name": "Node01" - } - ] + { + "applicationPorts": { + "endPort": 30000, + "startPort": 20000 + }, + "clientConnectionEndpointPort": 19000, + "durabilityLevel": "Bronze", + "ephemeralPorts": { + "endPort": 64000, + "startPort": 49000 + }, + "httpGatewayEndpointPort": 19007, + "isPrimary": true, + "name": "Node02", + "vmInstanceCount": 5 + } + ] + }, + "notifications": { + "value": [ + { + "isEnabled": true, + "notificationCategory": "WaveProgress", + "notificationLevel": "Critical", + "notificationTargets": [ + { + "notificationChannel": "EmailUser", + "receivers": [ + "SomeReceiver" + ] + } + ] + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] + }, + "tags": { + "value": { + "clusterName": "<>-az-sfc-full-001", + "resourceType": "Service Fabric" + } + }, + "upgradeDescription": { + "value": { + "deltaHealthPolicy": { + "maxPercentDeltaUnhealthyApplications": 0, + "maxPercentDeltaUnhealthyNodes": 0, + "maxPercentUpgradeDomainDeltaUnhealthyNodes": 0 + }, + "forceRestart": false, + "healthCheckRetryTimeout": "00:45:00", + "healthCheckStableDuration": "00:01:00", + "healthCheckWaitDuration": "00:00:30", + "healthPolicy": { + "maxPercentUnhealthyApplications": 0, + "maxPercentUnhealthyNodes": 0 + }, + "upgradeDomainTimeout": "02:00:00", + "upgradeReplicaSetCheckTimeout": "1.00:00:00", + "upgradeTimeout": "02:00:00" + } + }, + "vmImage": { + "value": "Linux" } + } } ```
+

+ +

Example 3: Min

@@ -769,9 +740,11 @@ module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = { module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = { name: '${uniqueString(deployment().name)}-clusters' params: { - name: '<>-az-sfc-min-001' + // Required parameters managementEndpoint: 'https://<>-az-sfc-min-001.westeurope.cloudapp.azure.com:19080' reliabilityLevel: 'None' + // Non-required parameters + name: '<>-az-sfc-min-001' nodeTypes: [ { applicationPorts: { @@ -795,3 +768,49 @@ module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "managementEndpoint": { + "value": "https://<>-az-sfc-min-001.westeurope.cloudapp.azure.com:19080" + }, + "reliabilityLevel": { + "value": "None" + }, + // Non-required parameters + "name": { + "value": "<>-az-sfc-min-001" + }, + "nodeTypes": { + "value": [ + { + "applicationPorts": { + "endPort": 30000, + "startPort": 20000 + }, + "clientConnectionEndpointPort": 19000, + "durabilityLevel": "Bronze", + "ephemeralPorts": { + "endPort": 65534, + "startPort": 49152 + }, + "httpGatewayEndpointPort": 19080, + "isPrimary": true, + "name": "Node01" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.SignalRService/webPubSub/readme.md b/modules/Microsoft.SignalRService/webPubSub/readme.md index c25260dd6a..1b7bf13e22 100644 --- a/modules/Microsoft.SignalRService/webPubSub/readme.md +++ b/modules/Microsoft.SignalRService/webPubSub/readme.md @@ -343,7 +343,27 @@ networkAcls: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. + +

Example 1: Min

+ +
+ +via Bicep module + +```bicep +module webPubSub './Microsoft.SignalRService/webPubSub/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-webPubSub' + params: { + name: '<>-az-pubsub-min-001' + } +} +``` + +
+

@@ -362,6 +382,9 @@ networkAcls: { ```
+

+ +

Example 2: Parameters

@@ -371,7 +394,57 @@ networkAcls: { module webPubSub './Microsoft.SignalRService/webPubSub/deploy.bicep' = { name: '${uniqueString(deployment().name)}-webPubSub' params: { - name: '<>-az-pubsub-min-001' + // Required parameters + name: '<>-az-pubsub-x-001' + // Additional parameters + capacity: 2 + clientCertEnabled: false + disableAadAuth: false + disableLocalAuth: true + location: 'westeurope' + lock: 'CanNotDelete' + networkAcls: { + defaultAction: 'Allow' + privateEndpoints: [ + { + allow: [] + deny: [ + 'ServerConnection' + 'Trace' + ] + name: 'pe-<>-az-pubsub-x-001-webpubsub-0' + } + ] + publicNetwork: { + allow: [] + deny: [ + 'RESTAPI' + 'Trace' + ] + } + } + privateEndpoints: [ + { + service: 'webpubsub' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + ] + resourceLogConfigurationsToEnable: [ + 'ConnectivityLogs' + ] + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + sku: 'Standard_S1' + systemAssignedIdentity: true + tags: { + purpose: 'test' + } } } ``` @@ -379,8 +452,6 @@ module webPubSub './Microsoft.SignalRService/webPubSub/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file @@ -390,12 +461,11 @@ module webPubSub './Microsoft.SignalRService/webPubSub/deploy.bicep' = { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { - "location": { - "value": "westeurope" - }, + // Required parameters "name": { "value": "<>-az-pubsub-x-001" }, + // Additional parameters "capacity": { "value": 2 }, @@ -408,33 +478,23 @@ module webPubSub './Microsoft.SignalRService/webPubSub/deploy.bicep' = { "disableLocalAuth": { "value": true }, + "location": { + "value": "westeurope" + }, "lock": { "value": "CanNotDelete" }, - "sku": { - "value": "Standard_S1" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, "networkAcls": { "value": { "defaultAction": "Allow", "privateEndpoints": [ { - "name": "pe-<>-az-pubsub-x-001-webpubsub-0", "allow": [], "deny": [ "ServerConnection", "Trace" - ] + ], + "name": "pe-<>-az-pubsub-x-001-webpubsub-0" } ], "publicNetwork": { @@ -446,90 +506,40 @@ module webPubSub './Microsoft.SignalRService/webPubSub/deploy.bicep' = { } } }, - "systemAssignedIdentity": { - "value": true - }, - "tags": { - "value": { - "purpose": "test" - } + "privateEndpoints": { + "value": [ + { + "service": "webpubsub", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] }, "resourceLogConfigurationsToEnable": { "value": [ "ConnectivityLogs" ] }, - "privateEndpoints": { + "roleAssignments": { "value": [ { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "webpubsub" - } - ] - } - } -} -``` - -
- -
- -via Bicep module - -```bicep -module webPubSub './Microsoft.SignalRService/webPubSub/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-webPubSub' - params: { - location: 'westeurope' - name: '<>-az-pubsub-x-001' - capacity: 2 - clientCertEnabled: false - disableAadAuth: false - disableLocalAuth: true - lock: 'CanNotDelete' - sku: 'Standard_S1' - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] - networkAcls: { - defaultAction: 'Allow' - privateEndpoints: [ - { - name: 'pe-<>-az-pubsub-x-001-webpubsub-0' - allow: [] - deny: [ - 'ServerConnection' - 'Trace' - ] + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } ] - publicNetwork: { - allow: [] - deny: [ - 'RESTAPI' - 'Trace' - ] + }, + "sku": { + "value": "Standard_S1" + }, + "systemAssignedIdentity": { + "value": true + }, + "tags": { + "value": { + "purpose": "test" } } - systemAssignedIdentity: true - tags: { - purpose: 'test' - } - resourceLogConfigurationsToEnable: [ - 'ConnectivityLogs' - ] - privateEndpoints: [ - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'webpubsub' - } - ] } } ``` diff --git a/modules/Microsoft.Sql/managedInstances/readme.md b/modules/Microsoft.Sql/managedInstances/readme.md index c2b83a041c..73bd69a962 100644 --- a/modules/Microsoft.Sql/managedInstances/readme.md +++ b/modules/Microsoft.Sql/managedInstances/readme.md @@ -274,166 +274,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-sqlmi-x-002" - }, - "lock": { - "value": "CanNotDelete" - }, - "administratorLogin": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "administratorLogin" - } - }, - "administratorLoginPassword": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "administratorLoginPassword" - } - }, - "subnetId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-sqlmi/subnets/<>-az-subnet-x-sqlmi" - }, - "skuName": { - "value": "GP_Gen5" - }, - "skuTier": { - "value": "GeneralPurpose" - }, - "storageSizeInGB": { - "value": 32 - }, - "vCores": { - "value": 4 - }, - "licenseType": { - "value": "LicenseIncluded" - }, - "hardwareFamily": { - "value": "Gen5" - }, - "servicePrincipal": { - "value": "SystemAssigned" - }, - "dnsZonePartner": { - "value": "" - }, - "timezoneId": { - "value": "UTC" - }, - "collation": { - "value": "SQL_Latin1_General_CP1_CI_AS" - }, - "proxyOverride": { - "value": "Proxy" - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "primaryUserAssignedIdentityId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" - }, - "publicDataEndpointEnabled": { - "value": false - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "keys": { - "value": [ - { - "name": "adp-<>-az-kv-x-sqlmi_keyEncryptionKeySqlMi_4bf367f64c914d8ba698700fb598ad07", // ID must be updated for new keys - "uri": "https://adp-<>-az-kv-x-sqlmi.vault.azure.net/keys/keyEncryptionKeySqlMi/4bf367f64c914d8ba698700fb598ad07", // ID must be updated for new keys - "serverKeyType": "AzureKeyVault" - } - ] - }, - "encryptionProtectorObj": { - "value": { - "serverKeyName": "adp-<>-az-kv-x-sqlmi_keyEncryptionKeySqlMi_4bf367f64c914d8ba698700fb598ad07", // ID must be updated for new keys - "serverKeyType": "AzureKeyVault" - } - }, - "securityAlertPoliciesObj": { - "value": { - "name": "default", - "state": "Enabled", - "emailAccountAdmins": true - } - }, - "vulnerabilityAssessmentsObj": { - "value": { - "name": "default", - "emailSubscriptionAdmins": true, - "recurringScansIsEnabled": true, - "recurringScansEmails": [ - "test1@contoso.com", - "test2@contoso.com" - ], - "vulnerabilityAssessmentsStorageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - } - }, - "databases": { - "value": [ - { - "name": "<>-az-sqlmidb-x-001", - "backupShortTermRetentionPolicies": { - "name": "default" - }, - "backupLongTermRetentionPolicies": { - "name": "default" - } - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Parameters

@@ -448,78 +293,238 @@ resource kv1 'Microsoft.KeyVault/vaults@2019-09-01' existing = { module managedInstances './Microsoft.Sql/managedInstances/deploy.bicep' = { name: '${uniqueString(deployment().name)}-managedInstances' params: { - name: '<>-az-sqlmi-x-002' - lock: 'CanNotDelete' administratorLogin: kv1.getSecret('administratorLogin') administratorLoginPassword: kv1.getSecret('administratorLoginPassword') + name: '<>-az-sqlmi-x-002' subnetId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-sqlmi/subnets/<>-az-subnet-x-sqlmi' - skuName: 'GP_Gen5' - skuTier: 'GeneralPurpose' - storageSizeInGB: 32 - vCores: 4 - licenseType: 'LicenseIncluded' - hardwareFamily: 'Gen5' - servicePrincipal: 'SystemAssigned' - dnsZonePartner: '' - timezoneId: 'UTC' collation: 'SQL_Latin1_General_CP1_CI_AS' - proxyOverride: 'Proxy' - systemAssignedIdentity: true - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + databases: [ + { + backupLongTermRetentionPolicies: { + name: 'default' + } + backupShortTermRetentionPolicies: { + name: 'default' + } + name: '<>-az-sqlmidb-x-001' + } + ] + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + dnsZonePartner: '' + encryptionProtectorObj: { + serverKeyName: 'adp-<>-az-kv-x-sqlmi_keyEncryptionKeySqlMi_4bf367f64c914d8ba698700fb598ad07' + serverKeyType: 'AzureKeyVault' } + hardwareFamily: 'Gen5' + keys: [ + { + name: 'adp-<>-az-kv-x-sqlmi_keyEncryptionKeySqlMi_4bf367f64c914d8ba698700fb598ad07' + serverKeyType: 'AzureKeyVault' + uri: 'https://adp-<>-az-kv-x-sqlmi.vault.azure.net/keys/keyEncryptionKeySqlMi/4bf367f64c914d8ba698700fb598ad07' + } + ] + licenseType: 'LicenseIncluded' + lock: 'CanNotDelete' primaryUserAssignedIdentityId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' + proxyOverride: 'Proxy' publicDataEndpointEnabled: false roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - keys: [ - { - name: 'adp-<>-az-kv-x-sqlmi_keyEncryptionKeySqlMi_4bf367f64c914d8ba698700fb598ad07' - uri: 'https://adp-<>-az-kv-x-sqlmi.vault.azure.net/keys/keyEncryptionKeySqlMi/4bf367f64c914d8ba698700fb598ad07' - serverKeyType: 'AzureKeyVault' - } - ] - encryptionProtectorObj: { - serverKeyName: 'adp-<>-az-kv-x-sqlmi_keyEncryptionKeySqlMi_4bf367f64c914d8ba698700fb598ad07' - serverKeyType: 'AzureKeyVault' - } securityAlertPoliciesObj: { + emailAccountAdmins: true name: 'default' state: 'Enabled' - emailAccountAdmins: true } + servicePrincipal: 'SystemAssigned' + skuName: 'GP_Gen5' + skuTier: 'GeneralPurpose' + storageSizeInGB: 32 + systemAssignedIdentity: true + timezoneId: 'UTC' + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } + vCores: 4 vulnerabilityAssessmentsObj: { - name: 'default' emailSubscriptionAdmins: true - recurringScansIsEnabled: true + name: 'default' recurringScansEmails: [ 'test1@contoso.com' 'test2@contoso.com' ] + recurringScansIsEnabled: true vulnerabilityAssessmentsStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' } - databases: [ - { - name: '<>-az-sqlmidb-x-001' - backupShortTermRetentionPolicies: { - name: 'default' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "administratorLogin": { + "reference": { + "keyVault": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "secretName": "administratorLogin" + } + }, + "administratorLoginPassword": { + "reference": { + "keyVault": { + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "secretName": "administratorLoginPassword" + } + }, + "name": { + "value": "<>-az-sqlmi-x-002" + }, + "subnetId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-sqlmi/subnets/<>-az-subnet-x-sqlmi" + }, + "collation": { + "value": "SQL_Latin1_General_CP1_CI_AS" + }, + "databases": { + "value": [ + { + "backupLongTermRetentionPolicies": { + "name": "default" + }, + "backupShortTermRetentionPolicies": { + "name": "default" + }, + "name": "<>-az-sqlmidb-x-001" } - backupLongTermRetentionPolicies: { - name: 'default' + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "dnsZonePartner": { + "value": "" + }, + "encryptionProtectorObj": { + "value": { + "serverKeyName": "adp-<>-az-kv-x-sqlmi_keyEncryptionKeySqlMi_4bf367f64c914d8ba698700fb598ad07", + "serverKeyType": "AzureKeyVault" + } + }, + "hardwareFamily": { + "value": "Gen5" + }, + "keys": { + "value": [ + { + "name": "adp-<>-az-kv-x-sqlmi_keyEncryptionKeySqlMi_4bf367f64c914d8ba698700fb598ad07", + "serverKeyType": "AzureKeyVault", + "uri": "https://adp-<>-az-kv-x-sqlmi.vault.azure.net/keys/keyEncryptionKeySqlMi/4bf367f64c914d8ba698700fb598ad07" + } + ] + }, + "licenseType": { + "value": "LicenseIncluded" + }, + "lock": { + "value": "CanNotDelete" + }, + "primaryUserAssignedIdentityId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" + }, + "proxyOverride": { + "value": "Proxy" + }, + "publicDataEndpointEnabled": { + "value": false + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] + }, + "securityAlertPoliciesObj": { + "value": { + "emailAccountAdmins": true, + "name": "default", + "state": "Enabled" } - ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + }, + "servicePrincipal": { + "value": "SystemAssigned" + }, + "skuName": { + "value": "GP_Gen5" + }, + "skuTier": { + "value": "GeneralPurpose" + }, + "storageSizeInGB": { + "value": 32 + }, + "systemAssignedIdentity": { + "value": true + }, + "timezoneId": { + "value": "UTC" + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + }, + "vCores": { + "value": 4 + }, + "vulnerabilityAssessmentsObj": { + "value": { + "emailSubscriptionAdmins": true, + "name": "default", + "recurringScansEmails": [ + "test1@contoso.com", + "test2@contoso.com" + ], + "recurringScansIsEnabled": true, + "vulnerabilityAssessmentsStorageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + } + } } } ``` diff --git a/modules/Microsoft.Sql/servers/readme.md b/modules/Microsoft.Sql/servers/readme.md index 8ccd6c4fb7..a97a414d5d 100644 --- a/modules/Microsoft.Sql/servers/readme.md +++ b/modules/Microsoft.Sql/servers/readme.md @@ -318,34 +318,11 @@ privateEndpoints: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-sqlsrv-admin-001" - }, - "administrators": { - "value": { - "azureADOnlyAuthentication": true, - "login": "myspn", - "sid": "<>", - "principalType": "Application", - "tenantId": "<>" - } - } - } -} -``` - -
+

Example 1: Admin

@@ -355,12 +332,14 @@ privateEndpoints: [ module servers './Microsoft.Sql/servers/deploy.bicep' = { name: '${uniqueString(deployment().name)}-servers' params: { + // Required parameters name: '<>-az-sqlsrv-admin-001' + // Non-required parameters administrators: { azureADOnlyAuthentication: true login: 'myspn' - sid: '<>' principalType: 'Application' + sid: '<>' tenantId: '<>' } } @@ -370,120 +349,37 @@ module servers './Microsoft.Sql/servers/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-sqlsrv-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "administratorLogin": { - "value": "adminUserName" - }, - "administratorLoginPassword": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/<>/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "administratorLoginPassword" - } - }, - "location": { - "value": "westeurope" - }, - "minimalTlsVersion": { - "value": "1.2" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "vulnerabilityAssessmentsObj": { - "value": { - "name": "default", - "emailSubscriptionAdmins": true, - "recurringScansIsEnabled": true, - "recurringScansEmails": [ - "test1@contoso.com", - "test2@contoso.com" - ], - "vulnerabilityAssessmentsStorageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - } - }, - "databases": { - "value": [ - { - "name": "<>-az-sqldb-x-001", - "collation": "SQL_Latin1_General_CP1_CI_AS", - "skuTier": "BusinessCritical", - "skuName": "BC_Gen5", - "skuCapacity": 12, - "skuFamily": "Gen5", - "maxSizeBytes": 34359738368, - "licenseType": "LicenseIncluded", - "diagnosticLogsRetentionInDays": 7, - "diagnosticStorageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", - "diagnosticWorkspaceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001", - "diagnosticEventHubAuthorizationRuleId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey", - "diagnosticEventHubName": "adp-<>-az-evh-x-001" - } - ] - }, - "firewallRules": { - "value": [ - { - "name": "AllowAllWindowsAzureIps", - "endIpAddress": "0.0.0.0", - "startIpAddress": "0.0.0.0" - } - ] - }, - "securityAlertPolicies": { - "value": [ - { - "name": "Default", - "state": "Enabled", - "emailAccountAdmins": true - } - ] - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "sqlServer" - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-sqlsrv-admin-001" + }, + // Non-required parameters + "administrators": { + "value": { + "azureADOnlyAuthentication": true, + "login": "myspn", + "principalType": "Application", + "sid": "<>", + "tenantId": "<>" + } } + } } ```
+

+ +

Example 2: Parameters

@@ -498,71 +394,194 @@ resource kv1 'Microsoft.KeyVault/vaults@2019-09-01' existing = { module servers './Microsoft.Sql/servers/deploy.bicep' = { name: '${uniqueString(deployment().name)}-servers' params: { + // Required parameters name: '<>-az-sqlsrv-x-001' - lock: 'CanNotDelete' - administratorLogin: 'adminUserName' + // Non-required parameters + administratorLogin: kv1.getSecret('administratorLogin') administratorLoginPassword: kv1.getSecret('administratorLoginPassword') - location: 'westeurope' - minimalTlsVersion: '1.2' - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] - vulnerabilityAssessmentsObj: { - name: 'default' - emailSubscriptionAdmins: true - recurringScansIsEnabled: true - recurringScansEmails: [ - 'test1@contoso.com' - 'test2@contoso.com' - ] - vulnerabilityAssessmentsStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - } databases: [ { - name: '<>-az-sqldb-x-001' collation: 'SQL_Latin1_General_CP1_CI_AS' - skuTier: 'BusinessCritical' - skuName: 'BC_Gen5' - skuCapacity: 12 - skuFamily: 'Gen5' - maxSizeBytes: 34359738368 - licenseType: 'LicenseIncluded' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' diagnosticLogsRetentionInDays: 7 diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + licenseType: 'LicenseIncluded' + maxSizeBytes: 34359738368 + name: '<>-az-sqldb-x-001' + skuCapacity: 12 + skuFamily: 'Gen5' + skuName: 'BC_Gen5' + skuTier: 'BusinessCritical' } ] firewallRules: [ { - name: 'AllowAllWindowsAzureIps' endIpAddress: '0.0.0.0' + name: 'AllowAllWindowsAzureIps' startIpAddress: '0.0.0.0' } ] + location: 'westeurope' + lock: 'CanNotDelete' + minimalTlsVersion: '1.2' + privateEndpoints: [ + { + service: 'sqlServer' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + ] + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] securityAlertPolicies: [ { + emailAccountAdmins: true name: 'Default' state: 'Enabled' - emailAccountAdmins: true } ] systemAssignedIdentity: true userAssignedIdentities: { '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } - privateEndpoints: [ - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'sqlServer' + vulnerabilityAssessmentsObj: { + emailSubscriptionAdmins: true + name: 'default' + recurringScansEmails: [ + 'test1@contoso.com' + 'test2@contoso.com' + ] + recurringScansIsEnabled: true + vulnerabilityAssessmentsStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + } + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-sqlsrv-x-001" + }, + // Non-required parameters + "administratorLogin": { + "reference": { + "keyVault": { + "id": "/subscriptions/<>/resourceGroups/<>/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "secretName": "administratorLogin" } - ] + }, + "administratorLoginPassword": { + "reference": { + "keyVault": { + "id": "/subscriptions/<>/resourceGroups/<>/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" + }, + "secretName": "administratorLoginPassword" + } + }, + "databases": { + "value": [ + { + "collation": "SQL_Latin1_General_CP1_CI_AS", + "diagnosticEventHubAuthorizationRuleId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey", + "diagnosticEventHubName": "adp-<>-az-evh-x-001", + "diagnosticLogsRetentionInDays": 7, + "diagnosticStorageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", + "diagnosticWorkspaceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001", + "licenseType": "LicenseIncluded", + "maxSizeBytes": 34359738368, + "name": "<>-az-sqldb-x-001", + "skuCapacity": 12, + "skuFamily": "Gen5", + "skuName": "BC_Gen5", + "skuTier": "BusinessCritical" + } + ] + }, + "firewallRules": { + "value": [ + { + "endIpAddress": "0.0.0.0", + "name": "AllowAllWindowsAzureIps", + "startIpAddress": "0.0.0.0" + } + ] + }, + "location": { + "value": "westeurope" + }, + "lock": { + "value": "CanNotDelete" + }, + "minimalTlsVersion": { + "value": "1.2" + }, + "privateEndpoints": { + "value": [ + { + "service": "sqlServer", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "securityAlertPolicies": { + "value": [ + { + "emailAccountAdmins": true, + "name": "Default", + "state": "Enabled" + } + ] + }, + "systemAssignedIdentity": { + "value": true + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } + }, + "vulnerabilityAssessmentsObj": { + "value": { + "emailSubscriptionAdmins": true, + "name": "default", + "recurringScansEmails": [ + "test1@contoso.com", + "test2@contoso.com" + ], + "recurringScansIsEnabled": true, + "vulnerabilityAssessmentsStorageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + } + } } } ``` diff --git a/modules/Microsoft.Storage/storageAccounts/readme.md b/modules/Microsoft.Storage/storageAccounts/readme.md index 02f1589e02..6e4f4059af 100644 --- a/modules/Microsoft.Storage/storageAccounts/readme.md +++ b/modules/Microsoft.Storage/storageAccounts/readme.md @@ -364,54 +364,11 @@ The hierarchical namespace of the storage account (see parameter `enableHierarch ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>azsaencr001" - }, - "storageAccountSku": { - "value": "Standard_LRS" - }, - "allowBlobPublicAccess": { - "value": false - }, - "publicNetworkAccess": { - "value": "Disabled" - }, - "requireInfrastructureEncryption": { - "value": true - }, - "systemAssignedIdentity": { - "value": false - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "cMKKeyVaultResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" - }, - "cMKKeyName": { - "value": "keyEncryptionKey" - }, - "cMKUserAssignedIdentityResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" - } - } -} -``` - -
+

Example 1: Encr

@@ -421,18 +378,18 @@ The hierarchical namespace of the storage account (see parameter `enableHierarch module storageAccounts './Microsoft.Storage/storageAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-storageAccounts' params: { - name: '<>azsaencr001' - storageAccountSku: 'Standard_LRS' allowBlobPublicAccess: false + cMKKeyName: 'keyEncryptionKey' + cMKKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002' + cMKUserAssignedIdentityResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' + name: '<>azsaencr001' publicNetworkAccess: 'Disabled' requireInfrastructureEncryption: true + storageAccountSku: 'Standard_LRS' systemAssignedIdentity: false userAssignedIdentities: { '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } - cMKKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002' - cMKKeyName: 'keyEncryptionKey' - cMKUserAssignedIdentityResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' } } ``` @@ -440,25 +397,55 @@ module storageAccounts './Microsoft.Storage/storageAccounts/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "allowBlobPublicAccess": { - "value": false - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "allowBlobPublicAccess": { + "value": false + }, + "cMKKeyName": { + "value": "keyEncryptionKey" + }, + "cMKKeyVaultResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" + }, + "cMKUserAssignedIdentityResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" + }, + "name": { + "value": "<>azsaencr001" + }, + "publicNetworkAccess": { + "value": "Disabled" + }, + "requireInfrastructureEncryption": { + "value": true + }, + "storageAccountSku": { + "value": "Standard_LRS" + }, + "systemAssignedIdentity": { + "value": false + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } } + } } ```
+

+ +

Example 2: Min

@@ -476,80 +463,26 @@ module storageAccounts './Microsoft.Storage/storageAccounts/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>azsax002" - }, - "storageAccountSku": { - "value": "Premium_LRS" - }, - "storageAccountKind": { - "value": "FileStorage" - }, - "allowBlobPublicAccess": { - "value": false - }, - "supportsHttpsTrafficOnly": { - "value": false - }, - "fileServices": { - "value": { - "shares": [ - { - "name": "nfsfileshare", - "enabledProtocols": "NFS" - } - ] - } - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "allowBlobPublicAccess": { + "value": false } + } } ```
+

+ +

Example 3: Nfs

@@ -559,36 +492,36 @@ module storageAccounts './Microsoft.Storage/storageAccounts/deploy.bicep' = { module storageAccounts './Microsoft.Storage/storageAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-storageAccounts' params: { - name: '<>azsax002' - storageAccountSku: 'Premium_LRS' - storageAccountKind: 'FileStorage' allowBlobPublicAccess: false - supportsHttpsTrafficOnly: false + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' fileServices: { shares: [ { - name: 'nfsfileshare' enabledProtocols: 'NFS' + name: 'nfsfileshare' } ] } - systemAssignedIdentity: true - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } + name: '<>azsax002' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + storageAccountKind: 'FileStorage' + storageAccountSku: 'Premium_LRS' + supportsHttpsTrafficOnly: false + systemAssignedIdentity: true + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } } } ``` @@ -596,208 +529,81 @@ module storageAccounts './Microsoft.Storage/storageAccounts/deploy.bicep' = {

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>azsax001" - }, - "storageAccountSku": { - "value": "Standard_LRS" - }, - "allowBlobPublicAccess": { - "value": false - }, - "publicNetworkAccess": { - "value": "Disabled" - }, - "requireInfrastructureEncryption": { - "value": true - }, - "lock": { - "value": "CanNotDelete" - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "blob" - }, - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "table" - }, - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "queue" - }, - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "file" - } - ] - }, - "networkAcls": { - "value": { - "bypass": "AzureServices", - "defaultAction": "Deny", - "virtualNetworkRules": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001", - "action": "Allow" - } - ], - "ipRules": [ - { - "action": "Allow", - "value": "1.1.1.1" - } - ] - } - }, - "blobServices": { - "value": { - "diagnosticLogsRetentionInDays": 7, - "diagnosticStorageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", - "diagnosticWorkspaceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001", - "diagnosticEventHubAuthorizationRuleId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey", - "diagnosticEventHubName": "adp-<>-az-evh-x-001", - "containers": [ - { - "name": "avdscripts", - "publicAccess": "None", - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - { - "name": "archivecontainer", - "publicAccess": "None", - "enableWORM": true, - "WORMRetention": 666, - "allowProtectedAppendWrites": false - } - ] - } - }, - "fileServices": { - "value": { - "diagnosticLogsRetentionInDays": 7, - "diagnosticStorageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", - "diagnosticWorkspaceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001", - "diagnosticEventHubAuthorizationRuleId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey", - "diagnosticEventHubName": "adp-<>-az-evh-x-001", - "shares": [ - { - "name": "avdprofiles", - "shareQuota": "5120", - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - { - "name": "avdprofiles2", - "shareQuota": "5120" - } - ] - } - }, - "tableServices": { - "value": { - "diagnosticLogsRetentionInDays": 7, - "diagnosticStorageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", - "diagnosticWorkspaceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001", - "diagnosticEventHubAuthorizationRuleId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey", - "diagnosticEventHubName": "adp-<>-az-evh-x-001", - "tables": [ - "table1", - "table2" - ] - } - }, - "queueServices": { - "value": { - "diagnosticLogsRetentionInDays": 7, - "diagnosticStorageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", - "diagnosticWorkspaceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001", - "diagnosticEventHubAuthorizationRuleId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey", - "diagnosticEventHubName": "adp-<>-az-evh-x-001", - "queues": [ - { - "name": "queue1", - "metadata": {}, - "roleAssignments": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - { - "name": "queue2", - "metadata": {} - } - ] - } - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "allowBlobPublicAccess": { + "value": false + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "fileServices": { + "value": { + "shares": [ + { + "enabledProtocols": "NFS", + "name": "nfsfileshare" + } + ] + } + }, + "name": { + "value": "<>azsax002" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] + }, + "storageAccountKind": { + "value": "FileStorage" + }, + "storageAccountSku": { + "value": "Premium_LRS" + }, + "supportsHttpsTrafficOnly": { + "value": false + }, + "systemAssignedIdentity": { + "value": true + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } } + } } ```
+

+ +

Example 4: Parameters

@@ -807,92 +613,58 @@ module storageAccounts './Microsoft.Storage/storageAccounts/deploy.bicep' = { module storageAccounts './Microsoft.Storage/storageAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-storageAccounts' params: { - name: '<>azsax001' - storageAccountSku: 'Standard_LRS' allowBlobPublicAccess: false - publicNetworkAccess: 'Disabled' - requireInfrastructureEncryption: true - lock: 'CanNotDelete' - privateEndpoints: [ - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'blob' - } - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'table' - } - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'queue' - } - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'file' - } - ] - networkAcls: { - bypass: 'AzureServices' - defaultAction: 'Deny' - virtualNetworkRules: [ - { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' - action: 'Allow' - } - ] - ipRules: [ - { - action: 'Allow' - value: '1.1.1.1' - } - ] - } blobServices: { - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' containers: [ { name: 'avdscripts' publicAccess: 'None' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } { + allowProtectedAppendWrites: false + enableWORM: true name: 'archivecontainer' publicAccess: 'None' - enableWORM: true WORMRetention: 666 - allowProtectedAppendWrites: false } ] - } - fileServices: { + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' diagnosticLogsRetentionInDays: 7 diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + } + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + fileServices: { diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' shares: [ { name: 'avdprofiles' - shareQuota: '5120' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + shareQuota: '5120' } { name: 'avdprofiles2' @@ -900,59 +672,93 @@ module storageAccounts './Microsoft.Storage/storageAccounts/deploy.bicep' = { } ] } - tableServices: { - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' - tables: [ - 'table1' - 'table2' + lock: 'CanNotDelete' + name: '<>azsax001' + networkAcls: { + bypass: 'AzureServices' + defaultAction: 'Deny' + ipRules: [ + { + action: 'Allow' + value: '1.1.1.1' + } + ] + virtualNetworkRules: [ + { + action: 'Allow' + id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001' + } ] } + privateEndpoints: [ + { + service: 'blob' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + { + service: 'table' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + { + service: 'queue' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + { + service: 'file' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + ] + publicNetworkAccess: 'Disabled' queueServices: { + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' diagnosticLogsRetentionInDays: 7 diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' queues: [ { - name: 'queue1' metadata: {} + name: 'queue1' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } { - name: 'queue2' metadata: {} + name: 'queue2' } ] } - systemAssignedIdentity: true - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } + requireInfrastructureEncryption: true roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + storageAccountSku: 'Standard_LRS' + systemAssignedIdentity: true + tableServices: { + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + tables: [ + 'table1' + 'table2' + ] + } + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } } } ``` @@ -960,28 +766,209 @@ module storageAccounts './Microsoft.Storage/storageAccounts/deploy.bicep' = {

-

Example 5

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "storageAccountKind": { - "value": "Storage" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "allowBlobPublicAccess": { + "value": false + }, + "blobServices": { + "value": { + "containers": [ + { + "name": "avdscripts", + "publicAccess": "None", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + { + "allowProtectedAppendWrites": false, + "enableWORM": true, + "name": "archivecontainer", + "publicAccess": "None", + "WORMRetention": 666 + } + ], + "diagnosticEventHubAuthorizationRuleId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey", + "diagnosticEventHubName": "adp-<>-az-evh-x-001", + "diagnosticLogsRetentionInDays": 7, + "diagnosticStorageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", + "diagnosticWorkspaceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + } + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "fileServices": { + "value": { + "diagnosticEventHubAuthorizationRuleId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey", + "diagnosticEventHubName": "adp-<>-az-evh-x-001", + "diagnosticLogsRetentionInDays": 7, + "diagnosticStorageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", + "diagnosticWorkspaceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001", + "shares": [ + { + "name": "avdprofiles", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ], + "shareQuota": "5120" + }, + { + "name": "avdprofiles2", + "shareQuota": "5120" + } + ] + } + }, + "lock": { + "value": "CanNotDelete" + }, + "name": { + "value": "<>azsax001" + }, + "networkAcls": { + "value": { + "bypass": "AzureServices", + "defaultAction": "Deny", + "ipRules": [ + { + "action": "Allow", + "value": "1.1.1.1" + } + ], + "virtualNetworkRules": [ + { + "action": "Allow", + "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-001" + } + ] + } + }, + "privateEndpoints": { + "value": [ + { + "service": "blob", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + }, + { + "service": "table", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + }, + { + "service": "queue", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" }, - "allowBlobPublicAccess": { - "value": false + { + "service": "file", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" } + ] + }, + "publicNetworkAccess": { + "value": "Disabled" + }, + "queueServices": { + "value": { + "diagnosticEventHubAuthorizationRuleId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey", + "diagnosticEventHubName": "adp-<>-az-evh-x-001", + "diagnosticLogsRetentionInDays": 7, + "diagnosticStorageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", + "diagnosticWorkspaceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001", + "queues": [ + { + "metadata": {}, + "name": "queue1", + "roleAssignments": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + { + "metadata": {}, + "name": "queue2" + } + ] + } + }, + "requireInfrastructureEncryption": { + "value": true + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "storageAccountSku": { + "value": "Standard_LRS" + }, + "systemAssignedIdentity": { + "value": true + }, + "tableServices": { + "value": { + "diagnosticEventHubAuthorizationRuleId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey", + "diagnosticEventHubName": "adp-<>-az-evh-x-001", + "diagnosticLogsRetentionInDays": 7, + "diagnosticStorageAccountId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001", + "diagnosticWorkspaceId": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001", + "tables": [ + "table1", + "table2" + ] + } + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } } + } } ```
+

+ +

Example 5: V1

@@ -991,8 +978,30 @@ module storageAccounts './Microsoft.Storage/storageAccounts/deploy.bicep' = { module storageAccounts './Microsoft.Storage/storageAccounts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-storageAccounts' params: { - storageAccountKind: 'Storage' allowBlobPublicAccess: false + storageAccountKind: 'Storage' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "allowBlobPublicAccess": { + "value": false + }, + "storageAccountKind": { + "value": "Storage" + } } } ``` diff --git a/modules/Microsoft.Synapse/privateLinkHubs/readme.md b/modules/Microsoft.Synapse/privateLinkHubs/readme.md index c361c3229c..8c57701958 100644 --- a/modules/Microsoft.Synapse/privateLinkHubs/readme.md +++ b/modules/Microsoft.Synapse/privateLinkHubs/readme.md @@ -225,25 +225,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "synplhmin001" - } - } -} -``` - -
+

Example 1: Min

@@ -261,52 +247,26 @@ module privateLinkHubs './Microsoft.Synapse/privateLinkHubs/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "synplhstandard001" - }, - "lock": { - "value": "CanNotDelete" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - }, - { - "roleDefinitionIdOrName": "/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c", - "principalIds": [ - "<>" - ] - } - ] - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "Web" - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "synplhmin001" } + } } ```
+

+ +

Example 2: Parameters

@@ -316,28 +276,78 @@ module privateLinkHubs './Microsoft.Synapse/privateLinkHubs/deploy.bicep' = { module privateLinkHubs './Microsoft.Synapse/privateLinkHubs/deploy.bicep' = { name: '${uniqueString(deployment().name)}-privateLinkHubs' params: { + // Required parameters name: 'synplhstandard001' + // Non-required parameters lock: 'CanNotDelete' + privateEndpoints: [ + { + service: 'Web' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } { - roleDefinitionIdOrName: '/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c' principalIds: [ '<>' ] + roleDefinitionIdOrName: '/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c' } ] - privateEndpoints: [ - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'Web' - } - ] + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "synplhstandard001" + }, + // Non-required parameters + "lock": { + "value": "CanNotDelete" + }, + "privateEndpoints": { + "value": [ + { + "service": "Web", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + }, + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c" + } + ] + } } } ``` diff --git a/modules/Microsoft.VirtualMachineImages/imageTemplates/readme.md b/modules/Microsoft.VirtualMachineImages/imageTemplates/readme.md index f8edd4cdd7..663da47411 100644 --- a/modules/Microsoft.VirtualMachineImages/imageTemplates/readme.md +++ b/modules/Microsoft.VirtualMachineImages/imageTemplates/readme.md @@ -260,85 +260,11 @@ roleAssignments: [ ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-imgt-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "userMsiName": { - "value": "adp-<>-az-msi-x-001" - }, - "userMsiResourceGroup": { - "value": "validation-rg" - }, - "buildTimeoutInMinutes": { - "value": 0 - }, - "vmSize": { - "value": "Standard_D2s_v3" - }, - "osDiskSizeGB": { - "value": 127 - }, - "subnetId": { - "value": "" - }, - "imageSource": { - "value": { - "type": "PlatformImage", - "publisher": "MicrosoftWindowsDesktop", - "offer": "Windows-10", - "sku": "19h2-evd", - "version": "latest" - } - }, - "customizationSteps": { - "value": [ - { - "type": "WindowsRestart", - "restartTimeout": "30m" - } - ] - }, - "managedImageName": { - "value": "<>-az-mi-x-001" - }, - "unManagedImageName": { - "value": "<>-az-umi-x-001" - }, - "sigImageDefinitionId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/galleries/adp<>azsigweux001/images/adp-<>-az-imgd-x-001" - }, - "imageReplicationRegions": { - "value": [] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -348,39 +274,122 @@ roleAssignments: [ module imageTemplates './Microsoft.VirtualMachineImages/imageTemplates/deploy.bicep' = { name: '${uniqueString(deployment().name)}-imageTemplates' params: { - name: '<>-az-imgt-x-001' - lock: 'CanNotDelete' - userMsiName: 'adp-<>-az-msi-x-001' - userMsiResourceGroup: 'validation-rg' - buildTimeoutInMinutes: 0 - vmSize: 'Standard_D2s_v3' - osDiskSizeGB: 127 - subnetId: '' - imageSource: { - type: 'PlatformImage' - publisher: 'MicrosoftWindowsDesktop' - offer: 'Windows-10' - sku: '19h2-evd' - version: 'latest' - } + // Required parameters customizationSteps: [ { - type: 'WindowsRestart' restartTimeout: '30m' + type: 'WindowsRestart' } ] - managedImageName: '<>-az-mi-x-001' - unManagedImageName: '<>-az-umi-x-001' - sigImageDefinitionId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/galleries/adp<>azsigweux001/images/adp-<>-az-imgd-x-001' + imageSource: { + offer: 'Windows-10' + publisher: 'MicrosoftWindowsDesktop' + sku: '19h2-evd' + type: 'PlatformImage' + version: 'latest' + } + name: '<>-az-imgt-x-001' + userMsiName: 'adp-<>-az-msi-x-001' + // Non-required parameters + buildTimeoutInMinutes: 0 imageReplicationRegions: [] + lock: 'CanNotDelete' + managedImageName: '<>-az-mi-x-001' + osDiskSizeGB: 127 roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] + sigImageDefinitionId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/galleries/adp<>azsigweux001/images/adp-<>-az-imgd-x-001' + subnetId: '' + unManagedImageName: '<>-az-umi-x-001' + userMsiResourceGroup: 'validation-rg' + vmSize: 'Standard_D2s_v3' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "customizationSteps": { + "value": [ + { + "restartTimeout": "30m", + "type": "WindowsRestart" + } + ] + }, + "imageSource": { + "value": { + "offer": "Windows-10", + "publisher": "MicrosoftWindowsDesktop", + "sku": "19h2-evd", + "type": "PlatformImage", + "version": "latest" + } + }, + "name": { + "value": "<>-az-imgt-x-001" + }, + "userMsiName": { + "value": "adp-<>-az-msi-x-001" + }, + // Non-required parameters + "buildTimeoutInMinutes": { + "value": 0 + }, + "imageReplicationRegions": { + "value": [] + }, + "lock": { + "value": "CanNotDelete" + }, + "managedImageName": { + "value": "<>-az-mi-x-001" + }, + "osDiskSizeGB": { + "value": 127 + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "sigImageDefinitionId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/galleries/adp<>azsigweux001/images/adp-<>-az-imgd-x-001" + }, + "subnetId": { + "value": "" + }, + "unManagedImageName": { + "value": "<>-az-umi-x-001" + }, + "userMsiResourceGroup": { + "value": "validation-rg" + }, + "vmSize": { + "value": "Standard_D2s_v3" + } } } ``` diff --git a/modules/Microsoft.Web/connections/readme.md b/modules/Microsoft.Web/connections/readme.md index 17d31cbb98..133961833a 100644 --- a/modules/Microsoft.Web/connections/readme.md +++ b/modules/Microsoft.Web/connections/readme.md @@ -153,46 +153,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "azuremonitor" - }, - "lock": { - "value": "CanNotDelete" - }, - "displayName": { - "value": "azuremonitorlogs" - }, - "connectionApi": { - "value": { - "id": "/subscriptions/<>/providers/Microsoft.Web/locations/westeurope/managedApis/azuremonitorlogs" - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -202,18 +167,20 @@ tags: { module connections './Microsoft.Web/connections/deploy.bicep' = { name: '${uniqueString(deployment().name)}-connections' params: { - name: 'azuremonitor' - lock: 'CanNotDelete' + // Required parameters displayName: 'azuremonitorlogs' + name: 'azuremonitor' + // Non-required parameters connectionApi: { id: '/subscriptions/<>/providers/Microsoft.Web/locations/westeurope/managedApis/azuremonitorlogs' } + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -222,3 +189,45 @@ module connections './Microsoft.Web/connections/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "displayName": { + "value": "azuremonitorlogs" + }, + "name": { + "value": "azuremonitor" + }, + // Non-required parameters + "connectionApi": { + "value": { + "id": "/subscriptions/<>/providers/Microsoft.Web/locations/westeurope/managedApis/azuremonitorlogs" + } + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Web/hostingEnvironments/readme.md b/modules/Microsoft.Web/hostingEnvironments/readme.md index 0dd5e01601..7b9c7aa52b 100644 --- a/modules/Microsoft.Web/hostingEnvironments/readme.md +++ b/modules/Microsoft.Web/hostingEnvironments/readme.md @@ -199,70 +199,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-appse-asev2-001" - }, - "kind": { - "value": "ASEv2" - }, - "multiSize": { - "value": "Standard_D1_V2" - }, - "ipsslAddressCount": { - "value": 2 - }, - "clusterSettings": { - "value": [ - { - "name": "DisableTls1.0", - "value": "1" - } - ] - }, - "subnetResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-008" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} -``` - -
+

Example 1: Asev2

@@ -272,30 +213,32 @@ tags: { module hostingEnvironments './Microsoft.Web/hostingEnvironments/deploy.bicep' = { name: '${uniqueString(deployment().name)}-hostingEnvironments' params: { + // Required parameters name: '<>-az-appse-asev2-001' - kind: 'ASEv2' - multiSize: 'Standard_D1_V2' - ipsslAddressCount: 2 + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-008' + // Non-required parameters clusterSettings: [ { name: 'DisableTls1.0' value: '1' } ] - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-008' + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + ipsslAddressCount: 2 + kind: 'ASEv2' + multiSize: 'Standard_D1_V2' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' } } ``` @@ -303,64 +246,73 @@ module hostingEnvironments './Microsoft.Web/hostingEnvironments/deploy.bicep' =

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-appse-asev3-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "subnetResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-006" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "clusterSettings": { - "value": [ - { - "name": "DisableTls1.0", - "value": "1" - } - ] - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-appse-asev2-001" + }, + "subnetResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-008" + }, + // Non-required parameters + "clusterSettings": { + "value": [ + { + "name": "DisableTls1.0", + "value": "1" + } + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "ipsslAddressCount": { + "value": 2 + }, + "kind": { + "value": "ASEv2" + }, + "multiSize": { + "value": "Standard_D1_V2" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" } + ] } + } } ```
+

+ +

Example 2: Asev3

@@ -370,28 +322,90 @@ module hostingEnvironments './Microsoft.Web/hostingEnvironments/deploy.bicep' = module hostingEnvironments './Microsoft.Web/hostingEnvironments/deploy.bicep' = { name: '${uniqueString(deployment().name)}-hostingEnvironments' params: { + // Required parameters name: '<>-az-appse-asev3-001' - lock: 'CanNotDelete' subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-006' - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] - diagnosticLogsRetentionInDays: 7 + // Non-required parameters clusterSettings: [ { name: 'DisableTls1.0' value: '1' } ] - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + lock: 'CanNotDelete' + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-appse-asev3-001" + }, + "subnetResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-006" + }, + // Non-required parameters + "clusterSettings": { + "value": [ + { + "name": "DisableTls1.0", + "value": "1" + } + ] + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } } } ``` diff --git a/modules/Microsoft.Web/serverfarms/readme.md b/modules/Microsoft.Web/serverfarms/readme.md index 72d0297048..080b38a01a 100644 --- a/modules/Microsoft.Web/serverfarms/readme.md +++ b/modules/Microsoft.Web/serverfarms/readme.md @@ -198,62 +198,11 @@ tags: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-asp-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "sku": { - "value": { - "name": "S1", - "tier": "Standard", - "size": "S1", - "family": "S", - "capacity": "1" - } - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} -``` - -
+

Example 1: Parameters

@@ -263,26 +212,28 @@ tags: { module serverfarms './Microsoft.Web/serverfarms/deploy.bicep' = { name: '${uniqueString(deployment().name)}-serverfarms' params: { + // Required parameters name: '<>-az-asp-x-001' - lock: 'CanNotDelete' sku: { + capacity: '1' + family: 'S' name: 'S1' - tier: 'Standard' size: 'S1' - family: 'S' - capacity: '1' + tier: 'Standard' } + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' diagnosticLogsRetentionInDays: 7 diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + lock: 'CanNotDelete' roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] } @@ -291,3 +242,61 @@ module serverfarms './Microsoft.Web/serverfarms/deploy.bicep' = {

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-asp-x-001" + }, + "sku": { + "value": { + "capacity": "1", + "family": "S", + "name": "S1", + "size": "S1", + "tier": "Standard" + } + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

diff --git a/modules/Microsoft.Web/sites/readme.md b/modules/Microsoft.Web/sites/readme.md index 00f4921ce5..6383cb6588 100644 --- a/modules/Microsoft.Web/sites/readme.md +++ b/modules/Microsoft.Web/sites/readme.md @@ -392,36 +392,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-fa-min-001" - }, - "kind": { - "value": "functionapp" - }, - "serverFarmResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Web/serverFarms/adp-<>-az-asp-x-001" - }, - "siteConfig": { - "value": { - "alwaysOn": true - } - } - } -} -``` - -
+

Example 1: Fa Min

@@ -431,8 +406,10 @@ userAssignedIdentities: { module sites './Microsoft.Web/sites/deploy.bicep' = { name: '${uniqueString(deployment().name)}-sites' params: { - name: '<>-az-fa-min-001' + // Required parameters kind: 'functionapp' + name: '<>-az-fa-min-001' + // Non-required parameters serverFarmResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Web/serverFarms/adp-<>-az-asp-x-001' siteConfig: { alwaysOn: true @@ -444,162 +421,39 @@ module sites './Microsoft.Web/sites/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-fa-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "kind": { - "value": "functionapp" - }, - "serverFarmResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Web/serverFarms/adp-<>-az-asp-x-001" - }, - "siteConfig": { - "value": { - "alwaysOn": true, - "use32BitWorkerProcess": false - } - }, - "appInsightId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001" - }, - "storageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "setAzureWebJobsDashboard": { - "value": true - }, - "appSettingsKeyValuePairs": { - "value": { - "FUNCTIONS_EXTENSION_VERSION": "~4", - "FUNCTIONS_WORKER_RUNTIME": "dotnet", - "AzureFunctionsJobHost__logging__logLevel__default": "Trace", - "EASYAUTH_SECRET": "https://adp-<>-az-kv-x-001.vault.azure.net/secrets/Modules-Test-SP-Password" - } - }, - "authSettingV2Configuration": { - "value": { - "globalValidation": { - "requireAuthentication": true, - "unauthenticatedClientAction": "Return401" - }, - "httpSettings": { - "forwardProxy": { - "convention": "NoProxy" - }, - "requireHttps": true, - "routes": { - "apiPrefix": "/.auth" - } - }, - "identityProviders": { - "azureActiveDirectory": { - "enabled": true, - "login": { - "disableWWWAuthenticate": false - }, - "registration": { - "openIdIssuer": "https://sts.windows.net/<>/v2.0/", - "clientId": "d874dd2f-2032-4db1-a053-f0ec243685aa", - "clientSecretSettingName": "EASYAUTH_SECRET" - }, - "validation": { - "allowedAudiences": [ - "api://d874dd2f-2032-4db1-a053-f0ec243685aa" - ], - "defaultAuthorizationPolicy": { - "allowedPrincipals": {} - }, - "jwtClaimChecks": {} - } - } - }, - "login": { - "allowedExternalRedirectUrls": [ - "string" - ], - "cookieExpiration": { - "convention": "FixedTime", - "timeToExpiration": "08:00:00" - }, - "nonce": { - "nonceExpirationInterval": "00:05:00", - "validateNonce": true - }, - "preserveUrlFragmentsForLogins": false, - "routes": {}, - "tokenStore": { - "azureBlobStorage": {}, - "enabled": true, - "fileSystem": {}, - "tokenRefreshExtensionHours": 72 - } - }, - "platform": { - "enabled": true, - "runtimeVersion": "~1" - } - } - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "sites" - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "kind": { + "value": "functionapp" + }, + "name": { + "value": "<>-az-fa-min-001" + }, + // Non-required parameters + "serverFarmResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Web/serverFarms/adp-<>-az-asp-x-001" + }, + "siteConfig": { + "value": { + "alwaysOn": true + } } + } } ```
+

+ +

Example 2: Fa

@@ -609,22 +463,16 @@ module sites './Microsoft.Web/sites/deploy.bicep' = { module sites './Microsoft.Web/sites/deploy.bicep' = { name: '${uniqueString(deployment().name)}-sites' params: { - name: '<>-az-fa-x-001' - lock: 'CanNotDelete' + // Required parameters kind: 'functionapp' - serverFarmResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Web/serverFarms/adp-<>-az-asp-x-001' - siteConfig: { - alwaysOn: true - use32BitWorkerProcess: false - } + name: '<>-az-fa-x-001' + // Non-required parameters appInsightId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001' - storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - setAzureWebJobsDashboard: true appSettingsKeyValuePairs: { - FUNCTIONS_EXTENSION_VERSION: '~4' - FUNCTIONS_WORKER_RUNTIME: 'dotnet' AzureFunctionsJobHost__logging__logLevel__default: 'Trace' EASYAUTH_SECRET: 'https://adp-<>-az-kv-x-001.vault.azure.net/secrets/Modules-Test-SP-Password' + FUNCTIONS_EXTENSION_VERSION: '~4' + FUNCTIONS_WORKER_RUNTIME: 'dotnet' } authSettingV2Configuration: { globalValidation: { @@ -647,9 +495,9 @@ module sites './Microsoft.Web/sites/deploy.bicep' = { disableWWWAuthenticate: false } registration: { - openIdIssuer: 'https://sts.windows.net/<>/v2.0/' clientId: 'd874dd2f-2032-4db1-a053-f0ec243685aa' clientSecretSettingName: 'EASYAUTH_SECRET' + openIdIssuer: 'https://sts.windows.net/<>/v2.0/' } validation: { allowedAudiences: [ @@ -688,29 +536,37 @@ module sites './Microsoft.Web/sites/deploy.bicep' = { runtimeVersion: '~1' } } - systemAssignedIdentity: true - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' - ] - } - ] + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' diagnosticLogsRetentionInDays: 7 diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + lock: 'CanNotDelete' privateEndpoints: [ { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' service: 'sites' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' } ] + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + serverFarmResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Web/serverFarms/adp-<>-az-asp-x-001' + setAzureWebJobsDashboard: true + siteConfig: { + alwaysOn: true + use32BitWorkerProcess: false + } + storageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + systemAssignedIdentity: true + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } } } ``` @@ -718,31 +574,165 @@ module sites './Microsoft.Web/sites/deploy.bicep' = {

-

Example 3

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-wa-min-001" + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "kind": { + "value": "functionapp" + }, + "name": { + "value": "<>-az-fa-x-001" + }, + // Non-required parameters + "appInsightId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Insights/components/adp-<>-az-appi-x-001" + }, + "appSettingsKeyValuePairs": { + "value": { + "AzureFunctionsJobHost__logging__logLevel__default": "Trace", + "EASYAUTH_SECRET": "https://adp-<>-az-kv-x-001.vault.azure.net/secrets/Modules-Test-SP-Password", + "FUNCTIONS_EXTENSION_VERSION": "~4", + "FUNCTIONS_WORKER_RUNTIME": "dotnet" + } + }, + "authSettingV2Configuration": { + "value": { + "globalValidation": { + "requireAuthentication": true, + "unauthenticatedClientAction": "Return401" + }, + "httpSettings": { + "forwardProxy": { + "convention": "NoProxy" + }, + "requireHttps": true, + "routes": { + "apiPrefix": "/.auth" + } }, - "kind": { - "value": "app" + "identityProviders": { + "azureActiveDirectory": { + "enabled": true, + "login": { + "disableWWWAuthenticate": false + }, + "registration": { + "clientId": "d874dd2f-2032-4db1-a053-f0ec243685aa", + "clientSecretSettingName": "EASYAUTH_SECRET", + "openIdIssuer": "https://sts.windows.net/<>/v2.0/" + }, + "validation": { + "allowedAudiences": [ + "api://d874dd2f-2032-4db1-a053-f0ec243685aa" + ], + "defaultAuthorizationPolicy": { + "allowedPrincipals": {} + }, + "jwtClaimChecks": {} + } + } }, - "serverFarmResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Web/serverFarms/adp-<>-az-asp-x-001" + "login": { + "allowedExternalRedirectUrls": [ + "string" + ], + "cookieExpiration": { + "convention": "FixedTime", + "timeToExpiration": "08:00:00" + }, + "nonce": { + "nonceExpirationInterval": "00:05:00", + "validateNonce": true + }, + "preserveUrlFragmentsForLogins": false, + "routes": {}, + "tokenStore": { + "azureBlobStorage": {}, + "enabled": true, + "fileSystem": {}, + "tokenRefreshExtensionHours": 72 + } + }, + "platform": { + "enabled": true, + "runtimeVersion": "~1" + } + } + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "lock": { + "value": "CanNotDelete" + }, + "privateEndpoints": { + "value": [ + { + "service": "sites", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "serverFarmResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Web/serverFarms/adp-<>-az-asp-x-001" + }, + "setAzureWebJobsDashboard": { + "value": true + }, + "siteConfig": { + "value": { + "alwaysOn": true, + "use32BitWorkerProcess": false + } + }, + "storageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "systemAssignedIdentity": { + "value": true + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + } } + } } ```
+

+ +

Example 3: Wa Min

@@ -752,8 +742,10 @@ module sites './Microsoft.Web/sites/deploy.bicep' = { module sites './Microsoft.Web/sites/deploy.bicep' = { name: '${uniqueString(deployment().name)}-sites' params: { - name: '<>-az-wa-min-001' + // Required parameters kind: 'app' + name: '<>-az-wa-min-001' + // Non-required parameters serverFarmResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Web/serverFarms/adp-<>-az-asp-x-001' } } @@ -762,86 +754,34 @@ module sites './Microsoft.Web/sites/deploy.bicep' = {

-

Example 4

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-wa-x-001" - }, - "kind": { - "value": "app" - }, - "serverFarmResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Web/serverFarms/adp-<>-az-asp-x-001" - }, - "siteConfig": { - "value": { - "metadata": [ - { - "name": "CURRENT_STACK", - "value": "dotnetcore" - } - ], - "alwaysOn": true - } - }, - "httpsOnly": { - "value": true - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "sites" - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "kind": { + "value": "app" + }, + "name": { + "value": "<>-az-wa-min-001" + }, + // Non-required parameters + "serverFarmResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Web/serverFarms/adp-<>-az-asp-x-001" } + } } ```
+

+ +

Example 4: Wa

@@ -851,42 +791,126 @@ module sites './Microsoft.Web/sites/deploy.bicep' = { module sites './Microsoft.Web/sites/deploy.bicep' = { name: '${uniqueString(deployment().name)}-sites' params: { - name: '<>-az-wa-x-001' + // Required parameters kind: 'app' + name: '<>-az-wa-x-001' + // Non-required parameters + diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' + diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + httpsOnly: true + privateEndpoints: [ + { + service: 'sites' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + ] + roleAssignments: [ + { + principalIds: [ + '<>' + ] + roleDefinitionIdOrName: 'Reader' + } + ] serverFarmResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Web/serverFarms/adp-<>-az-asp-x-001' siteConfig: { + alwaysOn: true metadata: [ { name: 'CURRENT_STACK' value: 'dotnetcore' } ] - alwaysOn: true } - httpsOnly: true systemAssignedIdentity: true userAssignedIdentities: { '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} } - roleAssignments: [ - { - roleDefinitionIdOrName: 'Reader' - principalIds: [ - '<>' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "kind": { + "value": "app" + }, + "name": { + "value": "<>-az-wa-x-001" + }, + // Non-required parameters + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "httpsOnly": { + "value": true + }, + "privateEndpoints": { + "value": [ + { + "service": "sites", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "serverFarmResourceId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Web/serverFarms/adp-<>-az-asp-x-001" + }, + "siteConfig": { + "value": { + "alwaysOn": true, + "metadata": [ + { + "name": "CURRENT_STACK", + "value": "dotnetcore" + } ] } - ] - diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' - privateEndpoints: [ - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'sites' + }, + "systemAssignedIdentity": { + "value": true + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} } - ] + } } } ``` diff --git a/modules/Microsoft.Web/staticSites/readme.md b/modules/Microsoft.Web/staticSites/readme.md index 52ed72ed41..1397072f88 100644 --- a/modules/Microsoft.Web/staticSites/readme.md +++ b/modules/Microsoft.Web/staticSites/readme.md @@ -271,25 +271,11 @@ userAssignedIdentities: { ## Deployment examples -

Example 1

+The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. + >**Note**: The name of each example is based on the name of the file from which it is taken. + >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -
- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-wss-min-001" - } - } -} -``` - -
+

Example 1: Min

@@ -307,66 +293,26 @@ module staticSites './Microsoft.Web/staticSites/deploy.bicep' = {

-

Example 2

-
via JSON Parameter file ```json { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-wss-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "sku": { - "value": "Standard" - }, - "stagingEnvironmentPolicy": { - "value": "Enabled" - }, - "allowConfigFileUpdates": { - "value": true - }, - "enterpriseGradeCdnStatus": { - "value": "Disabled" - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "staticSites" - } - ] - } + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>-az-wss-min-001" } + } } ```
+

+ +

Example 2: Parameters

@@ -376,30 +322,94 @@ module staticSites './Microsoft.Web/staticSites/deploy.bicep' = { module staticSites './Microsoft.Web/staticSites/deploy.bicep' = { name: '${uniqueString(deployment().name)}-staticSites' params: { + // Required parameters name: '<>-az-wss-x-001' - lock: 'CanNotDelete' - sku: 'Standard' - stagingEnvironmentPolicy: 'Enabled' + // Non-required parameters allowConfigFileUpdates: true enterpriseGradeCdnStatus: 'Disabled' - systemAssignedIdentity: true - userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} - } + lock: 'CanNotDelete' + privateEndpoints: [ + { + service: 'staticSites' + subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + } + ] roleAssignments: [ { - roleDefinitionIdOrName: 'Reader' principalIds: [ '<>' ] + roleDefinitionIdOrName: 'Reader' } ] - privateEndpoints: [ - { - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' - service: 'staticSites' + sku: 'Standard' + stagingEnvironmentPolicy: 'Enabled' + systemAssignedIdentity: true + userAssignedIdentities: { + '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + } + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>-az-wss-x-001" + }, + // Non-required parameters + "allowConfigFileUpdates": { + "value": true + }, + "enterpriseGradeCdnStatus": { + "value": "Disabled" + }, + "lock": { + "value": "CanNotDelete" + }, + "privateEndpoints": { + "value": [ + { + "service": "staticSites", + "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "<>" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, + "sku": { + "value": "Standard" + }, + "stagingEnvironmentPolicy": { + "value": "Enabled" + }, + "systemAssignedIdentity": { + "value": true + }, + "userAssignedIdentities": { + "value": { + "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} } - ] + } } } ``` diff --git a/utilities/tools/Set-ModuleReadMe.ps1 b/utilities/tools/Set-ModuleReadMe.ps1 index 8daf716a73..cefb10a64a 100644 --- a/utilities/tools/Set-ModuleReadMe.ps1 +++ b/utilities/tools/Set-ModuleReadMe.ps1 @@ -306,6 +306,9 @@ Generate 'Deployment examples' for the ReadMe out of the parameter files current .DESCRIPTION Generate 'Deployment examples' for the ReadMe out of the parameter files currently used to test the template +.PARAMETER TemplateFilePath +Mandatory. The path to the template file + .PARAMETER TemplateFileContent Mandatory. The template file content object to crawl data from @@ -322,7 +325,7 @@ Optional. A switch to control whether or not to add a ARM-JSON-Parameter file ex Optional. A switch to control whether or not to add a Bicep deployment example. Defaults to true. .EXAMPLE -Set-DeploymentExamplesSection -TemplateFileContent @{ resource = @{}; ... } -ReadMeFileContent @('# Title', '', '## Section 1', ...) +Set-DeploymentExamplesSection -TemplateFilePath 'C:/deploy.bicep' -TemplateFileContent @{ resource = @{}; ... } -ReadMeFileContent @('# Title', '', '## Section 1', ...) Update the given readme file's 'Deployment Examples' section based on the given template file content #> @@ -333,6 +336,9 @@ function Set-DeploymentExamplesSection { [Parameter(Mandatory = $true)] [string] $TemplateFilePath, + [Parameter(Mandatory)] + [hashtable] $TemplateFileContent, + [Parameter(Mandatory = $true)] [object[]] $ReadMeFileContent, @@ -346,36 +352,38 @@ function Set-DeploymentExamplesSection { [string] $SectionStartIdentifier = '## Deployment examples' ) + # Load used function(s) + . (Join-Path $PSScriptRoot 'helper' 'ConvertTo-OrderedHashtable.ps1') + # Process content - $SectionContent = [System.Collections.ArrayList]@() + $SectionContent = [System.Collections.ArrayList]@( + 'The following module usage examples are retrieved from the content of the files hosted in the module''s `.test` folder.', + ' >**Note**: The name of each example is based on the name of the file from which it is taken.', + ' >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order.', + '' + ) $moduleRoot = Split-Path $TemplateFilePath -Parent $resourceTypeIdentifier = $moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/') + $resourceType = $resourceTypeIdentifier.Split('/')[1] $parameterFiles = Get-ChildItem (Join-Path $moduleRoot '.test') -Filter '*parameters.json' -Recurse - $index = 1 + $requiredParameterNames = $TemplateFileContent.parameters.Keys | Where-Object { $TemplateFileContent.parameters[$_].Keys -notcontains 'defaultValue' } | Sort-Object + + ############################ + ## Process test files ## + ############################ + $pathIndex = 1 foreach ($testFilePath in $parameterFiles.FullName) { $contentInJSONFormat = Get-Content -Path $testFilePath -Encoding 'utf8' | Out-String + $exampleTitle = ((Split-Path $testFilePath -LeafBase) -replace '\.', ' ') -replace ' parameters', '' + $TextInfo = (Get-Culture).TextInfo + $exampleTitle = $TextInfo.ToTitleCase($exampleTitle) $SectionContent += @( - "

Example $index

" + '

Example {0}: {1}

' -f $pathIndex, $exampleTitle ) - if ($addJson) { - $SectionContent += @( - '', - '
', - '', - 'via JSON Parameter file', - '', - '```json', - $contentInJSONFormat.TrimEnd(), - '```', - '', - '
' - ) - } - if ($addBicep) { $JSONParametersHashTable = (ConvertFrom-Json $contentInJSONFormat -AsHashtable -Depth 99).parameters @@ -415,29 +423,86 @@ function Set-DeploymentExamplesSection { } # Handle VALUE references (i.e. remove them) - $JSONParameters = (ConvertFrom-Json $contentInJSONFormat -Depth 99).PSObject.properties['parameters'].value - $JSONParametersWithoutValue = [ordered]@{} - foreach ($parameter in $JSONParameters.PSObject.Properties) { - if ($parameter.value.PSObject.Properties.name -eq 'value') { - $JSONParametersWithoutValue[$parameter.name] = $parameter.value.PSObject.Properties['value'].value + $JSONParameters = (ConvertFrom-Json $contentInJSONFormat -Depth 99 -AsHashtable).parameters + $JSONParametersWithoutValue = @{} + foreach ($parameterName in $JSONParameters.Keys) { + if ($JSONParameters[$parameterName].Keys -eq 'value') { + $JSONParametersWithoutValue[$parameterName] = $JSONParameters[$parameterName]['value'] } else { # replace key vault references - $matchingTuple = $keyVaultReferenceData | Where-Object { $_.parameterName -eq $parameter.Name } - $JSONParametersWithoutValue[$parameter.name] = "{0}.getSecret('{1}')" -f $matchingTuple.vaultResourceReference, $matchingTuple.secretName + $matchingTuple = $keyVaultReferenceData | Where-Object { $_.parameterName -eq $parameterName } + $JSONParametersWithoutValue[$parameterName] = "{0}.getSecret('{1}')" -f $matchingTuple.vaultResourceReference, $matchingTuple.secretName } } - $templateParameterObject = $JSONParametersWithoutValue | ConvertTo-Json -Depth 99 + # Order parameters recursively + $JSONParametersWithoutValue = ConvertTo-OrderedHashtable -JSONInputObject ($JSONParametersWithoutValue | ConvertTo-Json -Depth 99) + + # Sort 'required' parameters to the front + $orderedJSONParameters = [ordered]@{} + $orderedTopLevelParameterNames = $JSONParametersWithoutValue.psbase.Keys # We must use PS-Base to handle conflicts of HashTable properties & keys (e.g. for a key 'keys'). + # Add required parameters first + $orderedTopLevelParameterNames | Where-Object { $_ -in $requiredParameterNames } | ForEach-Object { $orderedJSONParameters[$_] = $JSONParametersWithoutValue[$_] } + # Add rest after + $orderedTopLevelParameterNames | Where-Object { $_ -notin $requiredParameterNames } | ForEach-Object { $orderedJSONParameters[$_] = $JSONParametersWithoutValue[$_] } + + if ($orderedJSONParameters.count -eq 0) { + # Handle empty dictionaries (in case the parmaeter file was empty) + $orderedJSONParameters = @{} + } + + $templateParameterObject = $orderedJSONParameters | ConvertTo-Json -Depth 99 if ($templateParameterObject -ne '{}') { $contentInBicepFormat = $templateParameterObject -replace '"', "'" # Update any [xyz: "xyz"] to [xyz: 'xyz'] $contentInBicepFormat = $contentInBicepFormat -replace ',', '' # Update any [xyz: xyz,] to [xyz: xyz] $contentInBicepFormat = $contentInBicepFormat -replace "'(\w+)':", '$1:' # Update any ['xyz': xyz] to [xyz: xyz] $contentInBicepFormat = $contentInBicepFormat -replace "'(.+.getSecret\('.+'\))'", '$1' # Update any [xyz: 'xyz.GetSecret()'] to [xyz: xyz.GetSecret()] - $bicepParamsArray = $contentInBicepFormat -split ('\n') + $bicepParamsArray = $contentInBicepFormat -split '\n' $bicepParamsArray = $bicepParamsArray[1..($bicepParamsArray.count - 2)] } - $resourceType = $resourceTypeIdentifier.Split('/')[1] + + # Format params with indent + $bicepExample = $bicepParamsArray | ForEach-Object { " $_" } + + # Optional: Add comment where required & optional parameters start + # ---------------------------------------------------------------- + if ($requiredParameterNames -is [string]) { + $requiredParameterNames = @($requiredParameterNames) + } + + # If we have at least one required and one other parameter we want to add a comment + if ($requiredParameterNames.Count -ge 1 -and $orderedJSONParameters.Keys.Count -ge 2) { + + $bicepExampleArray = $bicepExample -split '\n' + + # Check where the 'last' required parameter is located in the example (and what its indent is) + $parameterToSplitAt = $requiredParameterNames[-1] + $requiredParameterIndent = ([regex]::Match($bicepExampleArray[0], '^(\s+).*')).Captures.Groups[1].Value.Length + + # Add a comment where the required parameters start + $bicepExampleArray = @('{0}// Required parameters' -f (' ' * $requiredParameterIndent)) + $bicepExampleArray[(0 .. ($bicepExampleArray.Count))] + + # Find the location if the last required parameter + $requiredParameterStartIndex = ($bicepExampleArray | Select-String ('^[\s]{0}{1}:.+' -f "{$requiredParameterIndent}", $parameterToSplitAt) | ForEach-Object { $_.LineNumber - 1 })[0] + + # If we have more than only required parameters, let's add a corresponding comment + if ($orderedJSONParameters.Keys.Count -gt $requiredParameterNames.Count) { + $nextLineIndent = ([regex]::Match($bicepExampleArray[$requiredParameterStartIndex + 1], '^(\s+).*')).Captures.Groups[1].Value.Length + if ($nextLineIndent -gt $requiredParameterIndent) { + # Case Param is object/array: Search in rest of array for the next closing bracket with the same indent - and then add the search index (1) & initial index (1) count back in + $requiredParameterEndIndex = ($bicepExampleArray[($requiredParameterStartIndex + 1)..($bicepExampleArray.Count)] | Select-String "^[\s]{$requiredParameterIndent}\S+" | ForEach-Object { $_.LineNumber - 1 })[0] + 1 + $requiredParameterStartIndex + } else { + # Case Param is single line bool/string/int: Add an index (1) for the 'required' comment + $requiredParameterEndIndex = $requiredParameterStartIndex + } + + # Add a comment where the non-required parameters start + $bicepExampleArray = $bicepExampleArray[0..$requiredParameterEndIndex] + ('{0}// Non-required parameters' -f (' ' * $requiredParameterIndent)) + $bicepExampleArray[(($requiredParameterEndIndex + 1) .. ($bicepExampleArray.Count))] + } + + $bicepExample = $bicepExampleArray | Out-String + } $SectionContent += @( '', @@ -450,7 +515,7 @@ function Set-DeploymentExamplesSection { "module $resourceType './$resourceTypeIdentifier/deploy.bicep' = {" " name: '`${uniqueString(deployment().name)}-$resourceType'" ' params: {' - ($bicepParamsArray | ForEach-Object { " $_" }).TrimEnd(), + $bicepExample.TrimEnd(), ' }' '}' '```', @@ -460,11 +525,82 @@ function Set-DeploymentExamplesSection { ) } + if ($addJson) { + $orderedContentInJSONFormat = ConvertTo-OrderedHashtable -JSONInputObject (($contentInJSONFormat | ConvertFrom-Json).parameters | ConvertTo-Json -Depth 99) + + # Sort 'required' parameters to the front + $orderedJSONParameters = [ordered]@{} + $orderedTopLevelParameterNames = $orderedContentInJSONFormat.psbase.Keys # We must use PS-Base to handle conflicts of HashTable properties & keys (e.g. for a key 'keys'). + # Add required parameters first + $orderedTopLevelParameterNames | Where-Object { $_ -in $requiredParameterNames } | ForEach-Object { $orderedJSONParameters[$_] = $orderedContentInJSONFormat[$_] } + # Add rest after + $orderedTopLevelParameterNames | Where-Object { $_ -notin $requiredParameterNames } | ForEach-Object { $orderedJSONParameters[$_] = $orderedContentInJSONFormat[$_] } + + if ($orderedJSONParameters.count -eq 0) { + # Handle empty dictionaries (in case the parmaeter file was empty) + $orderedJSONParameters = '' + } + + $jsonExample = ([ordered]@{ + '$schema' = 'https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#' + contentVersion = '1.0.0.0' + parameters = (-not [String]::IsNullOrEmpty($orderedJSONParameters)) ? $orderedJSONParameters : @{} + } | ConvertTo-Json -Depth 99) + + # Optional: Add comment where required & optional parameters start + # ---------------------------------------------------------------- + if ($requiredParameterNames -is [string]) { + $requiredParameterNames = @($requiredParameterNames) + } + + # If we have at least one required and one other parameter we want to add a comment + if ($requiredParameterNames.Count -ge 1 -and $orderedJSONParameters.Keys.Count -ge 2) { + + $jsonExampleArray = $jsonExample -split '\n' + + # Check where the 'last' required parameter is located in the example (and what its indent is) + $parameterToSplitAt = $requiredParameterNames[-1] + $parameterStartIndex = ($jsonExampleArray | Select-String '.*"parameters": \{.*' | ForEach-Object { $_.LineNumber - 1 })[0] + $requiredParameterIndent = ([regex]::Match($jsonExampleArray[($parameterStartIndex + 1)], '^(\s+).*')).Captures.Groups[1].Value.Length + + # Add a comment where the required parameters start + $jsonExampleArray = $jsonExampleArray[0..$parameterStartIndex] + ('{0}// Required parameters' -f (' ' * $requiredParameterIndent)) + $jsonExampleArray[(($parameterStartIndex + 1) .. ($jsonExampleArray.Count))] + + # Find the location if the last required parameter + $requiredParameterStartIndex = ($jsonExampleArray | Select-String "^[\s]{$requiredParameterIndent}`"$parameterToSplitAt`": \{.*" | ForEach-Object { $_.LineNumber - 1 })[0] + + # If we have more than only required parameters, let's add a corresponding comment + if ($orderedJSONParameters.Keys.Count -gt $requiredParameterNames.Count ) { + # Search in rest of array for the next closing bracket with the same indent - and then add the search index (1) & initial index (1) count back in + $requiredParameterEndIndex = ($jsonExampleArray[($requiredParameterStartIndex + 1)..($jsonExampleArray.Count)] | Select-String "^[\s]{$requiredParameterIndent}\}" | ForEach-Object { $_.LineNumber - 1 })[0] + 1 + $requiredParameterStartIndex + + # Add a comment where the non-required parameters start + $jsonExampleArray = $jsonExampleArray[0..$requiredParameterEndIndex] + ('{0}// Non-required parameters' -f (' ' * $requiredParameterIndent)) + $jsonExampleArray[(($requiredParameterEndIndex + 1) .. ($jsonExampleArray.Count))] + } + + $jsonExample = $jsonExampleArray | Out-String + } + + $SectionContent += @( + '', + '
', + '', + 'via JSON Parameter file', + '', + '```json', + $jsonExample.TrimEnd(), + '```', + '', + '
' + '

' + ) + } + $SectionContent += @( '' ) - $index++ + $pathIndex++ } # Build result @@ -718,12 +854,14 @@ function Set-ModuleReadMe { $readMeFileContent = Set-OutputsSection @inputObject } - if ($SectionsToRefresh -contains 'Deployment examples') { + $isTopLevelModule = $TemplateFilePath.Replace('\', '/').Split('/modules/')[1].Split('/').Count -eq 3 # //deploy.* + if ($SectionsToRefresh -contains 'Deployment examples' -and $isTopLevelModule) { # Handle [Deployment examples] section # =================================== $inputObject = @{ - ReadMeFileContent = $readMeFileContent - TemplateFilePath = $TemplateFilePath + ReadMeFileContent = $readMeFileContent + TemplateFilePath = $TemplateFilePath + TemplateFileContent = $templateFileContent } $readMeFileContent = Set-DeploymentExamplesSection @inputObject } diff --git a/utilities/tools/helper/ConvertTo-OrderedHashtable.ps1 b/utilities/tools/helper/ConvertTo-OrderedHashtable.ps1 new file mode 100644 index 0000000000..7311b4d8bb --- /dev/null +++ b/utilities/tools/helper/ConvertTo-OrderedHashtable.ps1 @@ -0,0 +1,116 @@ +<# +.SYNOPSIS +Convert a given JSON string into an ordered HashTable. + +.DESCRIPTION +Convert a given JSON string into an ordered HashTable. + +.PARAMETER JSONInputObject +Mandatory. The JSON string to convert into an ordered HashTable object. + +.EXAMPLE +ConvertTo-OrderedHashtable -JSONInputObject "@{ b = 'b'; a = 'a' ; c = @( 3, 1, 2 )}" + +Convert the given JSON string into a sorted HashTable. Would return the HashTable: + + @{ + a = 'a' + b = 'b' + c = @( + 1, + 2, + 3 + ) + } + +.EXAMPLE +ConvertTo-OrderedHashtable -JSONInputObject '{"elem":[3,1,2,"a",{"a":"a","b":"b"},[23,1],["23","1"]],"arr":["one"]}' + +Convert the given JSON string into a sorted HashTable. Would return the HashTable: + + @{ + arr = @('one') + elem = @( + 1, + @( + 1, + 23 + ), + @( + '1', + '23' + ) + 2, + 3, + 'a' + ) + } +#> +function ConvertTo-OrderedHashtable { + + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true)] + [string] $JSONInputObject # Must be string to workaround auto-conversion + ) + + $JSONObject = ConvertFrom-Json $JSONInputObject -AsHashtable -Depth 99 -NoEnumerate + $orderedLevel = [ordered]@{} + + if (-not ($JSONObject -is [hashtable])) { + return $JSONObject # E.g. in primitive data types [1,2,3] + } + + foreach ($currentLevelKey in ($JSONObject.Keys | Sort-Object)) { + + if ($null -eq $JSONObject[$currentLevelKey]) { + # Handle case in which the value is 'null' and hence has no type + $orderedLevel[$currentLevelKey] = $null + continue + } + + switch ($JSONObject[$currentLevelKey].GetType().BaseType.Name) { + 'Object' { + $orderedLevel[$currentLevelKey] = ConvertTo-OrderedHashtable -JSONInputObject ($JSONObject[$currentLevelKey] | ConvertTo-Json -Depth 99) + } + 'Array' { + $arrayOutput = @() + + # Case: Array of arrays + $arrayElements = $JSONObject[$currentLevelKey] | Where-Object { $_.GetType().Name -eq 'Object[]' } + foreach ($array in $arrayElements) { + if ($array.Count -gt 1) { + # Only sort for arrays with more than one item. Otherwise single-item arrays are casted + $array = $array | Sort-Object + } + $arrayOutput += , (ConvertTo-OrderedHashtable -JSONInputObject ($array | ConvertTo-Json -Depth 99)) + } + + # Case: Array of objects + $hashTableElements = $JSONObject[$currentLevelKey] | Where-Object { $_.GetType().Name -eq 'Hashtable' } + foreach ($hashTable in $hashTableElements) { + $arrayOutput += , (ConvertTo-OrderedHashtable -JSONInputObject ($hashTable | ConvertTo-Json -Depth 99)) + } + + # Case: Primitive data types + $primitiveElements = $JSONObject[$currentLevelKey] | Where-Object { $_.GetType().Name -notin @('Object[]', 'Hashtable') } | ConvertTo-Json | ConvertFrom-Json -AsHashtable -NoEnumerate + if ($primitiveElements.Count -gt 1) { + $primitiveElements = $primitiveElements | Sort-Object + } + $arrayOutput += $primitiveElements + + if ($array.Count -gt 1) { + # Only sort for arrays with more than one item. Otherwise single-item arrays are casted + $arrayOutput = $arrayOutput | Sort-Object + } + $orderedLevel[$currentLevelKey] = $arrayOutput + } + Default { + # string/int/etc. + $orderedLevel[$currentLevelKey] = $JSONObject[$currentLevelKey] + } + } + } + + return $orderedLevel +}