Alan Castro
Posted on April 24, 2020
Here is the .gitlab-ci.yml
that I use to deploy my .NET Core 3.1 azure functions in Gitlab CI/CD.
Variables that I use in the scripts:
- $APPLICATION_ID
- $APPLICATION_SECRET
- $TENANT_ID
- $FUNCTION_APP your function app's name in azure
stages:
- deploy
deploy:
stage: deploy
image: mcr.microsoft.com/dotnet/core/sdk:3.1
script:
- curl -sL https://aka.ms/InstallAzureCLIDeb | bash
- apt-get install curl && curl -sL https://deb.nodesource.com/setup_12.x | bash -
- apt-get install nodejs
- npm install -g azure-functions-core-tools@3 --unsafe-perm true
- az login --service-principal -u $APPLICATION_ID -p $APPLICATION_SECRET --tenant $TENANT_ID
- func azure functionapp publish $FUNCTION_APP --csharp
only:
- master
Hope it's useful
💖 💪 🙅 🚩
Alan Castro
Posted on April 24, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.