First time Deployment of Blazor solution with many multiple projects - azure

I am very new and have been exploring coding for quite a while, and I have finally completed a simple vs solution containing multiple projects.
Running the solution now in VS Studio (2019 community) will launch IIS and 4 localhost sites in the browser:
Data Controller (Asp.net api project with swagger)
File Controller (Asp.net api project with swagger)
Admin Portal (Blazor web assembly app project)
Public Portal (Blazor web assembly app project)
Note that the projects have no authentication yet...also I am using EF Core Code-First, and have no idea how to use the builder.HostEnvironment so I hardcoded the data and file Http base addresses in the program.cs Main() of the admin and public blazor projects (e.g. builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("...") }); )
I'd like to try deploying this solution to the cloud (say for example azure) please help me learn how to deploy this! 🙏🙏🙏

You can use azure static web app , its free but you have to register your credit card anyway , you can follow this tutorial .
https://learn.microsoft.com/en-us/azure/static-web-apps/deploy-blazor
I deployed my first apps in azure by this way.

Related

Azure B2C Protect Web API running as App Service

I am trying to set up a test case for Azure B2C authentication from scratch. I need to authenticate from a Winforms application and access a protected web API running as an Azure App Service.
I have found several tutorial but most of them seem out of date.
I eventually found this tutorial for the client side (it is a WPF app but this is OK).
I can not find a good tutorial for the server part. The previous tutorial, at chapter Step 3: Configure the sample web API, points to https://learn.microsoft.com/en-us/azure/active-directory-b2c/enable-authentication-web-api?tabs=csharpclient
Apparently, this server-side example is for .Net5. As I would like my API to run as an App Service, I must use .Net6 in order to deploy it. If I try to build my web API in .Net6, the code is quite different : no startup.cs file for instance, only an appsettings.json file automatically populated by Visual Studio. But any call to the web API running in Azure from my client App fails with an Internal Server Error.

Publishing .NET Core Web App to Linux on Azure

I'm trying to publish my .Net Core 2.2 Web app to a Linux environment.
I already created the Web App with a ServicePlan with Linux. I downloaded the publish profile and published it successfully.
I published it over FTP profile.
The problem is that when I access the web app address, it still shows the Azure Empty State web app:
Any ideas what I am missing?
I tried to repro your scenario and could see the same behavior.
There is a way one can configure Default documents for App Services, however, this is valid only for App Services on Windows and not Linux.
For Linux apps, the implementation would be based as per the runtime stack selected.
For .Net Core Razor pages specifically, the AddPageRoute() method can help in defining the route as described in this blog post:
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().AddRazorPagesOptions(options =>
{
//"/Home/welcome" is the page we want to land at
//The empty string signifies the root URL
options.Conventions.AddPageRoute("/Home/welcome", "");
});
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
}
That said, this worked only when published locally but not when published to the Azure App Service for Linux, which is not what one would expect.
I will check this with our internal Teams and get back to you. Thanks for bringing this to our attention!
UPDATE:
You could configure the Startup Command for your App Service. For .Net Core, it would look something like dotnet <myapp>.dll. This should definitely work. You can configure this setting here:
Note that you might have to delete all existing files prior to publish (from your Publish profile > Settings > File Publish Options > enable "Delete all existing files prior to publish" > Save) to see your changes.
Hope this helps!

Azure Mobile Service/App Services On-Premises

Microsoft Azure Mobile platform, Windows Azure Mobile Services WAMS, or its new version, App Services, are great Cloud and MBaaS tools for building mobile backends. They use a NodeJS Restful Service Engine combined with an ORM Engine to provide a very easy-to-use platform.
Does anyone know if it is possible to use this framework outside the Azure Cloud environment, i.e. in an on-premises environment ? Is this kind of NodeJS framework open ? What is the name of this framework ?
The Azure Mobile Apps Node.js SDK to Mobile Apps is an express middleware package which makes it easy to create a backend for your mobile application.
The SDK package is still in development, but you can get all the code and documents at https://github.com/Azure/azure-mobile-apps-node
About Mobile Service in Node, there is no full code project repository, but you can glance the entire code in KUDU console site of your mobile service, the URL should look like: https://<your_mobile_service_name>.scm.azure-mobile.net/DebugConsole. The root directory is D:\home\site\wwwroot
Azure Mobile Services and/or Azure Mobile Apps are only available in Azure. There is no 'framework' that you can download and install on your own infrastructures.
Besides the Node.Js version of Mobile Services there is also an .NET version which is basically just an MVC Web API with some additional 'services' added to it (notifications, authorization, etc.)
So, you could just build an MVC Web API app and manually add the missing components by using oAuth, entity framework, etc. However, this is probably not what you are looking for :)
Hope this helps!
Edward
Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure. It can run on premise https://github.com/projectkudu/kudu but unfortunately the rest of mobile services cannot

