Publish Multiple Projects to Different Locations on Azure Website - azure

Feel free to recommend a better title or changes to my explanation below!
I am using Windows Azure Websites (for the first time) and have connected it to a solution in Visual Studio Online (also my first time). I was also able to connect to Visual Studio Online, create a project, throw up a master page and web form connected to a master page and my Azure website updated itself. Great!
My Issue
If I add another project to the solution it seems that this new project overwrites the files in the first one. I can't figure out how to set this up so:
Project 1 -> deploy to wwwroot (happens by default great!)
Project 2 -> deploy to wwwroot/sub/directory/ (doesn't seem to work)
Could somebody explain how to configure project 2 so that when the solution auto deploys to an Azure Website that it goes to a specific location?

Go to the Configure tab for the site in Azure portal.
Scroll all the way to the bottom then add a new application where ever you want like Project2 below.
Basically the 'Project2' part is the URL after the root '/' and the 'site\wwwroot\Project2' is where the actual folder should live under the site root
Download the publishing profile and import it in Visual Studio, then add the application name after your site name like below. Also remember to update the destination URL as well
hope that helps

Related

What is the best way to move an online Azure Function to a local git repository?

I have written an Azure Function App by using the User Interface of Azure Portal. The code is written in C#.
Now, I want to:
download all of the relevant code and configuration files of this
function app
Create an IDE project (e.g. IntelliJ, Visual Studio Code, ...)
store it in a git repository
Deploy the code from IDE or command line to Azure and thereby replacing the previously written Azure function.
So far, I have found only documentation on how to initiate Azure function projects with no previous code. Does somebody know how to do above?
Yes, you could go to your function Overview page, click on Download app content as shown below.
And in your situation, you want configuration files, so select the Content and Visual Studio Project and Include app settings in the download. What is app settings? This will include a local.settings.json file which contains your application settings.
Also the third party .dlls are included.
In the VS, select the folder and it will be working.
Update:
Open the function with vs, then just right click the function and choose Publish, it will show you the publish page. Click start, then you will be able to publish it to a existing Function.
Follow this Setting up a CI/CD pipeline for Azure Functions doc which explain each step in detail.

I have copied files via FileZilla to Azure but the index page doesn't show

I shall try not to be subjective so as not be closed.
This is my first foray into Azure and it really is NOT like my dedicated server on another hosting company. Suffice it to say, what takes me minutes to deploy a site via FTP, then to IIS to set it up, has taken me WEEKS!
I don't want to set up any of the "pre-packaged" Quickstart solutions. I simply want my INDEX.HTML file to DISPLAY.
I copied all the files via Filezilla to Azure, quite easily, but yet, when I go to the URL, I keep getting:
Your App Service app has been created
Go to your app's Quick Start guide in the Azure portal to get started or read our deployment documentation.
Everything is set up on Azure perfectly.
Here's what it looks like under the appSettings Tab:
**Virtual applications and directories**
/ site\wwwroot Application …
/wwwroot site\wwwroot\mynewsite Application …
The directory, site\wwwroot\mynewsite has an index.html but it will not display when I type in the URL.
I already built the site and the company I'm working for wants it on AZURE.
A dedicated server takes under 15 min. This has taken weeks.
UPDATE:
Thiago, thank you... so here's the file structure below...
Reveals EXACTLY what my directory looks like. Under /thingblugrow is where "the fake name" mynewsite exists. I thought it'd be easier to just show you what I really have.
So, /thingblugrow has an index.html file....
If your want to visit http://yoursitename.azurewebsites.net/mynewsite/index.html,
The appsetting we need config it as following in your case:
Virtual applications and directories
/ site\wwwroot Application …
/mynewsite site\wwwroot\thingblugrow Application …
You also can refer to another SO Thread to get more info about creating Virtual applications and directories
You're adding an extra level, so in your case you'll be able to see the index through:
http://yoursitename.azurewebsites.net/mynewsite/index.html
Just move all the content from "mynewsite" folder to the parent directory (wwwroot).

How to configure an MVC6 app to work on IIS?

So I'm building an MVC6 app in Visual Studio 2015 and have managed to figure most stuff out, however, I haven't yet worked out deployment.
In MVC4 (what I was using before), our process* was publish to a folder, then setup the website in IIS (Right-Click on Sites -> Add Website).
Actually, our process is set it up in IIS and TeamCity, but not for test apps like this :).
I followed this process and obviously it's trivial to setup the IIS website and publish to the correct folder...but that does not actually work for me.
We're running IIS 8 on Windows Server 2012 and we've installed the .Net 4.6 runtime on the server.
The following steps have worked for me and should help you host your project on IIS.
Using Visual Studio 2015 Preview as your IDE,
Create an ASP .NET 5 Starter App.
Check that it is working outside of IIS.
Once complete, publish the application. In this example, I have selected the location C:\PublishWebApp.
3.1. When publishing your application, make sure that you have:
Disabled precompilation
Selected amd64
(See image below)
Upon a successful publish, go to C:\PublishWebApp.You should see the folders approot and wwwroot inside.
Now open the IIS Manager (I am assuming you have the ASP .NET 4.5 feature enabled)
Create a new website.
6.1 : Select the wwwrooot folder as the website's physical path. In this example, it is C:\PublishWebApp\wwwroot.
Check the website to see that it is working. If you encounter any errors, please post them here.
If the precompile option is ticked in the Publish Web Settings window pictured above, then you must
Go to the wwwroot folder of your published web application. In this example, it is C:\PublishWebApp\wwwroot.
Locate web.config.
Inside the folder of your published application, there is an packages folder inside of the approot folder which should contain a folder named after your application, with a folder for the version underneath. Inside that folder should be a folder named root. In web.config, set the value for the key kre-app-base to the root folder. For reference, see the line of code below. In this example, the application name is WebApplication10.
<add key="kre-app-base" value="..\approot\packages\WebApplication10\1.0.0\root" />
I Spent hours on debugging the issue finally got it worked, steps:
1) Publish your MVC6 application using visual studio into file system, make sure you are selecting correct DNX Target version in my case its dnx-clr-win-x64.1.0.0-rc1-update1.
In the output folder map "wwwroot" folder to your applicaiton in IIS (DO NOT Map it to sup-applicaiton, only ROOT application in IIS works with DNX for example "Default Web Site").
I have just spent a day trying to get this working. i found this here (search for posts by GuardRex) invaluable, complete the steps the accepted answer gave, that's the start of it.
Pretty much if you try to add an application to a site there is bunch of workarounds and extra configuration needed that is detailed in the link.
For starters:
1)Make sure you have the HttpPlatform handler installed here
2)Seems obvious but make sure .net5 is installed on your server here
I know this is if you are adding an application to a site, but there's some pitfalls and much needed refinements needed for the deployment process at the moment that everyone should be aware of.

