MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.2k stars 21.35k forks source link

Application config not set as environment variables #82973

Closed v-bbalaiagar closed 2 years ago

v-bbalaiagar commented 2 years ago

The documentation says that application settings are exposed as environment variables during execution.

I have an Azure function app setup (version 3), I configured few application settings.

Within that app I created a new Nodejs Azure function, and I can't see any my of application setting when printing/accessing them. The trigger of my function is EventHub, and I when logging process.env I see

SUDO_COMMAND:
   '/azure-functions-host/Microsoft.Azure.WebJobs.Script.WebHost',
  PATH:
   '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
  TERM: 'xterm',
  HOME: '/home',
  SHELL: '/bin/bash',
  SUDO_GID: '0',
  languageWorkers__python__defaultRuntimeVersion: '3.6',
  Fabric_NodeIPOrFQDN: '10.92.0.9',
  JAVA_HOME: '/usr/lib/jvm/zre-8-azure-amd64',
  Fabric_NetworkingMode: 'Other',
  SUDO_UID: '0',
  MESH_INIT_URI: 'http://localhost:6060/',
  CONTAINER_NAME: '33210E11-637335464109795532',
  Fabric_ReplicaId: '132424232167917561',
  Fabric_CodePackageName: 'functionsRuntimeContainer',
  Fabric_ServiceName: 'functionsRuntimeService',
  ServiceName: 'functionsRuntimeService',
  WEBSITE_CLOUD_NAME: 'Azure',
  ASPNETCORE_VERSION: '3.0.0',
  Location: 'East US',
  ResourceType: 'Microsoft.ServiceFabricMesh/applications',
  CONTAINER_START_CONTEXT_SAS_URI:
   'http://wawsstorageprodblu089.blob.core.windows.net/...',
  DOTNET_RUNNING_IN_CONTAINER: 'true',
  ASPNETCORE_URLS: 'http://localhost:9091',
  LANG: 'C.UTF-8',
  WEBSITE_STAMP_DEPLOYMENT_ID: 'b30d3459837e4ad386606b91c7cb0da4',
  AzureWebJobsScriptRoot: '/home/site/wwwroot',
  WEBSITE_HOME_STAMPNAME: 'waws-prod-blu-089',
  CONTAINER_ENCRYPTION_KEY: 'AM1tVZ23U1Oi4E3LNsjIzkdwwySzdnSaUEYU+xiN9mM=',
  Fabric_ApplicationName: 'App-33210E11-637335464109795532',
  ResourceName: 'App-33210E11-637335464109795532',
  Fabric_ServiceDnsName: 'functionsRuntimeService.App-33210E11-637335464109795532',
  Fabric_Epoch: '132424232148856091:8589934592',
  DOTNET_USE_POLLING_FILE_WATCHER: 'true',
  ResourceGroupName: 'AZCONTAINERS-WAWS-PROD-BLU-089-1',
  SubscriptionId: '<REDACTED>',
  PWD: '/',
  Fabric_Id: '731beced-ce7d-4d33-b3d3-34ee48861484',
  CodePackageName: 'functionsRuntimeContainer',
  HOST_VERSION: '3.0.14287.0',
  Fabric_ReplicaName: '0',
  LOGNAME: 'app',
  HOSTNAME: 'SandboxHost-637335464132842685',
  WEBSITE_PLACEHOLDER_MODE: '1',
  USER: 'app',
  CONTAINER_IMAGE_URL: 'mcr.microsoft.com/azure-functions/mesh:3.0.14287',
  SUDO_USER: 'root',
  FUNCTIONS_WORKER_DIRECTORY: '/azure-functions-host/workers/node'

Related Issue : https://github.com/Azure/Azure-Functions/issues/1696


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

GiftA-MSFT commented 2 years ago

@v-bbalaiagar we'll review your feedback and get back to you shortly. Thanks.

SamaraSoucy-MSFT commented 2 years ago

I've submitted a pull request to add a note that some creation methods like Terraform do not set the worker setting. It will go live onse the doc author has approved it.