Why IIS Application Pool automatically stopped when trying to browse or invoke BizTalk WCF Services?

Why IIS Application Pool automatically stopped when trying to browse or invoke BizTalk WCF Services?

This week I received a call of one of my customers reporting me a strange issue. Strange because everything was running fine and suddenly, for no apparent reason, each time someone tried to invoke or browse WCF Services exposed by BizTalk Server the IIS Application pool configured for that services automatically stopped.

If we tried to browse the services we got the following error message:

Login failed for user ‘Domain/user’
Exception Details: System.SqlClient.SqlException: Login failed for user ‘domain/user’

Application Pool automatically stopped : IIS Login failed for user

Of course, with that type of error description, the first step we did was to reenter the credentials for that user in the application pool but… the same problem persisted.

When we investigated the event viewer for additional error details we found in the Security log the following message:

Log Name:      Security
Source: Microsoft-Windows-Security-Auditing
Date: {date}
Event ID: 4625
Task Category: Logon
Level: Information
Keywords: Audit Failure
User: N/A
Computer: {machine name}
Description:
An account failed to log on.
Subject:
Security ID: SYSTEM
Account Name: {account name}
Account Domain: {domain name}
Logon ID: 0x3E7
Logon Type: 4
Account For Which Logon Failed:
Security ID: NULL SID
Account Name: {account name}
Account Domain: {domain name}
Failure Information:
Failure Reason: The user has not been granted the requested logon type at this machine.
Status: 0xC000015B
Sub Status: 0x0

Cause

So, at this point, we knew that this was a security policies problem and we suspect that some automatic process created by sysadmins where changings something in the Local Security Settings on the BizTalk Server machine.

After some research, we found out that the user account that is running the Application Pool – in which the BizTalk WCF Services are exposed – requires having “Log on as batch job” rights

Note: By definition, this security setting (Log on as a batch job), allows a user to be logged on by means of a batch-queue facility and is provided only for compatibility with older versions of Windows. For example, when a user submits a job by means of the task scheduler, the task scheduler logs that user on as a batch user rather than as an interactive user.

Solution

To add user rights in the “Log on as batch job” policy, you need to:

  • Press the “Windows key” to open the Start menu.
  • Type “secpol.msc” and click on “Local Security Policy” option from the Search window.
  • On the left pane, select “Local Policies” and the “User Rights Assignment”

Application Pool automatically stopped : Local Security Policy log on as a batch job

  • Right click on “Log on as batch job” and click Properties
  • Click “Add User or Group…” and add the desired user

Application Pool automatically stopped : Local Security Policy log on as a batch job Add User

  • Click “OK” and then “Apply”

Note: Of course, for you to do the above steps, you need to have administrator rights on the computer or be part of specific domain groups in case of Security Settings policies are governed by some AD domain groups.

Note: this problem can also occur and the same solution can be applied to SharePoint.

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community. View all posts by Sandro Pereira

XXVIII Porto.Data Community Meeting | February 28, 2017 | SharePoint, PowerApps & Microsoft Flow

XXVIII Porto.Data Community Meeting | February 28, 2017 | SharePoint, PowerApps & Microsoft Flow

This post is for the BizTalk Server and other Portuguese Community, will be held on February 28, 2017 between 18:45 – 21:30 the XXVIII Porto.Data Community meeting at the Science and Technology Park of University of Porto (UPTEC) in Oporto.

For me it is a pleasure to return once again to this community, this time with a topic about SharePoint, PowerApps and Microsoft Flow: “SharePoint integration: How can PowerApps and Microsoft Flow give power to your SharePoint users

Abstract

Every organization faces constant pressure to do more with less. While technology is often key to operating more effectively and efficiently, cost and complexity have often prevented organizations from taking maximum advantage of the potential benefits. The growth of SaaS (software as a service) has lowered barriers – no need to deploy servers or to install and configure complex software systems. Just sign up and go.

Microsoft Flow and Microsoft PowerApps will help these people (normally business users) achieve more.

We know not every business problem can be solved with off-the-shelf solutions. But developing custom solutions has traditionally been too costly and time consuming for many of the needs teams and departments face, especially those projects that integrate across multiple data sources or require delivery across multiple devices from desktop to mobile. As a result, too many technology needs end up unsolved or under-optimized. We piece together spreadsheets, email chains, SharePoint or/and manual processes to fill in the gaps.

