visual-studio-codeazure-logic-appsazureservicebusazure-functions-core-toolsazure-logic-app-standard

VSCode Logic App func.exe Service Bus Transport Type


Can i change the Azure Service Bus transport type used by func?

I ran c:\Users\xxxx.azurelogicapps\dependencies\FuncCoreTools\func host start --verbose

and I observed the following in the output:

[2024-05-16T12:41:47.806Z] ServiceBusOptions
[2024-05-16T12:41:47.808Z] {
[2024-05-16T12:41:47.808Z]   "ClientRetryOptions": {
[2024-05-16T12:41:47.809Z]     "Mode": "Exponential",
[2024-05-16T12:41:47.809Z]     "TryTimeout": "00:01:00",
[2024-05-16T12:41:47.810Z]     "Delay": "00:00:00.8000000",
[2024-05-16T12:41:47.810Z]     "MaxDelay": "00:01:00",
[2024-05-16T12:41:47.811Z]     "MaxRetries": 3
[2024-05-16T12:41:47.811Z]   },
[2024-05-16T12:41:47.812Z]   "TransportType": "AmqpTcp",
[2024-05-16T12:41:47.812Z]   "WebProxy": "",
[2024-05-16T12:41:47.813Z]   "AutoCompleteMessages": true,
[2024-05-16T12:41:47.813Z]   "PrefetchCount": 0,
[2024-05-16T12:41:47.814Z]   "MaxAutoLockRenewalDuration": "00:05:00",
[2024-05-16T12:41:47.814Z]   "MaxConcurrentCalls": 128,
[2024-05-16T12:41:47.815Z]   "MaxConcurrentSessions": 8,
[2024-05-16T12:41:47.815Z]   "MaxConcurrentCallsPerSession": 1,
[2024-05-16T12:41:47.816Z]   "MaxMessageBatchSize": 1000,
[2024-05-16T12:41:47.816Z]   "MinMessageBatchSize": 1,
[2024-05-16T12:41:47.817Z]   "MaxBatchWaitTime": "00:00:30",
[2024-05-16T12:41:47.817Z]   "SessionIdleTimeout": "",
[2024-05-16T12:41:47.818Z]   "EnableCrossEntityTransactions": false
[2024-05-16T12:41:47.818Z] }

Note "TransportType": "AmqpTcp".

I know our corporate firewall will not allow traffic on 5671,5672 but is OK with 443.

Ultimately i want to run a Logic App in VSCode (which uses fun.exe) Is there a way I can configure the transport type used by func (in VSCode) to use AMQP over web sockets i.e. port 443?


Solution

  • You can set the value of TransportType in host.json file as shown below.

    {
      "version": "2.0",
      "logging": {
        "applicationInsights": {
          "samplingSettings": {
            "isEnabled": true,
            "excludedTypes": "Request"
          },
          "enableLiveMetricsFilters": true
        }
      },
      "concurrency": {
        "dynamicConcurrencyEnabled": true,
        "snapshotPersistenceEnabled": true
      },
      "extensions": {
        "serviceBus": {
          "transportType": "amqpWebSockets"
        }
      }
    }
    

    In order to set the port, you need to use webProxy in host.json.

    "extensions": {
        "serviceBus": {
          "transportType": "amqpWebSockets",
          "webProxy": "<proxy address and port>"
        }
      }
    

    I am getting below output.

    enter image description here

    Please refer to the MS Doc to know more about the host.json settings.