Creating a Azure C# function dynamically using Azure Rest API

maria_praded 41 Reputation points
2021-08-20T06:57:10.97+00:00

Hi all,

I'm trying to create a new azure c# function, using templates from this (creating-a-azure-python-or-c-function-dynamically.html ) discussion, and I see the following error: 124879-image.png . The body of the request is exactly the same as the template, the url is correct as I tested it with GET request and it worked well.
Can you provide me some advice: what could I check or pay attention to?

Thanks in advance

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
{count} votes

Answer accepted by question author
  1. MayankBargali-MSFT 70,996 Reputation points Moderator
    2021-08-24T15:41:02.687+00:00

    @maria_praded You can create the text file and save the body and attach the file in your comment so I can review. In case if you are working with consumption plan then the below applies as mentioned in my answer here if in case if the WEBSITE_CONTENTAZUREFILECONNECTIONSTRING and WEBSITE_CONTENTSHARE is not define in your function app application setting.

    In consumption sku there is no persistent storage by default. So contents will be lost when the workers recycle. If you need to create a function for the consumption plan then you need to define (WEBSITE_CONTENTAZUREFILECONNECTIONSTRING, WEBSITE_CONTENTSHARE app settings). I have tested creating a python function once I have defined these two settings in my application settings of the function app.

    I have created a new function app in consumption SKU and used the same request body as I have mentioned in my previous post and the function gets sucessfully created.

    126121-image.png

    Looks like the runtime environment might have the issue which might be causing this behaviour where you might have deleted some of the configuration. I will suggest you to create a new consumption plan function app and test it to confirm if you observe the same behaviour.


0 additional answers

Sort by: Most helpful

Your answer

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