PowerApps and Microsoft Flow are both aimed squarely at these gaps. They give people who best understand their needs and challenges the power to quickly meet them, without the time, complexity and cost of custom software development.

In this session, we will look at these two-new offering from Microsoft: PowerApps and Flow. What are day? How can I use it? But special we will walk through and create from scratch some live demos showing how to create a new PowerApp that connects to a list stored in SharePoint Online, or how to create a new Microsoft Flow that connects to a list stored in SharePoint Online.

Agenda

18:45 – Welcome reception

18:50 – Community News

19:00 – “Elasticsearch – First Glance” – Vitor Saraiva – Software Architect at Farfetch & Mário Barbosa – Engineering Lead at Farfetch

20:10 – Coffee break

20:30 – ” SharePoint integration: How can PowerApps and Microsoft Flow give power to your SharePoint users” – Sandro Pereira – Azure MVP – DevScope

21:15 – Closure

21:20 – Prize draw

21:30 – Dinner (optional)

This is a free event with very limited vacancies that you will not want to miss, register now!

Join us and come to spend a different carnival night! We are waiting for you.

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community. View all posts by Sandro Pereira

Azure Logic Apps–Deleting Items From SharePoint (Online) List

Azure Logic Apps–Deleting Items From SharePoint (Online) List

 I have a scenario at work where we need to provide some simple syncronization between a SQL Azure table and a SharePoint Online Custom List. As a pre-requisite each morning before business users get into the office, we need to purge the contents from the SharePoint list and update it with today’s data + a 6 day forecast of future data.

I have integrated  BizTalk with custom SharePoint Lists in the past, and even wrote about it in one of my books. It wasn’t a particularly good experience so I was interested in evaluating how Logic Apps would deal with custom lists. 

One difference between BizTalk and Logic Apps, in this case, is that BIzTalk has a SharePoint Adapter but it will only interface with SharePoint Document Libraries. If you wanted to integrate BizTalk with SharePoint Custom lists you are likely going to do so with the Lists.asmx web service.  While it is completely possible to use this custom web service approach, be prepared to spend a few hours (if you are lucky) getting everything working.

With Logic Apps, it is a very different experience.  From the Logic Apps canvas you need to add a trigger to kick off your workflow.  In my case, I used a Recurrence trigger that will run every day at 7:45 am.  I can also kick this trigger off manually in the Azure Portal if I wish.

Next, I want to add an action and then search for SharePoint from the Microsoft managed APIs dropdown.  After we do that, all available SharePoint Online operations will be displayed.

In my case, I want to purge all items, but there is no Delete List operation.  Instead, I need to get all items in my list first, so that I can use the ID from each record to delete that item.  In my scenario I expect 7 days * 24 hourly records (168 items) to be in my list at any given time so this load is not a concern.

With this situation in-mind, I will select the Get Items  operation.

Once I have selected my Get Items operation, I need to establish my connection to my Office 365 subscription. (I will spare you from the password prompts)

With my connection established, I now need to provide the URL to my SharePoint List.  I can also specify optional parameters that control the number of items returned. 

I must say the experience in this dialog is a good one.  I can click on the Site URL dropdown and all of the sites that I have access to will be in that list.  Once I have selected my URL and then click on the List Name dropdown, I then see all the lists that I have access to on that site.

Next, I need to add another activity and this time I will select the Delete Item operation.

I have a similar experience in the Delete Item dialog that I had in the Get Items dialog.  With my connection already established, I need to provide the same Site URL  and the same List Name.  What is different this time is I need to provide an ID for the list item that I would like to delete.  In this case it will be an ID  that is coming from my Get Items response.

You might be asking yourself – will how is that going to work for all of my items in my list?  Don’t you need a for loop to iterate through the Get Items collection? The answer is Yes, but the Logic Apps team has made this very simple – they have done the heavy lifting for you.  If you go into Code View you can see it there:

