skip to Main Content

I am new for Azure and currently working for an Azure function project for accessing and working with Blob storage files. I am using User secret (secret.json) for setting connection string (just replaced actual values with something ).
{
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=something;AccountKey=ccwq2cRbydk0wnT2FKFmNonpyqMXiEO/ADnCmI7UB/5IfnL9NHDc8wioZQu5PHzg==;BlobEndpoint=https://something.blob.core.windows.net/;TableEndpoint=https://something.table.core.windows.net/;QueueEndpoint=https://something.queue.core.windows.net/;FileEndpoint=https://something.file.core.windows.net/",
"AzureWebJobsStorage:blob": "https://something.net/",
"CosmosDb": "AccountEndpoint=https://localhost:8080/;AccountKey=C2y6ybIZnqyMsEcaGQy67XIw/Jw=="

}
I am not able to run the Application , getting error on terminal like :

Can’t determine project language from files. Please use one of [–csharp, –javascript, –typescript, –java, –python, –powershell, –custom] Missing value for AzureWebJobsStorage in local.settings.json. This is required for all triggers other than httptrigger, kafkatrigger, rabbitmqtrigger, orchestrationTrigger, activityTrigger, entityTrigger. You can run ‘func azure functionapp fetch-app-settings ‘, specify a connection string in local.settings.json, or use managed identity to authenticate.
Press any key to continue….

I am using user secret so it should have precedence over local setting , right ?
Can you please help me for fixing this error .

I am using user secret so it should have precedence over local setting , right ?
Can you please help me for fixing this error .I dont have local.settings.json file in project .

2

Answers


  1. While creating Azure Functions locally you need to store all your secrets and connection string in local.settings.json file and not secrets.json, These settings can be called by using – os.environ[“myappsettings”]
    and os.getenv(“appsettings”)

    Now, Coming to your error code :-

    Can’t determine project language from files. Please use one of
    [–csharp, –javascript, –typescript, –java, –python, –powershell,
    –custom] Missing value for AzureWebJobsStorage in local.settings.json. This is required for all triggers other than
    httptrigger, kafkatrigger, rabbitmqtrigger, orchestrationTrigger,
    activityTrigger, entityTrigger. You can run ‘func azure functionapp
    fetch-app-settings ‘, specify a connection string in
    local.settings.json, or use managed identity to authenticate. Press
    any key to continue…

    While you’re running your function locally during runtime the function is not able to fetch which Function framework you’re using while deploying your function code from local machine to azure or while running your Function locally.

    According to the answer by ankitkumarr The error also occurs when local.settings.json file is missing in your function

    and your function code is unable to read the connection string or secret required by your function app.

    I tried running an Azure function without local.settings.json and received same error, Refer below:-

    enter image description here

    I created a new Azure Function by using Azure function extension in VS code like below:-

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    Azure Function HTTP trigger got created like below with all the required Function files including local.settings.json:-

    local.settings.json:-

    enter image description here

    In order to use settings from my Azure function to my local function> I visited my Azure function app and copied the storage account string and added it to my local function like below:-

    Azure Function app on portal> Click on Configuration > Application setting > AzureWebJobStorage > Copy the connection string and paste it in local.settings.json for your local function to use the storage account in azure

    enter image description here

    enter image description here

    My default init.py

    When you create a new function app locally with HTTP Trigger, Default code is created for the same:-

    enter image description here

    I ran my function by running the code below and did not receive any error:-

    func host start
    
    
    

    Output:-

    enter image description here

    Visited the HTTP URL in my browser :-

    enter image description here

    Note- The settings in local.settings.json are not ran during runtime as they are part of git ignore file. If you need to add any settings in your Function app, You need to do it directly on Azure Portal like below:-

    Go to your Function app > Configurations > New application settings > Add new Application settings with the secret and value:-

    enter image description here

    Also, According to the answer here by KalyanChanumolu-MSFT you can add the application settings in
    your Azure Function app in Visual studio directly like below:-

    enter image description here

    enter image description here

    I have ran the below command from this
    document to fetch your function app settings locally:-

    Code:-

    az functionapp config appsettings list –name Functionapp
    –resource-group resourcegroup “`

    Output:-

    enter image description here

    Login or Signup to reply.
  2. To eliminate the problem: Can’t determine project language from files. Please use one of [–csharp, –javascript, –typescript, –java, –python, –powershell, –

    You can put this in your Properties-> LaunchSetting:

    {
      "profiles": {
        "QueueCleaner": {
          "commandName": "Project",
          "commandLineArgs": "--csharp --port 7136",
          "launchBrowser": false
        }
      }
    }
    

    if you are using csharp put –csharp as appear in the example code. if you use other languajr change it property, you can see the value to add in the error code.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search