Skip to content

Commit 2fe51da

Browse files
committed
Incorporated OIDC for authenticating towards Azure in GH Action
1 parent 1ac8bdb commit 2fe51da

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"scripts": {
1818
"start": "react-scripts start",
19-
"build": "react-scripts build",
19+
"build": "GENERATE_SOURCEMAP=false react-scripts build",
2020
"test": "react-scripts test",
2121
"eject": "react-scripts eject"
2222
},

hvalfangst_function/function_app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ def validate_jwt(token: str, audience: str) -> bool:
7474

7575

7676
@app.route(route="upload_csv", auth_level=func.AuthLevel.ANONYMOUS)
77-
@app.blob_output(arg_name="outbound", path="hvalfangstcontainer/in/input.csv", connection="AzureWebJobsStorage")
77+
@app.blob_output(arg_name="outbound", path="hvalfangstcontainer/in/input.csv", connection="")
7878
def upload_csv(req: func.HttpRequest, outbound: func.Out[str]) -> str:
7979
try:
80+
logging.info("Received HTTP request to upload CSV")
8081

82+
# Validate JWT token
8183
token = req.headers.get("Authorization").split(" ")[1] # Extract Bearer token
8284
if not validate_jwt(token, audience=os.environ.get("FUNCTION_APP_CLIENT_ID")):
8385
return func.HttpResponse("Unauthorized", status_code=401)

0 commit comments

Comments
 (0)