Can Azure Functions be deployed to IIS? - azure

I've been trying out Azure Functions and have deployed them successfully to Azure. As their name suggests, Azure Functions are intended to be deployed to Azure. However, now I have the need to deploy those functions to local IIS.
I'm aware that I can adapt the code and create a regular WebAPI project instead, but was wondering if the Azure Function project can be deployed to IIS as-is or with minimal changes.
In Visual Studio there doesn't seem to be an option to publish to local IIS. I tried the option to publish to a Folder (bin/Release). I tried to deploy those files to IIS but it doesn't seem to work.

If you need to run Functions on your own infrastructure, you should use Azure Functions Runtime.
It is deployed to Windows Containers (not IIS), but it will give you a similar experience to Azure-hosted Function Apps.

Related

How to deploy single cshtml file in Azure app service

I have a .Net core app developed using Visual Studio 2019 and deployed on Azure app service. I have function app as well in the same solution. I have to do couple of things and then redeploy to Azure app service.
Add one .cshtml file
Modify one .cshtml file
My question is, how to deploy the CSHTML file only to the Azure app service? Without affecting the existing functionality of application.
As per my understanding, if web app is deployed in Azure app service then the whole thing (solution) has to be deployed even though there are/is very small code modifications.
Please let me know.Thanks.
Even if you have Web App and Function App in the same solution, they should be separated units of deployment. That said, your deployment pipeline should be separately triggered for Web App and Function App.
From the technical point of view(or architecture) there's no concept of "solution". Solution(.sln) is a Visual Studio specific being and even though it's supported e.g. in VS Code, I'd never treat it as deployment unit. Especially in your scenario, when in fact two separate services are responsible for handling your code.
Even if you deploy Function App as a part of the same App Service Plan as your Web App, it's still a separate Azure service. In such a scenario they only share compute.
Yes its possible if you have access to kudu deployment center you can perform manual add/update information , please visit below URL:-
https://[yourAppName].scm.azurewebsites.net
You can also navigate to this site using the azure portal , once you open the app service blade you will find the kudu deployment center option in the bottom left of the menu.
It will provide an online file explorer of your application hosted on the app service and from there you can migrate to relevant folder and perform add/update.

How do I package and deploy a single Azure web app containing several virtual apps from Visual Studio Team Services (previously VS Online)?

I have a Visual Studio solution that contains two web applications (our main site and our WebAPI project). I am able to host them locally in IIS Express as a single site using the applicationhost.config, but I want to package them (in our Build) and then deploy them (in our Release) as a single site from Visual Studio Online (which hosts our code) to Azure.
My Visual Studio Team Services Build configuration packages each of the Visual Studio projects into its own Web Deploy package. The Web Deploy packaging is done during my Build phase, and the deployment to Azure is done during the Release phase - this is done so I am not recompiling source every time I do a deployment, which is unnecessary and would slow down the process.
The first web application identifies "HelloAzure" as the DeployIisAppPath in its pubxml file. The second one (the WebAPI project) identifies "HelloAzure/api" as the DeployIisAppPath in its pubxml file.
Currently, I am using two of the "Azure Web Site Deployment" steps (the one that uses Service Endpoints to perform a deployment). I name the same web app name for both steps. When the second project is deployed, it seems to overwrite the first one rather than adding a second application to the existing site. I believe I must not be following the intended practice for deploying several Web Deploy packaged applications into one web site from Visual Studio Team Services to Azure, but I can't find the recommended practice documented anywhere.
I do need to have both applications hosted within a single site. Deploying them as separate sites is not an option.
It appears that Kudu has some options that might support this scenario, but I am not deploying from source code, I am deploying from Web Deploy packages created by our Team Services build.
The MSDeployAllTheThings VSTS extension supports deployment to a virtual app in an Azure site.
https://marketplace.visualstudio.com/items?itemName=rschiefer.MSDeployAllTheThings
Microsoft also seems to have added official support for deploying to virtual apps from VSTS to Azure to the AzureRM VSTS extensions according to this thread: https://github.com/Microsoft/vsts-tasks/issues/624

Run Azure Cloud App on local QA server without Visual Studio

We use continuous integration to local QA servers, and for normal ASP.NET web sites we just use MSDeploy or similar to deploy to QA servers, and run the applications in IIS.
For Azure Cloud Apps, we would like to do the same, but I can't understand whether or not this is a supported scenario - and if so, if there's a way to do it without actually installing Visual Studio with the Azure SDK on the QA server.
Several guides (like this one) mention cspack and csrun to start the environment locally, but this all seems dependent on having Visual Studio and the Azure SDK. There's also a guide here which I'm not sure is even describing what I'm looking for; it seems rather complicated.
Is there a way to run Azure Cloud Apps on QA servers without Visual Studio? Or is this how it's supposed to be done?

Azure Web Role Deployment

I have a Web Role in Azure that is under development. I would like to make a package that can be published and tested in staging environment without the help of Visual Studio. Is there a way to publish if just the package is provided?
You can use cspack to actually create the package, but from your question it sounds more like you are asking can you publish an already created package. The answer is yes.
There are multiple ways to do this and I'll provide three:
1) The management portal: you can deploy a package if you have the cspkg and csconfig files. Under the Cloud Services you can select a cloud service and select to deploy to the production or staging slot. You can also do this as part of creating a new cloud service in the portal. http://www.windowsazure.com/en-us/manage/services/cloud-services/how-to-create-and-deploy-a-cloud-service/
2) You can use Windows Azure PowerShell and CLI command line tools to deploy an already packaged deployment. In fact, you can also automate packaging and deploying. http://msdn.microsoft.com/en-us/library/windowsazure/jj883943.aspx
3) Using a tool like Cerebrata's Azure Management Studio you can also deploy already created packages : http://www.cerebrata.com/products/azure-management-studio/features
In additiont to being able to deploy an already created package, for Cloud Services you can also wire up to the hosted TFS service and have it deploy your web app when you do a check in. http://www.windowsazure.com/en-us/develop/net/common-tasks/publishing-with-tfs/

Library versions in Windows Azure Cloud Services

So, we deployed an application to Windows Azure and it crashed there for no apparent reason. After debugging it for a while we encountered an error that appeared due to Razor engine parsing failure. This was somewhat surprising as the application worked just fine on a local IIS Express. The error seemed to be caused by a different version of the Razor view engine in Azure Cloud Service and local IIS Express.
Apparently not everything is deployed to Azure when the application is and seems like the Razor view engine is one of those libraries which is NOT deployed with the actual project or red from any configuration file. This was somewhat surprising to me as I was pretty sure that everything is either deployed with the application package OR checked from a configuration file and a correct version is used in the Azure IIS. It seems a bit silly to use different versions that might cause bugs in the applications running in the Azure environment.
Now the question is; What is actually deployed or "installed" to the Azure Cloud Service IIS based on the configuration files in the application to be deployed and what is not?
I didn't find any information about this and am curious about how the actual Azure cloud service configuration is done upon the application deployment.
Also another question; What version of IIS is Azure Cloud Service actually using?
Your Azure PAAS machines are very basic and contain default installs of Windows server. You want to make sure that anything outside of the .NET framework is deployed with your application (e.g. CopyLocal is true), ie; MVC, RDLC, etc.
It is one of the more common deployment vows, as your solution may rely on the .DLL's from the GAC while your deployed to Azure server will not have the same stuff in GAC. So, paying attention to CopyLocal is very important.

Resources