Azure App Service project templates and new publish targets in VS2015

I installed VS2015 and the latest Azure SDK. I'm somewhat confused by the addition of new project templates compared to VS2013 and the previous Azure SDK. I'm trying to get my head around the new Azure App Service.
I used to create a Web API project and publish it as an Azure Cloud Service. Now, I'm offered more options:
1) Azure Cloud Service -> ASP.NET Web Role -> Web API
I'm familiar with this one.
2) Azure Cloud Service -> ASP.NET Web Role -> Azure API App
Why would anyone create an Azure API App and publish it as a cloud service?
3) ASP.NET Web Application -> Web API
4) ASP.NET Web Application -> Azure API App
These two are essentially the same as the first two without the cloud service template. However, the way they are published confuse me even more. You could publish each as a Microsoft Azure Web App or Microsoft Azure API App.
How do the following compare and contrast:
Web API -> Published as a Web App
Web API -> Published as an API APP
API App -> Published as a Web App
API App -> Published as an API APP
I agree, the tooling has confused this a little. Here is how I am dealing with it:
"Cloud Services" seem to be a thing of the past, any new project I am doing I am going with AppService and scripting the set-up of that app service with an ARM (Azure Resource Manager) template. You will find a template for this under Cloud->Azure Resource Group in VS 2015. This is entirely optional, but is a great best practise.
As you point out above, all 4 combinations are valid. In fact an Azure API App uses the same technology under the surface as the website does (it is a little buried away in the portal, but you can navigate down from the API app to the underlying website by opening the API App in the preview portal, and under the label for "API App Host" double click).
Using the API App template in VS2015 you will just get a standard asp.net website like you do with the web app templates, but the main difference is that the API App is slimmed down by default unlike the website template that will have lots of libraries that are of no use to an API app (no jquery, bootstrap RazorViews etc). The smaller footprint should mean that there is less to load when asp.net starts-up, hence faster start-up times.
API apps have easy integration points for use in Logic Apps (think a workflow from Salesforce defined in the Logic app that requires to call your API to update data to your database). You could do this with a web app, but there will be more plumbing to do.
I believe the plan in the near future is a marketplace of API apps (app store style) that will allow us devs to sell APIs.
Swagger out the box. The API app template has Swashbuckle pre-installed for generating the Swagger documentation for you API (arguably you could just install this via nuget into your web app template).
On the whole API apps have the exact same functionality as web apps, but slimmed down with extra bits in places.

Using Windows azure cloud service for making mobile and web application

I am a newbie to Windows Azure platform.
My team is developing a web and a mobile application and we are thinking of going with this platform. But I have few doubts taking that:
My web and mobile application will access the same database, so is it possible to have a same cloud database in windows azure allowing both mobile and web application to access it
Few examples and references will help a lot.
Note: I have a request and reponse operations from both client and server, so its two way communication process for mobile and web app.
Thanks!!
We built a project recently that was built using webAPI on MVC 4.0. We built an Azure Cloud service project in Visual Studio 2012 ,and created a web role that hosted both webapi (REST based Services) and MVC web application.
To secure our API, we implemented a token based security mechanism over the WebAPIs for user authorization. We created two different Routes /Rest/API (to handle CRUD) and REST/RPC(to handle additional operations.
In all, we had following layers in the solution
MVC Web Project
--API (APIControllers - REST + RPC)
--Controllers (MVC Controllers)
-- VIEWs
MVC Web ROle Project
-- Mapped to the MVC Project in the web
Repository
-- Repository classes for entities
Data Access
-- Data Access classes for each entity using DAPPER
Models
-- POCO Classes representing entiries

Resources