Creation of WebJob in Linux-Container WebApp fails with 'Bad request'

Benedikt Schmitt 40 Reputation points
2024-09-24T13:10:12.09+00:00

I have a Linux-container webapp that is running without problems.

I now want to create a WebJob with the current Preview-Feature. However every time I try to create a manually-triggered Webjob following this tutorial: https://learn.microsoft.com/en-us/azure/app-service/webjobs-create?tabs=windowscode

It fails and only returns "Bad Request".

User's image

For creating the WebJob I give it a .zip-file with two python-files and a run.sh.

The first python-file is a collection of helper-functions that the main python-file imports. The main-file runs code that works on my local machine and on other machines.

The run.sh consists only of the following:

#!/bin/bash
python 

I have some theories why this could fail:

  • I am missing specific settings in my webapp
  • I am not meeting a specific file-structure
  • I need to define a specific environment in the WebJob because contrary to my understanding it does not use the same environment as the webapp

I have set the "WEBSITES_ENABLE_APP_SERVICE_STORAGE" to false now since it prevented my web app from working. Now it tells me that remote storage is required for WebJob operations. How do I give it an already existing storage account in my resource group as a storage location?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,756 questions
{count} votes

Accepted answer
  1. VenkateshDodda-MSFT 20,696 Reputation points Microsoft Employee
    2024-10-01T04:03:02.8866667+00:00

    @Benedikt Schmitt Thanks for your patience on this. I am summarizing our above discussion and posting the same as answer for the benefit of other community members.

    Issue:

    Customer is facing an issue while creating a web job in a Linux container-based web app. The process is failing with a "Bad Request" error message. They are now exploring the possibility of creating the web job from a remote storage account.

    Solution:

    I have checked with the internal team, and they have confirmed that you need to have the app setting "WEBSITES_ENABLE_APP_SERVICE_STORAGE" value to true to create the web job on Linux app services and creating the web job from the remote storage account is not supported.

    Customer has switched to function app instead of a web app based on their requirement.

    Hope this helps, let me know if you have any further questions on this.

    Please accept as "Yes" if the answer is helpful so that it can help others in the community.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.