title: Microsoft Bot Framework NodeJS V4 running on AWS Lambda 401 unauthorized error
body: <p>I am trying to build a Chatbot using the MS BotFramework running Serverless at AWS Lambda.</p>
  
  <p>The Bot is working with the Emulator and NGROK when no AppId and AppSecret are specified:</p>
  
  <pre><code> var adapter = new BotFrameworkAdapter({
          appId: null,
          appPassword: null
      });
  </code></pre>
  
  <p>When I enable the AppId and Password:</p>
  
  <pre><code> var adapter = new BotFrameworkAdapter({
          appId: process.env.microsoftAppID,
          appPassword: process.env.microsoftAppPassword
      });
  </code></pre>
  
  <p>The Emulator responds with:
  Cannot post activity. Unauthorized to a message</p>
  
  <p>And in the logs I get this: 
  BotFrameworkAdapter.processActivity(): 401 ERROR - Error: Unauthorized Access. Request is not authorized</p>
  
  <p>I already verified the credentials with Step 2 from <a href="https://docs.microsoft.com/en-us/azure/bot-service/bot-service-troubleshoot-authentication-problems?view=azure-bot-service-4.0#issue-an-http-request-to-the-microsoft-login-service" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/bot-service/bot-service-troubleshoot-authentication-problems?view=azure-bot-service-4.0#issue-an-http-request-to-the-microsoft-login-service</a></p>