20
20
using Microsoft . Rest . Azure ;
21
21
using System . Threading . Tasks ;
22
22
using ProjectResources = Microsoft . Azure . Commands . ResourceManager . Cmdlets . Properties . Resources ;
23
- using Microsoft . Azure . Commands . ResourceManager . Cmdlets . SdkModels . DeploymentStacks ;
24
23
using Microsoft . Azure . Commands . ResourceManager . Cmdlets . SdkModels . Deployments ;
25
24
using System . Net ;
25
+ using System . Threading ;
26
26
27
27
namespace Microsoft . Azure . Commands . ResourceManager . Cmdlets . SdkClient
28
28
{
@@ -795,8 +795,6 @@ Func<Task<AzureOperationResponse<DeploymentStack>>> GetStackAction(string stackN
795
795
}
796
796
}
797
797
798
- //verboseLoggingStuff - subject to change
799
-
800
798
private DeploymentStack PollDeployments ( DeploymentStack stack )
801
799
{
802
800
string deploymentId = stack . DeploymentId ;
@@ -805,16 +803,20 @@ private DeploymentStack PollDeployments(DeploymentStack stack)
805
803
parameters . ResourceGroupName = ResourceIdUtility . GetResourceGroupName ( deploymentId ) ;
806
804
parameters . ManagementGroupId = ResourceIdUtility . GetManagementGroupId ( deploymentId ) ;
807
805
if ( parameters . ResourceGroupName != null )
808
- {
809
806
parameters . ScopeType = DeploymentScopeType . ResourceGroup ;
810
- ResourceManagerSdkClient . ProvisionDeploymentStatus ( parameters , new Deployment ( ) ) ; //Only called for RG at this time to avoid replication issues
811
- }
812
807
else if ( parameters . ManagementGroupId != null )
813
808
parameters . ScopeType = DeploymentScopeType . ManagementGroup ;
814
809
else
815
810
parameters . ScopeType = DeploymentScopeType . Subscription ;
816
- //Enable when deploymentOperations can be fetched for all scopes and not just RG
817
- //resourceManagerSdkClient.ProvisionDeploymentStatus(parameters, new Deployment());
811
+ WriteVerbose ( "Starting DeploymentOperations polling" ) ;
812
+ try
813
+ {
814
+ ResourceManagerSdkClient . ProvisionDeploymentStatus ( parameters , new Deployment ( ) ) ;
815
+ }
816
+ catch ( Exception )
817
+ {
818
+ WriteVerbose ( "DeploymentOperations polling failed" ) ;
819
+ }
818
820
return stack ;
819
821
}
820
822
0 commit comments