Learn how to edit Azure web app files in Visual Studio and publish the updates to Azure App Service.
[Narrator] - At this point we've provisioned several app services, and now we want to write some code, create some content, and eventually, when we're satisfied, we will push or publish or deploy those changes to Azure. Typically the development process is done with code tools that are on your local computer. So we need to somehow pull the code files over to my local computer, and then push them back. Now this is a rather big topic, and we've got courses that cover this so this is just going to be a quick overview.
I'll just be showing you some things. And I'm going to show you visuals to decode and Visual Studio. Now Visual Studio Code is a free tool and I've installed it. And I've also installed a couple of extensions to connect it to Azure. Again, that's beyond the scope of this video, but you can learn how to do that in our catalog. What I can do now is I've connected to Azure, and if I click on this section Azure, it'll show me all of the services that I have running in Azure, and I can see in this section, I've got all the app's services. So here's my Stata HTML five site.
So I'll open this up, drill down into the files, and then when I click on this HTML file, it will load that file (mumbles). So what's happened is it's pulled the content over so I'm editing it locally on my computer. And I'm going to change this text. But before I do that, let me show you a nice feature. I can right-click here, and choose to either open this in the portal, which would be the same as opening it here, or I can browse and go to the actually running site. And now I'm ready to make my changes. I'll go over here and put a number two there.
And then I'm ready to save the changes. And because this is remote, I can't just save it locally. If I want to see it on the website, I also need to upload it so I'll click on this button. Now it's updated to the web server, and now I can go back over here and refresh. Oh dear. I didn't save my changes. Let's try that again. Somehow I missed my changes so we'll do the same thing. Let's save it again. Upload.
Refresh. That's what I wanted to see. So that's nice. Now I can do the exact same thing if I've got a copy of Visual Studio. Over in Visual Studio, I've connected to my Azure account. I can open up this tool called the cloud explorer. This shows my subscriptions. Again I can pop open these notes, drill down in to app services, find that HTML big picture, and do the same thing here. Drill down into files and now when I double-click on this html file, it downloads a copy, and I can make my changes here.
Visual Studio knows how to do that. Quickly open up this ASP starter section here. Drill down into files. Here's all the of the files for the ASP site on the Azure server. So there's things like this account folder that's pulling down the changes right now. Now I've got the local copy of those files. I've got the default CSHTML file. This is a code file, a file that can have HTML and C Sharp code in it.
There's images and scripts and so on, and then because this needs to have executables when I compile it. If I look in this bin folder, I'll see there's a bunch of DLLs in here. And again, the whole idea of asp.net coding is beyond the scope of this video here, but I wanted to show you that I can see the content of these files. And even change them if necessary. Let's see, let's try this. We'll go to Default.cshtml. I double-clicked on this file. Then pull a cope over locally.
Right here, I'll type in hello comma. Save everything, and then I will go to open this in the browser. Oops that's the wrong one. Let's make sure I pick the right one. This one here. Open in browser, and there's my modified text. So the takeaway is easy to create these app services, and if you have the right tools on your developer computer, you can easily modify, then fix them.
In reality of course you should be using things like Source Control. We'll talk about that in the DevOps chapter. You should also be using Continuous Deployment. We'll talk about that in the DevOps chapter too.
- Comparing SaaS, IaaS, and PaaS
- Azure subscription options
- Azure costs
- Hosting websites and web apps with App Service
- Building workflows with Logic Apps
- Assessing Azure Storage options
- Securing services with Azure Active Directory
- Building systems with Azure virtual machines
- Continuous integration and deployment
- Machine learning and AI in Azure
- Sending notifications
- Encoding media