Skip to content

Commit 150c6f1

Browse files
author
Harsh Patel
committed
Added deployment scope paramter to new and set RG & sub [Needs testing]
1 parent 082c08e commit 150c6f1

File tree

5 files changed

+40
-7
lines changed

5 files changed

+40
-7
lines changed

src/Resources/ResourceManager/Implementation/DeploymentStacks/NewAzResourceGroupDeploymentStack.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ public class NewAzResourceGroupDeploymentStack : DeploymentStacksCmdletBase
109109
HelpMessage = "Do not ask for confirmation when overwriting an existing stack.")]
110110
public SwitchParameter Force { get; set; }
111111

112+
[Parameter(Mandatory = false,
113+
HelpMessage = "The scope at which the initial deployment should be created. If a scope isn't specified, it will default to the scope of the deployment stack.")]
114+
public string DeploymentScope { get; set; }
115+
112116
#endregion
113117

114118
#region Cmdlet Overrides
@@ -156,8 +160,14 @@ public override void ExecuteCmdlet()
156160
ParameterUri,
157161
parameters,
158162
Description,
163+
<<<<<<< Updated upstream
159164
UpdateBehavior == null ? "detach" : UpdateBehavior
160165
) ;
166+
=======
167+
"Detach",
168+
DeploymentScope
169+
);
170+
>>>>>>> Stashed changes
161171
WriteObject(deploymentStack);
162172
};
163173

src/Resources/ResourceManager/Implementation/DeploymentStacks/NewAzSubscriptionDeploymentStack.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ public class NewAzSubscriptionDeploymentStack : DeploymentStacksCmdletBase
107107
HelpMessage = "Do not ask for confirmation when overwriting an existing stack.")]
108108
public SwitchParameter Force { get; set; }
109109

110+
[Parameter(Mandatory = false,
111+
HelpMessage = "The scope at which the initial deployment should be created. If a scope isn't specified, it will default to the scope of the deployment stack.")]
112+
public string DeploymentScope { get; set; }
113+
110114
#endregion
111115

112116
#region Cmdlet Overrides
@@ -154,7 +158,12 @@ public override void ExecuteCmdlet()
154158
ParameterUri,
155159
parameters,
156160
Description,
161+
<<<<<<< Updated upstream
157162
UpdateBehavior == null ? "detach" : UpdateBehavior
163+
=======
164+
"Detach",
165+
DeploymentScope
166+
>>>>>>> Stashed changes
158167
);
159168
WriteObject(deploymentStack);
160169
};

src/Resources/ResourceManager/Implementation/DeploymentStacks/SetAzResourceGroupDeploymentStack.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ public class SetAzResourceGroupDeploymentStack : DeploymentStacksCmdletBase
109109
HelpMessage = "Do not ask for confirmation when overwriting an existing stack.")]
110110
public SwitchParameter Force { get; set; }
111111

112+
[Parameter(Mandatory = false,
113+
HelpMessage = "The scope at which the initial deployment should be created. If a scope isn't specified, it will default to the scope of the deployment stack.")]
114+
public string DeploymentScope { get; set; }
115+
112116
#endregion
113117

114118
#region Cmdlet Overrides
@@ -156,7 +160,8 @@ public override void ExecuteCmdlet()
156160
ParameterUri,
157161
parameters,
158162
Description,
159-
UpdateBehavior
163+
UpdateBehavior,
164+
DeploymentScope
160165
);
161166
WriteObject(deploymentStack);
162167
};

src/Resources/ResourceManager/Implementation/DeploymentStacks/SetAzSubscriptionDeploymentStack.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ public class SetAzSubscriptionDeploymentStack : DeploymentStacksCmdletBase
107107
HelpMessage = "Do not ask for confirmation when overwriting an existing stack.")]
108108
public SwitchParameter Force { get; set; }
109109

110+
[Parameter(Mandatory = false,
111+
HelpMessage = "The scope at which the initial deployment should be created. If a scope isn't specified, it will default to the scope of the deployment stack.")]
112+
public String DeploymentScope { get; set; }
113+
110114
#endregion
111115

112116
#region Cmdlet Overrides
@@ -154,7 +158,8 @@ public override void ExecuteCmdlet()
154158
ParameterUri,
155159
parameters,
156160
Description,
157-
UpdateBehavior
161+
UpdateBehavior,
162+
DeploymentScope
158163
);
159164

160165
WriteObject(deploymentStack);

src/Resources/ResourceManager/SdkClient/DeploymentStacksSdkClient.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,15 @@ public PSDeploymentStack ResourceGroupCreateOrUpdateDeploymentStack(
308308
string parameterUri,
309309
Hashtable parameters,
310310
string description,
311-
string updateBehavior
311+
string updateBehavior,
312+
string deploymentScope
312313
)
313314
{
314315
var deploymentStackModel = new DeploymentStack
315316
{
316317
Description = description,
317-
UpdateBehavior = updateBehavior
318+
UpdateBehavior = updateBehavior,
319+
DeploymentScope = deploymentScope
318320
};
319321

320322
DeploymentStacksTemplateLink templateLink = new DeploymentStacksTemplateLink();
@@ -440,14 +442,16 @@ public PSDeploymentStack SubscriptionCreateOrUpdateDeploymentStack(
440442
string parameterUri,
441443
Hashtable parameters,
442444
string description,
443-
string updateBehavior
444-
)
445+
string updateBehavior,
446+
string deploymentScope
447+
)
445448
{
446449
var deploymentStackModel = new DeploymentStack
447450
{
448451
Description = description,
449452
Location = location,
450-
UpdateBehavior = updateBehavior
453+
UpdateBehavior = updateBehavior,
454+
DeploymentScope = deploymentScope
451455
};
452456

453457
DeploymentStacksTemplateLink templateLink = new DeploymentStacksTemplateLink();

0 commit comments

Comments
 (0)