Skip to content

Commit 38d8421

Browse files
committed
Enable verbose dpeloyment operation logging and make it best effort
1 parent 0380907 commit 38d8421

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/Resources/ResourceManager/SdkClient/DeploymentStacksSdkClient.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
using Microsoft.Rest.Azure;
2121
using System.Threading.Tasks;
2222
using ProjectResources = Microsoft.Azure.Commands.ResourceManager.Cmdlets.Properties.Resources;
23-
using Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels.DeploymentStacks;
2423
using Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels.Deployments;
2524
using System.Net;
25+
using System.Threading;
2626

2727
namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkClient
2828
{
@@ -795,8 +795,6 @@ Func<Task<AzureOperationResponse<DeploymentStack>>> GetStackAction(string stackN
795795
}
796796
}
797797

798-
//verboseLoggingStuff - subject to change
799-
800798
private DeploymentStack PollDeployments(DeploymentStack stack)
801799
{
802800
string deploymentId = stack.DeploymentId;
@@ -805,16 +803,20 @@ private DeploymentStack PollDeployments(DeploymentStack stack)
805803
parameters.ResourceGroupName = ResourceIdUtility.GetResourceGroupName(deploymentId);
806804
parameters.ManagementGroupId = ResourceIdUtility.GetManagementGroupId(deploymentId);
807805
if (parameters.ResourceGroupName != null)
808-
{
809806
parameters.ScopeType = DeploymentScopeType.ResourceGroup;
810-
ResourceManagerSdkClient.ProvisionDeploymentStatus(parameters, new Deployment()); //Only called for RG at this time to avoid replication issues
811-
}
812807
else if (parameters.ManagementGroupId != null)
813808
parameters.ScopeType = DeploymentScopeType.ManagementGroup;
814809
else
815810
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+
}
818820
return stack;
819821
}
820822

0 commit comments

Comments
 (0)