Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 18789

Python Azure Function expecting System.Net.Http.Formatting

$
0
0

I have a Python Azure Function (V2 model) and work with Visual Studio Code, using Python 3.9 as an interpreter, also have 3.12 installed, but FA starts only with the Python 3.9 version.

While running the command -

  func host start

the function app almost starts but I get the following error -

   A host error has occurred during startup operation 'e832c327-df1a-464b-9045-e85072afd857'.   Microsoft.Azure.WebJobs.Extensions.Http: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

Value cannot be null. (Parameter 'provider')

Not sure what am I missing, I have used "import requests" but still it doesn't seem to work.

Very striaghtforward code-

  import logging  import azure.functions as func  app = func.FunctionApp()  @app.function_name(name="GetSettings")  @app.route(route="company/{Id}/Settings", methods=['GET'], auth_level=func.AuthLevel.FUNCTION)  def GetSettings(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') # Get ID from the route parameter site_id = req.route_params.get('companyId') logging.info(company_id)

Could someone suggest what am I missing?


Viewing all articles
Browse latest Browse all 18789

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>