File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
1
import json
2
2
import logging
3
+ import os
3
4
from io import StringIO
4
5
5
6
import azure .functions as func
@@ -72,13 +73,13 @@ def validate_jwt(token: str, audience: str) -> bool:
72
73
return False
73
74
74
75
75
- @app .route (route = "upload_csv" , auth_level = func .AuthLevel .FUNCTION )
76
+ @app .route (route = "upload_csv" , auth_level = func .AuthLevel .ANONYMOUS )
76
77
@app .blob_output (arg_name = "outbound" , path = "hvalfangstcontainer/in/input.csv" , connection = "AzureWebJobsStorage" )
77
78
def upload_csv (req : func .HttpRequest , outbound : func .Out [str ]) -> str :
78
79
try :
79
80
80
81
token = req .headers .get ("Authorization" ).split (" " )[1 ] # Extract Bearer token
81
- if not validate_jwt (token , audience = "61b4a548-3979-48df-b2df-37dc4e5e0e02" ):
82
+ if not validate_jwt (token , audience = os . environ . get ( "FUNCTION_APP_CLIENT_ID" ) ):
82
83
return func .HttpResponse ("Unauthorized" , status_code = 401 )
83
84
84
85
logging .info ("Received HTTP request to upload CSV" )
You can’t perform that action at this time.
0 commit comments