ASP.Net API running on Windows Azure websites - azure

I have an MVC project in Visual Studio 2012 RC which hosts an MVC web site and an ASP.NET API. I use routes to delegate the request to the correct controller.
On my local development machine both the website and api work fine. However when I push the change to Azure websites the website works, but the ASP.NET web api returns HTTP 500 errors.
The base site is: http://salaahtime.azurewebsites.net
One of the web site pages is http://salaahtime.azurewebsites.net/website/login
An example use of the API is http://salaahtime.azurewebsites.net/api/salaahtime/testestablishment/2012/1
However this returns HTTP 500.
I have
Updated my project to use .net 4.0. By default it is set to .net 4.5 which does not work with Azure websites
Removed Entity Framework 5.0 reference which only works with .net 4.5
Any ideas why the api would not work in Azure websites?

There is a known issue when backing a project down from 4.5 to 4.0 using the RC release of Visual Studio 2012. I know this will be slightly painful to hear, but you'll be better off creating a new project and setting the project's framework version to 4 rather than 4.5. This is an issue that should be fixed prior to the product's release.
Hope this helps. Trust me, we know of it and in our own development work have had to re-create projects using the 4 framework.
Also - the 4.5 framework will be supported in Windows Azure Web Sites once the 4.5 framework has been officially released.

