prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Application Insights configuration for processor function broken
  The `createNewWorkspace` function monitoring blade indicates that Application Insights integration is not enabled.
  ![image](https://user-images.githubusercontent.com/166592/123793166-b7edfa80-d8e1-11eb-8906-b4175f4348e0.png)
  
  At a first glance, the config seems to be there in [processor_function/function.tf](https://github.com/microsoft/AzureTRE/blob/develop/templates/core/terraform/processor_function/function.tf#L24)
  ```plaintext
      APP_INSIGHTS_INSTRUMENTATION_KEY      = var.app_insights_instrumentation_key
  ```
  however, the setting key name is incorrect.
  
  Manually enabling the integration in the portal adds additional config keys:
  
  `APPLICATIONINSIGHTS_CONNECTION_STRING`
  `APPINSIGHTS_INSTRUMENTATIONKEY`
  
  Need to add above keys with values to function app config.
  
  [Reference](https://docs.microsoft.com/en-us/azure/azure-monitor/app/resource-manager-function-app)
  
  </issue>
  <code>
  [start of processor_function/shared/logging.py]
  1 import logging
  2 import os
  3 
  4 from opencensus.ext.azure.log_exporter import AzureLogHandler
  5 from opencensus.trace import config_integration
  6 from opencensus.trace.samplers import AlwaysOnSampler
  7 from opencensus.trace.tracer import Tracer
  8 
  9 
  10 def initialize_logging(logging_level: int, correlation_id: str) -> logging.LoggerAdapter:
  11     """
  12     Adds the Application Insights handler for the root logger and sets the given logging level.
  13     Creates and returns a logger adapter that integrates the correlation ID, if given, to the log messages.
  14 
  15     :param logging_level: The logging level to set e.g., logging.WARNING.
  16     :param correlation_id: Optional. The correlation ID that is passed on to the operation_Id in App Insights.
  17     :returns: A newly created logger adapter.
  18     """
  19     logger = logging.getLogger()
  20     logger.addHandler(logging.StreamHandler())  # For logging into console
  21     app_insights_instrumentation_key = os.getenv("APP_INSIGHTS_INSTRUMENTATION_KEY")
  22 
  23     try:
  24         logger.addHandler(AzureLogHandler(connection_string=f"InstrumentationKey={app_insights_instrumentation_key}"))
  25     except ValueError as e:
  26         logger.error(f"Failed to set Application Insights logger handler: {e}")
  27 
  28     config_integration.trace_integrations(['logging'])
  29     logging.basicConfig(level=logging_level, format='%(asctime)s traceId=%(traceId)s spanId=%(spanId)s %(message)s')
  30     Tracer(sampler=AlwaysOnSampler())
  31     logger.setLevel(logging_level)
  32 
  33     extra = None
  34 
  35     if correlation_id:
  36         extra = {'traceId': correlation_id}
  37 
  38     adapter = logging.LoggerAdapter(logger, extra)
  39     adapter.debug(f"Logger adapter initialized with extra: {extra}")
  40 
  41     return adapter
  42
  [end of processor_function/shared/logging.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/processor_function/shared/logging.py b/processor_function/shared/logging.py
  --- a/processor_function/shared/logging.py
  +++ b/processor_function/shared/logging.py
  @@ -18,10 +18,10 @@
       """
       logger = logging.getLogger()
       logger.addHandler(logging.StreamHandler())  # For logging into console
  -    app_insights_instrumentation_key = os.getenv("APP_INSIGHTS_INSTRUMENTATION_KEY")
  +    app_insights_connection_string = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING")
   
       try:
  -        logger.addHandler(AzureLogHandler(connection_string=f"InstrumentationKey={app_insights_instrumentation_key}"))
  +        logger.addHandler(AzureLogHandler(connection_string=app_insights_connection_string))
       except ValueError as e:
           logger.error(f"Failed to set Application Insights logger handler: {e}")
  
verification_info: {"golden_diff": "diff --git a/processor_function/shared/logging.py b/processor_function/shared/logging.py\n--- a/processor_function/shared/logging.py\n+++ b/processor_function/shared/logging.py\n@@ -18,10 +18,10 @@\n     \"\"\"\n     logger = logging.getLogger()\n     logger.addHandler(logging.StreamHandler())  # For logging into console\n-    app_insights_instrumentation_key = os.getenv(\"APP_INSIGHTS_INSTRUMENTATION_KEY\")\n+    app_insights_connection_string = os.getenv(\"APPLICATIONINSIGHTS_CONNECTION_STRING\")\n \n     try:\n-        logger.addHandler(AzureLogHandler(connection_string=f\"InstrumentationKey={app_insights_instrumentation_key}\"))\n+        logger.addHandler(AzureLogHandler(connection_string=app_insights_connection_string))\n     except ValueError as e:\n         logger.error(f\"Failed to set Application Insights logger handler: {e}\")\n", "issue": "Application Insights configuration for processor function broken\nThe `createNewWorkspace` function monitoring blade indicates that Application Insights integration is not enabled.\r\n![image](https://user-images.githubusercontent.com/166592/123793166-b7edfa80-d8e1-11eb-8906-b4175f4348e0.png)\r\n\r\nAt a first glance, the config seems to be there in [processor_function/function.tf](https://github.com/microsoft/AzureTRE/blob/develop/templates/core/terraform/processor_function/function.tf#L24)\r\n```plaintext\r\n    APP_INSIGHTS_INSTRUMENTATION_KEY      = var.app_insights_instrumentation_key\r\n```\r\nhowever, the setting key name is incorrect.\r\n\r\nManually enabling the integration in the portal adds additional config keys:\r\n\r\n`APPLICATIONINSIGHTS_CONNECTION_STRING`\r\n`APPINSIGHTS_INSTRUMENTATIONKEY`\r\n\r\nNeed to add above keys with values to function app config.\r\n\r\n[Reference](https://docs.microsoft.com/en-us/azure/azure-monitor/app/resource-manager-function-app)\n", "before_files": [{"content": "import logging\nimport os\n\nfrom opencensus.ext.azure.log_exporter import AzureLogHandler\nfrom opencensus.trace import config_integration\nfrom opencensus.trace.samplers import AlwaysOnSampler\nfrom opencensus.trace.tracer import Tracer\n\n\ndef initialize_logging(logging_level: int, correlation_id: str) -> logging.LoggerAdapter:\n    \"\"\"\n    Adds the Application Insights handler for the root logger and sets the given logging level.\n    Creates and returns a logger adapter that integrates the correlation ID, if given, to the log messages.\n\n    :param logging_level: The logging level to set e.g., logging.WARNING.\n    :param correlation_id: Optional. The correlation ID that is passed on to the operation_Id in App Insights.\n    :returns: A newly created logger adapter.\n    \"\"\"\n    logger = logging.getLogger()\n    logger.addHandler(logging.StreamHandler())  # For logging into console\n    app_insights_instrumentation_key = os.getenv(\"APP_INSIGHTS_INSTRUMENTATION_KEY\")\n\n    try:\n        logger.addHandler(AzureLogHandler(connection_string=f\"InstrumentationKey={app_insights_instrumentation_key}\"))\n    except ValueError as e:\n        logger.error(f\"Failed to set Application Insights logger handler: {e}\")\n\n    config_integration.trace_integrations(['logging'])\n    logging.basicConfig(level=logging_level, format='%(asctime)s traceId=%(traceId)s spanId=%(spanId)s %(message)s')\n    Tracer(sampler=AlwaysOnSampler())\n    logger.setLevel(logging_level)\n\n    extra = None\n\n    if correlation_id:\n        extra = {'traceId': correlation_id}\n\n    adapter = logging.LoggerAdapter(logger, extra)\n    adapter.debug(f\"Logger adapter initialized with extra: {extra}\")\n\n    return adapter\n", "path": "processor_function/shared/logging.py"}]}