Zip Deploy Azure function to the Azure Portal using Azure CLI - azure

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.

Related

Change publish method for azure function app

Is it possible to change the publish method for an azure function without deleting and recreating it? Currently I want to swap the publish method from code to docker containers for a couple of azure functions apps.
I am not able to find anything useful for this matter under the deployment center or under the Microsoft's Azure CLI documentation.
I've seen that it's possible to do that for webapps but didn't found much about azure functions apps.
I highly appreciate any kind of help!
Thank you!
Here is the suitable MS Doc for your requirement of changing the Publish Method of Azure Functions to the Docker Container.
This documentation contains different ways of achieving the above requirement such as using the Azure Functions core tools commands, CLI and also PowerShell Commands.
The actual way of deploying/publishing the Azure Functions is creating the Azure functions along with the docker image initialization. But, when publishing the Azure Functions code manually to docker, you need the docker file in your Azure Functions Project.
You can initialize the docker file using the command func init --worker-runtime -docker which will prompts for the langauge runtime such as Java, dotnet, node, python, etc.
Refer to the SoundCode article given by #MarkHeath and Educba article for more information on adding the docker file in Azure Functions project and publishing to docker.

I've generated resources using Azure Bicep in ADO pipelines. Need to make a new pipeline that will populate the resources with code. Not sure how

I've got a bicep file that has made the following resources: Function app, storage account, app insights, key vault and app service plan, via a build pipeline in Azure Dev Ops Pipelines. I need to populate these resources with artifacts built from source code e.g. adding functions to the function app. I'm not sure how to do this though. Does anyone have any advice or links to tutorials? I'm new to Azure and would appreciate any help. Thanks.
Basically, Azure pipelines working with tasks to deploy artifacts to the resources. These resources can be AKS, IIS or Azure functions as you mentioned. If you particularly looking for Azure function deployment task you can use the AzureFunction#1 task for that.
Here is some additional useful links;
https://www.azuredevopslabs.com/labs/vstsextend/azurefunctions/#:~:text=Azure%20Functions%20is%20an%20event,well%20as%20on%2Dpremises%20systems.
https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-azure-devops?tabs=dotnet-core%2Cyaml%2Ccsharp

Azure Devops Pipeline returning: 'Failed to deploy web package to App Service. Internal Server Error (CODE: 500)'

I am trying to use Azure DevOps pipelines to build a .NET 5 (Core) web app and deploy it to my Azure app service. I can't find any complete examples in the documentation that achieve this so I'm following this:
https://github.com/shahedc/NetLearnerApp/blob/main/azure-pipelines.yml.txt
However, the Azure deploy task keeps returning this vague error:
In my Azure portal I only get this error:
I am assuming the issue is in my pipeline because deployment works when I deploy it directly from the Deployment Center in the Azure portal. Here are the details for the 3 relevant tasks my pipeline:
I found the solution. It turns out the issue was not in the pipeline, but was caused by a Git connection to the app service I had previously set up in the Azure Deployment Center. Even though I disconnected/removed this Git connection, there was somehow still a residual file left over in Azure that was causing the error. I deleted the 'deployments' folder in Kudu (pictured below) and the pipeline started working as expected.
Getting to the above pictured view:
Navigate to your Azure Function project
Search for Advanced Tools
Open PowerShell
Check if you have disk space available.
Yesterday we started getting this error, even if we tried to re-deploy packages that were successfully deployed just an hour before. Our system guys checked and found out that we reached the space limit and that it was time to upgrade.
P.S. I know that this was answered a long time ago. I am just sharing the solution that was not mentioned here and that worked for us.
think what Dan Beaulieu said in above answers is correct, but one thing to add, in my case, after deleting the deployments folder, remember to restart the app service/web app, which will make it take effect.

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.

Resources