title: Basic Python Echo Bot not addressable through Bot Framework Emulator (Post 500) after linking to Azure QnA Maker
body: <p>I have followed the official instructions (<a href="https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-tutorial-add-qna?view=azure-bot-service-4.0&amp;tabs=csharp" rel="nofollow noreferrer">Docs</a>) on how to create a python echo bot with the SDKv4 and as soon as  the described init function is added my bot ceases to work. The echo bot by itself, without the connection to the Azure QnA Maker works perfectly within the Bot Framework Emulator.</p>
  
  <p>The Error displayed in the Bot Framework Emulator: 
  POST500directline/conversations//activities. Also it doesn't display the welcoming message any more and when I send a message the bot apparently does not receive that message (send failed, retry is displayed below the message).  </p>
  
  <p>This problem occurs after adding the init function from the guide to the MyBot class from the bot.py file. The function reads: </p>
  
  <pre><code>def __init__(self, config: Config):
     self.qna_maker = QnAMaker(
        QnAMakerEndpoint(
           knowledge_base_id=config["QNA_KNOWLEDGEBASE_ID"],
           endpoint_key=config["QNA_ENDPOINT_KEY"],
           host=config["QNA_ENDPOINT_HOST"],
     )
  )
  </code></pre>
  
  <p>When following the guide, I had to move the bot instance creation to the very bottom of the app.py file, below: </p>
  
  <pre><code>APP = web.Application(middlewares=[aiohttp_error_middleware])
  APP.router.add_post("/api/messages", messages)
  if __name__ == "__main__": (...)` 
  </code></pre>
  
  <p>as the code otherwise doesn't run: <code>BOT = MyBot(APP.config)</code> causes: NameError: name 'APP' is not defined</p>
  
  <p>Also I get the problem in the app.py file: No name 'DefaultConfig' in module 'config' - even though config.py exists and is obviously used as the ports change when I change them in the config file. </p>
  
  <p>Aside from that I followed the guide precisely. I would be very thankful for any help or resource recommendations, over the past two days I've tried to everything I could find online. Thank you! </p>