question

UlisesOrtega-3724 avatar image
0 Votes"
UlisesOrtega-3724 asked shivapatpi-MSFT answered

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

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

shivapatpi-MSFT avatar image
0 Votes"
shivapatpi-MSFT answered

Hello @UlisesOrtega-3724 ,
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://docs.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://docs.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 !

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.