Why custom .net activity in azure data factory never finishes

973 views Asked by At

I have followed several tutorials, and actually had other activities running in azure data factory. Now, this one in particular doesn't perform any action and yet it never finishes processing. In the activity window, attempts, it shows the status: Running (0% complete).

I am looking at a reason and also, at understanding how does one know what is going on at this stage for the activity. Is there a way to debug this things? I will include the source code, i'm sure is possible I am missing something:

   public class MoveBlobsToSQLActivity : IDotNetActivity
{
    public IDictionary<string, string> Execute(
               IEnumerable<LinkedService> linkedServices, IEnumerable<Dataset> datasets, Activity activity, IActivityLogger logger)
    {
        logger.Write("Start");

        //Get extended properties
        DotNetActivity dotNetActivityPipeline = (DotNetActivity)activity.TypeProperties;

        string sliceStartString = dotNetActivityPipeline.ExtendedProperties["SliceStart"];

        //Get linked service details
        Dataset inputDataset = datasets.Single(dataset => dataset.Name == activity.Inputs.Single().Name);
        Dataset outputDataset = datasets.Single(dataset => dataset.Name == activity.Outputs.Single().Name);

        /*
            DO STUFF
        */

        logger.Write("End");

        return new Dictionary<string, string>();
    }
}

Update 1:

After finding this post and following the instructions on the github repo I was able to debug my activity.

It was erroring out here Dataset inputDataset = datasets.Single(dataset => dataset.Name == activity.Inputs.Single().Name); and I would have expected it to finish execution with an error, but in the debugger, it kept going and going to the same result until the pipeline timed out. Weird. Removed the error but still the pipeline never finishes although the debugger does now :(.

Update 2:

Not sure that the data factory is using in any way my code from the custom activity. I made changes: nothing, I deleted the zip file with the code: nothing, just says the activity is running. Nothing seems to change even if the supposed code is no longer there. I am assuming it is cached somewhere.

1

There are 1 answers

3
Charles Gu On

Could you share me the ADF runId, we can take a look what happen there. For your local test (#1), it is also strange for me. It should not hang there. Btw, I think re-deploy pipeline will cancel the run and start new run with new properties. :)