Azure Logic Apps Running Anywhere: Built-in connector extensibility
Published Nov 21 2020 11:08 PM 27K Views
Microsoft

Logic Apps connectors provide quick access from Logic Apps to events, data, and actions across other apps, services, systems, protocols, and platforms. By using connectors in your logic apps, you expand the capabilities for your cloud and on-premises apps to perform tasks with the data that you create and already have. Azure Logic Apps connectors are powered by the connector infrastructure that runs in Azure. A workflow running on the new runtime can use these connectors by creating a connection, an Azure resource that provides access to these connectors.

A key capability in the redesigned Logic Apps runtime introduces the extensibility to add built-in connectors. These built-in connectors are hosted in the same process as the Logic App runtime and it provides higher throughput, low latency, and local connectivity. The connection definition file also contains the required configuration information for connecting through these built-in connectors. The preview release comes with the built-in connectors for Azure Service Bus, Azure Event Hub and SQL Server. The extensibility framework that these connectors are built on can be used to build custom built-in connectors to any other service that you need.

In this blog post, I am showing how we can leverage this extensibility framework to create a built-in  CosmosDB connector with a trigger and no actions. In this example, whenever the new document is added in the lease collection or container of Cosmos DB, the Logic Apps trigger will fire and execute the Logic App with the input payload as Cosmos document. This built-in connector leverages the functionality of Azure function capability for Cosmos DB trigger based upon the Azure Function trigger binding. In general, you can add any action or function trigger as part of your own built-in connectors. Currently trigger capabilities are limited to Azure Function specific triggers only, in future the Logic app will support non-Azure function triggers also.

 

Built-in connector plugin model

The Logic Apps built-in connector extensibility model leverages the Azure Functions extensibility model to enable adding built-in connector implementations like Azure Functions extensions. This allows developers to write their connectors as Azure Functions extensions, build and package them as a NuGet for anyone to consume.

There are mainly two operation parts that a developer would need to implement:

  • Operation Descriptions

Operation descriptions are metadata about the operations that the custom built-in connector implements. These are primarily used by the Logic Apps designer to drive the authoring and monitoring experience related to these connectors' operations. For example, designer uses operation descriptions to understand the input parameters required for a given operation as well as facilitate the generation of outputs property tokens based on the schema of the output of an operation.

  • Operation Invocations

Logic Apps runtime will use these implementations at runtime to invoke the specified operation in the workflow definition.

In order to hook up with function runtime the new built-in connector extension need to be registered with the Azure Function runtime extensions. The details are discussed later in this blog.

 

CosmosDB  Built-in Connector

Here in this sample connector, I am developing the CosmosDB built-in custom connector which has only one  trigger and no actions are available. The details of the operations are described below:

Logic App  Operation

Operation details

Description

Trigger

Receive Document

The trigger is invoked when there are inserts or updates in the specified database and collection of CosmosDB.

Action

-

No action operation are defined for this  connector

 

To develop your own built-in connector, you need to add the work flow webjob extension package. , I am creating the .NET Core 3.1 class library project in visual studio and added the Microsoft.Azure.Workflows.Webjobs.Extension package as Nuget reference to the project. The Service provider interface is implemented to provide the operations of the CosmosDB connector.  

 

Service Provider interface implementation

The webjob extension Nuget package which was added to the class library project provides the service provider interface IServiceOperationsTriggerProvider which needs to be implemented.

As part of operation description, the IServiceOperationsTriggerProvider interface provides methods GetService() and GetOperations() which are required to be implemented by the custom built-in connector. These operations are used by the logic app designer to describe the actions/triggers by the custom built-in connector on the logic app designer surface.  Please note that the GetService() method also specifies the connection parameters needed by the Logic app designer.

For action operation, you need to implement the InvokeActionOperation() method, which is invoked during the action execution. If you would like to use the Azure function binding for azure triggers, then you need to provide connection information and trigger bindings as needed by Azure function. There are two methods which need to be implemented for Azure function binding, GetBindingConnectionInformation() method which provides the connection information to the Azure function binding and GetTriggerType() which is same as “type” binding parameter for Azure function.

The picture below shows the implementation of methods as required by the Logic app designer and Logic app runtime.

 

praveensri_0-1627404407591.png

 

 

The details of the methods which are required to be implemented are tabulated below:

Operation Methods

Comments

Example

GetService()

This is needed by Logic app designer. This is the high-level description of your service, which includes the service descriptions, brand color, Icon URL, connection parameters and capabilities etc.

public ServiceOperationApi GetService()
{
  return this.CosmosDBApis.ServiceOperationServiceApi;
}

GetOperations()

This is needed by Logic app designer, to get the list of operations that your service has implemented. This is based upon a swagger schema.

public IEnumerable<ServiceOperation> GetOperations(bool expandManifest)
{
  return expandManifest ? serviceOperationsList : GetApiOperations();
}

InvokeOperation()

This is invoked for every action operation during runtime. Here you can use any client (FTPClient, HTTPClient etc..) as needed by your custom built-in connector actions. If you are just implementing the trigger as in this case, then you do not need to implement this method.

using (var client = new HttpClient())
{
  response = client.SendAsync(httpRequestMessage).ConfigureAwait(false).ToJObject();
 }
 return new ServiceOperationResponse(body: response);

GetBindingConnectionInformation()

These are the required connection parameters by trigger binding in case you are using the Azure function trigger type.

return ServiceOperationsProviderUtilities
                    .GetRequiredParameterValue(
                        serviceId: ServiceId,
                        operationId: operationId,
                        parameterName: "connectionString",
                        parameters: connectionParameters)?
                    .ToValue<string>();

 

GetFunctionTriggerType()

If you are using the Azure function built-in triggers as Logic App trigger, then you need to return the string which is same as type in Azure function trigger binding.

"type": "cosmosDBTrigger",

