logicapps: Getting CallBackUrl for container throws nullreference exception

When i try to get the callbackUrl according this step in the wiki by doing this

POST /runtime/webhooks/flow/api/management/workflows/{workflowName}/triggers/{triggerName}/ listCallbackUrl?api-version=2019-10-01-edge-preview&code=<MASTER_KEY>

it results in a 500 error

Docker logs is showing this

fail: Host.Triggers.Workflows[22] Error message: subscriptionId='myedgeenvironment', correlationId='dc9f60f8-4c8b-40e7-a0c3-06e94c5f7ac6', principalOid='', principalPuid='(null)', tenantId='myedgeenvironment-tenantId', operationName='POST/RUNTIME/FLOW/MANAGEMENT/DEMOLOGICAPP/MANUAL/', message='Http request failed with unhandled exception of type 'NullReferenceException' and message: 'System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Azure.Workflows.Data.Engines.FlowUriTemplateEngine.GetRelativePathTriggerDirectApiUri(Uri endpoint, String apiVersion, String scaleUnit, String flowId, String flowName, String triggerName) at Microsoft.Azure.Workflows.Data.Definitions.CallbackUrlDefinition.GetTriggerCallbackUrlDefinition(Uri endpoint, String apiVersion, FlowAccessKey flowAccessKey, AccessKeyType keyType, Flow flow, String triggerName, String relativePath, FlowHttpMethod triggerHttpMethod, Nullable1 expirationTime, String flowSequenceId) at Microsoft.Azure.Workflows.Web.Common.RequestHandlers.FlowTriggerApiRequestHandler.GetCallbackUrl(FlowContext context, String flowVersion, String triggerName) at Microsoft.Azure.Workflows.Web.Controllers.EdgeFlowTriggerController.ListCallbackUrl(String flowName, String triggerName, CancellationToken cancellationToken) at Microsoft.Azure.Workflows.Web.FlowExtensionRouteInitializer.Invoke(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Azure.Workflows.Web.Handlers.FlowExtensionHttpRequestHandler.HandleRequest(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Azure.Workflows.Web.Handlers.FlowExtensionRequestCancellationHandler.HandleRequest(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Azure.Workflows.Web.Handlers.FlowExtensionAuthorizationHandler.HandleRequest(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Azure.Workflows.Web.Handlers.FlowExtensionErrorResponseHandler.HandleRequest(HttpRequestMessage request, CancellationToken cancellationToken)‘.’, exception='System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Azure.Workflows.Data.Engines.FlowUriTemplateEngine.GetRelativePathTriggerDirectApiUri(Uri endpoint, String apiVersion, String scaleUnit, String flowId, String flowName, String triggerName) at Microsoft.Azure.Workflows.Data.Definitions.CallbackUrlDefinition.GetTriggerCallbackUrlDefinition(Uri endpoint, String apiVersion, FlowAccessKey flowAccessKey, AccessKeyType keyType, Flow flow, String triggerName, String relativePath, FlowHttpMethod triggerHttpMethod, Nullable1 expirationTime, String flowSequenceId) at Microsoft.Azure.Workflows.Web.Common.RequestHandlers.FlowTriggerApiRequestHandler.GetCallbackUrl(FlowContext context, String flowVersion, String triggerName) at Microsoft.Azure.Workflows.Web.Controllers.EdgeFlowTriggerController.ListCallbackUrl(String flowName, String triggerName, CancellationToken cancellationToken) at Microsoft.Azure.Workflows.Web.FlowExtensionRouteInitializer.Invoke(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Azure.Workflows.Web.Handlers.FlowExtensionHttpRequestHandler.HandleRequest(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Azure.Workflows.Web.Handlers.FlowExtensionRequestCancellationHandler.HandleRequest(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Azure.Workflows.Web.Handlers.FlowExtensionAuthorizationHandler.HandleRequest(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Azure.Workflows.Web.Handlers.FlowExtensionErrorResponseHandler.HandleRequest(HttpRequestMessage request, CancellationToken cancellationToken)', organizationId='(null)', activityVector='IN.04', realPuid='', altSecId='', additionalProperties='(null)'.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (14 by maintainers)

Most upvoted comments

Ok I’ve managed to figure it out!

When calling following URL (which requires a POST instead of GET?):

http://localhost:8080/runtime/webhooks/flow/api/management/workflows/StatefulSample/triggers/manual/listCallbackUrl?api-version=2019-10-01-edge-preview&code=<code>

The result gave me all the info to call it:

{
  "value": "https://localhost:443/api/StatefulSample/triggers/manual/invoke?api-version=2020-05-01-preview&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=<code>",
  "method": "POST",
  "basePath": "https://localhost/api/StatefulSample/triggers/manual/invoke",
  "queries": {
    "api-version": "2020-05-01-preview",
    "sp": "/triggers/manual/run",
    "sv": "1.0",
    "sig": "<sig>"
  }
}

Once that info was mapped to my container it was working, for example:

http://localhost:8080/api/StatefulSample/triggers/manual/invoke?api-version=2020-05-01-preview&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=<code>

@rohithah Can you please update the wiki to reflect this along with the ENV AZURE_FUNCTIONS_ENVIRONMENT Development for others to avoid this issue please?

Or let us help with PRs 😃 (#140)

Sorry for the delay in getting this resolved. The issue was that the function runtime needed the WEBSITE_HOSTNAME environment variable to be pointing to the host name of the container endpoint.

for example, running your container like below should fix this issue. (will have a tracking bug to surface the right error in this case)

docker run -e WEBSITE_HOSTNAME=localhost -p 8080:80 local/workflowcontainer1

Any update on this? It’s blocking us a bit to proceed on our end.

/cc @MattFarm