Azure function error: app does not support remote build as it was created before August 1st, 2019 - azure

I am trying to deploy my azure function with VS code using func azure functionapp publish nhtsa --build remote and I am getting below error.
Remote build is a new feature added to function apps.
Your function app does not support remote build as it was created before August 1st, 2019.
Please use '--build local' or '--build-native-deps'.
For more information, please visit https://aka.ms/remotebuild
I thought it's because of the storage account access -tier and access level, so I change my storage account tier to cool and container access to public, and I deploy the function again, and I'm still getting the error.
Any idea how I can resolve this issue.
Thanks

As the error specified, it is not supported for function app created before August 1, 2019 (see documentation):
If you're having issues with remote build, it might be because your app was created before the feature was made available (August 1, 2019). Try creating a new function app, or running az functionapp update -g <RESOURCE_GROUP_NAME> -n <APP_NAME> to update your function app. This command might take two tries to succeed.

I had the same issue the solution was to fix the "defaultAction"
It should be "Allow"

Related

Authorization:REDACTED when executing an Azure Function

I am observing Authorization:REDACTED in the log stream attached to my Azure Function.
Context:
Note, that I can execute the same function successfully when I run the Function App in the debugger within my Visual Studio session, using local host.
Details:
x-ms-return-client-request-id:true
User-Agent:azsdk-net-Storage.Blobs/12.13.0,(.NET 6.0.11; Microsoft Windows 10.0.14393)
x-ms-date:Wed, 01 Feb 2023 19:42:49 GMT
Authorization:REDACTED
client assembly: Azure.Storage.Blobs
The Azure Function was deployed using Pulumi.
FUNCTIONS_EXTENSION_VERSION : ~4
Verifications:
I verified that the Azure Function's URL referenced in my client app is valid and matches the URL in the Azure portal for the Azure Function I want to invoke
I executed the Azure Function from local host without issue.
Please check the below findings if that helps to fix your issue:
When I run the Pulumi Serverless Function (CSharp) in Visual Studio locally, I got the below output:
Not Sure the cause of the issue because I tried Pulumi Stack for the 1st time.
And I have identified the similar issue registered in MS Q&A Forum #1163056 and the user #MayankBargali-MSFT given the accepted solution to check the local storage emulator is running on the specified ports each with each Storage object such as Blob, Queue, Table.

Upgraded Azure Function cannot test from the portal

