@@ -43,6 +43,7 @@ internal sealed class ResourceExportVisitor
43
43
private const string PROPERTY_SECURITYPOLICIES = "securityPolicies" ;
44
44
private const string PROPERTY_CONTAINERS = "containers" ;
45
45
private const string PROPERTY_SHARES = "shares" ;
46
+ private const string PROPERTY_TOPICS = "topics" ;
46
47
47
48
private const string TYPE_CONTAINERSERVICE_MANAGEDCLUSTERS = "Microsoft.ContainerService/managedClusters" ;
48
49
private const string TYPE_CONTAINERREGISTRY_REGISTRIES = "Microsoft.ContainerRegistry/registries" ;
@@ -73,6 +74,11 @@ internal sealed class ResourceExportVisitor
73
74
private const string TYPE_SERVICEBUS_NAMESPACE = "Microsoft.ServiceBus/namespaces" ;
74
75
private const string TYPE_VISUALSTUDIO_ACCOUNT = "Microsoft.VisualStudio/account" ;
75
76
private const string TYPE_DEVCENTER_PROJECT = "Microsoft.DevCenter/projects" ;
77
+ private const string TYPE_NETWORK_FIREWALLPOLICY = "Microsoft.Network/firewallPolicies" ;
78
+ private const string TYPE_NETWORK_VIRTUALHUB = "Microsoft.Network/virtualHubs" ;
79
+ private const string TYPE_EVENTGRID_TOPIC = "Microsoft.EventGrid/topics" ;
80
+ private const string TYPE_EVENTGRID_DOMAIN = "Microsoft.EventGrid/domains" ;
81
+ private const string TYPE_EVENTGRID_NAMESPACE = "Microsoft.EventGrid/namespaces" ;
76
82
77
83
private const string PROVIDERTYPE_DIAGNOSTICSETTINGS = "/providers/microsoft.insights/diagnosticSettings" ;
78
84
private const string PROVIDERTYPE_ROLEASSIGNMENTS = "/providers/Microsoft.Authorization/roleAssignments" ;
@@ -91,6 +97,8 @@ internal sealed class ResourceExportVisitor
91
97
private const string APIVERSION_2016_09_01 = "2016-09-01" ;
92
98
private const string APIVERSION_2017_12_01 = "2017-12-01" ;
93
99
private const string APIVERSION_2021_05_01_PREVIEW = "2021-05-01-preview" ;
100
+ private const string APIVERSION_2021_06_01_PREVIEW = "2021-06-01-preview" ;
101
+ private const string APIVERSION_2021_08_27 = "2021-08-27" ;
94
102
private const string APIVERSION_2021_11_01 = "2021-11-01" ;
95
103
private const string APIVERSION_2022_07_01 = "2022-07-01" ;
96
104
private const string APIVERSION_2022_08_01 = "2022-08-01" ;
@@ -104,6 +112,7 @@ internal sealed class ResourceExportVisitor
104
112
private const string APIVERSION_2023_06_30 = "2023-06-30" ;
105
113
private const string APIVERSION_2023_01_01_PREVIEW = "2023-01-01-preview" ;
106
114
private const string APIVERSION_2023_03_01_PREVIEW = "2023-03-01-preview" ;
115
+ private const string APIVERSION_2023_12_15_PREVIEW = "2023-12-15-preview" ;
107
116
108
117
private readonly ProviderData _ProviderData ;
109
118
@@ -186,7 +195,12 @@ await VisitSubscription(resourceContext, resource, resourceType, resourceId) ||
186
195
await VisitDataExplorerCluster ( resourceContext , resource , resourceType , resourceId ) ||
187
196
await VisitEventHubNamespace ( resourceContext , resource , resourceType , resourceId ) ||
188
197
await VisitServiceBusNamespace ( resourceContext , resource , resourceType , resourceId ) ||
198
+ await VisitEventGridTopic ( resourceContext , resource , resourceType , resourceId ) ||
199
+ await VisitEventGridDomain ( resourceContext , resource , resourceType , resourceId ) ||
200
+ await VisitEventGridNamespace ( resourceContext , resource , resourceType , resourceId ) ||
189
201
await VisitDevCenterProject ( resourceContext , resource , resourceType , resourceId ) ||
202
+ await VisitFirewallPolicy ( resourceContext , resource , resourceType , resourceId ) ||
203
+ await VisitVirtualHub ( resourceContext , resource , resourceType , resourceId ) ||
190
204
VisitNetworkConnection ( resource , resourceType ) ;
191
205
}
192
206
@@ -242,8 +256,8 @@ private static async Task<bool> VisitServiceBusNamespace(ResourceContext context
242
256
if ( ! string . Equals ( resourceType , TYPE_SERVICEBUS_NAMESPACE , StringComparison . OrdinalIgnoreCase ) )
243
257
return false ;
244
258
245
- AddSubResource ( resource , await GetSubResourcesByType ( context , resourceId , "queues" , "2021-06-01-preview" ) ) ;
246
- AddSubResource ( resource , await GetSubResourcesByType ( context , resourceId , "topics" , "2021-06-01-preview" ) ) ;
259
+ AddSubResource ( resource , await GetSubResourcesByType ( context , resourceId , "queues" , APIVERSION_2021_06_01_PREVIEW ) ) ;
260
+ AddSubResource ( resource , await GetSubResourcesByType ( context , resourceId , PROPERTY_TOPICS , APIVERSION_2021_06_01_PREVIEW ) ) ;
247
261
return true ;
248
262
}
249
263
@@ -252,7 +266,49 @@ private static async Task<bool> VisitEventHubNamespace(ResourceContext context,
252
266
if ( ! string . Equals ( resourceType , TYPE_EVENTHUB_NAMESPACE , StringComparison . OrdinalIgnoreCase ) )
253
267
return false ;
254
268
255
- AddSubResource ( resource , await GetSubResourcesByType ( context , resourceId , "eventhubs" , "2021-11-01" ) ) ;
269
+ AddSubResource ( resource , await GetSubResourcesByType ( context , resourceId , "eventhubs" , APIVERSION_2021_11_01 ) ) ;
270
+ return true ;
271
+ }
272
+
273
+ private static async Task < bool > VisitEventGridTopic ( ResourceContext context , JObject resource , string resourceType , string resourceId )
274
+ {
275
+ if ( ! string . Equals ( resourceType , TYPE_EVENTGRID_TOPIC , StringComparison . OrdinalIgnoreCase ) )
276
+ return false ;
277
+
278
+ AddSubResource ( resource , await GetSubResourcesByType ( context , resourceId , "eventSubscriptions" , APIVERSION_2023_12_15_PREVIEW ) ) ;
279
+ return true ;
280
+ }
281
+
282
+ private static async Task < bool > VisitEventGridDomain ( ResourceContext context , JObject resource , string resourceType , string resourceId )
283
+ {
284
+ if ( ! string . Equals ( resourceType , TYPE_EVENTGRID_DOMAIN , StringComparison . OrdinalIgnoreCase ) )
285
+ return false ;
286
+
287
+ var topics = await GetSubResourcesByType ( context , resourceId , PROPERTY_TOPICS , APIVERSION_2023_12_15_PREVIEW ) ;
288
+ foreach ( var topic in topics )
289
+ {
290
+ if ( topic . TryStringProperty ( PROPERTY_ID , out var topicId ) )
291
+ AddSubResource ( topic , await GetSubResourcesByType ( context , topicId , "eventSubscriptions" , APIVERSION_2023_12_15_PREVIEW ) ) ;
292
+ }
293
+
294
+ AddSubResource ( resource , topics ) ;
295
+ AddSubResource ( resource , await GetSubResourcesByType ( context , resourceId , "eventSubscriptions" , APIVERSION_2023_12_15_PREVIEW ) ) ;
296
+ return true ;
297
+ }
298
+
299
+ private static async Task < bool > VisitEventGridNamespace ( ResourceContext context , JObject resource , string resourceType , string resourceId )
300
+ {
301
+ if ( ! string . Equals ( resourceType , TYPE_EVENTGRID_NAMESPACE , StringComparison . OrdinalIgnoreCase ) )
302
+ return false ;
303
+
304
+ var topics = await GetSubResourcesByType ( context , resourceId , PROPERTY_TOPICS , APIVERSION_2023_12_15_PREVIEW ) ;
305
+ foreach ( var topic in topics )
306
+ {
307
+ if ( topic . TryStringProperty ( PROPERTY_ID , out var topicId ) )
308
+ AddSubResource ( topic , await GetSubResourcesByType ( context , topicId , "eventSubscriptions" , APIVERSION_2023_12_15_PREVIEW ) ) ;
309
+ }
310
+
311
+ AddSubResource ( resource , topics ) ;
256
312
return true ;
257
313
}
258
314
@@ -267,8 +323,27 @@ private static async Task<bool> VisitDevCenterProject(ResourceContext context, J
267
323
if ( pool . TryStringProperty ( PROPERTY_ID , out var poolId ) )
268
324
AddSubResource ( pool , await GetSubResourcesByType ( context , poolId , "schedules" , APIVERSION_2023_04_01 ) ) ;
269
325
}
326
+
270
327
AddSubResource ( resource , pools ) ;
328
+ return true ;
329
+ }
330
+
331
+ private static async Task < bool > VisitFirewallPolicy ( ResourceContext context , JObject resource , string resourceType , string resourceId )
332
+ {
333
+ if ( ! string . Equals ( resourceType , TYPE_NETWORK_FIREWALLPOLICY , StringComparison . OrdinalIgnoreCase ) )
334
+ return false ;
335
+
336
+ AddSubResource ( resource , await GetSubResourcesByType ( context , resourceId , "ruleCollectionGroups" , APIVERSION_2023_04_01 ) ) ;
337
+ AddSubResource ( resource , await GetSubResourcesByType ( context , resourceId , "signatureOverrides" , APIVERSION_2023_04_01 ) ) ;
338
+ return true ;
339
+ }
340
+
341
+ private static async Task < bool > VisitVirtualHub ( ResourceContext context , JObject resource , string resourceType , string resourceId )
342
+ {
343
+ if ( ! string . Equals ( resourceType , TYPE_NETWORK_VIRTUALHUB , StringComparison . OrdinalIgnoreCase ) )
344
+ return false ;
271
345
346
+ AddSubResource ( resource , await GetSubResourcesByType ( context , resourceId , "routingIntent" , APIVERSION_2023_04_01 ) ) ;
272
347
return true ;
273
348
}
274
349
@@ -277,7 +352,7 @@ private static async Task<bool> VisitDataExplorerCluster(ResourceContext context
277
352
if ( ! string . Equals ( resourceType , TYPE_KUSTO_CLUSTER , StringComparison . OrdinalIgnoreCase ) )
278
353
return false ;
279
354
280
- AddSubResource ( resource , await GetSubResourcesByType ( context , resourceId , "databases" , "2021-08-27" ) ) ;
355
+ AddSubResource ( resource , await GetSubResourcesByType ( context , resourceId , "databases" , APIVERSION_2021_08_27 ) ) ;
281
356
return true ;
282
357
}
283
358
0 commit comments