I have created a Linux Node JS app in Azure. I have created a Blank Azure Nodejs Web App project in Visual Studio 2022.
When I try to publish my code to the Azure app, I right click on the project > Publish > Azure, but the option for Azure App Service (Linux) is missing. I do see the option for Azure App Service (Windows).
I tried to import the publish settings. When I do the import Visual Studio 22, the configuration seems to import, but never moves on when clicking Finish. If I close the import window, then the publish profile doesn't exist (though there are some publish config changes evident in the Solution Explorer under Properties).
I did the same thing in Visual Studio 19 and it did accept the import, but it sets things as Azure App Service (Windows) and doesn't manage to get the rest of the config i.e. it doesn't work either.
I have checked my Azure App and it is for sure Linux running Node 16.
Related
I created a simple node.js express app that I want to host in an Azure Windows App Service.
The App Service resource was created successfully on Azure.
The project was created using the "Node.js Web Application" template.
When I attempt to deploy from Visual Studio 2019, I get the following error message:
web.config not found in project, to create a project to deploy to
Microsoft Azure you must create an Azure Node.js project.
Is there a different template I should be using?
If not, what the contents of the web.config file look like, so I can attempt to create it by hand.
For deploying Node js Application to Azure you need to select
Azure Node js Web Application Template.
You have selected Node.js Web Application.
If you select Azure Node js App, by default web.config will be generated.
Copy the already created source files to the newly created Azure node.js Application.
Update
You might not have selected Node.js development option while installing Visual studio.
Click on the Install more tools and features option and select Node.js and update the VS
I have started with asp.net core 2 web app and I can publish it to App Service from Visual Studio using web deploy.
I've created new clean .net core 2 console app. I'm able to upload it as webjob and run using Azure Portal, but how do I publish it from local command line or Visual Studio?
Basically, I don't care whether it will be published alongside the Web Application or as standalone.
EDIT: I've somehow managed to get the publish dialog by right clicking the project and selecting Publish (not Publish as Azure WebJob) as menioned in the docs. But I still don't know what did the trick. Installing Azure SDK? Adding webjob-publish-settings.json? Adding Setting.job?
Publish .net core as webjob with Azure portal:
As you know:
A WebJob looks for specific file type, for example (.cmd, .bat, .exe, etc…)
To run a .NET Core console application you use the DOTNET command
Therefore, you need to create a file with an extension which is WebJob looking for that executes.
1.You could create a .net core conosole application. After running it, you will have the follow file in your projectname/bin/Debug/netcoreapp2.0
2.Create a run.cmd file under it. And the run.cmd content is as below:
#echo off
dotnet ConsoleApp7.dll
3.To deploy the .NET Core console application to an Azure App Service Web App Web Job access the Azure portal and navigate to the Azure App Service where you will host the WebJob.
Click on the WebJobs link and the Add button.
4.Upload the netcoreapp2.0.zip
5.Once the WebJob is successfuly uploaded, it will render in the WebJob blade. Click on it and you will see the Run button.
6.When you write output to the console using the WriteLine() method, it will show in the Run Details window on KUDU/SCM.
For more detail, you could refer to this article and this one.
Update:(publish with command line)
1.First, download your publish settings file of your webapp from Azure Portal.
2.Prepare the .zip folder you have created.
As David said, you could use WAWSDeploy to publish webjob with command line.
You could download WAWSDeploy with this link.
3.Then go to WAWSDeploy/bin/Debug folder to open the local command line.
Try the following command to deploy the webjob:
WAWSDeploy.exe DotNetCoreWebJobSample.zip [WEBSITE_NAME].PublishSettings /t app_data\jobs\triggered\DotNetCoreWebJobSample /v
Target directory will be app_data\jobs\triggered\[WEBJOB_NAME]. If this web job is a continuously running one, replace triggered with continuous.
Note:you could put the WAWSDeploy.exe and publish settings file and the .zip into a folder. If not, you should give the full path of publish settings and .zip file. So that you could publish webjob successfully.
For more detail about WAWSDeploy, refer to this article.
Make sure your csproj includes correct SDK's:
<Project Sdk="Microsoft.NET.Sdk;Microsoft.NET.Sdk.Publish">
Then just right click on the project in Visual Studio and click publish, select Microsoft Azure App Service and you should see the WebJob publish options:
Also notice that you should use Microsoft.NET.Sdk and not Microsoft.NET.Sdk.Web
If you are using Microsoft.NET.Sdk.Web, Visual Studio assumes that you are deploying to WebSite and not WebJob. The publish dialogs are slightly different for WebSite and WebJob. For example, for WebJob project you can specify WebJob Name.
You might be interested in:
github/aspnet/websdk/issue: WebJob publishing for Microsoft.NET.Sdk.Web
github/aspnet/Mvc/issue: How to publish console app as a WebJob rather than Web App
There is a great articel about Develop and deploy WebJobs using Visual Studio - Azure App Service that covers your question.
Basically after installing the prerequisites (depending on your VS version) you can
Right-click the Console Application project in the Solution Explorer, and then click Publish as Azure WebJob.
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.
We are experimenting with the templates created here: http://blog.stevensanderson.com/2016/10/04/angular2-template-for-visual-studio/. However when we open in Visual Studio 2017 and select publish we are presented with only a Linux App Service:
Instead of:
Can anyone explain what configuration is causing this to happen, as the only option is the Linux preview existing app services we have in Azure are not available to be selected.
I believe it's the presence of the Dockerfile. If you close the Publish UI, delete the Dockerfile, and reopen the Publish UI, it will show the non-Linux App Service option. See here for a little bit of info.
I have created an Azure API App using visual studio. I run it locally its working fine then i published it to Azure from the Visual Studio publish -> Microsoft Azure API App option. The API app is deployed to Azure and working fine.
Is there any other option to deploy it to azure using publish package without using visual studio? If yes then how it can be done, please help.
Or can we create a package for the API App then can be used further?
You don't need to Publish using Visual Studio. Underlying an API app is a "Host". You can see this by browsing to the API app in Ibiza. All the deployment options for Web Apps work with this host. This article highlights the options: https://azure.microsoft.com/en-in/documentation/articles/web-sites-deploy/.