@@ -253,42 +253,43 @@ public override void ExecuteCmdlet()
253
253
else
254
254
{
255
255
this . _Helper . WriteWarning ( "[WARN] Standard Managed Disks are not supported. Extension will be installed but no disk metrics will be available." ) ;
256
-
256
+
257
257
}
258
- continue ;
259
258
}
260
-
261
- var accountName = this . _Helper . GetStorageAccountFromUri ( disk . Vhd . Uri ) ;
262
- if ( ! accounts . ContainsKey ( accountName ) )
259
+ else
263
260
{
264
- var storageKey = this . _Helper . GetAzureStorageKeyFromCache ( accountName ) ;
265
- accounts . Add ( accountName , storageKey ) ;
266
- }
267
261
268
- this . _Helper . WriteHost ( "[INFO] Adding configuration for data disk {0}" , disk . Name ) ;
269
- var caching = disk . Caching ;
270
- sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.lun." + diskNumber , Value = disk . Lun } ) ;
271
- sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.name." + diskNumber , Value = this . _Helper . GetDiskName ( disk . Vhd . Uri ) } ) ;
272
- sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.caching." + diskNumber , Value = caching } ) ;
273
- sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.account." + diskNumber , Value = accountName } ) ;
262
+ var accountName = this . _Helper . GetStorageAccountFromUri ( disk . Vhd . Uri ) ;
263
+ if ( ! accounts . ContainsKey ( accountName ) )
264
+ {
265
+ var storageKey = this . _Helper . GetAzureStorageKeyFromCache ( accountName ) ;
266
+ accounts . Add ( accountName , storageKey ) ;
267
+ }
274
268
275
- if ( this . _Helper . IsPremiumStorageAccount ( accountName ) )
276
- {
277
- this . _Helper . WriteVerbose ( "Data Disk {0} Storage Account is a premium account - adding SLAs for disk" , diskNumber . ToString ( ) ) ;
278
- var sla = this . _Helper . GetDiskSLA ( disk ) ;
279
- sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.type." + diskNumber , Value = AEMExtensionConstants . DISK_TYPE_PREMIUM } ) ;
280
- sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.sla.throughput." + diskNumber , Value = sla . TP } ) ;
281
- sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.sla.iops." + diskNumber , Value = sla . IOPS } ) ;
282
- this . _Helper . WriteVerbose ( "Done - Data Disk {0} Storage Account is a premium account - adding SLAs for disk" , diskNumber . ToString ( ) ) ;
269
+ this . _Helper . WriteHost ( "[INFO] Adding configuration for data disk {0}" , disk . Name ) ;
270
+ var caching = disk . Caching ;
271
+ sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.lun." + diskNumber , Value = disk . Lun } ) ;
272
+ sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.name." + diskNumber , Value = this . _Helper . GetDiskName ( disk . Vhd . Uri ) } ) ;
273
+ sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.caching." + diskNumber , Value = caching } ) ;
274
+ sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.account." + diskNumber , Value = accountName } ) ;
283
275
284
- }
285
- else
286
- {
287
- sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.type." + diskNumber , Value = AEMExtensionConstants . DISK_TYPE_STANDARD } ) ;
288
- sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.connminute." + diskNumber , Value = ( accountName + ".minute" ) } ) ;
289
- sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.connhour." + diskNumber , Value = ( accountName + ".hour" ) } ) ;
290
- }
276
+ if ( this . _Helper . IsPremiumStorageAccount ( accountName ) )
277
+ {
278
+ this . _Helper . WriteVerbose ( "Data Disk {0} Storage Account is a premium account - adding SLAs for disk" , diskNumber . ToString ( ) ) ;
279
+ var sla = this . _Helper . GetDiskSLA ( disk ) ;
280
+ sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.type." + diskNumber , Value = AEMExtensionConstants . DISK_TYPE_PREMIUM } ) ;
281
+ sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.sla.throughput." + diskNumber , Value = sla . TP } ) ;
282
+ sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.sla.iops." + diskNumber , Value = sla . IOPS } ) ;
283
+ this . _Helper . WriteVerbose ( "Done - Data Disk {0} Storage Account is a premium account - adding SLAs for disk" , diskNumber . ToString ( ) ) ;
291
284
285
+ }
286
+ else
287
+ {
288
+ sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.type." + diskNumber , Value = AEMExtensionConstants . DISK_TYPE_STANDARD } ) ;
289
+ sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.connminute." + diskNumber , Value = ( accountName + ".minute" ) } ) ;
290
+ sapmonPublicConfig . Add ( new KeyValuePair ( ) { Key = "disk.connhour." + diskNumber , Value = ( accountName + ".hour" ) } ) ;
291
+ }
292
+ }
292
293
diskNumber += 1 ;
293
294
}
294
295
0 commit comments