Skip to content

Commit def67b0

Browse files
helderpintoflanakinHélder Pinto
authored
AOE: migrate to DCR-based ingestion (#2193)
Co-authored-by: Michael Flanakin <flanakin@users.noreply.github.com> Co-authored-by: Hélder Pinto <helder.pinto@microsoft.com>
1 parent f5bf284 commit def67b0

12 files changed

Lines changed: 2005 additions & 599 deletions

‎docs-mslearn/toolkit/changelog.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ _Released June 2026_
6969
- **Fixed**
7070
- Corrected stale and incorrect descriptions for `BilledCost`, `EffectiveCost`, `BillingCurrency`, `BillingProfileId`, `BillingProfileName`, `CommitmentDiscountQuantity`, `ListUnitPrice`, `PricingQuantity`, `PricingUnitDescription`, and `TotalSavingsRunningTotal` to align with FOCUS 1.2 ([#2112](https://github.com/microsoft/finops-toolkit/pull/2112)).
7171

72-
### [Optimization engine](optimization-engine/overview.md) updates
72+
### [Optimization engine](optimization-engine/overview.md) v15
7373

74+
- **Changed**
75+
- Migrated Log Analytics ingestion from the Data Collection API (to be deprecated in September 2026) to a Data Collection Rule, Ingestion API-based solution.
7476
- **Fixed**
7577
- Removed call to Azure Classic administrators endpoint (deprecated on May 1, 2026) from Azure RBAC assignments exports ([#2142](https://github.com/microsoft/finops-toolkit/issues/2142)).
7678

‎src/optimization-engine/Deploy-AzureOptimizationEngine.ps1‎

Lines changed: 137 additions & 79 deletions
Large diffs are not rendered by default.

‎src/optimization-engine/Setup-LogAnalyticsTablesAndDCRs.ps1‎

Lines changed: 1203 additions & 0 deletions
Large diffs are not rendered by default.

‎src/optimization-engine/azuredeploy-nested.bicep‎

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ var csvExportsSchedules = [
257257
{
258258
exportSchedule: priceExportsScheduleName
259259
exportDescription: 'Weekly Pricesheet and Reservation Prices exports'
260-
exportTimeOffset: 'PT1H35M'
260+
exportTimeOffset: 'PT1H05M'
261261
exportFrequency: 'Week'
262262
}
263263
{
@@ -562,7 +562,7 @@ var csvExports = [
562562
variableDescription: 'The Storage Account container where Pricesheet exports are dumped to'
563563
ingestSchedule: 'AzureOptimization_IngestPricesheetWeekly'
564564
ingestDescription: 'Weekly Pricesheet ingests'
565-
ingestTimeOffset: 'PT2H'
565+
ingestTimeOffset: 'PT1H35M'
566566
ingestFrequency: 'Week'
567567
ingestJobId: pricesheetIngestJobId
568568
exportSchedule: priceExportsScheduleName
@@ -576,7 +576,7 @@ var csvExports = [
576576
variableDescription: 'The Storage Account container where Reservations Prices exports are dumped to'
577577
ingestSchedule: 'AzureOptimization_IngestReservationsPriceWeekly'
578578
ingestDescription: 'Weekly Reservations Prices ingests'
579-
ingestTimeOffset: 'PT2H'
579+
ingestTimeOffset: 'PT1H35M'
580580
ingestFrequency: 'Week'
581581
ingestJobId: reservationPricesIngestJobId
582582
exportSchedule: priceExportsScheduleName
@@ -949,7 +949,7 @@ var runbooks = [
949949
}
950950
{
951951
name: consumptionExportsRunbookName
952-
version: '2.1.1.0'
952+
version: '2.1.2.0'
953953
description: 'Exports Azure Consumption events to Blob Storage using Azure Consumption API'
954954
type: 'PowerShell'
955955
scriptUri: uri(templateLocation, 'runbooks/data-collection/${consumptionExportsRunbookName}.ps1')
@@ -1075,7 +1075,7 @@ var runbooks = [
10751075
}
10761076
{
10771077
name: csvIngestRunbookName
1078-
version: '1.6.2.0'
1078+
version: '2.0.0.0'
10791079
description: 'Ingests CSV blobs as custom logs to Log Analytics'
10801080
type: 'PowerShell'
10811081
scriptUri: uri(templateLocation, 'runbooks/data-collection/${csvIngestRunbookName}.ps1')
@@ -1187,21 +1187,21 @@ var runbooks = [
11871187
}
11881188
{
11891189
name: recommendationsIngestRunbookName
1190-
version: '1.7.1.0'
1190+
version: '1.7.2.0'
11911191
description: 'Ingests JSON-based recommendations into an Azure SQL Database'
11921192
type: 'PowerShell'
11931193
scriptUri: uri(templateLocation, 'runbooks/recommendations/${recommendationsIngestRunbookName}.ps1')
11941194
}
11951195
{
11961196
name: recommendationsLogAnalyticsIngestRunbookName
1197-
version: '1.1.1.0'
1197+
version: '2.0.0.0'
11981198
description: 'Ingests JSON-based recommendations into Log Analytics'
11991199
type: 'PowerShell'
12001200
scriptUri: uri(templateLocation, 'runbooks/recommendations/${recommendationsLogAnalyticsIngestRunbookName}.ps1')
12011201
}
12021202
{
12031203
name: suppressionsLogAnalyticsIngestRunbookName
1204-
version: '1.1.0.0'
1204+
version: '2.0.0.0'
12051205
description: 'Ingests suppressions into Log Analytics'
12061206
type: 'PowerShell'
12071207
scriptUri: uri(templateLocation, 'runbooks/recommendations/${suppressionsLogAnalyticsIngestRunbookName}.ps1')
@@ -1274,7 +1274,7 @@ var automationVariables = [
12741274
{
12751275
name: 'AzureOptimization_LogAnalyticsChunkSize'
12761276
description: 'The size (in rows) for each chunk of Log Analytics ingestion request'
1277-
value: 6000
1277+
value: 150
12781278
}
12791279
{
12801280
name: 'AzureOptimization_StorageBlobsPageSize'
@@ -1570,6 +1570,17 @@ resource logAnalyticsWorkspace 'microsoft.operationalinsights/workspaces@2020-08
15701570
}
15711571
}
15721572

1573+
resource dataCollectionEndpoint 'Microsoft.Insights/dataCollectionEndpoints@2022-06-01' = {
1574+
name: '${automationAccountName}-dce'
1575+
location: projectLocation
1576+
tags: resourceTags
1577+
properties: {
1578+
networkAcls: {
1579+
publicNetworkAccess: 'Enabled'
1580+
}
1581+
}
1582+
}
1583+
15731584
resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
15741585
name: storageAccountName
15751586
location: projectLocation
@@ -1893,6 +1904,15 @@ resource automationVariables_LogAnalyticsWorkspaceKey 'Microsoft.Automation/auto
18931904
}
18941905
}
18951906

1907+
resource automationVariables_DCEIngestionEndpoint 'Microsoft.Automation/automationAccounts/variables@2020-01-13-preview' = {
1908+
parent: automationAccount
1909+
name: 'AzureOptimization_DCEIngestionEndpoint'
1910+
properties: {
1911+
description: 'The Logs Ingestion endpoint URL of the Data Collection Endpoint used for DCR-based ingestion'
1912+
value: '"${dataCollectionEndpoint.properties.logsIngestion.endpoint}"'
1913+
}
1914+
}
1915+
18961916
resource automationSchedules_csvExports 'Microsoft.Automation/automationAccounts/schedules@2020-01-13-preview' = [for item in csvExportsSchedules: {
18971917
parent: automationAccount
18981918
name: item.exportSchedule
@@ -2156,3 +2176,5 @@ resource contributorRoleAssignmentGuid_resource 'Microsoft.Authorization/roleAss
21562176
}
21572177

21582178
output automationPrincipalId string = reference(automationAccount.id, '2019-06-01', 'Full').identity.principalId
2179+
output dceLogsIngestionEndpoint string = dataCollectionEndpoint.properties.logsIngestion.endpoint
2180+
output dceResourceId string = dataCollectionEndpoint.id
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,155 +1,155 @@
11
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'argvmexports')
22
BEGIN
3-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
3+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
44
VALUES ('argvmexports', '1901-01-01T00:00:00Z', -1, 'VMsV1', 'ARGVirtualMachine')
55
END
66

77
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'argdiskexports')
88
BEGIN
9-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
9+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
1010
VALUES ('argdiskexports', '1901-01-01T00:00:00Z', -1, 'DisksV1', 'ARGManagedDisk')
1111
END
1212

1313
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'argvhdexports')
1414
BEGIN
15-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
15+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
1616
VALUES ('argvhdexports', '1901-01-01T00:00:00Z', -1, 'VhdDisksV1', 'ARGUnmanagedDisk')
1717
END
1818

1919
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'argavailsetexports')
2020
BEGIN
21-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
21+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
2222
VALUES ('argavailsetexports', '1901-01-01T00:00:00Z', -1, 'AvailSetsV1', 'ARGAvailabilitySet')
2323
END
2424

2525
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'advisorexports')
2626
BEGIN
27-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
27+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
2828
VALUES ('advisorexports', '1901-01-01T00:00:00Z', -1, 'AdvisorV1', 'AzureAdvisor')
2929
END
3030

3131
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'remediationlogs')
3232
BEGIN
33-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
33+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
3434
VALUES ('remediationlogs', '1901-01-01T00:00:00Z', -1, 'RemediationV1', 'RemediationLogs')
3535
END
3636

3737
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'consumptionexports')
3838
BEGIN
39-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
39+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
4040
VALUES ('consumptionexports', '1901-01-01T00:00:00Z', -1, 'ConsumptionV1', 'AzureConsumption')
4141
END
4242

4343
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'aadobjectsexports')
4444
BEGIN
45-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
45+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
4646
VALUES ('aadobjectsexports', '1901-01-01T00:00:00Z', -1, 'AADObjectsV1', 'AADObjects')
4747
END
4848

4949
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'arglbexports')
5050
BEGIN
51-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
51+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
5252
VALUES ('arglbexports', '1901-01-01T00:00:00Z', -1, 'LoadBalancersV1', 'ARGLoadBalancer')
5353
END
5454

5555
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'argappgwexports')
5656
BEGIN
57-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
57+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
5858
VALUES ('argappgwexports', '1901-01-01T00:00:00Z', -1, 'AppGatewaysV1', 'ARGAppGateway')
5959
END
6060

6161
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'argrescontainersexports')
6262
BEGIN
63-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
63+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
6464
VALUES ('argrescontainersexports', '1901-01-01T00:00:00Z', -1, 'ResourceContainersV1', 'ARGResourceContainers')
6565
END
6666

