SAS is a Storage-as-a-Service platform designed to automate storage allocation in EDU institutions. Its main goal is to provide agility to stakeholders on having access to object storage infrastructure in Microsoft Azure.
Some of the capabilities currently provided by the system are:
- Dynamic creation of top level folder and file systems in Azure Data Lake Storage (ADLS) Gen 2.
- Dynamic addition of object owner as "Execute" in File System's ACL.
- Automatic creation of initial folder under the File System.
- Dynamic addition of folder's owner under initial folder.
- Exposure of "how to use" the storage infrastructure through Web UI.
In order to deploy this solution to your environment, you'll need to setup some variables in the build process and create a static web app in Azure. To accomplish this, do the following:
- Fork the code
- Create a Static Web App
- Create an application registration
- Prepare the storage accounts
- Add a GitHub secret
- Configure the Static Web App
- Configure Custom Authentication
- Build
Fork this repo into your GitHub account. You can name the repo whatever you like.
- Navigate to the Azure Portal and create a new Static Web App.
- Name the app according to your organization's naming convention.
- Choose the Standard hosting plan, which is required to enable custom authentication.
- Select your preferred region.
- Select Other as the deployment source.
- Select Review + create and Create.
When the Static Web App is created, copy the Static Web App's URL for use later.
Select Manage deployment token and copy the token for use later.
Follow these steps to create a new Application Registration in Azure Active Directory:
-
In the Azure Portal, navigate to Azure Active Directory.
-
Select App registrations.
-
Select + New registration.
-
Provide an application name of your choice. Your users might need to consent, so make the application name descriptive.
You can grant admin consent for the entire organization.
-
Choose the single tenant option.
-
For Redirect URI, select Web and paste the URL of your Static Web App followed by
/.auth/login/aad/callback
.For example, the redirect URI might be
https://awesome-sauce-1234abcd.azurestaticapps.net/.auth/login/aad/callback
. -
Select Register to create the application registration.
When the application registration is created, copy the Directory (tenant) ID and Application (client) ID for use later.
-
Select Certificates & secrets in the menu bar of the application registration.
-
In the Client secrets section, select + New client secret.
-
Enter a name for the client secret. For example, MyStaticWebApp.
-
Choose an appropriate expiration timeframe for the secret.
Note
You must rotate the secret before the expiration date by generating a new secret and updating the application settings with the new value.
-
Select Add.
Copy the value of the client secret for use later.
- Select Authentication in the menu bar of the application registration.
- In the Implicit grant and hybrid flows section, select ID tokens (used for implicit and hybrid flows).
- Select Save.
Required
TODO: pending
In order to allow this application to modify storage accounts, you need to assign the Storage Blob Data Owner role to the application registration for each of the storage accounts to be managed.
If you named the application Storage-as-a-Service, the RBAC entry would look like this:
The GitHub workflow has a required secret that enables it to deploy the code to the app in Azure. Create the following repository secrets by going to Settings -> Secrets.
Secret | Value | Notes |
---|---|---|
SAS_DEPLOYMENT_TOKEN | The deployment token of your Static Web App. |
Add the following application settings to the Static Web App using the Configuration pane.
Name | Value |
---|---|
AZURE_CLIENT_ID | The application ID from the app registration. |
AZURE_CLIENT_SECRET | The application secret from the app registration. |
AZURE_TENANT_ID | The tenant ID of your Azure AD. |
COST_PER_TB | A numeric value for your monthly cost per terabyte of storage. |
DATALAKE_STORAGE_ACCOUNTS | A comma-separated list of one or more ADLS Gen2 storage account names that have been prepared following the instructions above. |
On GitHub, modify the fragment from src/sas.front/staticwebapp.config.json shown below:
{
"auth": {
"rolesSource": "/api/Roles",
"identityProviders": {
"azureActiveDirectory": {
"registration": {
"openIdIssuer": "https://login.microsoftonline.com/<TENANT_ID>/v2.0",
"clientIdSettingName": "AZURE_CLIENT_ID",
"clientSecretSettingName": "AZURE_CLIENT_SECRET"
}
}
}
}
}
Replace <TENANT_ID> with your Azure AD tenant ID that you copied earlier.
Commit the change directly to the main branch.
Go to Actions in GitHub and review the workflow. It should have run automatically when your configuration change above was committed.
If it didn't, run the Azure Static Web Apps CI/CD workflow.
Optional, but recommended.
TODO: Provide instructions to create a Log Analytics Workspace and Application Insights instance.