Skip to content

Commit 33abef8

Browse files
committed
Bug 2065636:$[Mohoro] AzurePowershell should set "ForceRedeploy=true"
when customer tries to patch collection with the same gold image
1 parent 9cc4d80 commit 33abef8

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Collection/SetAzureRemoteAppCollection.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public override void ExecuteCmdlet()
6666
CollectionCreationDetails details = null;
6767
OperationResultWithTrackingId response = null;
6868
Collection collection = null;
69+
bool forceRedeploy = false;
6970

7071
collection = FindCollection(CollectionName);
7172
if (collection == null)
@@ -107,11 +108,19 @@ public override void ExecuteCmdlet()
107108
details.AdInfo.UserName = creds.UserName;
108109
details.AdInfo.Password = creds.Password;
109110
}
111+
112+
if (String.Equals("Inactive", collection.Status, StringComparison.OrdinalIgnoreCase))
113+
{
114+
// the collection may have failed due to bad domain join information before,
115+
// re-trying with the new information
116+
forceRedeploy = true;
117+
}
118+
110119
break;
111120
}
112121
}
113122

114-
response = CallClient(() => Client.Collections.Set(CollectionName, false, false, details), Client.Collections);
123+
response = CallClient(() => Client.Collections.Set(CollectionName, forceRedeploy, false, details), Client.Collections);
115124
if (response != null)
116125
{
117126
TrackingResult trackingId = new TrackingResult(response);

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Collection/UpdateAzureRemoteAppCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public override void ExecuteCmdlet()
5555

5656
if (ShouldProcess(CollectionName, "Update collection"))
5757
{
58-
response = CallClient(() => Client.Collections.Set(CollectionName, false, false, details), Client.Collections);
58+
response = CallClient(() => Client.Collections.Set(CollectionName, true, false, details), Client.Collections);
5959
}
6060

6161
if (response != null)

0 commit comments

Comments
 (0)