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.
Related
I have a query regarding deploying the Azure function in the portal using the CLI.
I have created the storage account, resource group and created instance for the function app as well.
I created one normal azure http trigger function.
After that I have executed the command to deploy the Azure function using CLI. My command is executing without any issues but when I check the same in the portal changes are not reflecting.
Please help me to resolve the issue .
Thanks in advance.
Regards,
Manikanta
As already mentioned by George and Thomas.
Please make sure to meet the requirements, especially the project file struct.
https://learn.microsoft.com/en-us/azure/azure-functions/deployment-zip-push#deployment-zip-file-requirements
After deployment , restart the app.
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
I am trying to deploy the basic-bot Microsoft Botbuilder sample application to azure.
I started by creating a new botbuilder node.js sample application through the Azure dashboard, and I was able to successfully follow the instructions here to download and redeploy the application.
I then attempted to copy over the deploy scripts and .env file from the downloaded sample application into the basic-bot application, and attempted to publish using the az bot publish command from the link above. This successfully deployed the basic-bot application, but the deployed application now returns 500 errors. Initially, the 500 errors were caused by the "botbuilder-ai" nodejs package not being installed. I installed this package manually through the Azure console, and this error went away. But the application continues throw 500 errors, without producing a stack trace, and I have not been able to determine why.
The only official documentation I have found that explains how to deploy the bot is specifically for C# and Visual Studio. Is there a way to deploy a bot to azure for a Node.js app using the azure CLI?
Thank you.
Is there a way to deploy a bot to azure for a Node.js app using the
azure CLI?
Yes there is. You can type az bot publish -h for all the options available to you when publishing a bot. Here are some tips about getting it to work:
You will need to log in to Azure with az login
Make sure you've set an active subscription. Type az account set -h for help. Use az account list to see your choices of subscriptions and az account show to see the current active subscription
Publishing can be easier if you set the resource group you're publishing to as your default. Unlike your active subscription, configured defaults don't reset when you log out. Use az configure to see your current defaults and az configure -h to see how to set a default resource group
If you publish and it says Not a valid azure publish directory. missing post deploy scripts then you'll need a PostDeployScripts folder in your bot folder
There are some instructions in the deploymentScripts folder that you might find helpful. Note that as an alternative to the Azure CLI, you can also publish from Visual Studio Code using the Azure App Service extension.
If you publish successfully and you're getting errors when you try to test in Web Chat, sometimes Azure needs a little nudging. When I checked my Channels blade it said Web Chat was encountering errors regarding missing files. I tried some troubleshooting steps and eventually got it to work without any real changes.
Try logging out of your Azure account in the online portal and then logging back in
Try running your code in the online code editor in the Build blade
Try publishing again
Regarding your specific situation of trying to repurpose the downloaded source code to deploy the basic-bot sample, there are a few things you need to know. The .bot file is very important as it contains information about all the services the bot uses, but basic-bot.bot contains none of the needed information. In addition to the deployment scripts and the .env file you will also need to copy over your .bot file. However, basic-bot's bot.js expects the .bot file to contain a LUIS service named "basic-bot-LUIS" so you need to go into the bot.js code and change the value of LUIS_CONFIGURATION to the name of the LUIS service in your .bot file ("BasicBotLuisApplication" if you downloaded the V4 Basic Bot NodeJS code and kept it the same). Make sure you can get the basic-bot sample to run locally before you try to publish it.
I may very well be not understanding how this works, but I thought I was doing pretty good up until now.
I have a Azure Storage Account setup for my WebJob Dashboards.
In the application settings of my WebApp I am setting a Connection String AzureWebJobDashboard of type Custom and it has the connection string to that storage account.
In my Webjob I have the following code:
[FunctionName("ProcessIncomingCustomerQueue")]
public static void ProcessIncomingCustomerQueue([QueueTrigger("incoming-customer")] string message, ILogger logger)
{
When I start the webjob, is acts like it is finding everything correctly.
No error message about needing to configure the AzureWebJobDashboard.
When it starts it finds the function per the log:
But when I click on Functions on the top right it says "No functions are present".
Is that not what that is for, to show the functions that are in the webjobs?
Thank you --
Joe
Azure Functions and Azure Web Jobs are 2 different (but related) technologies.
Web Jobs run as part of your Web App. Azure Functions are running separate from your Web App.
If you want to have an Azure Function, create a Function App Resource in the Azure portal and use either the Web Portal to write your code or create a Azure Function Project in Visual Studio and deploy it to that resource.
You can also use Visual Studio Code and the Function CLI to create Azure Functions.
Find details and quick starts here:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-first-azure-function
https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-your-first-function-visual-studio
https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-first-azure-function-azure-cli
I am trying to chance some appsettings and the ConnectionString of an application in a certain slot in my Azure Web App.
When I try to change the config via the Application Settings on Azure portal, nothing happens.
So I found this post:
http://brian.vallelunga.com/blog/chaining-azure-web-config-transforms-when-deploying-from-source-control
Ok, I done what the tutorial tells me to do and I got success on some deploys (I am using Kudu for auto deploy from GitHub).
But suddenly (without any change of config) the deploys are using the Release transform, instead of the dev one.
Via Kudu console, I saw in deployment folder, in some moment Kudu transformed my web.config in right one, and after transforms it again into the release version.
Someone have any idea what I can do?
Oh. My solution have more than one web project. I am using the "Project" Key on Azure application config page and that one works.
Thanks,
Ok guys, found the answer.
For some strange reason, the value of the parameter SCM_BUILD_ARGS changed from /p:Environment=Staging to -p:Configuration=Debug.
I just passed that value on Azure app settings and voil! It's working now :)