Ends in:
2 DAYS
14 HRS
37 MIN
22 SEC
Ends in:
2 D
14 H
37 M
22 S
Open Closed

Azure Function call Micro Service API #5414


User avatar
0
DominaTang created

Hi, From Azure Function, how I directly use modules within Abp Framework or need to call Micro Service API? To call API, how to get access token for API from Abp Auth Server?

Thanks

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v7.1.0
  • UI type: Angular
  • DB provider: EF Core / MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

2 Answer(s)
  • User Avatar
    0
    nlachmuthDev created

    Hi,

    let me first ask if i got your question right:

    You want to call an api of an abp application form an azure function right?

    If so, is your azure function written in C#? Because you could use the HttpApi.Client Project to make api calls to your abp project.

    In your abp solution there is even a HttpApi.Client.ConsoleTestApp Project that shows how to use the http api client.

    To get an auth token you just need to configure the IdentityClient in the appsettings. Then the api client will automaticly get an access token before sending requests to the api.

    Kind regards

  • User Avatar
    0
    DominaTang created

    The abp sample code that get access token works (https://github.com/bartvanhoey/), I tested that both client credential and resource owner grant type work.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 02, 2024, 12:35