Please try to turn off custom error (http://msdn.microsoft.com/en-us/library/h0hfz6fc.aspx), which may give more detailed information. If you’re working with a database, make sure you’ve updated the connection string to use Windows Azure SQL Database instead of a local database. There is also a possibility that Web API is not stood by web sites. The name web sites indicate it is used to build web sites, not web platforms. Web sites have limited features compared to web roles and virtual machines. If that’s the case, please use a web role or a virtual machine.
Best Regards,
Ming Xu.

Related

Can't create new .NET Core 3.1 web app in Azure under Windows operating system

I spent many hours trying to find some way to create a new .NET Core 3.1 web app under Windows subscription. I found that if you pick up the Runtime stack as .Net Core 3.1 (LTS) the only option is to create an app under the Linux. I tried to play with different regions and Sku and sizes as well but for all cases, it's just the same. There is no option to configure App Insight during the creation time either when using the Linux.
The interesting thing is that when I created the Web App under .net core 3.0 marked as current I was able to deploy .net core 3.1 web app and it all worked including the app insights stuff.
My question: is it just a bug in the Azure UI that you cannot create .net core 3.1 web app under Windows or there is some specific reason behind it?
This option is going to be available once the deployment of .NET Core 3.1 has been rolled out to all AppServices worldwide. So far, this is only been completed for Linux.
https://github.com/Azure/app-service-announcements/issues/217
https://github.com/Azure/app-service-announcements-discussions/issues/129#issuecomment-565620039
Windows hosted App Service option will be enabled once world wide rollout of 3.1 SDK to App Service backend is complete.
Since Windows AppServices have all required runtimes installed, you can select 3.0 and try to deploy your app regardles of what the portal says. I was able to host a WebApi in west Europe this week with .NET Core 3.1, but from what I read that might just have been luck.
Deploying a self contained version is probably also possible from what I read in the linked Github issue.
edit2:Note that the accouncement talks about the SDK. As of the writing of this post, most of the app services have the 3.1 runtime installed, while the SDK will take a while longer.
edit:
You can also check manually if your AppService has the runtimes installed already:
Go to Kudu (https://myappservicename.scm.azurewebsites.net/)
Open the Debug console (e.g. CMD)
type in dotnet --list-runtimes
I had the same problem. I could not get windows selected in Azure.
What I did was let Visual Studio create the App in my App Services. (Note the app insights!)
When this profile finished creating I went into the created App in the Azure portal. Settings - Configuration and changed the stack from 4.7 to .Net Core (Sorry this is in dutch, I hope you can manage...)
And now I also had the standard documents available which I did not have creating it in Azure portal! I changed it to only have index as landing page :
After I did this the homepage of my website showed up. Hope this helps someone!

Confirmation of Licence violation in case of Using Mobile App .net server deployed on self-hosted server

I am developing Mobile App .Net server and want to use the service on self hosted servers for production usage. The service will be deployed on IIS instead of Azure portal. I am working on offline data sync feature using Microsoft.Azure.Mobile.Server package. And for client Microsoft.Azure.Mobile.Client is being used. And all these packages and dependent libraries are open source as its available on github.
So, what about its licencing? Is there any limitation or licencing clause that restricts from using these applications without Azure portal?
Or its free to use?
As you mentioned, these libraries are open source licensed with Apache 2.0. So, you can use them without any problem, as long as you mention the original authors.

can a web app which is created using .net framework 2.0 running on windows server 2003 be migrated to azure?

i have a web application which is created using .net framework 2.0 which is running on windows server 2003.is it possible to migrate that to Microsoft azure.if so does it require an entire rebuild on azure?
A really useful utility for this case is Azure Migration Assistant.
https://azure.microsoft.com/en-us/downloads/migration-assistant/
It will check all your IIS sites and show you if it can be moved up to an App Service, checking target framework, port bindings, etc.
If everything is ok, it can do the migration for you.
Worst case scenario, you can move your application to Azure inside a VM.
It depends on what you mean by "migrate".
If you think about moving as is, you have an option to choose IaaS, where you'll just get a VM and do what you want on it. That'll give you both full control as well as full responsibility over your app.
Otherwise, if you want to avail of the PaaS offering, you'll have to make minor tweaks to your application (assuming the framework version is supported).

How do I setup web pages within Azure Service Fabric Stateless Web API?

I am using VS 2017 and have successfully setup to use Stateless Web API. I can see the output of the default controller when I run it.
Now, I want to create web pages within this project and use AngularJS SPA within it to access its own API.
I am unable to find any examples which clearly show how to do this. Note this is ASP.NET Web API - not ASP.NET Core.
Someone please help.
I opened a support ticket with Microsoft and this can be done with the ASP.NET Web API support in service fabric. Web pages can be added to the self-hosted web api project, but each file has to be individually configured for this project - if you have hundreds of files, it does not allow you to configure the entire folder contents for the project, because you have to mark each file to build as content. The example they sent me is an obscure article in a Microsoft blog from a Microsoft Engineer nobody has heard of before.
Not worth it. Use the ASP.NET Core support.

Azure Websites, Can one deploy .NET 4.5.1 websites?

I notice that Azure Websites seems to offer .NET 3.5 and .NET 4.5. So I assume that one cannot deploy .NET 4.5.1 web applications yet?
I mention this as .NET 4.5.1 seems to have a useful new feature called "ASP.NET app suspension" which seems to pull back app images much more quickly into RAM. Perhaps Although this feature is targeted at hosters, one wonders whether this is a solution to the "Warm Up" issue?
Thanks in advance.
There are two questions here.
1) Azure Web Sites does support .NET 4.5.1, as in the update is installed on all Azure Web Site VMs. This has been available for several months now. So when you select 4.5, you are really running 4.5.1. The version reading "4.5" in the portal is misleading, unfortunately, and due to the fact the 4.5.1 upgrade did not change major/minor versions of framework so the "4.5" remains.
2) The specific "ASP.NET application suspension feature" unfortunately is part of a .NET 4.5.1 version that only ships in Windows 8.1/Server 2012R2. Azure Web Sites VMs currently only run Server 2012. Therefore ASP.NET application suspension is not supported in Azure Web Sites.
Azure Web Sites does other things to attempt to manage cold start performance issues (such as aggressive caching of compiled assemblies) but this is certainly a feature we would like to add in a future version of WAWS. Thanks for the feedback.
Cloud Services supports .NET 4.5.1
look here

Resources