You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-9Lines changed: 6 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,9 @@ This [static web app](client/src/App.js), built with the React framework, enable
4
4
Once uploaded, a blob-triggered Azure Function processes the files to calculate correlations between various variables, such as experience, state, gender, and income. The computed statistics are then stored in a separate storage blob (**out**).
5
5
These functions are implemented in the python script [function_app.py](hvalfangst_function/function_app.py); which is the main entrypoint of our Azure Function App instance.
6
6
7
-
A branch-triggered pipeline has been set up to deploy the function app and the static web app to Azure using a GitHub Actions Workflow [script](.github/workflows/deploy_to_azure.yml). A service principal has been created as part of the resource provisioning script, which is used
8
-
to authenticate our requests in said pipeline script. It is therefore important to set the associated GitHub secrets in the repository settings.
7
+
A branch-triggered pipeline has been set up to deploy the function app and the static web app to Azure using a GitHub Actions Workflow [script](.github/workflows/deploy_to_azure.yml).
8
+
A service principal assigned to a federated credential has been created as part of the [resource provisioning script](infra/allocate_resources.sh), which is used to authenticate our requests in said pipeline script.
9
+
It is therefore important to set the associated GitHub secrets in the repository settings (more on this in below).
9
10
10
11
11
12
@@ -43,10 +44,6 @@ graph TD
43
44
```
44
45
45
46
## GitHub secrets
46
-
As touched upon earlier, the GitHub secret **AZURE_CREDENTIALS** must be set in the repository settings. This secret comprises a JSON object containing the service principal credentials.
47
-
It is generated by the Azure CLI command `az ad sp create-for-rbac`, which
48
-
was executed as part of our [resource provisioning script](infra/allocate_resources.sh). The resulting terminal output of said command needs to be copy/pasted to the secret field.
49
-
Again, it is used to authenticate our requests in the [GitHub Actions Workflow script](.github/workflows/deploy_to_azure.yml) as contributor access to the resource group is necessary
50
-
in order to deploy our function and static web app. There are many ways to do this, but this is obviously a simple example.
51
-
52
-

47
+
When inspecting the **Login to Azure with OIDC** step in our **deploy** stage associated with our [GitHub Actions Workflow script](.github/workflows/deploy_to_azure.yml), it is evident
48
+
that three secrets are required. These are the **AZURE_CLIENT_ID**, **AZURE_TENANT_ID**, and **AZURE_SUBSCRIPTION_ID** and
Copy file name to clipboardExpand all lines: infra/allocate_resources.sh
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -59,12 +59,23 @@ fi
59
59
60
60
# Create service principal used by GitHub Actions, the returned JSON is stored as secret in the GitHub repository
61
61
echo -e "${YELLOW}Creating service principal...${RESET}"
62
-
az ad sp create-for-rbac --name hvalfangst-github-actions-sp --role contributor --scopes /subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RESOURCE_GROUP}
0 commit comments