public string GetFunctionTriggerType(){
  return "CosmosDBTrigger";
}

 

Function Extensions and registration:

The function extension registration needs to be added as a startup job and register the service provider as part of service provider list, so that the built-in connector extension can be loaded during the function runtime start process.

Adding the converter is optional depending upon the type of data you need as an input to the built-in trigger. In this example I am converting the Document data type for Cosmos DB Documents to JObject array.

  • Create startup job: To register the custom built-in connector as function extension, you need to create a startup class using [assembly:WebJobsStartup] assembly attribute and implementing IWebJobsStartup interface, refer the function registration for more details. In the configure method you need to register the extension and inject the service provider as shown below:

 

 

 

 

    public class CosmosDbServiceProviderStartup : IWebJobsStartup
    {
        public void Configure(IWebJobsBuilder builder)
        {
            // Registering and extension
            builder.AddExtension<CosmosDbServiceProvider>();

            // DI the trigger service operation provider.
            builder.Services.TryAddSingleton<CosmosDbTriggerServiceOperationProvider>();
        }
    }

 

 

 

 

 

  • Register service provider: We need to register the service provider implementation as function extension. We are using the built-in Azure function Cosmos DB Trigger as a new trigger.  Here in this example, we register the new Cosmos DB service provider for an existing list of service providers which are already part of Logic App extension.

  

 

 

 

   [Extension("CosmosDbServiceProvider", configurationSection: "CosmosDbServiceProvider")]
   public class CosmosDbServiceProvider : IExtensionConfigProvider
   {
       public CosmosDbServiceProvider(ServiceOperationsProvider serviceOperationsProvider, CosmosDbTriggerServiceOperationProvider operationsProvider)
      {
            serviceOperationsProvider.RegisterService(ServiceName, ServiceId, operationsProvider);
      }
      public void Initialize(ExtensionConfigContext context)
      {
            // Converts Cosmos Document list to JObject array.
            context.AddConverter<IReadOnlyList<Document>, JObject[]>(ConvertDocumentToJObject);
      }
   }

 

 

 

 

  • Add Converter: Logic app has implemented the generic way to handle any function built-in trigger using the JObject array, we may need (optional) to add a converter to convert the read only list of Azure Cosmos DB document into JObject array. Once the converter is ready as shown in above example, we need to register the converter as part of ExtensionConfigContext.

 

 

 

 

// Converts Cosmos Document list to JObject array.
context.AddConverter<IReadOnlyList<Document>, JObject[]>(ConvertDocumentToJObject);

 

 

 

 

The complete implementation of all three classes as mentioned above are given in the following code map diagram.

CodeMap.JPG

 

Testing the built-in connector:

You need to update the extensions.json in extension bundle to add the above NuGet reference. You can refer the add-extension.ps1 script.

Update the extension bundle to include the custom built-in connector.

Create the Logic App project and install the extension package given below:

 

 

 

dotnet add package "Microsoft.Azure.Workflows.ServiceProvider.Extensions.CosmosDB" --version 1.0.0  --source $extensionPath

 

 

 

 

Alternatively, you can execute the PowerShell script add-extension.ps1 as given below in you Logic App project directory.

 

 

 

powershell -file add-extension.ps1 <CosmosDB output bin Nuget folder path> CosmosDB

 

 

praveensri_0-1617948468250.png

 

 

Once you open the workflow in designer (make sure you close any func.exe process in case if it already running before opening the designer), you should be able to see the newly added connector.

praveensri_2-1606030048844.png

 

You can now add connection string of Azure cosmos DB and add new document in the database under collection or lease collection to test the trigger by creating a simple logic app using the CosmosDB trigger.

Specifying the connection string.

praveensri_3-1606030048848.png

 

Specify the database name and collection name for the trigger.

praveensri_4-1606030048855.png

 

 

Execute F5 in VS code and invoke trigger by adding a new item using data explorer of your CosmosDB account as shown below to trigger the workflow.

praveensri_5-1606030048866.png

 

 

The sample code can be downloaded from the repository. 

https://github.com/Azure/logicapps-connector-extensions/tree/main/src/CosmosDB

29 Comments

Hi, 

there are 2 PS files in github I have run the deploy.ps1  that pointing to the Microsoft.Azure.Functions.ExtensionBundle.Workflows\1.1.3\bin\extensions.json

 

 

can you let me know how to do the next step? and what the path value (dll or json )

dotnet add package ServiceProviders.CosmosDb.Extensions --version 1.0.0 --source <ServiceProviders.CosmosDb.Extensions package path>

 

Microsoft

Mobarqaw, you can go ahead and update the deploy.ps1 script locally based upon extension bundle path on your machine. If you are executing the deploy.ps1 script then you need not to execute the dotnet add package explicitly - as it is taken care by the deployment script.

Copper Contributor

Is there a binary version somewhere for download ? Thanks.

Copper Contributor

Did anybody find out how to use this new Connector ? I was able to build it (after a LOT of things to resolve) but now I have NO idea how to use it. The deploy.ps1 has syntax errors ($typeFullName = "": "ServiceProviders.CosmosDb.Extensions.CosmosDbTriggerStartup, $fullAssemlyName") and there is no description at all what "--source <ServiceProviders.CosmosDb.Extensions package path>" should look like ?

Thanks.

Microsoft

@Fraggle ,

The binary for this custom connector is not released as we have shared the sample code for CosmosDB trigger which you can build locally and deploy. With the recent release of Azure Logic App Preview refresh, you can deploy the sample code on MacOS as well.  I think this will unblock you for not taking dependency upon the binary release and go ahead with deployment from MacOS box itself. The deploy.ps1 script mainly does two things :

  1. Update the local extension bundle to add the Nuget reference of custom connector so that the Logic App designer can pick up the custom connector as built-in connector.
  2. Add the custom connector Nuget reference to the Logic App project, so that runtime works fine.

