Skip to content

Commit a36114f

Browse files
author
Hovsep
committed
Merge pull request #2205 from TianoMS/tiano-d2
Use backoff delay for New-AzureRmResourceGroupDeployment query calls
2 parents be2a4ad + e173851 commit a36114f

File tree

4 files changed

+85
-14
lines changed

4 files changed

+85
-14
lines changed

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Resource/NewAzureResourceCmdlet.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,18 @@ public sealed class NewAzureResourceCmdlet : ResourceManipulationCmdletBase
5656
/// <summary>
5757
/// Gets or sets the plan object.
5858
/// </summary>
59+
[Alias("PlanObject")]
5960
[Parameter(Mandatory = false, HelpMessage = "A hash table which represents resource plan properties.")]
6061
[ValidateNotNullOrEmpty]
61-
public Hashtable PlanObject { get; set; }
62+
public Hashtable Plan { get; set; }
6263

6364
/// <summary>
64-
/// Gets or sets the plan object.
65+
/// Gets or sets the Sku object.
6566
/// </summary>
67+
[Alias("SkuObject")]
6668
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "A hash table which represents sku properties.")]
6769
[ValidateNotNullOrEmpty]
68-
public Hashtable SkuObject { get; set; }
69-
70+
public Hashtable Sku { get; set; }
7071

7172
/// <summary>
7273
/// Gets or sets the tags.
@@ -142,8 +143,8 @@ private Resource<JToken> GetResource()
142143
{
143144
Location = this.Location,
144145
Kind = this.Kind,
145-
Plan = this.PlanObject.ToDictionary(addValueLayer: false).ToJson().FromJson<ResourcePlan>(),
146-
Sku = this.SkuObject.ToDictionary(addValueLayer: false).ToJson().FromJson<ResourceSku>(),
146+
Plan = this.Plan.ToDictionary(addValueLayer: false).ToJson().FromJson<ResourcePlan>(),
147+
Sku = this.Sku.ToDictionary(addValueLayer: false).ToJson().FromJson<ResourceSku>(),
147148
Tags = TagsHelper.GetTagsDictionary(this.Tag),
148149
Properties = this.Properties.ToResourcePropertiesBody(),
149150
};

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Resource/SetAzureResourceCmdlet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public sealed class SetAzureResourceCmdlet : ResourceManipulationCmdletBase
5454
public Hashtable Plan { get; set; }
5555

