feat: add Azure Function for authenticated dataset downloads#17
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
feat: add Azure Function for authenticated dataset downloads#17devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Adds a Python Azure Function that authenticates BCIT users via Entra ID Easy Auth and generates short-lived SAS URLs for dataset downloads from Azure Blob Storage. - api/function_app.py: HTTP trigger that validates file names, creates user delegation SAS tokens, and returns 302 redirect - api/requirements.txt: azure-functions, azure-identity, azure-storage-blob - deploy-function.yaml: GitHub Actions workflow for zip deployment - .gitignore/.dockerignore: exclude function runtime artifacts Co-Authored-By: kyle_hunter@bcit.ca <kyle_hunter@bcit.ca>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Python Azure Function (
api/directory) that serves as an authenticated download proxy for open-data datasets. The function:api/function_app.pyapi/requirements.txtazure-functions,azure-identity,azure-storage-blobapi/host.json.github/workflows/deploy-function.yamlmain(api/ path filter).gitignore/.dockerignoreapi/from Docker image buildReview & Testing Checklist for Human
This is a medium-risk change (new code + deployment workflow, but function is simple):
function_app.py— verify the SAS token generation logic and theALLOWED_FILESset matches the current datasetsdeploy-function.yamlreferences the correct function app name (bcit-tlu-opendata-dl) matching the infra-azure Terraformterraform apply, configure GitHub secrets:AZURE_CLIENT_ID,AZURE_TENANT_ID,AZURE_SUBSCRIPTION_ID(fromterraform output github_oidc)productionenvironment in the open-data repo settings (required by the deployment workflow)Test plan:
terraform applydeploy-function.yamlworkflow triggers on push to maincurl -v "https://bcit-tlu-opendata-dl.azurewebsites.net/api/download?file=roledetails.zip"Notes
local.settings.jsonis gitignored — it's only for local development with Azure Functions Core Tools.datasets.jsonURL updates (pointing download links to the function endpoint) will be a follow-up PR once the function is deployed and tested.Link to Devin session: https://app.devin.ai/sessions/96d3707e572d4c968d5bfa32f62562e8
Requested by: @kphunter