Coder Social home page Coder Social logo

Comments (4)

halspang avatar halspang commented on June 10, 2024

@MingGitTest - Thanks for opening the issue. For my clarification, the main issue you're facing is that using a Dapr API Token does not function in container apps? Or, more specifically, that the token is not the one you sent in your original request?

How are you deploying Dapr to container apps? I believe the token needs to be set on the actual deployment.

I'll see if I can find some time to repro this though.

from dotnet-sdk.

MingGitTest avatar MingGitTest commented on June 10, 2024

@halspang Thanks for the response. If I set the Target Port of Ingress to 80 in Azure portal and invoke the app using https://myapp.azurecontainerapps.io/my-method, it will work. The dapr-api-token is right and authentication works as expected. The problem is when I invoke dapr sidecar in postman like this:
https://myapp.azurecontainerapps.io/v1.0/invoke/my-app-id/method/my-method
I got 401 unauthorized error. The app is listening on 3500 now and the logged dapr-api-token is not the one I sent.

I published the app to azure using visual studio. Not sure what is the right way to set the Dapr token. I set both dapr and app api token in azure container app as Environment Variable and did not work either.

Any pointer would be appreciated.

from dotnet-sdk.

halspang avatar halspang commented on June 10, 2024

I don't see any docs for using Container Apps with the DAPR_API_TOKEN but I do see a document for the APP_API_TOKEN. The difference here being that APP_API_TOKEN is used for communication from Dapr to your app, not the other way around.

My concern in their being only one document here is that they may not be exposing the ability to use DAPR_API_TOKEN. The also state that they randomly generate the APP_API_TOKEN. So maybe something similar is happening here which is why you may be seeing an issue with the token?

https://learn.microsoft.com/en-us/azure/container-apps/dapr-authentication-token?tabs=sdk

from dotnet-sdk.

MingGitTest avatar MingGitTest commented on June 10, 2024

@halspang Thanks for the response. Yes I read the link as well and it fits my needs to authenticate all the requests to Dapr. However, I am kind of confused because in my project, if I connect to http 80, everything works. The dapr token is passed and authentication works. But if I tried to connect to dapr (port 3500) using invoke, the token passed is not the one I sent. It is more like an encoded value. Anyone has any idea? Any perspective would be appreciated.

from dotnet-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.