How to deploy single cshtml file in Azure app service - azure

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.

Related

Deploy an existing web app over a new one

I have a working app service named "matanwebserver" over a subscription in Azure.
This is a website that I am working on. I work with Visual Studio and I wrote my code inside this app service in Visual Studio.
Now I want to create an Integration site so I can test my code before publishing to the production site.
For that, I created a new app service in azure under the name "matanwebservertest" and I want to use the code I wrote for "matanwebserver" over the new app service that I just created.
I could not find any source which provides a solution, so thanks in advance.
Added some screenshots for a better understanding of the issue
In Visual Studio I do right click on the web app which is called "MatanWebServer" and choose "publish".
Then I choose the new web app that I just created on Azure portal which called "matanwebserertest", and publish successfully.
enter image description here
This is the original (production) website. which its address is http://matanwebserver.azurewebsites.net
enter image description here
After publish to the matanwebservertest web app, I expect to see a "copy" of the original site, but it seems like nothing is there.
enter image description here
To get the current app cloned to the new one, have a look at the 'Clone App' option.
What you're trying to do feels like a perfect example to use for using Deployment Slots Please refer to Set up staging environments in Azure App Service.
When you deploy your web app, web app on Linux, mobile back end, and API app to App Service, you can deploy to a separate deployment slot instead of the default production slot when running in the Standard or Premium App Service plan tier. Deployment slots are actually live apps with their own hostnames. App content and configurations elements can be swapped between two deployment slots, including the production slot. Deploying your application to a deployment slot has the following benefits:
You can validate app changes in a staging deployment slot before swapping it with the production slot.
Deploying an app to a slot first and swapping it into production ensures that all instances of the slot are warmed up before being swapped into production. This eliminates downtime when you deploy your app. The traffic redirection is seamless, and no requests are dropped as a result of swap operations. This entire workflow can be automated by configuring Auto Swap when pre-swap validation is not needed.
After a swap, the slot with previously staged app now has the previous production app. If the changes swapped into the production slot are not as you expected, you can perform the same swap immediately to get your "last known good site" back.

Azure WCF Service in a Web App rather than a Classic Cloud Service

I have created a Xamarin Android App that uses Azure for the back end. It seems that it would be better to host it in an App Service, but in Visual Studio 2017 Community, the only option seems to be to host it in a Classic Could Service. In VS, I created a Cloud Service project and added the WCF Project as a Role. Is there a better way to do this?
If you can't use Visual Studio Web Deploy, you can use FTP to deploy your compiled project. The FTP information is located in the Overview blade of the App Service. In the same blade, you can also click on the Publish Profile button to download an XML file containing credentials for Web Deploy and FTP.
Here's a video explaining the whole process.

Continuous deployment from Visual Studio Team Services to Azure App Service

I'm trying to automatically deploy from Team Services (was Visual Studio Online) after a successful build a C# program to an azure app service without success.
I can only do it to a cloud service (classic) rather app service.
I've seen that I could plug Team Services directly to the app service with "deployment source" (I did tried so far because both tenant, Team Services & Azure one are different and requires some effort)
but wouldn't it break the normal release / test process from Team Services?
I can only find little information over internet regarding these topics ...
Any help would be appreciated.
You can also add a FTP Upload task in your build definition to publish the output to Azure App Service via FTP Method.
To publish to an Azure App Service, you need to use either of the following Agent tasks:
Here is a walkthrough: https://www.visualstudio.com/en-us/docs/build/apps/aspnet/aspnet4-to-azure
When making a new build definition, it is easiest to choose the Deployment -> Azure WebApp option.

Add Azure WebJob to mobile service hosted in App Service

With the new Azure Mobile App Services in Azure the mobile services apparently gains the same WebJob support as Websites have had for a while.
Following the article Deploy WebJobs using Visual Studio according to the section 'Enable automatic WebJobs deployment with a web project' we should be able to add a web job from a right click on the project. None of these options show up for my mobile service project in VS.
I can add a WebJob project to the solution manually, but this does not add the webjobs-list.json file to my mobile service project as the article suggests.
Does anyone know why the add web job context menu doesn't show when right-clicking on the mobile service project? Or the manual steps required to configure the project and appropriate webjobs-list.json file?
Update:
I have manually added the webjobs-list.json file to the main project by copying the format from another initial template project and adjusted the web job project path in it. Even deploying the mobile service to an azure web app doesn't pick up the web job.
It should work. I just created a new Mobile App, downloaded the quickstart, right-clicked the web project (appname-code), and was able to associate a webjob to the web project. Deployment worked as planned. Did you try that workflow? Did you try adding the webjob through the portal?

Azure Continuous Deployment from Visual Studio Team Services with multiple projects

While using Github (or anything other than Visual Studio Team Services) I can use the following page to customize deployment: https://github.com/projectkudu/kudu/wiki/Customizing-deployments
I'd like to customize my deployment as I currently have both a web app and a web api project. I want the web app to be deployed, as default it deploys the web api project. Using project Kudu the settings (.deployment file or even better, the app settings on Azure itself) works great, but not when you deploy from Visual Studio Team Services.
I've spoken with David Ebbo from Project Kudu, and he explained that VS Team Services doesn't use Kudu at all, but probably MS Build. So my question is, how to specifically deploy the web app.
I managed to change the Build Definition and specify the web app .csproj as the Projects To Build. This works. However, I also want to deploy my web api.
Deploying the web api project with Kudu is easy as I can create a separate website, connect to the some repository (and solution) and specify the Project App setting so that it deploys the correct .csproj. How should we do this for MS Build? When I change the Build Definition, it will always deploy the project specified in there.
Just saw another answer on Stackoverflow that looks to solve this problem: Publish Multiple Projects to Different Locations on Azure Website

Resources