Gaurav Garg
Gaurav Garg

Reputation: 1

Deploy or publish Asp.Net Core 6.0 Web Job Zip file on Azure App service (Window Instance) using AZURE CLI

I want to Deploy or publish my Asp.Net Core 6.0 Web Job (Continuous) project Zip file on Azure App service (Window Instance) using AZURE CLI

I want it to deploy using AZURE CLI Commends only

Upvotes: 0

Views: 1082

Answers (1)

anon
anon

Reputation:

Here is the Syntax of Azure CLI for publishing/deploying the Web Job to the Azure App Service:

dotnet publish --configuration Release -o .deploy/app_data/Jobs/Continuous/pgp
cp run.cmd .deploy/app_data/Jobs/Continuous/pgp
cd .deploy ; zip -r ../deploy.zip . * ; cd ..
az webapp deployment source config-zip -g $AZURE_RESOURCE_GROUP -n $AZURE_APP_SERVICE --src ./deploy.zip

From your current working directory location, you have to run these commands.

Example:

Note: run.cmd file consists of the command called dotnet MyWebJob.dll %*

dotnet publish src --configuration Release -o '../_zip/app_data/Jobs/Continuous/MyWebJob'
copy ./run.cmd './_zip/app_data/Jobs/Continuous/MyWebJob'
Compress-Archive -Path ./_zip/* -DestinationPath ./deploy.zip -Force
az webapp deployment source config-zip -g mywebjobapp-rg -n mywebjobapp --src ./deploy.zip

Upvotes: 0

Related Questions