6767
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'rbacexports')
6868
BEGIN
69-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
69+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
7070
VALUES ('rbacexports', '1901-01-01T00:00:00Z', -1, 'RBACAssignmentsV1', 'RBACAssignments')
7171
END
7272

7373
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'argvnetexports')
7474
BEGIN
75-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
75+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
7676
VALUES ('argvnetexports', '1901-01-01T00:00:00Z', -1, 'VNetsV1', 'ARGVirtualNetwork')
7777
END
7878

7979
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'argnicexports')
8080
BEGIN
81-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
81+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
8282
VALUES ('argnicexports', '1901-01-01T00:00:00Z', -1, 'NICsV1', 'ARGNetworkInterface')
8383
END
8484

8585
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'argnsgexports')
8686
BEGIN
87-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
87+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
8888
VALUES ('argnsgexports', '1901-01-01T00:00:00Z', -1, 'NSGsV1', 'ARGNSGRule')
8989
END
9090

9191
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'argpublicipexports')
9292
BEGIN
93-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
93+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
9494
VALUES ('argpublicipexports', '1901-01-01T00:00:00Z', -1, 'PublicIPsV1', 'ARGPublicIP')
9595
END
9696

9797
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'argvmssexports')
9898
BEGIN
99-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
99+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
100100
VALUES ('argvmssexports', '1901-01-01T00:00:00Z', -1, 'VMSSV1', 'ARGVMSS')
101101
END
102102

