Error while accessing Azure Functions app - azure

I have an Azure App deployed. This app is tested locally (in VS Code) & deployed via Azure Devops (using Azure Pipeline). It successfully runs in local environment while testing. It also has deployment slots enabled.
Bindings used in this Azure Functions are ServiceBus (trigger) and Storage (output). Also the Function App has a package.json in the root of the project for installing the dependencies (as per this article).
When accessing the app in Azure portal I get this error:
When I access the staging slot, I get this error(Error about bindings):
Errors on staging are related to binding errors, but looking at this Integrate page for staging slot it seems they are recognized correctly.
How can I get rid of these errors? What am I missing? Am I missing some extensions of these bindings. And why the error on production slot has the message An error has occurred. with no more detail.

For V2 function you need to register service bus extension using CLI:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-register#local-development-azure-functions-core-tools

Related

Azure release pipeline keeps adding ".scm" to the appservice's URL

I have an appservice called compspiadev, and I am using Azure's Pipelines to set-up CI/CD. Created the build pipeline and build the project into an artifact to use it in the build pipeline. When I try to deploy I get the following error:
Now my appService doesn't have the ".scm." part in it, and in my configuration I don't set the name to have the KUDU endpoint it adds it automatically:
How can I fix this issue for it to deploy correctly?
Your guess is correct. That is an network error which is because our Azure devops Hosted agent could not connect to the internal deployment endpoint of ILB ASE. (As I mentioned in this ticket, I checked your app from our backend and found it is connecting to ILB ASE.)
You can check this source code (actual working code snippet, I can not help you locate the exact code line since I don't know witch deploy method you used), and you will found that the process of Azure app deployment via Azure app service deploy task is actually the process of communicate with app files to Kudu service (xxx.scm.azurewebsite.net).
For example, if you are using Run from package type to deploy your web app, you can refer to this code snippet.
After you configured ILB ASE, per this doc, the scm site is only available at <appname>.scm.<asename>.appserviceenvironment.net. But you should have known that Hosted agent is a dynamic-distribution Azure VM that is neither in nor connected to the virtual network.
That is why you encountered the error like could not connect to the remote computer <appname>.scm.<asename>.appserviceenvironment.net.
To resolve this issue, you need use private agent to execute your deployment pipeline. For how to configure a valid self agent so that it can communicate with your private DNS, you can follow this reply or this blog.
As is visible in (the URL part of) the error message in your first image, you're deploying to an App Service Environment (which is something of a special cookie).
The Azure App Service Environment is an Azure App Service feature that provides a fully isolated and dedicated environment for securely running App Service apps at high scale.
As we can see in the second image, you don't have the checkbox "Deploy to Slot or App Service Environment" checked.
Check that checkbox, specify the Resource Group name, leave slot name set to production and you should be good to go.
If the deployment target is an Azure App Service environment, leave the slot name as production and specify just the Resource Group name.
Source: Azure App Service Deploy task - Prerequisites for the task

Azure function app deploy and release pipeline error

I pushed my .net core function application using visual studio and now setting up release pipeline. I can publish and execute the application just fine and it works great on the Azure portal. However when I see the builds for releases in azure-devOps that slot fails with the following error.
2019-06-19T23:21:33.3543380Z ##[error]Error: Deployment of msBuild generated package is not supported. Change package format or use Azure App Service Deploy task. D:\a\r1\a\_...AVFunctionCore.zip
I am not sure where I need to check in my setup to even start diagnosing the issue.
Here are the pipeline steps.
I create a new stage and then select a template of type (Azure app service deployment)
Under tasks
App type is Function App on Windows
Give the app name, resource group , give the slot and
package folder as
$(System.DefaultWorkingDirectory)/**/AVFunctionCore.zip
Everything else on this is left as default.
Azure function app deploy and release pipeline error
According to the error message:
Deployment of msBuild generated package is not supported. Change
package format or use Azure App Service Deploy task.
It seems you are not using the correct task to publish the generated package. Since the generated package is .zip, you can try the suggestion as error message said use Azure App Service Deploy task.
Azure App Service Deploy task:
Use this task in a build or release pipeline to deploy to a range of
App Services on Azure. The task works on cross-platform agents running
Windows, Linux, or Mac and uses several different underlying
deployment technologies.
The task works for ASP.NET, ASP.NET Core, PHP, Java, Python, Go, and
Node.js based web applications.
The task can be used to deploy to a range of Azure App Services such
as:
Web Apps on both Windows and Linux
Web Apps for Containers Function
Apps on both Windows and Linux
Function Apps for Containers
WebJobs
Apps configured under Azure App Service Environments
Check this blog Visual Studio 2017 Tools for Azure Functions and Continuous Integration with VSTS for some more details.
Hope this helps.
I get predefined pipeline from VS integration. So for those you have the same case:
In GUI/Classic mode Release page -> edit pipeline
Edit task in stage section (this is responsible for deploying)
Replace Azure Web App task with Azure App Service deploy
I have more than one project (web api + azure function) in my solution. For the web app I used the zip file, but for the azure function to work I needed to publish the whole folder.
Azure Function
Package or folder:
$(System.DefaultWorkingDirectory)/_Backend/drop
Web Api
Package or folder:
$(System.DefaultWorkingDirectory)/_Backend/drop/ClientAPI.zip

Deploying a Java Azure Function to Azure Functions Runtime (On Premises)

So I am using Azure Functions at work and thought I would have a play and install them on my own server. I have successfully installed Azure Functions Runtime 2 (preview).
I have then followed the Java tutorial to create an Azure Function :
https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-first-java-maven
How do I then deploy this function to my own Azure functions server?
In the guide it says about using :
az login
mvn azure-functions:deploy
Unfortunately, mvn azure-functions:deploy is to deploy functions to Azure site as az login is required before deployment, which doesn't support deployment to on-premises Runtime portal.
But the key point is, the on-premises Runtime is obsolete(one year behind the latest bits), new project probably can't work with it even if we find how to publish.
Since v2 becomes GA, it is recommended to leverage custom image for usages out of Azure box.
Update
Missed one point. As AF Team answered in the issue you post, no Java Image for now so the usage of Azure Java Function outside Azure is blocked unless we could figure out creating the image on our own.

Azure Functions - Visual Studio Tools

I was trying to create Azure Functions as provided in the help link - https://blogs.msdn.microsoft.com/webdev/2016/12/01/visual-studio-tools-for-azure-functions/
I am actually creating a Evenhub trigger to write the messages to blob storage.
When I try to run the project, I am getting an error:
"Microsoft.Azure.WebJobs.Host: Error indexing method
'Functions.DashPOCEventHub'. Microsoft.WindowsAzure.Storage: Value
cannot be null."
I have put the correct values in the appsettings.json.
Can somebody help me with this error?
Also, when I try to publish the function to Azure, the appsettings.json is not being set correctly. I cannot see the values and keys when I go into the Azure UI application settings page.
appsettings.json won't create/override your web app ApplicationSettings when you deploy. You'll need to specify the ApplicationSettings for the web app explicitly.
The reason for this is so that you can use different secrets locally (appsettings.json) from what you deploy (web app appsettings).
There is more info on appsettings.json and web app Application Settings here.
Silly John, did you update the Azure CLI when you run your Function Locally? Today is on the Azure Functions Console CLI 1.0.0-beta.97.
Probably, this update solves this issue.

Azure Worker Role / Web Role not reading from ServiceConfig

I have an Azure Worker Role (WR) which is supposed to pick up it's config from the .cscfg files using:
var setting = CloudConfigurationManager.GetSetting("My.Setting.Name");
Running in the emulator this is fine, I get the:
Getting "My.Setting.Name" from ServiceRuntime: PASS.
message. However, when I publish to my remote environment, I get:
Getting "My.Setting.Name" from ServiceRuntime: FAIL.
Getting "My.Setting.Name" from ConfigurationManager: FAIL.
messages. In the 'CloudServices/Configure' section of the Azure Management Portal I can see the setting listed in the configuration, and it's set correctly.
I'm using Azure SDK 2.0
Are you deploying correct Azure SDK .DLL's with your project? Did you by chance upgrade recently to a newer Azure SDK? I would check your .DLL references to make sure that they all match across the solution

Resources