Skip to content

Commit b5e7cc3

Browse files
committed
Incorporated OIDC for authenticating towards Azure in GH Action
1 parent eec4435 commit b5e7cc3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Static web app invoking Azure functions
22

3-
This repository contains a [static web app](client/src/App.js), which enables users to upload CSV files containing demographic and financial data about individuals to a designated storage blob via an HTTP-triggered Azure Function.
4-
Once uploaded to the blob, another, blob-triggered function calculates correlations between various variables, such as experience, state, gender, and income. The computed statistics are then stored in a separate storage blob.
3+
This aim of this repo is to demonstrate how to deploy a [static web app](client/src/App.js) written in React to an Azure Storage Blob where static web app hosting has been enabled. The
4+
web app itself enables users to upload CSV files containing demographic and financial data about individuals. This data is to be transferred to an input storage blob by the use of an HTTP-triggered Azure Function.
5+
Once the CSV has been uploaded to the input blob, another, blob-triggered Azure Function calculates correlations between various variables, such as experience, state, gender, and income. The computed statistics are then stored in a separate ouput storage blob.
56
These functions are defined in the python script [function_app.py](hvalfangst_function/function_app.py) - which is the main entrypoint of our Azure Function App instance.
67

78
The associated Azure infrastructure is deployed with a script (more on that below).

hvalfangst_function/function_app.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import json
21
import logging
2+
import json
33
import os
4-
from io import StringIO
5-
6-
import azure.functions as func
74
import jwt
85
import pandas as pd
6+
import azure.functions as func
7+
from io import StringIO
98
from sklearn.preprocessing import LabelEncoder
109

1110
# Decree and declare our project as an Azure Function App subsidiary
@@ -16,8 +15,8 @@
1615
logger = logging.getLogger(__name__)
1716

1817

19-
@app.blob_trigger(arg_name="inbound", path="hvalfangstcontainer/in/input.csv", connection="AzureWebJobsStorage")
20-
@app.blob_output(arg_name="outbound", path="hvalfangstcontainer/out/statistics.json", connection="AzureWebJobsStorage")
18+
@app.blob_trigger(arg_name="inbound", path="hvalfangstcontainer/in/input.csv", connection="")
19+
@app.blob_output(arg_name="outbound", path="hvalfangstcontainer/out/statistics.json", connection="")
2120
def blob_trigger(inbound: func.InputStream, outbound: func.Out[str]):
2221
try:
2322
logging.info("Triggered blob function with blob: %s", inbound.name)

0 commit comments

Comments
 (0)