103103
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'argsqldbexports')
104104
BEGIN
105-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
105+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
106106
VALUES ('argsqldbexports', '1901-01-01T00:00:00Z', -1, 'SqlDbV1', 'ARGSqlDb')
107107
END
108108

109109
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'azmonitorexports')
110110
BEGIN
111-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
111+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
112112
VALUES ('azmonitorexports', '1901-01-01T00:00:00Z', -1, 'MonitorMetricsV1', 'MonitorMetrics')
113113
END
114114

115115
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'policystateexports')
116116
BEGIN
117-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
117+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
118118
VALUES ('policystateexports', '1901-01-01T00:00:00Z', -1, 'PolicyStatesV1', 'PolicyStates')
119119
END
120120

121121
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'recommendationsexports')
122122
BEGIN
123-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
123+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
124124
VALUES ('recommendationsexports', '2022-12-26T00:00:00Z', -1, 'RecommendationsV1', 'Recommendations')
125125
END
126126

127127
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'reservationsexports')
128128
BEGIN
129-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
129+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
130130
VALUES ('reservationsexports', '1901-01-01T00:00:00Z', -1, 'ReservationsUsageV1', 'ReservationsUsage')
131131
END
132132

133133
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'argappserviceplanexports')
134134
BEGIN
135-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
135+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
136136
VALUES ('argappserviceplanexports', '1901-01-01T00:00:00Z', -1, 'AppServicePlansV1', 'AppServicePlans')
137137
END
138138

