title: Getting ModuleNotFoundError: No module named 'azure'
body: <p>I am using Azure Pipelines and getting the following error:</p>
  <pre><code>ImportError: Failed to import test module: QueryUrls
  Traceback (most recent call last):
    File &quot;/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/unittest/loader.py&quot;, line 154, in loadTestsFromName
      module = __import__(module_name)
    File &quot;/home/vsts/work/1/s/QueryUrls/__init__.py&quot;, line 2, in &lt;module&gt;
      import azure.functions as func
  ModuleNotFoundError: No module named 'azure'
  </code></pre>
  <p>The error occurs when I run unit tests for an Azure Function written in Python. The code I am runnning in the pipeline (to run the unit tests) is the following:</p>
  <pre><code>- script: |
    python -m unittest QueryUrls/test_queryurls.py
  displayName: 'Test with unittest'
  </code></pre>
  <p>The pipeline was running correctly before I added the above lines. Here is the script that is being called:</p>
  <pre><code># tests/test_httptrigger.py
  import unittest
  from pathlib import Path
  
  import azure.functions as func
  from . import main
  #from QueryUrls import my_function
  
  class TestFunction(unittest.TestCase):
      def test_my_function(self):
          # Construct a mock HTTP request.
          req = func.HttpRequest(
              method='GET',
              body=None,
              url='/api/QueryUrls',
              params={'name': 'World'})
  
          # Call the function.
          resp = my_function(req)
  
          # Check the output.
          self.assertEqual(
              resp.get_body(),
              b'Hello World',
          )
  
  if __name__ == '__main__':
      unittest.main()
  </code></pre>