-
Notifications
You must be signed in to change notification settings - Fork 4.1k
AzureRT - Fix Problem of Adding Extension while using New/Set-AzureDeployment #466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 12 commits
f7864d1
ed4a82f
bd515ad
06f3e6a
58fc58c
9df5168
d51ddb6
376bddd
1b3a72a
11a93ef
452308f
0ae847a
d503bab
6b26e4b
85ba01b
01db32a
7717ba5
6c54908
6483748
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,6 +50,7 @@ public abstract class BaseAzureServiceExtensionCmdlet : ServiceManagementBaseCmd | |
| protected XDocument PublicConfigurationXml { get; set; } | ||
| protected XDocument PrivateConfigurationXml { get; set; } | ||
| protected DeploymentGetResponse Deployment { get; set; } | ||
| protected DeploymentGetResponse PeerDeployment { get; set; } | ||
|
|
||
| public virtual string ServiceName { get; set; } | ||
| public virtual string Slot { get; set; } | ||
|
|
@@ -109,6 +110,8 @@ protected void ValidateDeployment() | |
| } | ||
| Deployment.ExtensionConfiguration = Deployment.ExtensionConfiguration ?? new Microsoft.WindowsAzure.Management.Compute.Models.ExtensionConfiguration(); | ||
| } | ||
|
|
||
| PeerDeployment = GetPeerDeployment(Slot); | ||
| } | ||
|
|
||
| protected void ValidateRoles() | ||
|
|
@@ -285,6 +288,15 @@ protected DeploymentGetResponse GetDeployment(string slot) | |
| return d; | ||
| } | ||
|
|
||
| protected DeploymentGetResponse GetPeerDeployment(string currentSlot) | ||
| { | ||
| var currentSlotType = (DeploymentSlot)Enum.Parse(typeof(DeploymentSlot), currentSlot, true); | ||
| var peerSlot = currentSlotType == DeploymentSlot.Production ? DeploymentSlot.Staging : DeploymentSlot.Production; | ||
| var peerSlotStr = peerSlot.ToString(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: peerSlotStr is redundant. Just call GetDeployment with peerSlot.ToString().
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. Thanks. Will try to fix in the next PR. Now just trying to stabilize it for tests. |
||
|
|
||
| return GetDeployment(peerSlotStr); | ||
| } | ||
|
|
||
| protected SecureString GetSecurePassword(string password) | ||
| { | ||
| SecureString securePassword = new SecureString(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are Set-AzureDeployment with "-ExtensionConfiguration $null" parameter and Set-AzureDeployment without -ExtensionConfiguration paramter the same?
If they are the same, this line should be added when 'extConfig' is not null.
If they are not the same, we need two separate methods, with $null extConfig and without extConfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.