Skip to content

Commit d6847b7

Browse files
committed
Admin Export Template Image: Add Ops, TA Cmdlet and security check for exporting template image out of ARA
1 parent 2d01dc3 commit d6847b7

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

src/ServiceManagement/RemoteApp/Commands.RemoteApp/TemplateImage/ExportAzureRemoteAppTemplateImage.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ public override void ExecuteCmdlet()
5050
{
5151
OperationResultWithTrackingId response = null;
5252

53-
if (ShouldProcess(CollectionName, "Overwrite existing template image while exporting the template image of collection"))
53+
if (ShouldProcess(CollectionName, "Migrate the template image of collection"))
5454
{
55-
response = CallClient(() => Client.TemplateImages.Migrate(CollectionName, DestinationStorageAccountName, DestinationStorageAccountKey, DestinationStorageAccountContainerName, true), Client.TemplateImages);
55+
if (ShouldContinue(DestinationStorageAccountContainerName, "Overwrite existing migration records in the destination container"))
56+
{
57+
response = CallClient(() => Client.TemplateImages.Migrate(CollectionName, DestinationStorageAccountName, DestinationStorageAccountKey, DestinationStorageAccountContainerName, true), Client.TemplateImages);
58+
}
59+
60+
if (response != null)
61+
{
62+
WriteTrackingId(response);
63+
}
5664
}
57-
else
58-
{
59-
response = CallClient(() => Client.TemplateImages.Migrate(CollectionName, DestinationStorageAccountName, DestinationStorageAccountKey, DestinationStorageAccountContainerName, false), Client.TemplateImages);
60-
}
61-
62-
if (response != null)
63-
{
64-
WriteTrackingId(response);
65-
}
65+
6666
}
6767
}
6868
}

src/ServiceManagement/RemoteApp/Commands.RemoteApp/UserDisk/ExportAzureRemoteAppUserDisk.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ public override void ExecuteCmdlet()
5050
{
5151
OperationResultWithTrackingId response = null;
5252

53-
if (ShouldProcess(CollectionName, "Overwrite existing user disks while exporting user disks of collection"))
53+
if (ShouldProcess(CollectionName, "Migrate user disks of collection"))
5454
{
55-
response = CallClient(() => Client.UserDisks.Migrate(CollectionName, DestinationStorageAccountName, DestinationStorageAccountKey, DestinationStorageAccountContainerName, true), Client.UserDisks);
56-
}
57-
else
58-
{
59-
response = CallClient(() => Client.UserDisks.Migrate(CollectionName, DestinationStorageAccountName, DestinationStorageAccountKey, DestinationStorageAccountContainerName, false), Client.UserDisks);
60-
}
55+
if (ShouldContinue(DestinationStorageAccountContainerName, "Overwrite existing migration records in the destination container"))
56+
{
57+
response = CallClient(() => Client.UserDisks.Migrate(CollectionName, DestinationStorageAccountName, DestinationStorageAccountKey, DestinationStorageAccountContainerName, true), Client.UserDisks);
58+
}
6159

62-
if (response != null)
63-
{
64-
WriteTrackingId(response);
60+
if (response != null)
61+
{
62+
WriteTrackingId(response);
63+
}
6564
}
65+
6666
}
6767
}
6868
}

0 commit comments

Comments
 (0)