Skip to content
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions infra-as-code/bicep/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
Expand Down Expand Up @@ -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: {}
}