Skip to content

Commit

Permalink
Updated telemetry implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderSehr committed Sep 21, 2023
1 parent 465ac43 commit 98fcc07
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 18 deletions.
15 changes: 12 additions & 3 deletions avm/res/cognitive-services/account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ param userOwnedStorage array = []
@description('Optional. The managed identity definition for this resource')
param managedIdentities managedIdentitiesType

@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

var enableReferencedModulesTelemetry = false
Expand Down Expand Up @@ -164,14 +164,23 @@ var builtInRoleNames = {
'User Access Administrator': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18d7d88d-d35e-4fb5-a5c3-7773c20a72d9')
}

resource defaultTelemetry 'Microsoft.Resources/deployments@2022-09-01' = if (enableTelemetry) {
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name, location)}'
@description('The current released version of the module. Used for telemetry.')
var moduleVersion = '[[moduleVersion]]' // for example '1.0.0'

resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) {
name: '46d3xbcp.res.cognitiveservices-account.${replace(moduleVersion, '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
outputs: {
telemetry: {
type: 'String'
value: 'For more information, see https://aka.ms/avm/TelemetryInfo'
}
}
}
}
}
Expand Down
15 changes: 12 additions & 3 deletions avm/res/key-vault/vault/access-policy/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ param keyVaultName string
@description('Optional. An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault\'s tenant ID.')
param accessPolicies array = []

@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

var formattedAccessPolicies = [for accessPolicy in accessPolicies: {
Expand All @@ -18,14 +18,23 @@ var formattedAccessPolicies = [for accessPolicy in accessPolicies: {
tenantId: contains(accessPolicy, 'tenantId') ? accessPolicy.tenantId : tenant().tenantId
}]

resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableTelemetry) {
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
@description('The current released version of the module. Used for telemetry.')
var moduleVersion = '[[moduleVersion]]' // for example '1.0.0'

resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) {
name: '46d3xbcp.res.keyvault-vault.${replace(moduleVersion, '.', '-')}.${substring(uniqueString(deployment().name), 0, 4)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
outputs: {
telemetry: {
type: 'String'
value: 'For more information, see https://aka.ms/avm/TelemetryInfo'
}
}
}
}
}
Expand Down
15 changes: 12 additions & 3 deletions avm/res/key-vault/vault/key/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ param roleAssignments roleAssignmentType
@description('Optional. Key rotation policy properties object.')
param rotationPolicy object = {}

@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

var builtInRoleNames = {
Expand All @@ -79,14 +79,23 @@ var builtInRoleNames = {
'User Access Administrator': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18d7d88d-d35e-4fb5-a5c3-7773c20a72d9')
}

resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableTelemetry) {
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
@description('The current released version of the module. Used for telemetry.')
var moduleVersion = '[[moduleVersion]]' // for example '1.0.0'

resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) {
name: '46d3xbcp.res.keyvault-vault.${replace(moduleVersion, '.', '-')}.${substring(uniqueString(deployment().name), 0, 4)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
outputs: {
telemetry: {
type: 'String'
value: 'For more information, see https://aka.ms/avm/TelemetryInfo'
}
}
}
}
}
Expand Down
16 changes: 13 additions & 3 deletions avm/res/key-vault/vault/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ param tags object = {}
@description('Optional. The diagnostic settings of the service.')
param diagnosticSettings diagnosticSettingType

@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

// =========== //
Expand Down Expand Up @@ -122,14 +122,24 @@ var enableReferencedModulesTelemetry = false
// ============ //
// Dependencies //
// ============ //
resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableTelemetry) {
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name, location)}'

@description('The current released version of the module. Used for telemetry.')
var moduleVersion = '[[moduleVersion]]' // for example '1.0.0'

resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) {
name: '46d3xbcp.res.keyvault-vault.${replace(moduleVersion, '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
outputs: {
telemetry: {
type: 'String'
value: 'For more information, see https://aka.ms/avm/TelemetryInfo'
}
}
}
}
}
Expand Down
13 changes: 11 additions & 2 deletions avm/res/key-vault/vault/secret/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,23 @@ var builtInRoleNames = {
'User Access Administrator': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18d7d88d-d35e-4fb5-a5c3-7773c20a72d9')
}

resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableTelemetry) {
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
@description('The current released version of the module. Used for telemetry.')
var moduleVersion = '[[moduleVersion]]' // for example '1.0.0'

resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) {
name: '46d3xbcp.res.keyvault-vault.${replace(moduleVersion, '.', '-')}.${substring(uniqueString(deployment().name), 0, 4)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
outputs: {
telemetry: {
type: 'String'
value: 'For more information, see https://aka.ms/avm/TelemetryInfo'
}
}
}
}
}
Expand Down
23 changes: 22 additions & 1 deletion avm/res/network/private-endpoint/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ param customDnsConfigs array = []
@description('Optional. Manual PrivateLink Service Connections.')
param manualPrivateLinkServiceConnections array = []

@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

var builtInRoleNames = {
Expand Down Expand Up @@ -79,6 +79,27 @@ resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (ena
}
}

@description('The current released version of the module. Used for telemetry.')
var moduleVersion = '[[moduleVersion]]' // for example '1.0.0'

resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) {
name: '46d3xbcp.res.network-privateendpoint.${replace(moduleVersion, '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
outputs: {
telemetry: {
type: 'String'
value: 'For more information, see https://aka.ms/avm/TelemetryInfo'
}
}
}
}
}

resource privateEndpoint 'Microsoft.Network/privateEndpoints@2023-04-01' = {
name: name
location: location
Expand Down
15 changes: 12 additions & 3 deletions avm/res/network/private-endpoint/private-dns-zone-group/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,26 @@ param privateDNSResourceIds array
@description('Optional. The name of the private DNS zone group.')
param name string = 'default'

@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableTelemetry) {
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
@description('The current released version of the module. Used for telemetry.')
var moduleVersion = '[[moduleVersion]]' // for example '1.0.0'

resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) {
name: '46d3xbcp.res.network-privateendpoint.${replace(moduleVersion, '.', '-')}.${substring(uniqueString(deployment().name), 0, 4)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
outputs: {
telemetry: {
type: 'String'
value: 'For more information, see https://aka.ms/avm/TelemetryInfo'
}
}
}
}
}
Expand Down

0 comments on commit 98fcc07

Please sign in to comment.