Comments (5)
Here is a working example for you my friend. Just setup the publish profile as a secret and your done.
(and of course change the variables)
And also notice the folder "Triggered". If you have a continuous job change that folder to "Continuous".
name: Deploy WebJob
on:
workflow_dispatch:
push:
branches: [ develop ]
env:
WEBJOB_NAME: YourWebJobName
AZURE_APP_NAME: your-azure-app-service-name
PROJECT_ROOT: path/to/your/Project.Root
TEST_PROJECT_ROOT: path/to/your/Project.Root.Tests
DOTNET_VERSION: '3.1.x'
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/checkout@v2
# Setup .NET Core SDK
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: dotnet test
run: |
dotnet test ${{ env.TEST_PROJECT_ROOT }}
- name: dotnet publish
run: |
dotnet publish -c Release -o './publish/App_Data/Jobs/Triggered/${{ env.WEBJOB_NAME }}' ${{ env.PROJECT_ROOT }}
- name: Deploy to Azure App Service
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_APP_NAME }}
publish-profile: ${{ secrets.PUBLISH_PROFILE }}
package: './publish'
from webapps-deploy.
@joeystdio - perfect! I've been trying for hours to get it to work. The key for me was getting the files deployed to the right place, i.e under app_data/jobs/continuous.
I couldn't find a single piece of documentation that explained how to do the whole thing. Wish I'd hit your post above sooner- would've saved me going round the houses.
Note: the above also works with azure login rather than publish profiles which didnt work for me, ie:
# ---------------------------------------------
# Login using Service-Principal-type secret
# See: https://docs.microsoft.com/en-us/azure/app-service/deploy-github-actions?tabs=userlevel#configure-the-github-secret
# ---------------------------------------------
- uses: azure/login@v1
with:
creds: ${{secrets.AZURE_WEBJOB_CREDENTIALS_DEV}}
# Deploy to Azure Web apps
- name: Deploy to Azure App Service ${{env.AZURE_APPSERVICE_NAME}}
uses: azure/webapps-deploy@v2
with:
app-name: '${{env.AZURE_APPSERVICE_NAME}}'
package: '${{env.PUBLISH_OUTPUT_ROOT}}'
- name: logout
run: |
az logout
from webapps-deploy.
@srijken - Web jobs are just regular file content, so there shouldn't be anything special required in order to deploy them. Building them may be a different story of course, but for this repo which is specific to the deployment action, I don't see why it would be anything different. Are you running into issues with it?
from webapps-deploy.
This issue is stale because it has been open for 14 days with no activity. Please remove the stale label or comment on the issue otherwise this will be closed in 5 days
from webapps-deploy.
Hi. I had a very hard time getting this to work for .Net Core 7.0 WebJob for Azure App Service using GitHub Action Workflow.
Hopefully this helps someone else.
It fails if I try to use ubuntu with Error: Process completed with exit code 1.
name: Deploy WebJob
on:
push:
branches:
- master
workflow_dispatch:
env:
WEBJOB_NAME: DotNetWorker
AZURE_APP_NAME: 'webjob-xpert'
PROJECT_ROOT: ./DotNetWorker
DOTNET_VERSION: '7.0.x'
jobs:
build:
runs-on: windows-latest
steps:
# Checkout the repo
- uses: actions/checkout@v2
# Setup .NET Core SDK
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
#- name: dotnet test
# run: |
# dotnet test ${{ env.TEST_PROJECT_ROOT }}
- name: dotnet publish
run: |
dotnet restore
dotnet build --configuration Release
dotnet publish -c Release -o './publish/App_Data/Jobs/Continuous/${{ env.WEBJOB_NAME }}' ${{ env.PROJECT_ROOT }}
- name: Deploy to Azure App Service
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_APP_NAME }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_99DA0552C0F24762B786220FDECEA669 }}
package: ./publish
from webapps-deploy.
Related Issues (20)
- Commit messages containing emoji and multibytes cause zipdeploy to fail HOT 6
- Deployment Fails with certain NPM modules HOT 7
- Deploy to Azure Web App is stuck on 'Package deployment using ZIP Deploy initiated.' HOT 6
- How to deploy to a virtual Directory using GitHub action "azure/webapps-deploy" HOT 15
- Github private docker registry, the token expires before the deployment completes HOT 5
- How to add --force flag to NPM in azure/webapps-deploy@v2 HOT 3
- Package deployment using ZIP Deploy initiated. HOT 2
- JS API failure
- `images` is still required in the latest 2.2.10 release HOT 3
- Deployment Failed, Error: Failed to deploy web package to App Service. Not Found (CODE: 404) HOT 7
- Deployment always failing with error "Failed to deploy web package to App Service" HOT 2
- Deployment Failed. deployer = GITHUB_ZIP_DEPLOY deploymentPath = ZipDeploy. Extract zip. Remote build. Error: Failed to deploy web package to App Service. Error: Deployment Failed, Package deployment using ZIP Deploy failed. Refer logs for more details. HOT 12
- Statuscode 406: Failed to deploy Image to Web App container HOT 2
- Deployment succeeded but GitHub Action timed out HOT 8
- Case sensitivity issue with Web.config file on a Linux based runner. HOT 2
- Package deployment fails on v3.0.0 HOT 11
- Deprecation warning due to Node 16 HOT 13
- \n/opt/Kudu/Scripts/starter.sh "/home/site/deployments/tools/deploy.sh" Deployment Failed. deployer = GITHUB_ZIP_DEPLOY deploymentPath = ZipDeploy. Extract zip. Error: Failed to deploy web package to App Service. Error: Deployment Failed, Package deployment using ZIP Deploy failed. Refer logs for more details. HOT 5
- Problems releasing after upgrade to v3 HOT 4
- v3 faield to reboot webapp due to 401, but v2 is OK HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webapps-deploy.