We had a Azure Function with Timer Trigger which was develop using function version 3.0 and .NET 3.1. This function is running on Windows App Service Plan on Azure. So, I have upgraded it to function version 4.0 and .NET 6.0 using below steps:
Upgrade your local project
The following changes are required in the .csproj XML project file:
Change the value of PropertyGroup.TargetFramework to net6.0.
Change the value of PropertyGroup.AzureFunctionsVersion to v4.
Replace the existing ItemGroup.PackageReference list with the following ItemGroup:
Image
After you make these changes, your updated project should look like the following example:
Image
Upgrade the local.settings.json file
Image
Run the function app locally and verify the functionality.
Upgrade your function app in Azure
Run below command to set the FUNCTIONS_EXTENSION_VERSION application setting to ~4 on your function app in Azure.
az functionapp config appsettings set --settings FUNCTIONS_EXTENSION_VERSION=~4 -g <RESOURCE_GROUP_NAME> -n <APP_NAME>
Change the .NET version of the function app. If you're function app is hosted on Windows, run below command.
az functionapp config set --net-framework-version v6.0 -g <RESOURCE_GROUP_NAME> -n <APP_NAME>
However, I cannot test or see the function.json file from Azure Portal.
I have taken the .NET 3.1 Azure Function Project with Timer Trigger in the VS 2022 IDE:
Published the .NET Core 3.1 Azure Functions Project to Azure Function App in the Azure Portal and then changed the FUNCTIONS_EXTENSION_VERSION to 4 using Azure CLI Command by following this MS Doc:
Running locally after migration to V4-.NET 6:
Then, deployed the migrated project to the Azure Function App and tested as shown below:
I was able to find the reason for the issue by running "Diagnose and solve problems" from Azure portal.
The issue was related to the function name. My function name length was more than 32 characters long. By default, the Host ID is auto-generated from the Function App name, by taking the first 32 characters. If you have multiple Function Apps sharing a single storage account and they're each using the same Host ID (generated or explicit), that can result in a Host ID collision. For example, if you have multiple apps with names longer than 32 characters their computed IDs may be the same. Consider two Function Apps with names myfunctionappwithareallylongname-eastus-production and
myfunctionappwithareallylongname-westus-production
that are sharing the same storage account. The first 32 characters of these names are the same, resulting in the same Host ID myfunctionappwithareallylongname being generated for each(Please refer https://github.com/Azure/azure-functions-host/wiki/Host-IDs#host-id-collisions for more information).
So, to solve the issue, I just rename the function name on Azure.

Unable to deploy Azure Function App - error with storage account

Lately I've had trouble with deploying a Function App via Azure CLI. Last week on Tuesday, I was still able to deploy a Function App via Azure CLI.
This week, like any other day before that, I used fairly common Azure Function Tools command func azure functionapp publish. The version of Azure Function Tools I am using is 3.0.3233.
Now I am getting this error every time:
Retry: 1 of 3
Error creating a Blob container reference. Please make sure your connection string in "AzureWebJobsStorage" is valid
Retry: 2 of 3
Error creating a Blob container reference. Please make sure your connection string in "AzureWebJobsStorage" is valid
Retry: 3 of 3
Error creating a Blob container reference. Please make sure your connection string in "AzureWebJobsStorage" is valid
I checked that AzureWebJobsStorage setting has a correct value, I even connected to storage account connection string via Azure Storage Explorer app.
Just in case, I created a new Function App in another region and I still get the same error.
Has anyone else encountered this error? I suspect this is an error in the tool itself, maybe a faulty build?
I suspect that AzureWebJobsStorage is not present/invalid in App Settings section of the function app in the Azure portal.
Make sure that it is added there and you are not deleting those settings through CLI/templates and recreating them without AzureWebJobsStorage.
I answer to my own question. It seems that this was a transient error. Without changing any code, today I was able to redeploy my function app. Cheers.
If you don't have "Allow storage account key access" enabled , you get this error.
There could be other scenarios as well. But the error does not say anything .

Can't find app with name error while publish the azure function

I tried to create an azure function using following link in Ubuntu system(16.04).
[azure function][2]
Deployment using arm template and create a local azure function using vs code.
Folder contains following files
LocalFunctionProj.csproj, HttpExample.cs, host.json, local.settings.json
azure function is created successfully in portal after deployment.But when i tried to publish the local azure function ,it shows an error Can't find app with name "HttpExample" while using following command
func azure functionapp publish HttpExample
Is anything wrong in my step.
Also i tried this command after 30 mnt when function created in portal
screen shot
I had a similar issue when I followed a tutorial about Azure Functions Core Tools from Microsoft Learning.
In my case, I had the error Can't find app with name X, because I had a wrong subscription set in my local Azure CLI. The command from below changes subscription for the one that is created with "Microsoft Learning Sandbox". Note that, in your case, the name of the subscription can be different.
az account set --subscription "Concierge Subscription"
If it's not the issue, your question suggests that your function app name should be HttpExample. You need to ensure beforehand that there's a function app with such a name in the subscription you are logged into with Azure CLI.
Moreover, there is a ProvisioningState: Failed in the screenshot, which could also be an issue.
If you want to publish the local app into azure ,you must create the functional app before in azure portal.Also the name of the azure function is portal should be same as the local azure app.otherwise you can't publish the app.

Azure functions developing locally - cannot register EventHub triggered function

I want to develop locally my Azure Function App and later publish it to Azure Portal.
I am using Azure Functions Core Tools command line and all my functions are in Node.js
Currently, I managed to download my functions locally and fetch their settings with command:
func azure functionapp fetch-app-settings
So after that my local.settings.json has correct settings values. When I make any changes I am also able to publish them succesfully to Azure Portal.
The problem is now that I have two functions in my app, one is Http Triggered and the second is EventHub triggered.
When I try run locally host with:
func host start
I get the following output from console:
[10.12.2017 13:03:47] Found the following functions:
[10.12.2017 13:03:47] Host.Functions.HttpTriggerJS1
[10.12.2017 13:03:47]
[10.12.2017 13:03:47] Job host started
[10.12.2017 13:03:47] The following 1 functions are in error:
[10.12.2017 13:03:47] EventHubTriggerJS1: The binding type 'eventHubTrigger' is not registered. Please ensure the type is correct and the binding extension is installed.
And when I try to run locally this EventHubTriggerJS1 function with curl:
curl --request POST -H "Content-Type:application/json" --data '{"input":"sample queue data"}' http://localhost:7071/admin/functions/EventHubTriggerJS1
then nothing happens, so I guess this is a problem of this trigger registration.
The HttpTriggerJS1 runs perfectly, I can access it under
http://localhost:7071/api/HttpTriggerJS1
So, do you have any idea where might be a problem in configuring? BTW Is it possible to have locally function and connect to the remote EventHub in portal?
I was unable to reproduce your error on the Version 1.0 runtime.
I reproduced the error in 2.0. I believe 2.0 does not support event hubs yet,
https://github.com/Azure/azure-webjobs-sdk-script/wiki/Azure-Functions-runtime-2.0-known-issues#functional-gaps
try installing the extensions
func extensions install --package Microsoft.Azure.WebJobs.Extensions.EventHubs -v 3.0.0-beta4
Can you provided more detail about your functions, and the steps you took to create them?
HttpTriggerJS1 was created locally and then published to the portal following the steps outlined in https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local ?
EventHubTriggerJS1 was created in the portal? in the same Function App?
Do not mix local development with portal development in the same function app. When you create and publish functions from a local project, you should not try to maintain or modify project code in the portal.

Resources