PL/SQL (MOSC)

MOSC Banner

How to generate OAuth2.0 barer token and invoke a POST Azure API from PL/SQL package UTL_HTTP ?

Hello Experts,

I am trying to generate OAuth2.0 barer token and to invoke Azure API using PL/SQL but always getting "ORA-29273: HTTP request failed" error. I am sure the Client ID and Client Secret values are correct because I am not able to get the token . Below is the sample code.

Please help me to resolve this issue.


Thank you.

--SET DEFINE OFF;

--SET SERVEROUTPUT ON;


DECLARE


http_req utl_http.req;

v_http_response utl_http.resp;

l_value CLOB;

req_body VARCHAR2(2000);

v_text VARCHAR2 (32767);

v_clob CLOB;

l_token VARCHAR2(100);

l_raw VARCHAR2 (32767);


BEGIN

UTL_HTTP.set_persistent_conn_support (FALSE, 0);

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center