tye rewrite Dapr Environment variable
See original GitHub issueI’m using tye locally(tye run) to Run Dapr locally as well and use service to service invocation from Dapr.
$"http://localhost:{Environment.GetEnvironmentVariable("DAPR_HTTP_PORT")}/v1.0/invoke/backend/method/"
this work running when using dapr run or deploy to k8s. I wrote a method to print all environment variable to see why when using tye is coming empty and it look like tye is rewriting the environment variable.
$"http://localhost:{Environment.GetEnvironmentVariable("SERVICE__FRONTEND-DAPR__HTTP__PORT")}/v1.0/invoke/backend/method/"
and this is the output of the Environment variable from tye local:
[frontend_e61771b1-9]: SERVICE__BACKEND-DAPR__HTTP__HOST = localhost
[frontend_e61771b1-9]: SERVICE__FRONTEND-DAPR__HTTP__HOST = localhost
[frontend_e61771b1-9]: BACKEND-DAPR_METRICS_SERVICE_HOST = localhost
[frontend_e61771b1-9]: BACKEND-DAPR_METRICS_SERVICE_PROTOCOL = http
[frontend_e61771b1-9]: SERVICE__FRONTEND__HTTPS__PROTOCOL = https
[frontend_e61771b1-9]: SHLVL = 1
[frontend_e61771b1-9]: FRONTEND_HTTPS_SERVICE_PROTOCOL = https
[frontend_e61771b1-9]: SERVICE__BACKEND-DAPR__METRICS__PROTOCOL = http
[frontend_e61771b1-9]: __CF_USER_TEXT_ENCODING = 0x1F5:0x0:0x0
[frontend_e61771b1-9]: FRONTEND-DAPR_HTTP_SERVICE_PROTOCOL = http
[frontend_e61771b1-9]: SERVICE__BACKEND__PROTOCOL = http
[frontend_e61771b1-9]: SERVICE__BACKEND-DAPR__GRPC__PORT = 53423
[frontend_e61771b1-9]: BACKEND_HTTPS_SERVICE_PORT = 53419
[frontend_e61771b1-9]: BACKEND_HTTPS_SERVICE_HOST = localhost
[frontend_e61771b1-9]: SERVICE__FRONTEND__HOST = localhost
[frontend_e61771b1-9]: TERM_SESSION_ID = 147A436C-43F2-48DB-AE05-1CAE65830EBC
[frontend_e61771b1-9]: FRONTEND-DAPR_METRICS_SERVICE_PORT = 53422
[frontend_e61771b1-9]: SERVICE__BACKEND__PORT = 53418
[frontend_e61771b1-9]: FRONTEND-DAPR_METRICS_SERVICE_PROTOCOL = http
[frontend_e61771b1-9]: BACKEND-DAPR_METRICS_SERVICE_PORT = 53425
I know on pull request #510 it mention that it’s fixed, it’s injecting the variables but by changing the name it mean that the isn’t as portable as it could be.
Any suggestion, would be gladly appreciated.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
This should be fixed now in nightly builds - the issue is that Tye wasn’t setting
DAPR_HTTP_PORT
.Sure @jkotalik ,
The following code return a port number when run dapr CLI
But when I run the same project with Tye the same code doesn’t return anything and I have the extension added too.
let me know if it’s clear now. thanks