question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tye rewrite Dapr Environment variable

See original GitHub issue

I’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:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rynowakcommented, Oct 12, 2020

This should be fixed now in nightly builds - the issue is that Tye wasn’t setting DAPR_HTTP_PORT.

1reaction
rspaulinocommented, Jul 10, 2020

Sure @jkotalik ,

The following code return a port number when run dapr CLI

Environment.GetEnvironmentVariable("DAPR_HTTP_PORT")

But when I run the same project with Tye the same code doesn’t return anything and I have the extension added too.

name: dapr.microservices
extensions:
- name: dapr
  log-level: debug

let me know if it’s clear now. thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

tye/docs/reference/schema.md at main · dotnet/tye
A list of environment variable mappings for the service. ... For the Dapr extension, the available properties closely follow those found on the...
Read more >
Environment variable reference
A list of environment variables used by Dapr.
Read more >
DaprClient usage
The API Token used to authenticate requests to the sidecar. The SDK will read the following environment variables to configure the default values:....
Read more >
Quickstart: Configuration
Once the app has unsubscribed, try updating the configuration item values. Change the orderId1 and orderId2 values using the following command:.
Read more >
Setup & configure mTLS certificates
Encrypt communication between applications using self-signed or user supplied x.509 certificates.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found