@@ -449,3 +449,56 @@ function Run-AutoGeneratedServiceExtensionCmdletTests
449
449
Cleanup- CloudService $svcName ;
450
450
}
451
451
}
452
+
453
+ # Run Service Extension Set Cmdlet Tests
454
+ function Run-ServiceExtensionSetCmdletTests
455
+ {
456
+ # Setup
457
+ $location = Get-DefaultLocation ;
458
+ $imgName = Get-DefaultImage $location ;
459
+
460
+ $storageName = ' pstest' + (getAssetName);
461
+ New-AzureStorageAccount - StorageAccountName $storageName - Location $location ;
462
+
463
+ # Associate the new storage account with the current subscription
464
+ Set-CurrentStorageAccountName $storageName ;
465
+
466
+ $svcName = ' pstest' + (Get-CloudServiceName );
467
+ $userName = " pstestuser" ;
468
+ $password = " p@ssw0rd" ;
469
+ $sPassword = ConvertTo-SecureString $password - AsPlainText - Force;
470
+ $credential = New-Object System.Management.Automation.PSCredential ($userName , $sPassword );
471
+
472
+ # Test
473
+ New-AzureService - ServiceName $svcName - Location $location ;
474
+
475
+ try
476
+ {
477
+ # New-AzureDeployment (in Azure.psd1)
478
+ $cspkg = ' .\Resources\ServiceManagement\Files\OneWebOneWorker.cspkg' ;
479
+ $cscfg = ' .\Resources\ServiceManagement\Files\OneWebOneWorker.cscfg' ;
480
+
481
+ # Staging 1st
482
+ $st = New-AzureDeployment - ServiceName $svcName - Package $cspkg - Configuration $cscfg - Label $svcName - Slot Staging;
483
+ $st = Set-AzureServiceRemoteDesktopExtension - ServiceName $svcName - Slot Staging - Credential $credential ;
484
+ $ex = Get-AzureServiceExtension - ServiceName $svcName - Slot Staging;
485
+ $st = Move-AzureDeployment - ServiceName $svcName ;
486
+ $ex = Get-AzureServiceExtension - ServiceName $svcName - Slot Production;
487
+
488
+ # Staging 2nd
489
+ $st = New-AzureDeployment - ServiceName $svcName - Package $cspkg - Configuration $cscfg - Label $svcName - Slot Staging;
490
+ $st = Set-AzureServiceRemoteDesktopExtension - ServiceName $svcName - Slot Staging - Credential $credential ;
491
+ $ex = Get-AzureServiceExtension - ServiceName $svcName - Slot Staging;
492
+ $st = Move-AzureDeployment - ServiceName $svcName ;
493
+ $ex = Get-AzureServiceExtension - ServiceName $svcName - Slot Production;
494
+
495
+ # Set Extensions
496
+ $st = Set-AzureServiceRemoteDesktopExtension - ServiceName $svcName - Slot Production - Credential $credential ;
497
+ $st = Set-AzureServiceRemoteDesktopExtension - ServiceName $svcName - Slot Staging - Credential $credential ;
498
+ }
499
+ finally
500
+ {
501
+ # Cleanup
502
+ Cleanup- CloudService $svcName ;
503
+ }
504
+ }
0 commit comments