Please make sure the deploy.ps1 refers the right path of extension bundle installed locally on your box and the FQN of custom connector required to update the extensions.json is proper. Once you completed the custom connector build it generates the Nuget package , you need to replace the Nuget package path with the  <ServiceProviders.CosmosDb.Extensions package path>.

HTH

Copper Contributor

I am getting the below error when opening the Logic Apps designer. Not really sure what is causing this issue. Could you please point me in the right direction?

 

[2020-12-17T14:27:58.316Z] A host error has occurred during startup operation '25bdd815-af37-4576-9a13-42a68c1e82a2'.
[2020-12-17T14:27:58.316Z] System.Private.CoreLib: Exception has been thrown by the target of an invocation. Microsoft.Azure.Workflows.ServiceProvider.Extensions.CosmosDB: The type initializer for 'ServiceProviders.CosmosDb.Extensions.CosmosDbTriggerServiceOperationProvider' threw an exception. Microsoft.Azure.Workflows.ServiceProvider.Extensions.CosmosDB: Method not found: 'Void Microsoft.Azure.Workflows.ServiceProviders.Abstractions.ServiceOperationApiProperties.set_ConnectionParameters(Microsoft.Azure.Workflows.ServiceProviders.Abstractions.ConnectionParameters)'.
Value cannot be null. (Parameter 'provider')
 
Below is the logs from the deploy script
 
Full assembly name + Microsoft.Azure.Workflows.ServiceProvider.Extensions.CosmosDB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c7c64cb54a897c02
ERROR: The process "func.exe" not found.
Writing C:\Users\Shankar Chandrasekar\AppData\Local\Temp\tmp5054.tmp
info : Adding PackageReference for package 'Microsoft.Azure.Workflows.ServiceProvider.Extensions.CosmosDB' into project 'C:\Shankar\LogicAppsNew\Test2\Test2.csproj'.
info : Restoring packages for C:\Shankar\LogicAppsNew\Test2\Test2.csproj...
info : Package 'Microsoft.Azure.Workflows.ServiceProvider.Extensions.CosmosDB' is compatible with all the specified frameworks in project 'C:\Shankar\LogicAppsNew\Test2\Test2.csproj'.
info : PackageReference for package 'Microsoft.Azure.Workflows.ServiceProvider.Extensions.CosmosDB' version '1.0.0' updated in file 'C:\Shankar\LogicAppsNew\Test2\Test2.csproj'.
info : Committing restore...
info : Assets file has not changed. Skipping assets file writing. Path: C:\Shankar\LogicAppsNew\Test2\obj\project.assets.json
log : Restore completed in 1.18 sec for C:\Shankar\LogicAppsNew\Test2\Test2.csproj.
Full assembly + Microsoft.Azure.Workflows.ServiceProvider.Extensions.CosmosDB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c7c64cb54a897c02
updating the extension folder extensions.json extensions.json
updating the extension file + C:\Shankar\LogicAppsNew\Test2\bin\Debug\netcoreapp3.1\bin\extensions.json
updating the extension file + C:\Shankar\LogicAppsNew\Test2\bin\output\bin\extensions.json
Successfully added extension..
 
Microsoft

Hi Shankar, 

The error you see is because the CosmosDB extension could not be loaded during func start, most likely the deploy.ps1 script is unable to add the extensions in the project file.  You can confirm this by looking into function log file. I have updated the deploy.ps1 script and Startup job. Can you refer the latest code and deployment script? Kindly Let me know if you still face the issue.

Thanks

Copper Contributor

@praveensri I have used reference git code to build the extension and able to successfully register it. But whenever I tried to run the function or deploy it. It is throwing error as below - 

A host error has occurred during startup operation '80edf427-43dd-46cf-aeff-16efc5b23ea3'.
[2021-02-22T17:55:46.853Z] Microsoft.Azure.Workflows.ServiceProvider.Extensions.CosmosDB: Method 'InvokeOperation' in type 'Microsoft.Azure.Workflows.ServiceProvider.Extensions.CosmosDB.CosmosDbServiceOperationProvider' from assembly 'Microsoft.Azure.Workflows.ServiceProvider.Extensions.CosmosDB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c7c64cb54a897c02' does not have an implementation.
Value cannot be null. (Parameter 'provider')

I have used deploy.ps1 to register the extension by running it inside my logic app preview root folder and able to see the extension.json reflect the details. - 

{
  "extensions": [
    :
:
    {
      "name": "WorkflowExtension",
      "typeName": "Microsoft.Azure.Workflows.WebJobs.Extensions.Initialization.WorkflowExtensionStartup, Microsoft.Azure.Workflows.WebJobs.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
      "bindings": null
    },
    {
      "name": "CosmosDBServiceProvider",
      "typeName": "Microsoft.Azure.Workflows.ServiceProvider.Extensions.CosmosDB.CosmosDBServiceProviderStartup, "
    }
  ]
}

Am I missing something?
 

Microsoft

@mansh34124 ,

Can you rename the method InvokeActionOperation(..) to InvokeOperation(..) in the class CosmosDbServiceOperationProvider?

Error: Method 'InvokeOperation' ... does not have an implementation

The method name is changed after I wrote the blog. I will update the GitHub sample code.

HTH,

Praveen

Copper Contributor

@praveensri  We cant rename the method name as it is coming via the interface IServiceOperationsTriggerProvider. I don't see any method with the name InvokeOperation in the referenced interface. 

 

Am I using some old library reference? Currently it is refering to nuget package -  Microsoft.Azure.Workflows.WebJobs.Extension" Version="1.0.0.9-preview"

Microsoft

@mansh34124 , Please upgrade the Nuget package to NuGet Gallery | Microsoft.Azure.Workflows.WebJobs.Extension 1.0.0.11-preview

