upload Azure function zip to Azure storage account #28
Workflow file for this run
This file contains 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
name: upload Azure function zip to Azure storage account | |
on: | |
release: | |
types: [published] | |
jobs: | |
upload-azure-function-zip: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Azure Login | |
uses: azure/actions/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
- name: Install Azure Functions Core Tools | |
run: npm i -g azure-functions-core-tools@4 --unsafe-perm true | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Create zip file with specific files | |
run: | | |
mkdir logzio_function | |
cp host.json requirements.txt logzio_function/ | |
cp -r LogzioShipper logzio_function/ | |
cd logzio_function | |
func pack --build-native-deps --python | |
cp logzio_function.zip ../logzio_function.zip | |
- name: Set file permissions | |
run: chmod 755 logzio_function.zip | |
- name: List directory contents | |
run: ls -la | |
- name: Upload 'logzio_function' zip file to Azure storage | |
run: | | |
az storage blob upload \ | |
--file logzio_function.zip \ | |
--container-name eventhub \ | |
--name "logzio_function-${{ github.event.release.tag_name }}.zip" \ | |
--connection-string "${{ secrets.STORAGE_ACCOUNT_KEY }}" \ | |
-overwrite true |