@@ -1251,11 +1251,10 @@ public NodeConfigurationDeployment StartNodeConfigurationDeployment(string resou
1251
1251
Requires . Argument ( "NodeConfiguraionName" , nodeConfiguraionName ) . NotNullOrEmpty ( ) . ValidNodeConfigurationName ( ) ;
1252
1252
1253
1253
const string runbookName = "Deploy-NodeConfigurationToAutomationDscNodesV1" ;
1254
+ System . Guid jobId = System . Guid . NewGuid ( ) ;
1254
1255
1255
- IDictionary < string , string > processedParameters =
1256
- this . ProcessRunbookParameters ( BuildParametersForNodeConfigurationDeploymentRunbook ( ) ,
1257
- ProcessParametersFornodeConfigurationRunbook ( resourceGroupName , automationAccountName ,
1258
- nodeConfiguraionName , nodeNames ) ) ;
1256
+ IDictionary < string , string > processedParameters = this . ProcessRunbookParameters ( BuildParametersForNodeConfigurationDeploymentRunbook ( ) ,
1257
+ ProcessParametersFornodeConfigurationRunbook ( jobId , resourceGroupName , automationAccountName , nodeConfiguraionName , nodeNames ) ) ;
1259
1258
1260
1259
JobSchedule jobSchedule = null ;
1261
1260
Job job = null ;
@@ -1265,7 +1264,7 @@ public NodeConfigurationDeployment StartNodeConfigurationDeployment(string resou
1265
1264
job = this . automationManagementClient . Job . Create (
1266
1265
resourceGroupName ,
1267
1266
automationAccountName ,
1268
- new Guid ( ) . ToString ( ) ,
1267
+ jobId . ToString ( ) ,
1269
1268
new JobCreateParameters
1270
1269
{
1271
1270
Runbook = new RunbookAssociationProperty
@@ -1280,7 +1279,7 @@ public NodeConfigurationDeployment StartNodeConfigurationDeployment(string resou
1280
1279
jobSchedule = this . automationManagementClient . JobSchedule . Create (
1281
1280
resourceGroupName ,
1282
1281
automationAccountName ,
1283
- new Guid ( ) ,
1282
+ jobId ,
1284
1283
new JobScheduleCreateParameters
1285
1284
{
1286
1285
Schedule = new ScheduleAssociationProperty { Name = schedule . Name } ,
@@ -1592,7 +1591,7 @@ private Model.JobStream CreateJobStreamFromJobStreamModel(AutomationManagement.M
1592
1591
return new Model . JobStream ( jobStream , resourceGroupName , automationAccountName , jobId ) ;
1593
1592
}
1594
1593
1595
- private IDictionary < string , object > ProcessParametersFornodeConfigurationRunbook ( string resourceGroup ,
1594
+ private IDictionary < string , object > ProcessParametersFornodeConfigurationRunbook ( System . Guid jobId , string resourceGroup ,
1596
1595
string automationAccountName , string nodeConfigurationName , string [ ] [ ] nodeNames , int waitingPeriod = 0 ,
1597
1596
int numberOfAttempts = 0 )
1598
1597
{
@@ -1604,6 +1603,7 @@ private IDictionary<string, object> ProcessParametersFornodeConfigurationRunbook
1604
1603
parameters . Add ( "AutomationAccountName" , automationAccountName ) ;
1605
1604
parameters . Add ( "NodeConfigurationName" , nodeConfigurationName ) ;
1606
1605
parameters . Add ( "ListOfNodeNames" , nodeNames ) ;
1606
+ parameters . Add ( "Id" , jobId . ToString ( ) ) ;
1607
1607
}
1608
1608
catch ( JsonSerializationException )
1609
1609
{
@@ -1629,44 +1629,51 @@ private IEnumerable<KeyValuePair<string, RunbookParameter>> BuildParametersForNo
1629
1629
{
1630
1630
var paramsForRunbook = new List < KeyValuePair < string , RunbookParameter > >
1631
1631
{
1632
- new KeyValuePair < string , RunbookParameter > ( "ResourceGroupName " , new RunbookParameter
1632
+ new KeyValuePair < string , RunbookParameter > ( "Id " , new RunbookParameter
1633
1633
{
1634
1634
IsMandatory = true ,
1635
1635
Position = 0 ,
1636
1636
DefaultValue = "" ,
1637
+ Type = "System.Guid"
1638
+ } ) ,
1639
+ new KeyValuePair < string , RunbookParameter > ( "ResourceGroupName" , new RunbookParameter
1640
+ {
1641
+ IsMandatory = true ,
1642
+ Position = 1 ,
1643
+ DefaultValue = "" ,
1637
1644
Type = "System.String"
1638
1645
} ) ,
1639
1646
new KeyValuePair < string , RunbookParameter > ( "AutomationAccountName" , new RunbookParameter
1640
1647
{
1641
1648
IsMandatory = true ,
1642
- Position = 1 ,
1649
+ Position = 2 ,
1643
1650
DefaultValue = "" ,
1644
1651
Type = "System.String"
1645
1652
} ) ,
1646
1653
new KeyValuePair < string , RunbookParameter > ( "NodeConfigurationName" , new RunbookParameter
1647
1654
{
1648
1655
IsMandatory = true ,
1649
- Position = 2 ,
1656
+ Position = 3 ,
1650
1657
DefaultValue = "" ,
1651
1658
Type = "System.String"
1652
1659
} ) ,
1653
1660
new KeyValuePair < string , RunbookParameter > ( "ListOfNodeNames" , new RunbookParameter
1654
1661
{
1655
1662
IsMandatory = true ,
1656
- Position = 3 ,
1663
+ Position = 4 ,
1657
1664
Type = "System.Array"
1658
1665
} ) ,
1659
1666
new KeyValuePair < string , RunbookParameter > ( "WaitingPeriod" , new RunbookParameter
1660
1667
{
1661
1668
IsMandatory = false ,
1662
- Position = 4 ,
1669
+ Position = 5 ,
1663
1670
DefaultValue = "60" ,
1664
1671
Type = "System.Int32"
1665
1672
} ) ,
1666
1673
new KeyValuePair < string , RunbookParameter > ( "NumberOfTriesPerGroup" , new RunbookParameter
1667
1674
{
1668
1675
IsMandatory = false ,
1669
- Position = 5 ,
1676
+ Position = 6 ,
1670
1677
DefaultValue = "100" ,
1671
1678
Type = "System.Int32"
1672
1679
} )
0 commit comments