Thanks,

Praveen

Copper Contributor

Thanks @praveensri  it resolved my issue.

Copper Contributor

Are there now different repos for this blog? I noticed that there are several links to "deploy.ps1" through out the article but the GitHub repository linked at the end of the article does not have this file. There is now a "add-extension.ps1" in its place.

 

Also, I can not get the new repository to deploy as the built NuGet packages for CosmosDB and ActiveMQ both rely on a common library that is not packaged, or deployed and is not included in the two parent packages.

 

Microsoft

@Boschy  Thanks for the feedback. I updated the deployment script link in the blog post and updated CosmosDB csproj file in github so that Nuget package generation will include the common library.

Copper Contributor

Thanks for the update @praveensri. I managed to get the Cosmos extension added to a logic apps standard csproj after a few more modifications.

 

I updated the Microsoft.Azure.Workflows.WebJobs.Extension version the projects reference to the latest version (1.1.4) as that's what the logic apps standard project references. I also had to run "dotnet add package Microsoft.Azure.Workflows.WebJobs.Extension" in the logic apps project folder before I could get the add-extension.ps1 script to run successfully. I assume that may be due to it being the first logic apps standard project I had created on this machine.

 

Now though, attempting to open a workflow in the designer results in the following error ...

 

Azure Functions Core Tools
Core Tools Version:       3.0.3568 Commit hash: e30a0ede85fd498199c28ad699ab2548593f759b  (64-bit)
Function Runtime Version: 3.0.15828.0

[2021-07-28T06:02:36.285Z] A host error has occurred during startup operation 'eb0edb82-5ec2-43dd-86fc-e96c50571974'.
[2021-07-28T06:02:36.285Z] System.Private.CoreLib: Exception has been thrown by the target of an invocation. Microsoft.Azure.Workflows.ServiceProvider.Extensions.CosmosDB: Could not load file or assembly 'Microsoft.Azure.Workflows.ServiceProvider.Extensions.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c7c64cb54a897c02'. The system cannot find the file specified.
Value cannot be null. (Parameter 'provider')
 
This implies that your common assembly can't be found, even though it is in the nuget package and is in the ".azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle.Workflows\1.1.19\bin" folder along with its CosmosDB parent assembly.
 
Any ideas?
Microsoft

@Boschy Looks like Nuget cache issue in you local Nuget packages folder.  Can you clean up your Microsoft.Azure.Workflows.ServiceProvider.Extensions.CosmosDB Nuget package from your local Nuget folder ( e.,g, C:\users\<userprofile>\.nuget\.. )?

Kindly re-add the Nuget package using "dotnet add package.." as mentioned in the blog post?

Copper Contributor

@praveensri, you were right in that my Nuget cache was old. I have now cleaned that up and rerun the package add so my cache now has the package containing the common dll. However that wasn't the end of the issue. The Microsoft.Azure.Workflows.ServiceProvider.Extensions.Common dll is not being copied to the extensions bin folder at the end of the add-extensions.ps1 script (in the "# 3. update dll in extension module." step). After I copied the common dll in to the bin folder it all works correctly and I can now see the Cosmos Db connector in the workflow designer.

 

 

Copper Contributor

Hi @praveensri 

 

I am trying to add a custom built in connector that I have made but, regardless, it would be the same if I was trying to add the CosmosDB one mentioned in the article.

 

The add-extensions.ps1 appears to refer to a path /Users/{userId}/.azure-functions-core-tools/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle.Workflows which doesn't appear to be there on my machine (I am on a Mac). 

 

I am a bit confused about what this is doing.

 

In general, one area of confusion I have is where the LogicAppsDesigner is installed and how that operates.

 

Thanks

Iain

 

Copper Contributor

Hi Praveen,

 

i was able to successfully register the extension as in the screen attached, and i have made sure that no func.exe is running. but then when i open my logic app and try to find the cosmosdb connector i don't see it getting listed. 

 

can you please guide me if i am missing anything here.

 

Arihantjain_0-1634516510602.png

 

Copper Contributor

Hi @praveensri , managed to register the extension and I can now see the extension in the designer. However, after I configured and started debugging, I got the following error

 

[2021-10-27T16:54:48.911Z] The 'Stateful1' function is in error: The binding type(s) 'cosmosDBTrigger' were not found in the configured extension bundle. Please ensure the type is correct and the correct version of extension bundle is configured.

 

I am not sure what is missing. Below is the full logs. 

 

C:\Shankar\Projects\LACustomConnector>func host start --verbose

%%%%%%
%%%%%%
@ %%%%%% @
@@ %%%%%% @@
@@@ %%%%%%%%%%% @@@
@@ %%%%%%%%%% @@
@@ %%%% @@
@@ %%% @@
@@ %% @@
%%
%


Azure Functions Core Tools
Core Tools Version: 3.0.3477 Commit hash: 5fbb9a76fc00e4168f2cc90d6ff0afe5373afc6d (64-bit)
Function Runtime Version: 3.0.15584.0

