Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/wiki/The library - Module design.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ In addition, they follow these file-type-specific guidelines:
- If the module deploys a resource group level resource, the template should further have a `resourceGroupName` parameter and subsequent resource deployment. As a reference for the default name you can use `ms.<providerNamespace>.<resourceType>-${serviceShort}-test-rg`.
- Each file should also provide a `location` parameter that may default to the deployments default location
- It is recommended to define all major resource names in the `deploy.test.bicep` file as it makes later maintenance easier. To implement this, make sure to pass all resource names to any referenced module.
- Further, for any test file, the usage of variables should be reduced to the absolute minimum. In other words: You should only use variables if you must use them in more than one place. The idea is to keep the test files as simple as possible
- References to dependencies should be implemented using resource references in combination with outputs. In other words: You should not hardcode any references into the module template's deployment. Instead use references such as `resourceGroupResources.outputs.managedIdentityPrincipalId`
- If any diagnostic resources (e.g., a Log Analytics workspace) are required for a test scenario, you can reference the centralized `modules/.shared/dependencyConstructs/diagnostic.dependencies.bicep` template. It will also provide you with all outputs you'd need.

Expand Down Expand Up @@ -660,7 +661,7 @@ In addition, they follow these file-type-specific guidelines:

# Telemetry

## Overview
## Overview

Microsoft uses the approach detailed in this section to identify the deployments of the Bicep and ARM JSON templates of the CARML library. Microsoft collects this information to provide the best experiences with their products and to operate their business. Telemetry data is captured through the built-in mechanisms of the Azure platform; therefore, it never leaves the platform, providing only Microsoft with access. Deployments are identified through a specific GUID (Globally Unique ID), indicating that the code originated from the CARML library. The data is collected and governed by Microsoft's privacy policies, located at the [Trust Center](https://www.microsoft.com/en-us/trust-center).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ param certDeploymentScriptName string

var certPWSecretName = 'pfxCertificatePassword'
var certSecretName = 'pfxBase64Certificate'
var addressPrefix = '10.0.0.0/16'

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/24'
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: '10.0.0.0/24'
addressPrefix: addressPrefix
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ param location string = resourceGroup().location
@secure()
param customSecret string = newGuid()

var keyVaultSecretName = 'apimclientsecret'

resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = {
name: managedIdentityName
location: location
Expand All @@ -36,7 +34,7 @@ resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = {
}

resource secret 'secrets@2022-07-01' = {
name: keyVaultSecretName
name: 'apimclientsecret'
properties: {
value: customSecret
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ param virtualNetworkName string
@description('Optional. The location to deploy resources to.')
param location string = resourceGroup().location

var addressPrefix = '10.0.0.0/16'

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/24'
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: '10.0.0.0/24'
addressPrefix: addressPrefix
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,22 @@ param keyVaultName string
@description('Required. The name of the Managed Identity to create.')
param managedIdentityName string

var addressPrefix = '10.0.0.0/16'

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/24'
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: '10.0.0.0/24'
addressPrefix: addressPrefix
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ param managedIdentityName string
@description('Required. The name of the Storage Account to create.')
param storageAccountName string

var addressPrefix = '10.0.0.0/16'

resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' = {
name: storageAccountName
location: location
Expand All @@ -25,14 +27,14 @@ resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = {
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/24'
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: '10.0.0.0/24'
addressPrefix: addressPrefix
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ param managedIdentityName string
@description('Required. The name of the Storage Account to create.')
param storageAccountName string

var addressPrefix = '10.0.0.0/16'

resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' = {
name: storageAccountName
location: location
Expand All @@ -28,14 +30,14 @@ resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = {
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/24'
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: '10.0.0.0/24'
addressPrefix: addressPrefix
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ param location string = resourceGroup().location
@description('Required. The name of the Virtual Network to create.')
param virtualNetworkName string

var addressPrefix = '10.0.0.0/16'

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/24'
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: '10.0.0.0/24'
addressPrefix: addressPrefix
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@ param virtualNetworkName string
@description('Required. The name of the Managed Identity to create.')
param managedIdentityName string

var addressPrefix = '10.0.0.0/16'

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/24'
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: '10.0.0.0/24'
addressPrefix: addressPrefix
serviceEndpoints: [
{
service: 'Microsoft.CognitiveServices'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,22 @@ param managedIdentityName string
@description('Required. The name of the Key Vault to create.')
param keyVaultName string

var addressPrefix = '10.0.0.0/16'

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/24'
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: '10.0.0.0/24'
addressPrefix: addressPrefix
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@ param virtualNetworkName string
@description('Required. The name of the Managed Identity to create.')
param managedIdentityName string

var addressPrefix = '10.0.0.0/16'

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/24'
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: '10.0.0.0/24'
addressPrefix: addressPrefix
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,22 @@ param sshDeploymentScriptName string
@description('Required. The name of the SSH Key to create.')
param sshKeyName string

var addressPrefix = '10.0.0.0/16'

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/24'
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: '10.0.0.0/24'
addressPrefix: addressPrefix
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@ param sshKeyName string
@description('Optional. The location to deploy resources to.')
param location string = resourceGroup().location

var addressPrefix = '10.0.0.0/16'

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/24'
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: '10.0.0.0/24'
addressPrefix: addressPrefix
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ param sshDeploymentScriptName string
@description('Required. The name of the SSH Key to create.')
param sshKeyName string

var storageContainerName = 'scripts'
var storageAccountCSEFileName = 'scriptExtensionMasterInstaller.ps1'
var addressPrefix = '10.0.0.0/16'

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/24'
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: '10.0.0.0/24'
addressPrefix: addressPrefix
}
}
]
Expand Down Expand Up @@ -107,7 +107,7 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' = {
name: 'default'

resource container 'containers@2021-09-01' = {
name: storageContainerName
name: 'scripts'
}
}
}
Expand Down Expand Up @@ -186,8 +186,8 @@ output storageAccountName string = storageAccount.name
@description('The resource ID of the created Storage Account.')
output storageAccountResourceId string = storageAccount.id

@description('The URL of the Custom Script Extension in the created Storage Account.')
output storageAccountCSEFileUrl string = '${storageAccount.properties.primaryEndpoints.blob}${storageContainerName}/${storageAccountCSEFileName}'
@description('The URL of the Custom Script Extension in the created Storage Account')
output storageAccountCSEFileUrl string = '${storageAccount.properties.primaryEndpoints.blob}${storageAccount::blobService::container.name}/${storageAccountCSEFileName}'

@description('The Public Key of the created SSH Key.')
output SSHKeyPublicKey string = sshKey.properties.publicKey
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ param location string = resourceGroup().location
@description('Required. The name of the Virtual Network to create.')
param virtualNetworkName string

var addressPrefix = '10.0.0.0/16'

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/24'
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: '10.0.0.0/24'
addressPrefix: addressPrefix
}
}
]
Expand Down
Loading