2
votes

I have a azure data factory project.

I read the docs https://docs.microsoft.com/en-us/azure/data-factory/data-factory-use-custom-activities to add custom activities to one of my pipelines.

in the documentation said that you have to zip the dlls of your class library that represent the custom activities, and storage this zip in a azure blob.

and the definition of the pipeline are:

{
"name": "LoadFromOnerxSalesInvoicesRaw",
"properties": {
    "description": "Test Deserialize Sales Invoices Raw",
    "activities": [
      {
        "type": "DotNetActivity",
        "typeProperties": {
          "assemblyName": "BICodeActivities.dll",
          "entryPoint": "BICodeActivities.Activities.OneRx.DeserializeSalesInvoiceToLines",
          "packageLinkedService": "biCABlobLS",
          "packageFile": "bi-activities-container/BICodeActivities.zip",
          "extendedProperties": {
            "SliceStart": "$$Text.Format('{0:yyyyMMddHH-mm}', Time.AddMinutes(SliceStart, 0))"
          }
        },
        "inputs": [
          {
            "name": "o-staging-onerx-salesInvoices"
          }
        ],
        "outputs": [
          {
            "name": "o-staging-onerx-salesInvoicesLines"
          }
        ],
        "policy": {
          "timeout": "00:30:00",
          "concurrency": 2,
          "retry": 3
        },
        "scheduler": {
          "frequency": "Day",
          "interval": 1
        },
        "name": "DeserializeSalesInvoiceToLines",
        "linkedServiceName": "biBatchLS"
      },
      {
        "type": "DotNetActivity",
        "typeProperties": {
          "assemblyName": "BICodeActivities.dll",
          "entryPoint": "BICodeActivities.Activities.OneRx.DeserializeSalesInvoiceToDiscounts",
          "packageLinkedService": "biCABlobLS",
          "packageFile": "bi-activities-container/BICodeActivities.zip",
          "extendedProperties": {
            "SliceStart": "$$Text.Format('{0:yyyyMMddHH-mm}', Time.AddMinutes(SliceStart, 0))"
          }
        },
        "inputs": [
          {
            "name": "o-staging-onerx-salesInvoices"
          }
        ],
        "outputs": [
          {
            "name": "o-staging-onerx-salesInvoicesDiscounts"
          }
        ],
        "policy": {
          "timeout": "00:30:00",
          "concurrency": 2,
          "retry": 3
        },
        "scheduler": {
          "frequency": "Day",
          "interval": 1
        },
        "name": "DeserializeSalesInvoiceToDiscounts",
        "linkedServiceName": "biBatchLS"
      }
    ],
    "start": "2017-04-26T09:20:00Z",
    "end": "2018-04-26T22:30:00Z"
}

}

When set up this pipeline in my visual studio project and build i get an error "BICodeActivities.zip is not found in the solution".

I have to zip the dlls and add manually to the solution?, or i need to do something else?

1

1 Answers

1
votes

I'm assuming you have the custom acitivites as class library in the same solution as your data factory project.

If so, you simply need to reference the class library project in the data factory project. Right click > Add > Reference. Select the library project.

enter image description here

Once done, when you build the solution Visual Studio will handle the zipping of the DLL's for you and also add the ZIP folder as a dependency which will show in the publishing wizard to be deployed to the blob storage linked service.

For further support check out this blog post.

https://www.purplefrogsystems.com/paul/2016/11/creating-azure-data-factory-custom-activities/

Hope this helps.