Continuous Integration with Visual Studio Online and a multiple solution project

I have an MVC Web App that I am trying to get set up with continuous integration on Azure and Visual Studio Online. Basically, the solution has 4 projects within, 3 of which go to supporting the 1 Web App. The problem is, when I set up continuous deployment on Azure, it builds the entire solution and doesn't know which project I want for the root URL.
When I download the drop folder that is produced by the compilation it looks like this.
drop/lots of dlls including the dll of my web app.
drop/_PublishedWebsites
drop/_PublishedWebsites/MyWebApp (including its bin, content, fonts etc)
drop/_PublishedWebsites/MyWebApp_Package
and some other folders as well.
How can I configure the continuous deployment to put my Web App at the root of the website??
Thanks
Looks like the dumb solution is to rename your "main" project to be the alphabetically first project in the solution. Microsoft suggests this, or having only one project per solution. Either way, this is the most reliable and simple way to get the desired effect.

After migrating TFS server to server projects not showing up in team explorer

Here is the setup:
We had a one server TFS solution previously. We split each part out so the DB, TFS and the Build Service each have their own server now.
I manually restored the TFS DBs to the new server. I installed the app tier on the app server and the Build Service on another server. As usual, everything works fine on my computer. However, about half of my team has an issue where the team explorer shows just one project. Most of the team doesn't even have permissions to view this project yet it is all they see.
I had each of them run the tf workspaces ... command to sync up their workspaces to the new server location. I verified permissions. I had one of the affected delete his workspace and create a new one. Same issue. Team explorer only shows one project... that he doesn't even have permission to view. Source control explorer seems to operate fine.
Also, this only seems to affect one project collection. I have not heard anyone on another project collection having this issue.
Suggestions?
Hmm, I'm wondering if you need to do a ChangeServerID.

Resources