Logic Apps

More output detail needed in the retries history in Logic App runs history

Some feedback for the Azure Logic Apps product team…

I have defined a custom retry policy on in my Logic App to retry four times at twenty second intervals. The retries history for an execution of a connector is shown in the “raw output” blade something like this..

"retryHistory": [
 {
 "startTime": "2017-05-10T18:36:30.5791892Z",
 "endTime": "2017-05-10T18:36:33.1109529Z",
 "code": "BadGateway",
 "clientRequestId": "c81917d5-964c-4230-bc39-516df18dc055",
 "serviceRequestId": "c81917d5-964c-4230-bc39-516df18dc055"
 },
 {
 "startTime": "2017-05-10T18:36:53.6442386Z",
 "endTime": "2017-05-10T18:36:56.3362655Z",
 "code": "BadGateway",
 "clientRequestId": "ddf44a88-d0df-4ec7-a177-40138ce8ea4d",
 "serviceRequestId": "ddf44a88-d0df-4ec7-a177-40138ce8ea4d"
 },
 {
 "startTime": "2017-05-10T18:37:16.5762731Z",
 "endTime": "2017-05-10T18:37:19.248291Z",
 "code": "BadGateway",
 "clientRequestId": "e19871e7-746a-41bd-a8f0-0e176138b39f",
 "serviceRequestId": "e19871e7-746a-41bd-a8f0-0e176138b39f"
 },
 {
 "startTime": "2017-05-10T18:37:39.6648436Z",
 "endTime": "2017-05-10T18:37:41.9461642Z",
 "code": "BadGateway",
 "clientRequestId": "58ae54b4-0d34-4296-afca-0c6e2896633c",
 "serviceRequestId": "58ae54b4-0d34-4296-afca-0c6e2896633c"
 }
 ]

In my particular case, the first call actually managed to create the record in the downstream system. However, an error was returned to the Logic App.

It would be nice if the retries history contained the error information for each retry as it does for the body of the output. For example, the retries history could look like this…