5656
/// <summary>
57-
/// Gets or sets the plan object.
57+
/// Gets or sets the Sku object.
5858
/// </summary>
5959
[Alias("SkuObject")]
6060
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "A hash table which represents sku properties.")]

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Microsoft.Azure.Commands.ResourceManager.Cmdlets.dll-Help.xml

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,12 +2167,19 @@
21672167
<command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
21682168
</command:parameter>
21692169
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
2170-
<maml:name>PlanObject</maml:name>
2170+
<maml:name>Plan</maml:name>
21712171
<maml:description>
21722172
<maml:para>A hash table which represents resource plan properties.</maml:para>
21732173
</maml:description>
21742174
<command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue>
21752175
</command:parameter>
2176+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
2177+
<maml:name>Sku</maml:name>
2178+
<maml:description>
2179+
<maml:para>A hash table which represents sku properties.</maml:para>
2180+
</maml:description>
2181+
<command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue>
2182+
</command:parameter>
21762183
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named">
21772184
<maml:name>Tag</maml:name>
21782185
<maml:description>
@@ -2282,12 +2289,19 @@
22822289
<command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
22832290
</command:parameter>
22842291
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
2285-
<maml:name>PlanObject</maml:name>
2292+
<maml:name>Plan</maml:name>
22862293
<maml:description>
22872294
<maml:para>A hash table which represents resource plan properties.</maml:para>
22882295
</maml:description>
22892296
<command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue>
22902297
</command:parameter>
2298+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
2299+
<maml:name>Sku</maml:name>
2300+
<maml:description>
2301+
<maml:para>A hash table which represents sku properties.</maml:para>
2302+
</maml:description>
2303+
<command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue>
2304+
</command:parameter>
22912305
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named">
22922306
<maml:name>Tag</maml:name>
22932307
<maml:description>
@@ -2425,12 +2439,19 @@
24252439
<command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
24262440
</command:parameter>
24272441
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
2428-
<maml:name>PlanObject</maml:name>
2442+
<maml:name>Plan</maml:name>
24292443
<maml:description>
24302444
<maml:para>A hash table which represents resource plan properties.</maml:para>
24312445
</maml:description>
24322446
<command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue>
24332447
</command:parameter>
2448+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
2449+
<maml:name>Sku</maml:name>
2450+
<maml:description>
2451+
<maml:para>A hash table which represents sku properties.</maml:para>
2452+
</maml:description>
2453+
<command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue>
2454+
</command:parameter>
24342455
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named">
24352456
<maml:name>Tag</maml:name>
24362457
<maml:description>
@@ -2586,7 +2607,7 @@
25862607
</dev:defaultValue>
25872608
</command:parameter>
25882609
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
2589-
<maml:name>PlanObject</maml:name>
2610+
<maml:name>Plan</maml:name>
25902611
<maml:description>
25912612
<maml:para>A hash table which represents resource plan properties.</maml:para>
25922613
</maml:description>
@@ -2598,6 +2619,19 @@
25982619
<dev:defaultValue>
25992620
</dev:defaultValue>
26002621
</command:parameter>
2622+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
2623+
<maml:name>Sku</maml:name>
2624+
<maml:description>
2625+
<maml:para>A hash table which represents sku properties.</maml:para>
2626+
</maml:description>
2627+
<command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue>
2628+
<dev:type>
2629+
<maml:name>Hashtable</maml:name>
2630+
<maml:uri />
2631+
</dev:type>
2632+
<dev:defaultValue>
2633+
</dev:defaultValue>
2634+
</command:parameter>
26012635
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named">
26022636
<maml:name>Tag</maml:name>
26032637
<maml:description>
@@ -4988,6 +5022,13 @@
49885022
</maml:description>
49895023
<command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue>
49905024
</command:parameter>
5025+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
5026+
<maml:name>Sku</maml:name>
5027+
<maml:description>
5028+
<maml:para>A hash table which represents sku properties.</maml:para>
5029+
</maml:description>
5030+
<command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue>
5031+
</command:parameter>
49915032
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
49925033
<maml:name>Tag</maml:name>
49935034
<maml:description>
@@ -5096,6 +5137,13 @@
50965137
</maml:description>
50975138
<command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue>
50985139
</command:parameter>
5140+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
5141+
<maml:name>Sku</maml:name>
5142+
<maml:description>
5143+
<maml:para>A hash table which represents sku properties.</maml:para>
5144+
</maml:description>
5145+
<command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue>
5146+
</command:parameter>
50995147
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
51005148
<maml:name>Tag</maml:name>
51015149
<maml:description>
@@ -5232,6 +5280,13 @@
52325280
</maml:description>
52335281
<command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue>
52345282
</command:parameter>
5283+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
5284+
<maml:name>Sku</maml:name>
5285+
<maml:description>
5286+
<maml:para>A hash table which represents sku properties.</maml:para>
5287+
</maml:description>
5288+
<command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue>
5289+
</command:parameter>
52355290
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
52365291
<maml:name>Tag</maml:name>
52375292
<maml:description>
@@ -5386,6 +5441,19 @@
53865441
<dev:defaultValue>
53875442
</dev:defaultValue>
53885443
</command:parameter>
5444+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
5445+
<maml:name>Sku</maml:name>
5446+
<maml:description>
5447+
<maml:para>A hash table which represents sku properties.</maml:para>
5448+
</maml:description>
5449+
<command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue>
5450+
<dev:type>
5451+
<maml:name>Hashtable</maml:name>
5452+
<maml:uri />
5453+
</dev:type>
5454+
<dev:defaultValue>
5455+
</dev:defaultValue>
5456+
</command:parameter>
53895457
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
53905458
<maml:name>Tag</maml:name>
53915459
<maml:description>

src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,16 +325,18 @@ private DeploymentExtended WaitDeploymentStatus(
325325
params string[] status)
326326
{
327327
DeploymentExtended deployment;
328+
int counter = 0;
328329

329330
do
330331
{
332+
TestMockSupport.Delay(counter);
333+
331334
if (job != null)
332335
{
333336
job(resourceGroup, deploymentName, basicDeployment);
334-
}
335-
337+
}
336338
deployment = ResourceManagementClient.Deployments.Get(resourceGroup, deploymentName).Deployment;
337-
TestMockSupport.Delay(10000);
339+
counter = counter + 5000 > 60000 ? 60000 : counter + 5000;
338340

339341
} while (!status.Any(s => s.Equals(deployment.Properties.ProvisioningState, StringComparison.OrdinalIgnoreCase)));
340342

0 commit comments

Comments
 (0)