139139
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'pricesheetexports')
140140
BEGIN
141-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
141+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
142142
VALUES ('pricesheetexports', '1901-01-01T00:00:00Z', -1, 'PricesheetV1', 'Pricesheet')
143143
END
144144

145145
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'reservationspriceexports')
146146
BEGIN
147-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
147+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
148148
VALUES ('reservationspriceexports', '1901-01-01T00:00:00Z', -1, 'ReservationsPriceV1', 'ReservationsPrice')
149149
END
150150

151151
IF NOT EXISTS (SELECT * FROM [dbo].[LogAnalyticsIngestControl] WHERE StorageContainerName = 'savingsplansexports')
152152
BEGIN
153-
INSERT INTO [dbo].[LogAnalyticsIngestControl]
153+
INSERT INTO [dbo].[LogAnalyticsIngestControl] (StorageContainerName, LastProcessedDateTime, LastProcessedLine, LogAnalyticsSuffix, CollectedType)
154154
VALUES ('savingsplansexports', '1901-01-01T00:00:00Z', -1, 'SavingsPlansUsageV1', 'SavingsPlansUsage')
155155
END

‎src/optimization-engine/model/loganalyticsingestcontrol-table.sql‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
88
[LastProcessedDateTime] [datetime] NULL,
99
[LastProcessedLine] [int] NULL,
1010
[LogAnalyticsSuffix] [varchar](50) NOT NULL,
11-
[CollectedType] [varchar](50) NULL
11+
[CollectedType] [varchar](50) NULL,
12+
[DCRImmutableId] [varchar](100) NULL
1213
)
1314

1415
ALTER TABLE [dbo].[LogAnalyticsIngestControl] ADD PRIMARY KEY CLUSTERED
@@ -18,8 +19,12 @@ AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
1819
END
1920
ELSE
2021
BEGIN
21-
IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[dbo].[LogAnalyticsIngestControl]') AND name = 'CollectedType'
22-
) BEGIN
22+
IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[dbo].[LogAnalyticsIngestControl]') AND name = 'CollectedType')
23+
BEGIN
2324
ALTER TABLE [dbo].[LogAnalyticsIngestControl] ADD [CollectedType] VARCHAR (50) NULL
2425
END
26+
IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[dbo].[LogAnalyticsIngestControl]') AND name = 'DCRImmutableId')
27+
BEGIN
28+
ALTER TABLE [dbo].[LogAnalyticsIngestControl] ADD [DCRImmutableId] VARCHAR (100) NULL
29+
END
2530
END

0 commit comments

Comments
 (0)