2013-11-19

Monitoring Biztalk

We do not have any fancy system monitoring tool, we still need to track if something is going wrong in BizTalk, to my experience it is most likely either suspended messages or a receive port that shuts down

The below script will check for that and send a mail alerting me about the status, not very fancy but it does the trick


-- Query if any messages are suspended

declare @Status int
declare @messages varchar(256)
declare @msgbody varchar(max)

select @messages = COUNT(*) from [dbo].[InstancesSuspended]

select @msgbody = 'There are ' + @messages + ' suspended messages' + CHAR(13)

if @messages != 0
begin

      exec sp_send_dbmail @profile_name ='ProfileName'
      ,@recipients = 'name@company.com'
      ,@subject ='Error in BizTalk application, Suspended messages'
      ,@body = @msgbody
end


-- Query for any receive ports that are disabled

declare @Status2 int
declare @ports varchar(256)
declare @msgbody2 varchar(max)

select @msgbody2 = 'The following receive ports are disabled:' + CHAR(13)

select @Status2 = COUNT(*) from [dbo].[adm_ReceiveLocation] where [Disabled] != 0
 

if @Status2 != 0

begin

declare port_cursor cursor FOR

select name from [dbo].[adm_ReceiveLocation] where [Disabled] != 0;

open port_cursor

      fetch next from port_cursor into @ports

            while @@FETCH_STATUS = 0
            begin
                  select @msgbody2 = @msgbody2 + @ports + CHAR(13)
                  fetch next from port_cursor into @ports;
            end

            close port_cursor;
            deallocate port_cursor;   

begin

      exec sp_send_dbmail @profile_name ='ProfileName'
      ,@recipients = 'name@company.com'
      ,@subject ='Error in BizTalk application, receive port(s) are disabled'
      ,@body = @msgbody2

end

end
 
I have put this script in a SQL job that runs every hour, that should do it.

2013-11-15

Deploying SSRS reports from AX 2012 R2


I have been tearing my hair out (I don’t ha have much) for the last couple of days trying to deploy reports to SSRS from the Dynamics AX 2012 R2 and having read all the tips on how to do that I finally managed to resolve the issue

The error messages are several, permission related but also more generic ones referring to the configuration of the SSRS.

There are many related threads on various forums covering several aspect of this but none that clearly states what finally resolved it for me.  The SSRS service account was setup as a BCproxy account, when running the Power Shell under the same account I was finally able to deploy my report. The command is:



publishAxreport -reportName salesInvocie –skipreportserveradmincheck

 
I still believe this should be possible to resolve without having to run the command under a different account. Probably somewhere on the SSRS this account will need additional permission, however I have tried giving my user account all possible permission without any luck... the search continue, at least this is an easy workaround.

EDIT: You have to run the power shell as admin for this to work.