<p>I have built a .NET Core Azure Function using a ServiceBusTrigger.  The function works fine when deployed in a regular App Service plan once the appropriate Application settings, such as the Service Bus connection string.</p>

<p>However, I would prefer to host the function as a Docker container on Azure Kubernetes Service (AKS).  I have AKS setup and have a number of .NET Core Docker containers running fine there, including some Azure Functions on TimerTriggers.</p>

<p>When I deploy the function using the ServiceBusTrigger, it fails to properly tun and I get "Function host is not running." when I visit the functions IP address.  I believe this is because the app settings are not being found.</p>

<p>The problem is I do not know how to include them when hosting in the Docker/Kubernetes environment.  I've tried including the appropriate ENV entries in the Docker file, but then I cannot find the corresponding values in the deployment YAML viewed via the Kubernetes dashboard after I've successfully run <code>func deploy</code> from PowerShell.</p>

<p>Most of the Microsoft documentation addresses the TimerTrigger and HttpTrigger cases, but I can find little on the ServiceBusTrigger when using Docker/Kubernetes.</p>

<p>So, how do I include with the appropriate app settings with my deployment?</p>

ProfNimrod
<p>From this Blog ：<a href="https://medium.com/@tsuyoshiushio/playing-with-azure-functions-kubernetes-integration-9048908bfc2a" rel="nofollow noreferrer">Playing with Azure Functions kubernetes integration</a>, you could find a description about add environment variables.</p>

<p>In the deployment.yml, add the env(like <code>AzureWebJobsStorage</code> as an environment variable).</p>

<pre><code>containers:
    - image: tsuyoshiushio/queuefunction-azurefunc
      imagePullPolicy: Always
      name: queuefunction-deployment
      env:
        - name: AzureWebJobsStorage
          value: YOUR_STORAGE_ACCOUNT_CONNECTION_STRING_HERE
      ports:
        - containerPort: 80
      protocol: TCP
</code></pre>

<p>Then apply it, it will works.</p>
