How to set the environment variable APP_API_TOKEN in the dapr sidecar using Azure container app

Ulises Ortega 1 Reputation point
2022-05-11T14:07:04.08+00:00

Hi,

I'm deploying my microservices in azure container app, I'm using dapr and I would like to have secure the connection between the sidecar and ethe application. I see one of the way dapr suggest is using Dapr token authentication.

I would like to know if it's possible to inject in the sidecar from azure container the environment variable APP_API_TOKEN.

Thanks

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
639 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. shiva patpi 13,141 Reputation points Microsoft Employee
    2022-05-12T04:53:09.24+00:00

    Hello @Ulises Ortega ,
    Thanks for reaching out to Microsoft Q&A !
    I am thinking of couple of options:-

    While creating the Azure Container Instance , there are couple of ways to set the environment variable for the container instance:
    You can have a look at the below documentation:
    https://learn.microsoft.com/en-us/azure/container-instances/container-instances-environment-variables

    If you are using Azure Portal -> you can use Advanced Options
    Best way is either to use Azure CLI or Azure Powershell. Both the options are mentioned in the same document.

    ///////////////////////////////////////

    Other option is using YAML file:
    In the YAML configuration file we can mention the details of main container & sidecar container . In the sidecar container you can have the environment variable and that variable can be accessed in the main container !

    Can you take a look at the example YAML file mentioned at https://learn.microsoft.com/en-us/learn/modules/secure-apps-azure-container-instances-sidecar/4-deploy-sidecar
    Probably you might get some thoughts how to use that for dapr sidecar ?

    Let us know if that helps !

    0 comments No comments