[2021-10-27T16:54:44.902Z] Building host: startup suppressed: 'False', configuration suppressed: 'False', startup operation id: '197bacbe-451f-435b-a1cf-11d018a40145'
[2021-10-27T16:54:44.922Z] Reading host configuration file 'C:\Shankar\Projects\LACustomConnector\host.json'
[2021-10-27T16:54:44.926Z] Host configuration file read:
[2021-10-27T16:54:44.929Z] {
[2021-10-27T16:54:44.931Z] "version": "2.0",
[2021-10-27T16:54:44.935Z] "extensionBundle": {
[2021-10-27T16:54:44.940Z] "id": "Microsoft.Azure.Functions.ExtensionBundle.Workflows",
[2021-10-27T16:54:44.945Z] "version": "[1.*, 2.0.0)"
[2021-10-27T16:54:44.950Z] }
[2021-10-27T16:54:44.956Z] }
[2021-10-27T16:54:44.984Z] Loading functions metadata
[2021-10-27T16:54:45.030Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:java
[2021-10-27T16:54:45.044Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:powershell
[2021-10-27T16:54:45.052Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:python
[2021-10-27T16:54:45.062Z] Reading functions metadata
[2021-10-27T16:54:45.075Z] 0 functions found
[2021-10-27T16:54:45.108Z] 0 functions loaded
[2021-10-27T16:54:45.117Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle.Workflows at C:\Users\Shankar Chandrasekar\.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle.Workflows
[2021-10-27T16:54:45.128Z] Found a matching extension bundle at C:\Users\Shankar Chandrasekar\.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle.Workflows\1.1.25
[2021-10-27T16:54:45.136Z] Fetching information on versions of extension bundle Microsoft.Azure.Functions.ExtensionBundle.Workflows available on https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle...] Skipping bundle download since it already exists at path C:\Users\Shankar Chandrasekar\.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle.Workflows\1.1.25
[2021-10-27T16:54:45.411Z] Loading extension bundle from C:\Users\Shankar Chandrasekar\.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle.Workflows\1.1.25\bin
[2021-10-27T16:54:45.418Z] Loading startup extension 'EventHubs'
[2021-10-27T16:54:45.452Z] Loaded extension 'EventHubs' (4.1.1.0)
[2021-10-27T16:54:45.490Z] Loading startup extension 'AzureStorage'
[2021-10-27T16:54:45.497Z] Loaded extension 'AzureStorage' (4.0.4.0)
[2021-10-27T16:54:45.504Z] Loading startup extension 'ServiceBus'
[2021-10-27T16:54:45.512Z] Loaded extension 'ServiceBus' (4.3.0.0)
[2021-10-27T16:54:45.518Z] Loading startup extension 'AzureBlobServiceProvider'
[2021-10-27T16:54:45.525Z] Loaded extension 'AzureBlobServiceProvider' (0.0.0.0)
[2021-10-27T16:54:45.532Z] Loading startup extension 'DB2ServiceProvider'
[2021-10-27T16:54:45.539Z] Loaded extension 'DB2ServiceProvider' (1.0.0.0)
[2021-10-27T16:54:45.545Z] Loading startup extension 'EventHubsServiceProvider'
[2021-10-27T16:54:45.551Z] Loaded extension 'EventHubsServiceProvider' (1.0.0.0)
[2021-10-27T16:54:45.558Z] Loading startup extension 'HostFileServiceProvider'
[2021-10-27T16:54:45.565Z] Loaded extension 'HostFileServiceProvider' (1.0.0.0)
[2021-10-27T16:54:45.571Z] Loading startup extension 'MqServiceProvider'
[2021-10-27T16:54:45.580Z] Loaded extension 'MqServiceProvider' (1.0.0.0)
[2021-10-27T16:54:45.587Z] Loading startup extension 'ServiceBusServiceProvider'
[2021-10-27T16:54:45.595Z] Loaded extension 'ServiceBusServiceProvider' (1.0.0.0)
[2021-10-27T16:54:45.602Z] Loading startup extension 'SqlServiceProvider'
[2021-10-27T16:54:45.608Z] Loaded extension 'SqlServiceProvider' (1.0.0.0)
[2021-10-27T16:54:45.614Z] Loading startup extension 'WorkflowExtension'
[2021-10-27T16:54:45.620Z] Loaded extension 'WorkflowExtension' (1.0.0.0)
[2021-10-27T16:54:45.627Z] Loading startup extension 'CosmosDbServiceProvider'
[2021-10-27T16:54:45.633Z] Loaded extension 'CosmosDbServiceProvider' (1.0.0.0)
[2021-10-27T16:54:45.644Z] Reading host configuration file 'C:\Shankar\Projects\LACustomConnector\host.json'
[2021-10-27T16:54:45.649Z] Host configuration file read:
[2021-10-27T16:54:45.655Z] {
[2021-10-27T16:54:45.660Z] "version": "2.0",
[2021-10-27T16:54:45.665Z] "extensionBundle": {
[2021-10-27T16:54:45.670Z] "id": "Microsoft.Azure.Functions.ExtensionBundle.Workflows",
[2021-10-27T16:54:45.675Z] "version": "[1.*, 2.0.0)"
[2021-10-27T16:54:45.679Z] }
[2021-10-27T16:54:45.684Z] }
[2021-10-27T16:54:46.050Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:java
[2021-10-27T16:54:46.055Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:powershell
[2021-10-27T16:54:46.059Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:python
[2021-10-27T16:54:46.734Z] Initializing Warmup Extension.
[2021-10-27T16:54:47.419Z] Initializing Host. OperationId: '197bacbe-451f-435b-a1cf-11d018a40145'.
[2021-10-27T16:54:47.432Z] Host initialization: ConsecutiveErrors=0, StartupCount=1, OperationId=197bacbe-451f-435b-a1cf-11d018a40145[2021-10-27T16:54:47.455Z] LoggerFilterOptions
[2021-10-27T16:54:47.459Z] {
[2021-10-27T16:54:47.461Z] "MinLevel": "None",
[2021-10-27T16:54:47.463Z] "Rules": [
[2021-10-27T16:54:47.466Z] {
[2021-10-27T16:54:47.470Z] "ProviderName": null,
[2021-10-27T16:54:47.473Z] "CategoryName": null,
[2021-10-27T16:54:47.476Z] "LogLevel": null,
[2021-10-27T16:54:47.479Z] "Filter": "<AddFilter>b__0"
[2021-10-27T16:54:47.481Z] },
[2021-10-27T16:54:47.484Z] {
[2021-10-27T16:54:47.487Z] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2021-10-27T16:54:47.491Z] "CategoryName": null,
[2021-10-27T16:54:47.494Z] "LogLevel": "None",
[2021-10-27T16:54:47.497Z] "Filter": null
[2021-10-27T16:54:47.499Z] },
[2021-10-27T16:54:47.502Z] {
[2021-10-27T16:54:47.506Z] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2021-10-27T16:54:47.509Z] "CategoryName": null,
[2021-10-27T16:54:47.512Z] "LogLevel": null,
[2021-10-27T16:54:47.516Z] "Filter": "<AddFilter>b__0"
[2021-10-27T16:54:47.519Z] },
[2021-10-27T16:54:47.523Z] {
[2021-10-27T16:54:47.526Z] "ProviderName": "Azure.Functions.Cli.Diagnostics.ColoredConsoleLoggerProvider",
[2021-10-27T16:54:47.529Z] "CategoryName": null,
[2021-10-27T16:54:47.531Z] "LogLevel": null,
[2021-10-27T16:54:47.535Z] "Filter": "<AddFilter>b__0"
[2021-10-27T16:54:47.538Z] }
[2021-10-27T16:54:47.542Z] ]
[2021-10-27T16:54:47.545Z] }
[2021-10-27T16:54:47.549Z] LoggerFilterOptions
[2021-10-27T16:54:47.552Z] {
[2021-10-27T16:54:47.556Z] "MinLevel": "None",
[2021-10-27T16:54:47.559Z] "Rules": [
[2021-10-27T16:54:47.562Z] {
[2021-10-27T16:54:47.565Z] "ProviderName": null,
[2021-10-27T16:54:47.568Z] "CategoryName": null,
[2021-10-27T16:54:47.572Z] "LogLevel": null,
[2021-10-27T16:54:47.575Z] "Filter": "<AddFilter>b__0"
[2021-10-27T16:54:47.578Z] },
[2021-10-27T16:54:47.581Z] {
[2021-10-27T16:54:47.584Z] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2021-10-27T16:54:47.588Z] "CategoryName": null,
[2021-10-27T16:54:47.592Z] "LogLevel": "None",
[2021-10-27T16:54:47.594Z] "Filter": null
[2021-10-27T16:54:47.598Z] },
[2021-10-27T16:54:47.601Z] {
[2021-10-27T16:54:47.605Z] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2021-10-27T16:54:47.608Z] "CategoryName": null,
[2021-10-27T16:54:47.612Z] "LogLevel": null,
[2021-10-27T16:54:47.615Z] "Filter": "<AddFilter>b__0"
[2021-10-27T16:54:47.618Z] },
[2021-10-27T16:54:47.622Z] {
[2021-10-27T16:54:47.624Z] "ProviderName": "Azure.Functions.Cli.Diagnostics.ColoredConsoleLoggerProvider",
[2021-10-27T16:54:47.628Z] "CategoryName": null,
[2021-10-27T16:54:47.631Z] "LogLevel": null,
[2021-10-27T16:54:47.635Z] "Filter": "<AddFilter>b__0"
[2021-10-27T16:54:47.638Z] }
[2021-10-27T16:54:47.642Z] ]
[2021-10-27T16:54:47.645Z] }
[2021-10-27T16:54:47.648Z] FunctionResultAggregatorOptions
[2021-10-27T16:54:47.652Z] {
[2021-10-27T16:54:47.655Z] "BatchSize": 1000,
[2021-10-27T16:54:47.658Z] "FlushTimeout": "00:00:30",
[2021-10-27T16:54:47.662Z] "IsEnabled": true
[2021-10-27T16:54:47.666Z] }
[2021-10-27T16:54:47.670Z] SingletonOptions
[2021-10-27T16:54:47.673Z] {
[2021-10-27T16:54:47.676Z] "LockPeriod": "00:00:15",
[2021-10-27T16:54:47.679Z] "ListenerLockPeriod": "00:00:15",
[2021-10-27T16:54:47.682Z] "LockAcquisitionTimeout": "10675199.02:48:05.4775807",
[2021-10-27T16:54:47.685Z] "LockAcquisitionPollingInterval": "00:00:05",
[2021-10-27T16:54:47.688Z] "ListenerLockRecoveryPollingInterval": "00:01:00"
[2021-10-27T16:54:47.692Z] }
[2021-10-27T16:54:47.696Z] QueuesOptions
[2021-10-27T16:54:47.699Z] {
[2021-10-27T16:54:47.702Z] "BatchSize": 16,
[2021-10-27T16:54:47.706Z] "NewBatchThreshold": 64,
[2021-10-27T16:54:47.709Z] "MaxPollingInterval": "00:00:02",
[2021-10-27T16:54:47.712Z] "MaxDequeueCount": 5,
[2021-10-27T16:54:47.715Z] "VisibilityTimeout": "00:00:00"
[2021-10-27T16:54:47.717Z] }
[2021-10-27T16:54:47.719Z] BlobsOptions
[2021-10-27T16:54:47.723Z] {
[2021-10-27T16:54:47.726Z] "CentralizedPoisonQueue": false
[2021-10-27T16:54:47.730Z] }
[2021-10-27T16:54:47.733Z] ServiceBusOptions
[2021-10-27T16:54:47.737Z] {
[2021-10-27T16:54:47.741Z] "PrefetchCount": 0,
[2021-10-27T16:54:47.744Z] "MessageHandlerOptions": {
[2021-10-27T16:54:47.747Z] "AutoComplete": true,
[2021-10-27T16:54:47.750Z] "MaxAutoRenewDuration": "00:05:00",
[2021-10-27T16:54:47.754Z] "MaxConcurrentCalls": 128
[2021-10-27T16:54:47.758Z] },
[2021-10-27T16:54:47.761Z] "SessionHandlerOptions": {
[2021-10-27T16:54:47.764Z] "AutoComplete": true,
[2021-10-27T16:54:47.766Z] "MaxAutoRenewDuration": "00:05:00",
[2021-10-27T16:54:47.767Z] "MaxConcurrentSessions": 2000,
[2021-10-27T16:54:47.768Z] "MessageWaitTimeout": "00:01:00"
[2021-10-27T16:54:47.770Z] },
[2021-10-27T16:54:47.771Z] "BatchOptions": {
[2021-10-27T16:54:47.772Z] "MaxMessageCount": 1000,
[2021-10-27T16:54:47.773Z] "OperationTimeout": "00:01:00",
[2021-10-27T16:54:47.775Z] "AutoComplete": true
[2021-10-27T16:54:47.776Z] }
[2021-10-27T16:54:47.778Z] }
[2021-10-27T16:54:47.780Z] EventHubOptions
[2021-10-27T16:54:47.781Z] {
[2021-10-27T16:54:47.782Z] "BatchCheckpointFrequency": 1,
[2021-10-27T16:54:47.783Z] "EventProcessorOptions": {
[2021-10-27T16:54:47.785Z] "EnableReceiverRuntimeMetric": false,
[2021-10-27T16:54:47.786Z] "InvokeProcessorAfterReceiveTimeout": false,
[2021-10-27T16:54:47.787Z] "MaxBatchSize": 10,
[2021-10-27T16:54:47.789Z] "PrefetchCount": 300,
[2021-10-27T16:54:47.790Z] "ReceiveTimeout": "00:01:00"
[2021-10-27T16:54:47.791Z] },
[2021-10-27T16:54:47.793Z] "PartitionManagerOptions": {
[2021-10-27T16:54:47.794Z] "LeaseDuration": "00:00:30",
[2021-10-27T16:54:47.795Z] "RenewInterval": "00:00:10"
[2021-10-27T16:54:47.796Z] }
[2021-10-27T16:54:47.797Z] }
[2021-10-27T16:54:47.801Z] Starting JobHost
[2021-10-27T16:54:47.804Z] Starting Host (HostId=desktop4hcgsld-1514621621, InstanceId=69edd4ec-2d4f-45ee-b1b1-bcc3f01562fb, Version=3.0.15584.0, ProcessId=21724, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null))
[2021-10-27T16:54:47.829Z] Loading functions metadata
[2021-10-27T16:54:47.832Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:java
[2021-10-27T16:54:47.834Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:powershell
[2021-10-27T16:54:47.836Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:python
[2021-10-27T16:54:47.838Z] Reading functions metadata
[2021-10-27T16:54:47.841Z] 0 functions found
[2021-10-27T16:54:48.215Z] Error message: correlationId='9e7501fe-ea12-46b3-961a-494df175d80c', operationName='SubscriptionExtensions.ToCachedSubscription', message='Resource provider namespace is empty for subscription 'myedgeenvironment'.', exception='<null>', organizationId='', activityVector='IN.02', additionalProperties='', extensionVersion='1.0.0.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='9e7501fe-ea12-46b3-961a-494df175d80c'.
[2021-10-27T16:54:48.476Z] 2 functions loaded
[2021-10-27T16:54:48.520Z] Generating 1 job function(s)
[2021-10-27T16:54:48.548Z] Found the following functions:
[2021-10-27T16:54:48.551Z] Host.Functions.WorkflowDispatcher
[2021-10-27T16:54:48.555Z]
[2021-10-27T16:54:48.584Z] HttpOptions
[2021-10-27T16:54:48.588Z] {
[2021-10-27T16:54:48.584Z] Initializing function HTTP routes
[2021-10-27T16:54:48.592Z] "DynamicThrottlesEnabled": false,
[2021-10-27T16:54:48.601Z] "EnableChunkedRequestBinding": false,
[2021-10-27T16:54:48.606Z] "MaxConcurrentRequests": -1,
[2021-10-27T16:54:48.596Z] No HTTP routes mapped
[2021-10-27T16:54:48.611Z] "MaxOutstandingRequests": -1,
[2021-10-27T16:54:48.622Z] "RoutePrefix": "api"
[2021-10-27T16:54:48.616Z]
[2021-10-27T16:54:48.627Z] }
[2021-10-27T16:54:48.650Z] Host initialized (823ms)
[2021-10-27T16:54:48.668Z] Service starting: serviceName='Microsoft-Azure-Workflows', name='', value='', version='1.0.0', message='Starting the worker app with environment name 'Flow function extension', Number of cores: '8'.Memory: '125845504'.', correlationId='',
organizationId='', activityVector='', additionalProperties='', extensionVersion='1.0.0.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='00000000-0000-0000-0000-000000000000'.

Functions:

WorkflowDispatcher: edgeWorkflowRuntimeTrigger

[2021-10-27T16:54:48.889Z] Service started: serviceName='Microsoft-Azure-Workflows', version='1.0.0', name='', value='', message='Started the worker app with environment name 'Flow function extension', Number of cores: '8'. Memory: '128901120'.', correlationId='', organizationId='', activityVector='', additionalProperties='', extensionVersion='1.0.0.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='00000000-0000-0000-0000-000000000000'.
[2021-10-27T16:54:48.898Z] Host started (1091ms)
[2021-10-27T16:54:48.900Z] Job host started
[2021-10-27T16:54:48.911Z] The 'Stateful1' function is in error: The binding type(s) 'cosmosDBTrigger' were not found in the configured extension bundle. Please ensure the type is correct and the correct version of extension bundle is configured.
[2021-10-27T16:54:54.040Z] Host lock lease acquired by instance ID '000000000000000000000000ABCFD64B'.

Copper Contributor

@Arihantjain Was your problem fixed? Are you able to see it under Built-In? Because even I am facing same issue.
@praveensri Even I am facing same issue. I get logs saying that "CosmosDB is successfully added.", but I am not seeing it in Logic app designer.

Copper Contributor

@praveensri I was able to fix above issue. I was able to run logic app locally with custom built connector.
But now I needed your help in deploying this to Azure Portal. I tried deploying logic app from VS code option "Deploy to Logic App", and I am able to see it on Azure portal. But custom connector is not accessible there. In workflow also where connector is used, it gives error "This API could not be found".

Copper Contributor

@praveensri,Created a custom connector using this article, please check out.

https://www.linkedin.com/feed/update/urn:li:activity:6909114022831304704/

 

 

Copper Contributor

@praveensri I have now successfully built a custom built-in connector and in runs perfectly in VS Code. I can use Postman to trigger the logic app and it successfully connects to the service I need and gets data.

However, when I deploy the logic app to Azure I get the following error showing up in the logs ...

2022-05-13T01:39:46.408 [Error] Workflow Error: operationName='WorkflowDefinitionProvider.ProcessWorkflow', message='Workflow 'AhpraValidation' validate and create workflow operation failed, the exception is 'The value '/serviceProviders/ahpraPie' provided for the 'serviceProviderConfiguration.serviceProviderId' for action 'Verify_an_AHPRA_identity' is not valid.'', exception='Microsoft.Azure.Workflows.Common.ErrorResponses.ErrorResponseMessageException: The value '/serviceProviders/ahpraPie' provided for the 'serviceProviderConfiguration.serviceProviderId' for action 'Verify_an_AHPRA_identity' is not valid.
   at Microsoft.Azure.Workflows.Data.Engines.EdgeFlowDefinitionValidationEngine.ValidateServiceProviderAction(String actionName, FlowTemplateAction action, InsensitiveDictionary`1 triggers)
   at Microsoft.Azure.Workflows.Data.Engines.EdgeFlowDefinitionValidationEngine.OnValidateFlowAction(FlowPropertiesDefinition definition, String flowName, String actionName, InsensitiveDictionary`1 parameterValues, FlowOperationConfiguration flowOperationConfiguration, Boolean hasOpenApiOperationInWorkflow, IntegrationAccount integrationAccount)
   at Microsoft.Azure.Workflows.Data.Engines.FlowDefinitionValidationEngine.ValidateFlowAction(FlowPropertiesDefinition definition, String flowName, String actionName, InsensitiveDictionary`1 parameterValues, Boolean hasOpenApiOperationInWorkflow, Nullable`1 flowKind, IntegrationAccount integrationAccount)
   at Microsoft.Azure.Workflows.Data.Engines.FlowDefinitionValidationEngine.ValidateFlowActions(FlowPropertiesDefinition definition, InsensitiveDictionary`1 parameterValues, String flowName, IntegrationAccount integrationAccount)
   at Microsoft.Azure.Workflows.Data.Engines.FlowDefinitionValidationEngine.ValidateFlowTemplate(FlowPropertiesDefinition definition, InsensitiveDictionary`1 templateParameters, String flowName, IntegrationAccount integrationAccount)
   at Microsoft.Azure.Workflows.Data.Engines.FlowDefinitionValidationEngine.ValidateFlow(String flowName, Flow existingFlow, FlowPropertiesDefinition definition, IntegrationAccount integrationAccount)
   at Microsoft.Azure.Workflows.Web.Engines.EdgeFlowWebManagementEngine.ValidateAndCreateFlow(String flowName, FlowPropertiesDefinition flowPropertiesDefinition)
   at Microsoft.WindowsAzure.ResourceStack.Common.Algorithms.AsyncRetry.Retry(Func`1 action, Int32 retryCount, TimeSpan retryInterval, CancellationToken cancellationToken, Nullable`1 retryTimeout, Func`2 isRetryable, Action`1 errorAction, Func`2 retryAfter)
   at Microsoft.WindowsAzure.ResourceStack.Common.Algorithms.AsyncRetry.Retry(Func`1 action, Int32 retryCount, TimeSpan retryInterval, CancellationToken cancellationToken, Nullable`1 retryTimeout, Func`2 isRetryable, Action`1 errorAction, Func`2 retryAfter)
   at Microsoft.Azure.Workflows.WebJobs.Extensions.Initialization.WorkflowFunctionDefinitionProvider.ProcessWorkflow(FlowFunction flowFunction, ConcurrentDictionary`2 flowsProcessed)', extensionVersion='1.0.0.0', siteName='ndss-dev-central-la-hp-portal', slotName='Production', activityId='a4af6daa-079d-447d-b420-844b330959eb'.
 
... and in the the connector shows the error "The API 'ahpraPie' could not be found."

Any ideas?
Microsoft

@Boschy If everything is working locally on VS Code surface it should work in Azure as well, from the error it seems the API is not located in the dlls, the most common reason is the Azure Logic App (check if it already created) refers the official extension bundle instead of your bits, check the app settings. The best thing is create a new Logic App when you deploy the app to Azure from VS. If you are using pre-existing Logic App then by default it refers the extension bundle. check the following app settings should not be there when you deploy from VS.

praveensri_0-1652544577683.png

 

Copper Contributor

@praveensri, you're a genius! That was the problem. Removing those two app settings has fixed the problem.

 

I deploy this function via Azure DevOps and can see those environment settings in my Bicep. I will be removing them on Monday morning. You have made my Sunday a better day. Thank you once again for your help.

Microsoft

Thanks a lot !  @Boschy 

Copper Contributor

@praveensri How to deploy the code to azure( custom connector ) and refer the same in azure logic app.

@NidhiSheth Were you able to deploy the custom connector

Thanks both of you in advance. It would be great, if you provide some articles to deploy the connector to azure and refer the same in azure logic apps.

 

Copper Contributor

Hi Praveen and team, I am not able to access the connectionstring in custom connector

Co-Authors
Version history
Last update:
‎Jul 27 2021 09:52 AM
Updated by: