Deploying [different-project-folder] instead of selected folder [current-project-folder]. Use "appService.deploySubpath" to change this behavior - azure

I have two projects I'm working on for two separate Web Apps on Microsoft Azure under the same subscription. The first Web App project works fine, but for some reason when I try to deploy my new project to the other Web App, VSCode keeps telling me:
Deploying [first-project-folder] instead of selected folder [current-project-folder]. Use "appService.deploySubpath" to change this behavior.
Even when I change this setting to point to the correct project folder, it does the same thing. Nothing changes. I'm using the Azure App Service extension in VSCode on Windows 10.

I had a similar problem, and it was because I was changing the deploySubpath in the wrong settings.json file. I changed the one in the directory I was trying to deploy and it didn't work.
Try changing settings.json under the root \.vscode.

Related

Azure App Service Could not load file or assembly

I am trying to stand up a sitecore site inside a fresh app service in Azure. This already works in our production Azure account, but we would like to see how to set it up from scratch.
The build and deploy succeed in pushing it out to the app service, however, I am getting:
Could not load file or assembly 'System.Web.Http.Cors, Version=5.2.3.0
and no further information. I verified that system.web.http.dll is present in the bin folder. I read in some other articles that sometimes the wrong version could cause issues but this works on my work machine. Is there another step I need to do to make this work in an app service? Some configuration change, maybe?
The dll is missing in the published (deployed environment). That is the reason why it is working in the local i.e. Visual Studio but not in the Azure Website Environment.
Just do Copy Local = true in the properties for the assembly(System.Web.Http.Cors) and then do a redeploy, it should work fine.
If Copy Local is already set to true and you cannot update the WebApi because of dependencies, there is that trick to set Copy Local to false, build, then set Copy Local back to true and build.

Functions published as a VS2015 Web Application not showing up in the portal list

I followed the roadmap to create a set of Azure Functions as a Web Application. They deployed without an issue to my Azure Function App.
I moved the project to a new solution and changed the name spaces and updated the function.json files. When I redeployed to the Function App I was getting a bad entry point on one function which I double checked and tried to update a couple of ways without any success.
Thinking that the Function App might be caching I tried restarting the app and then finally went into the App Service Editor and deleted all the files and republished. Now none of the functions show up in the list even through the directories and function.json files for each function are confirmed present.
Has anyone else experienced something like this or have a suggestion as to how to resolve it?
It looks like your script file in function.json is set to a dll that doesn't exist in bin. Double check the dll name there.
You can see the content of bin folder on azure through debug console by going to https://<yourAppName>.scm.azurewebsites.net/DebugConsole

VSO not deploying Azure website with WebJob

A website with webjob not deploying to Azure.
I am having an issue getting a website with an associated webjob console application to deploy using continuous deployment via Visual Studio Online. I am using VS2013 with update 4 and latest Azure SDK.
The website, and the associated webjob, will publish to Azure using direct publish for Visual Studio and works perfectly, so I am confident the publish settings are fine.
The solution will build and work locally fine.
The solution, once checked in, will build and (seemingly) deploy fine in VSO (using CI) and Azure notes the build was successful and shows it as 'Active deployment'.
However, the website and associated webjob will not be updated.
When I have browsed the deployed files after the VSO build and deploy on Azure, all that is happening, is the binaries of the console app are being copied into the bin/ folder of the website.
None of the website files are being updated. It is almost as if it is deploying the wrong project!
If I remove the Webjob and just deploy the website, it will build and deploy fine through VSO - the website will update.
It is adding the webjob that causes some issue with the deployment via VSO.
I am confident all steps are correct to add the webjob to the WebApp, with the correct webjobs-list.json being added to the webapp and webjob-publish-settings.json to the Console app - as I said, publishing the website (with the webjob) direct to Azure works perfectly, and both the site and webjob get updated.
I have searched post after post and tried all manner of things, but none have worked.
Given the fact this published fine direct from VS, and also that the build is completing, it would suggest that something is wrong with the VSO Build Defintion.
My first guess would be to change it from building the solution to instead building the web project only, but this does not seem to work.
I have also tried every Output location setting (both for the solution build and the web project build) - the only one that works and the build completes is the solution (.sln) build with 'SingleFolder' set.
I have been battling this for a couple of days now an I'm a bit stumped!
This also happens if you have a static website being deployed using a Visual Studio solution via VSO with an automated build - unless the Visual Studio project / solution containing the website is changed then the actual site contents will not be redeployed.
I think your hunch that it's deploying the wrong project is correct. If you have multiple "deployable" projects in your solution (and the console app is considered deployable, as this is one way you can host/deploy a webjob), you need to tell Kudu which one to deploy.
You can control it adding a new setting under "app settings" on the "configure" tab for the webapp.
The setting you want is Project and it's a relative path from the solution root to the .csproj file of your web project.
Alternatively, you can specify the setting in a custom .deployment file.
Relevant Kudu documentation here
From the documentation:
You can specify the full path to the project file. Note that this is not a path to the solution file (.sln), but to the project file (.csproj/.vbproj). The reason for this is that Kudu only builds the minimal dependency tree for this project, and avoids building unrelated projects in the solution that are not needed by the web project.
Here is an example:
[config]
project = WebProject/WebProject.csproj
I have also tried every Output location setting (both for the solution build and the web project build) - the only one that works and the build completes is the solution (.sln) build with 'SingleFolder' set
That's the root case of problem.
You can't have SingleFolder as it sets the OutDir which mess up with web job packaging.
I had to introduce a wpp.targets files in each of my web app project to create the publish package to a particular path (using PackageLocation)
So, let each project have that and set the setting to AsConfigured (or Per Project) instead of SingleFolder.
See this

Azure Service Configuration Files

So I have been banging my head against a wall on this one...I am trying to publish an Azure Web Role and I have two ServiceConfiguration files:
ServiceConfiguration.Cloud.cscfg
ServiceConfiguration.Local.cscfg
In my publish xml I have:
<AzureServiceConfiguration>Cloud</AzureServiceConfiguration>
So my assumption here is that when I publish it will use the Cloud cfg.
For working locally, under the emulator I have set the flag for local debugging to use Local.
However it would seem that this flag here also determines the cscfg to use for the cloud...so I am a little confused - is this the correct behavior or am I missing something? I really want to have a separate one for local as I have different values I need.
Update
Suddenly it started to work fine today. Didn't really change anything.
Tom, your publish XML configuration file is OK, and your publish to Azure will use the .Cloud.cscfg.
You can pick which of the configuration files you want to use when publishing (right click > Publish...), on the second screen (under Service configuration).
What you did for your local environment should work fine, and use the .Local.cscfg file.

How to get standard out from a Node.js application in Azure?

We have a Node.js application with a pretty big codebase that we're trying to deploy to an Azure Web Site. My problem is that when I deploy the app and try to access it, I just get a message saying "The page cannot be displayed because an internal server error has occurred".
According to http://azure.microsoft.com/en-us/documentation/articles/web-sites-nodejs-debug/ I should be able to configure some settings and have my standard out be logged to a file - well, it's not working. in /LogFiles I can see /git, /html, and /DetailedErrors, but none of these folders contain the stdout logs.
I have deployed the app using Visual Studio. I created a blank Azure project, and manually added all the folders and files I need. I also created an iisnode.yml file that contains the following config:
loggingEnabled: true
devErrorsEnabled: true
logDirectory: ./logs
debugHeaderEnabled: true
The last two lines I added later, the first ones are from the tutorial. I also have a web.config file, the contents of which I haven't really touched.
I've attempted to configure the settings that are available in the Web Sites UI, but I haven't really been able to make any headway. I think currently they are pretty much default.
I'm sorry that I can't provide you with more information. I'm really kind of banging my head against the wall here, since all the tutorials I've found basically state that if I do this and that, everything should work. The problem is, it doesn't. Sad face.
Edit: I should probably add that my server.js is in a folder called /NodeServer. It's not in the root as Azure seems to presume.
Edit2: I deployed a Hello World example and got it to work, but when I try to move the server.js file from the root I can't get it to work anymore.
I've added a tag to the web.config, so that the structure is basically
configuration
location path="NodeServer"
system.webServer
I've also edited my package.json so that it says
"main":"NodeServer/server.js",
"scripts":{
"start":"cd NodeServer && node server.js"
}
If the app is started successfully, you should be able to find the stdout at
D:\home\LogFiles\Application
in Azure Websites, without configuring anything.
But here it looks like an error related to incorrect/missing web.config. The node app may not get launched. You can try:
Publishing your app using git to Azure Websites.
Or if you are familiar with IIS and iisnode, make sure your app works locally with IIS and iisnode. See http://tomasz.janczuk.org/2011/08/hosting-nodejs-applications-in-iis-on.html
Or try publishing an "hello world" node.js app to Azure Websites, take the generated web.config and modify it for your app.
Edit: When you change the location of server.js, you have to change web.config too. The change in web.config is not correct. And package.json is only used as hints to generate web.config during git deployment. To get your "hello world" to work, you can either
In your web.config, replace all "server.js" with "NodeServer/server.js".
Or deploy the modified app using git. Make sure it does not contain the wrong web.config.
Then you can try to get your larger app to work.

Resources