"retryHistory": [
 {
 "startTime": "2017-05-10T18:36:30.5791892Z",
 "endTime": "2017-05-10T18:36:33.1109529Z",
 "code": "BadGateway",
 "clientRequestId": "c81917d5-964c-4230-bc39-516df18dc055",
 "serviceRequestId": "c81917d5-964c-4230-bc39-516df18dc055",
 "status": 502, 
 "message": "{\r\n \"code\": \"\",\r\n \"message\": \"This is the 
error message\",\r\n \"innererror\": {\r\n \"message\": \"This is the
inner error message\",\r\n \"type\": \"
System.ServiceModel.FaultException`1
[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, 
Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]\",
\r\n \"stacktrace\": \" at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Create(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Dictionary`2 optionalParameters)\\r\\n at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Create(Entity entity)\\r\\n at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.CreateEdmEntity(CrmODataExecutionContext context, String edmEntityName, EdmEntityObject entityObject, Boolean isUpsert)\\r\\n at Microsoft.Crm.Extensibility.OData.EntityController.PostEntitySet(String entitySetName, EdmEntityObject entityObject)\\r\\n at lambda_method(Closure , Object , Object[] )\\r\\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\\r\\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\\r\\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\"\r\n }\r\n}", 
 "source": "organisation123.api.crm6.dynamics.com", 
 "errors": []
 },
 {
 "startTime": "2017-05-10T18:36:53.6442386Z",
 "endTime": "2017-05-10T18:36:56.3362655Z",
 "code": "BadGateway",
 "clientRequestId": "ddf44a88-d0df-4ec7-a177-40138ce8ea4d",
 "serviceRequestId": "ddf44a88-d0df-4ec7-a177-40138ce8ea4d",
 "status": 502, 
 "message": "{\r\n \"code\": \"\",\r\n \"message\": \"This is the 
error message\",\r\n \"innererror\": {\r\n \"message\": \"This is the
inner error message\",\r\n \"type\": \"
System.ServiceModel.FaultException`1
[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, 
Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]\",
\r\n \"stacktrace\": \" at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Create(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Dictionary`2 optionalParameters)\\r\\n at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Create(Entity entity)\\r\\n at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.CreateEdmEntity(CrmODataExecutionContext context, String edmEntityName, EdmEntityObject entityObject, Boolean isUpsert)\\r\\n at Microsoft.Crm.Extensibility.OData.EntityController.PostEntitySet(String entitySetName, EdmEntityObject entityObject)\\r\\n at lambda_method(Closure , Object , Object[] )\\r\\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\\r\\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\\r\\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\"\r\n }\r\n}", 
 "source": "organisation123.api.crm6.dynamics.com", 
 "errors": []
 },
 {
 "startTime": "2017-05-10T18:37:16.5762731Z",
 "endTime": "2017-05-10T18:37:19.248291Z",
 "code": "BadGateway",
 "clientRequestId": "e19871e7-746a-41bd-a8f0-0e176138b39f",
 "serviceRequestId": "e19871e7-746a-41bd-a8f0-0e176138b39f",
 "status": 502, 
 "message": "{\r\n \"code\": \"\",\r\n \"message\": \"This is the 
error message\",\r\n \"innererror\": {\r\n \"message\": \"This is the
inner error message\",\r\n \"type\": \"
System.ServiceModel.FaultException`1
[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, 
Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]\",
\r\n \"stacktrace\": \" at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Create(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Dictionary`2 optionalParameters)\\r\\n at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Create(Entity entity)\\r\\n at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.CreateEdmEntity(CrmODataExecutionContext context, String edmEntityName, EdmEntityObject entityObject, Boolean isUpsert)\\r\\n at Microsoft.Crm.Extensibility.OData.EntityController.PostEntitySet(String entitySetName, EdmEntityObject entityObject)\\r\\n at lambda_method(Closure , Object , Object[] )\\r\\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\\r\\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\\r\\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\"\r\n }\r\n}", 
 "source": "organisation123.api.crm6.dynamics.com", 
 "errors": [] },
 {
 "startTime": "2017-05-10T18:37:39.6648436Z",
 "endTime": "2017-05-10T18:37:41.9461642Z",
 "code": "BadGateway",
 "clientRequestId": "58ae54b4-0d34-4296-afca-0c6e2896633c",
 "serviceRequestId": "58ae54b4-0d34-4296-afca-0c6e2896633c",
 "status": 502, 
 "message": "{\r\n \"code\": \"\",\r\n \"message\": \"This is the 
error message\",\r\n \"innererror\": {\r\n \"message\": \"This is the
inner error message\",\r\n \"type\": \"
System.ServiceModel.FaultException`1
[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, 
Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]\",
\r\n \"stacktrace\": \" at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Create(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Dictionary`2 optionalParameters)\\r\\n at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Create(Entity entity)\\r\\n at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.CreateEdmEntity(CrmODataExecutionContext context, String edmEntityName, EdmEntityObject entityObject, Boolean isUpsert)\\r\\n at Microsoft.Crm.Extensibility.OData.EntityController.PostEntitySet(String entitySetName, EdmEntityObject entityObject)\\r\\n at lambda_method(Closure , Object , Object[] )\\r\\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\\r\\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\\r\\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\"\r\n }\r\n}", 
 "source": "organisation123.api.crm6.dynamics.com", 
 "errors": [] }
 ] 

 

Until next tip… be good!

Advertisements

Logic Apps and the Succeeded Terminate Action

More and more of my integration efforts are centring around the use of Logic Apps on the Azure platform.

Logic Apps offers a great number of connectors to perform calls to external services such as Dynamics CRM, Office 365, Slack and the list goes on. A full list can be found on the following link … Azure Logic Apps Connectors

My client had a particular requirement which basically stated that if a value existing in a certain field, then the workflow should not proceed any further. And the subsequence of this was that the Logic App had to terminate “successfully” (i.e., “Succeeded”, not “Failed” nor “Cancelled”).

The Logic Apps designer allows you to add the Terminate Control action simply by searching for “terminate” when adding your action. 

At the time of authoring this blog post (Edit: I started writing this blog post on 3rd April, but had not published it! Apologies if this led to confusion that I wrote this in May), you could not select “Succeeded” in the designer. You had to switch to Code View and set the properties correctly by changing “Failed” to “Succeeded” AND by removing the result code too!

Thanks to the constant updates by the Logic Apps team, this issue has been fixed and is a just memory …

Until next tip… be good!