Example #1
0
 public virtual ArmOperation Delete(bool waitForCompletion, CancellationToken cancellationToken = default)
 {
     using var scope = _deploymentScriptClientDiagnostics.CreateScope("DeploymentScript.Delete");
     scope.Start();
     try
     {
         var response  = _deploymentScriptRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
         var operation = new ResourcesArmOperation(response);
         if (waitForCompletion)
         {
             operation.WaitForCompletionResponse(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }