TechToolKit-API is an Azure Functions-based project written in PowerShell. It provides functionality to interact with Azure Blob Storage, including listing blobs and generating SAS URLs for secure access. This repo is designed to be a part of the TechToolKit project, which pairs with TechToolKit-SWA to provide a simple interface to download files/tools stored in an Azure Blob.
- Trigger: HTTP GET
- Description: Lists all blobs in the specified Azure Blob Storage container.
- Environment Variables:
AZURE_STORAGE_ACCOUNT_NAMEAZURE_STORAGE_ACCOUNT_KEYAZURE_STORAGE_CONTAINER_NAME
- Trigger: HTTP GET or POST
- Description: Generates a SAS URL for a specific blob in Azure Blob Storage.
- Environment Variables:
AZURE_STORAGE_ACCOUNT_NAMEAZURE_STORAGE_ACCOUNT_KEYAZURE_STORAGE_CONTAINER_NAME
- Trigger: HTTP POST
- Description: Sets tags on specified blobs in Azure Blob Storage. Existing tags are replaced with those provided in the request body.
- Environment Variables:
AZURE_STORAGE_ACCOUNT_NAMEAZURE_STORAGE_ACCOUNT_KEYAZURE_STORAGE_CONTAINER_NAME
- Trigger: HTTP POST
- Description: Uploads a file to Azure Blob Storage. Checks for existing blobs with the same name and either overwrites them or returns a conflict message based on the query parameter.
- Environment Variables:
AZURE_STORAGE_ACCOUNT_NAMEAZURE_STORAGE_ACCOUNT_KEYAZURE_STORAGE_CONTAINER_NAME
To set up and deploy this project, ensure the following tools are installed:
- Azure Subscription: Required to deploy and run the functions.
- PowerShell: Ensure PowerShell is installed on your system.
- Azure CLI: Install the Azure CLI for deployment and management.
- VS Code: Recommended IDE with the Azure Functions and PowerShell extensions.
-
Clone the repository:
git clone https://github.com/your-repo/TechToolKit-API.git cd TechToolKit-API -
Create an Azure Storage Account and Blob Container if you haven't already.
-
Create an Azure Function App in your Azure Subscription.
-
Set the required environment variables in your Function App:
AZURE_STORAGE_ACCOUNT_NAMEAZURE_STORAGE_ACCOUNT_KEYAZURE_STORAGE_CONTAINER_NAME
-
Deploy the functions using the Azure Functions Core Tools or directly from VS Code, or link the repository to your Function App in Azure. https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-github-actions?tabs=windows%2Cdotnet&pivots=method-portal
-
Retrieve the function URLs from the Azure portal or from the output of the deployment command for use in the SWA.
This project is licensed under the MIT License.