Microsoft

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!

BizTalk Server Performance Tips: #2 – Auto Growth

What’s so important about “Auto Growth”?

Firstly, let’s explore what it is and why it happens.

Auto-growth is an operation by which SQL Server expands the size of a database file (could be either the data file or the transaction log) when it runs out of space. How much depends on the settings that you have chosen; or if you’ve done no changes (which many don’t do), the default values of 1MB for data files and 10% for the log file. The growth settings available to choose for the files from are:-

  1. They can grow by a specific size
  2. Grow based on a percentage of the current size
  3. Not grow at all
  4. Unrestricted growth
  5. Set the growth of a database file to grow no larger than a specified size.

SQL Server, during the auto-growth operation, will block all current transactions until it completes the operation. If SQL Server is asking for a 1MB extension, that won’t take long. But imagine how long it will take if SQL Server was requesting for 2GB disk space?

On top of that, you need to understand that this disk space will not be contiguous (i.e., it won’t be physically right next to the existing database space), but instead will be somewhere else on the disk. You’re introducing disk fragmentation which will slow down SQL Server due to extra number of disk reads and writes that will now be necessary to support BizTalk. The more auto-growth operations you have, the more disk fragmentation!

That’s the theory, now let’s move onto what I reckon should be done and why.

1) Pre-size your BizTalk databases

You need to pre-size your databases so auto-growth is a contingency, not an expected behaviour.

Tim Form, a SQL Server MVP, believes that three years worth of transactions would be the basis of sizing your databases files. He even believes that auto growth is #10 of the Top 13 SQL Server Mistakes and Missteps

2) Pre-define the auto-growth setting for your data and transaction log files

Database auto-growth for both data and transaction log files should be set to 100MB instead of 1MB and 10% (respectively).

So, putting these together is very well summed up in the Microsoft BizTalk Performance Optimisation Guide. The guide states:

  • BizTalk DTADB (BizTalk Tracking database files): Data file having a file size of 2048 MB with 100 MB growth and a log file of 1024 MB with 100 MB growth.
  • BizTalkMgmtdb (BizTalk Management database files): Data file having a file size of 512 MB with 100 MB growth and a log file of 512 MB with 100 MB growth.
  • SSODB: Data file having a file size of 512 MB with 100 MB growth and a log file of 512 MB with 100 MB growth.
  • BizTalkMsgBoxDb (BizTalk MessageBox databases): 8 data files, each having a file size of 2 GB with 100 MB growth and a log file of 20 GB with 100 MB growth.

AutoGrowthSizeExample

Here’s a screenshot of the database properties of the BizTalkDTADb with the guidelines in place.

Until next tip… be good!

Microsoft SecondShot offer

Microsoft are still offering for you to get a second shot at your Microsoft Certification for free. The Second Shot offer is available from September 1, 2013, to May 31, 2014.

Second Shot is available for the regular-priced individual technical exams with a prefix of 070 or 071, and for the Microsoft Technology Associate (MTA) certification exams administered through Prometric.

Go to http://www.microsoft.com/learning/secondshot for the details