foreach”: “@body(‘Get_items’)[‘value’]”,
“inputs”: {
    “host”: {
        “api”: {
            “runtimeUrl”: “https://logic-apis-westus.azure-apim.net/apim/sharepointonline”
        },
        “connection”: {
            “name”: “@parameters(‘$connections’)[‘sharepointonline’][‘connectionId’]”
        }
    },
    “method”: “delete”,
    “path”: “/datasets/@{encodeURIComponent(encodeURIComponent(string(‘https://SharePointsharepoint.com/sites/HOPOC/Bighorn/SitePages/Home.aspx’)))}/tables/@{encodeURIComponent(encodeURIComponent(string(‘c28b1ea2-e2a0-4faf-b7c2-3eerec21a8b’)))}/items/@{encodeURIComponent(string(item()[‘ID’]))}”
},

Awesome!

The end result is a Logic App that looks like this:

I can now my Logic App from the Azure Portal by clicking on Select Trigger and then recurrence.

I can follow my execution and dive into my Get Items and Delete Items calls.  By inspecting my inbound and outbound traces I can see the exact payloads and HTTP Status codes from the underlying operations.  In this case I was able to delete 300 items in 23 seconds.  For each item in my collection, a Delete Item call is made.

Conclusion

It honestly took me about 10 minutes to figure this out.  Part of the reason why I am writing about this is I know how long this would take with BizTalk. I anticipate it would take at least 3 hours to do this in BizTalk if it was your first time.  So this isn’t a knock against BizTalk, as Logic Apps has been built, IMO, for these lightweight scenarios with little friction.

In the short term I think Microsoft Integration architects and developers will have many opportunities like this one where you can choose one tool or the other.  For me, developer productivity needs to be part of that equation.  Where the systems that you are integrating are hosted will also play a role.  In this case, I am connecting to SharePoint Online and SQL Azure so it also doesn’t make sense, IMO, to route all of this info back on-premises only to go back up to the cloud.

We may also see a Hybrid approach where a BizTalk process can call out to a Logic App where you can take advantage of these new Logic App connectors.  This was something that Microsoft discussed at 2016 Integrate Event in London.

In a future blog post we will talk about the other half of this solution which is how to create items in SharePoint Online from SQL Azure.

Advertisements

Overview of the New BizTalk 2006 Sharepoint Adapter

I came across Adrian Hamza’s blog today.  His blog seems to be totally dedicated to the Sharepoint Adapter for Biztalk. 



It looks like it will be a great resource for information on anything related to Sharepoint and Biztalk integration.



The post I like best gives a detailed comparison between the GotDotNet Sharepoint Adapter and the new Biztalk 2006 Sharepoint Adapter. 



I think the best new “feature” of the Sharepoint Adapter is that it will be supported by Microsoft.  I know this has held up a lot of customers from using it in the past.


BizTalk Integration with Sharepoint and InfoPath Lab

Curious on how you can use Sharepoint, InfoPath, and BizTalk 2004 together?  This hands on lab will take you through a simple integration scenario step-by-step using Sharepoint and InfoPath to display delivery exceptions using Delivery Notification inside an Orchestration using BizTalk 2004. 



This lab will take around 60 minutes to complete and is based on Microsoft’s hands-on-labs.  Sharepoint (or Windows Sharepoint Services) and the Sharepoint Adapter for BizTalk 2004 (available on GotDotNet) are required.



Download: Sharepoint-InfoPath Hands On Lab



Setup is simple.  Unzip the download to your c:\ drive.  Make sure the root folder named “Microsoft Hands-On-Labs” is located at c:\.  The lab manual is located under \ILL019_InfoPath.  The exercises are located in the \Source\Exercises folder.  The full solution is located in the \Source\Solution folder.



Although newbie’s to BizTalk can complete this lab, it covers advanced topics.  If you are new to BizTalk, do not get discouraged if you find this lab difficult. 


Integration with Sharepoint 2003 and InfoPath SP1 Lab

This lab will take you through a simple integration scenario step-by-step using Sharepoint and InfoPath to display delivery exceptions using Delivery Notification inside an Orchestration. Windows Sharepoint Services, the Sharepoint Adapter for BizTalk 2004, and InfoPath SP1 are required.

Get more information from the original blog post on this topic: https://www.biztalkgurus.com/biztalk_server/biztalk_blogs/b/biztalk/archive/2005/06/12/biztalk-integration-with-sharepoint-and-infopath-lab.aspx