diff --git a/README.md b/README.md index 9b0ca56..81f5304 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,8 @@ The following steps are required to deploy the infrastructure from the command l 1. Create a resource group and deploy the infrastructure. + *There is an optional tracking ID on this deployment. To opt out of its use, add the following parameter to the deployment code below: `-p telemetryOptOut true`.* + ```bash RESOURCE_GROUP=rg-chat-basic-${LOCATION} az group create -l $LOCATION -n $RESOURCE_GROUP diff --git a/infra-as-code/bicep/customerUsageAttribution/cuaIdResourceGroup.bicep b/infra-as-code/bicep/customerUsageAttribution/cuaIdResourceGroup.bicep new file mode 100644 index 0000000..ea0e755 --- /dev/null +++ b/infra-as-code/bicep/customerUsageAttribution/cuaIdResourceGroup.bicep @@ -0,0 +1,4 @@ +targetScope = 'resourceGroup' + +// This is an empty deployment by design +// Reference: https://learn.microsoft.com/partner-center/marketplace-offers/azure-partner-customer-usage-attribution diff --git a/infra-as-code/bicep/main.bicep b/infra-as-code/bicep/main.bicep index c019ac7..a19900b 100755 --- a/infra-as-code/bicep/main.bicep +++ b/infra-as-code/bicep/main.bicep @@ -11,6 +11,12 @@ param baseName string @maxLength(36) param yourPrincipalId string +@description('Set to true to opt-out of deployment telemetry.') +param telemetryOptOut bool = false + +// Customer Usage Attribution Id +var varCuaid = '6aa4564a-a8b7-4ced-8e57-1043a41f4747' + // ---- Log Analytics workspace ---- resource logWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' = { name: 'log-${baseName}' @@ -104,3 +110,10 @@ module webappModule 'webapp.bicep' = { aiStudio ] } + +// Optional Deployment for Customer Usage Attribution +module customerUsageAttributionModule 'customerUsageAttribution/cuaIdResourceGroup.bicep' = if (!telemetryOptOut) { + #disable-next-line no-loc-expr-outside-params // Only to ensure telemetry data is stored in same location as deployment. See https://github.com/Azure/ALZ-Bicep/wiki/FAQ#why-are-some-linter-rules-disabled-via-the-disable-next-line-bicep-function for more information + name: 'pid-${varCuaid}-${uniqueString(resourceGroup().location)}' + params: {} +}