C# backend Azure - c#

I have a C# application that is built using the .NET Core Web API template. This works great locally and I can access the rest endpoints in my application.
For example /api/person/0 where 0 is the id of a person.
The problem is with Azure. When I create an app service and use a github repository the app gets deployed. In the logs I see the following partial error:
Physical Path   C:\home\site\wwwroot\api\gerecht\1
Azure thinks that my C# app is a simple website and tries to access the path as a physical file and not as an endpoint in my application. Why is Azure not accessing the endpoint?
Thanks

How did you deploy the application to Azure?
[Brute Force]
You may want to use GitHub Action from inside Visual Studio for this.
Right Click Publish
Azure (Select appropriate OS)
Deploy using GitHub Action
I experience this in the past and that was how I solved it.
Alternatively, you could use the Azure CLI from inside the directory that contains your .csproj file.
Official documentation here.

Related

How do I add a C# Azure Function App an Azure Resource Group Project for deployment

How do I add a C# Azure Function App that I have created in my Visual Studio 2017 solution to an Azure Resource Group Project and have it deploy to Azure. The ultimate goal here is I have a WebApp that is a website but I want to use an Azure Function App as a backend. This would require two separate projects but I want them to publish at the same time which lead me to Azure Resource Group projects. I was able to successfully deploy the Resource Group when it was only the WebApp but once I added the Function App it fails to build. I feel like this whole process should be a lot simpler.
Created a issue here to track adding support to deploy via Azure Resource Group project.

Azure with Xamarin.forms Name resolution Failure

Currently trying to executing Azure with forms TO DO sample application.
When I executing I facing some issues
When I trying to publish the service there is no option for Microsoft Azure App service instead of that I am getting Microsoft Azure web app
After run app (Emulator).when trying to add new record I am getting Name Resolution Failure error
Well... not a lot of details but I will give a try...
Go to your Azure Dashboard and look for your App Service to download the publish profile.
Now, import it on your Visual Studio Project:

Update Javascript libraries when deploying a web application to Windows Azure

I have an MVC4 web application that uses jquery and some other libs (jquery-ui in particular).
Yesterday I decided to update all the packages via NuGet package manager; my web application worked correctly on my local machine, but when I deployed it to my azure website a javascript error popped out in my browser (it was related to jquery-ui library, something like "$browser is not a function").
I searched the web and found out that the cause of this error was that I was still using an old version of jquery. It seems that deploy process didn't publish the new version of the js libraries even if they have been updated in local project.
I solved the problem connecting via RDP to the Azure machine, deleting the contents of "Scripts" folder and deploying again, but I'm wondering if there's a way to "force" script/libraries update when deploying to Azure.
Edit 1: I'm developing with Visual Studio 2012, using Mercurial as source control provider
Edit 2: I'm deploying to Azure Web Sites
Please, in your future questions clearly indicate what type of Azure Service do you use. An MVC4 web application can be deployed to 3 different type of services: Azure Web Sites, Azure Cloud Service, Azure Virtual Machine!
Since you are talking about RDP, the viable options are Cloud Service or Virtual Machine. But then you say
I solved the problem connecting via RDP to the Azure machine, deleting
the contents of "Scripts" folder and deploying again, but I'm
wondering if there's a way to "force" script/libraries update when
deploying to Azure.
Now the question is how you do deploy to Windows Azure? Is it via Visual Studio's Publish feature to Azure Cloud Service. Is it Visual Studio's Package feature and then using any other method of deployment (upload the package from the portal, use Azure PowerShell cmdlets, or use third party tool to deploy the package)? Is it integration with Mercurial and deployment is done automatically when you check-in?
Any any case, the issue you face is a mixture of NuGET failing to do real clean update of everything. Browser caching - especially for local development - IE caches all the scripts, CSS and images and it is hard to say (without explicitly deleting all locally cached files) which script are you actually using. Simple version control issue - keeping old and new scripts.
When you do a JS/CSS updates I strongly advise all the customers to first delete all browser's cache (crtl+shift+del - works for all browsers) before testing locally.
I highly doubt that if you use a Cloud Service, RDP-ing and deleting anything in the sitesroot folder will help you when you redeploy. What you do in the ROLEROOT drive (usually E:, sometimes F: drive) is dropped of/forgotten when you re-deploy regardless of the re-deploy method you use: in-place-upgrade or full re-deploy. So what you did is actually creating new package and re-deploying your new package.
The fact that you deleted some folder has no effect on your re-deploy action.

Windows azure application developing step failed

This is my first time trying to develop a windows azure application on my visual studio 2010.
what I have done so far is:
Open new project > C# > Cloud.
Downloaded the SDK.
Add new class with code that only displays my name and age.
try to run this code locally and failed!
My questions is:
am I able to run the application locally? if yes the how?
How can I deploy the application? (I already have an account)
Well for what I see your problem is not your windows azure sdk, the thing is that you are creating a WorkerRole project which is a Class Library type and that won't give you an output, for that you need to create a WebRole project.
here I let you this tutorial, it would show you how to create your first WebRole project.
http://www.dotnetcurry.com/ShowArticle.aspx?ID=801
And this one would show you how to deploy on the cloud
http://www.developerfusion.com/article/125435/deploying-an-azure-application
What type of application are you trying to build? Your error is because you are trying to run a class library, which isn't an executable.
There are primarily two types of applications that are hosted in Azure:
Website - These are just standard ASP.NET WebForms or MVC projects, hosted on Azure. These are the easiest to get going, and with the latest Azure release, require nothing special. Simply create a Web project, and git deploy to your Azure Web Site
Worker Role - Worker roles are usually for background tasks like performing computations, sending emails, distributing work, etc. These can effectively be thought of as console applications that never end.
For example:
while(true)
{
// do work here
Thread.Sleep(5000);
}
When developing Azure applications, you need to either create a website (WebForms, MVC, WebAPI), a WCF service, or a console application to run as a background worker. Once you've built the application locally, then you can add an Azure Cloud project, which will handle the actual deployments.
Yes, you can run your application locally: Select the Azure application project in the Solution Explorer, right click, "Set as StartupUp Project" and run
To Publish: goto https://manage.windowsazure.com/ . Create a new web role and download the publishing settings.

How to determine the location of a Cloud WebRole on Harddisk?

After creating a Azure Project within my silverlight app and adding the existing service as a "Add Web Role Project in Solution" I can run my silverlight app hosted in the Cloud and run it successfully locally.
I would like to use the SDK Toolkit instead of Visual Studio to create a package from the webrole. But what is the correct path to the WebRole?
In order to create a package, you shouldn't need to know where your local role runs. You should only need the service definition file and the binaries/files.
See the cspack cmdline:
http://msdn.microsoft.com/en-us/library/windowsazure/gg433133.aspx
You can also use msbuild to create a package:
http://msdn.microsoft.com/en-us/library/windowsazure/hh301088.aspx
Also, this is a good starting point:
http://msdn.microsoft.com/en-us/library/windowsazure/gg433055.aspx
Let me know if I mis-understood what you're trying to ultimately accomplish.

Categories

Resources