Do you know?
This post is going to mentioned a few important notes specific to .NET development and Azure platform which we should remember or follow. These will help us to take the right call of upcoming future decision.
Let's see what are those in below.
- Azure Web apps use Application Request Routing (ARR) to route all requests to the same server. And this is specific for IMemoryCache which represents a cache stored in the memory of the specific web server.
- The in-memory cache can store any object.
- The distributed cache interface is limited to byte[].
- The in-memory and distributed cache store cache items as key-value pairs.
Authentication and authorization in Azure App Service for feature architecture on Linux and containers
- Feature architecture on Windows (non-container deployment)
The authentication and authorization module runs as a native IIS module in the same sandbox as your application.
- Feature architecture on Linux and containers
The authentication and authorization module runs in a separate container, isolated from your application code. Using what's known as the Ambassador pattern, it interacts with the incoming traffic to perform similar functionality as on Windows. Because it does not run in-process, no direct integration with specific language frameworks is possible.
App Service Configuration in Azure
If you configure an app setting with the same name in App Service and in appsettings.json, then the App Service value takes precedence over the appsettings.json value.
The local appsettings.json value lets you debug the app locally, but the App Service value lets you run the app in production with production settings. Connection strings work in the same way.
Authentication flow
- Without provider SDK: The application delegates federated sign-in to App Service. The server code manages the sign-in process, so it is also called server-directed flow or server flow. This case applies to browser apps and mobile apps that use an embedded browser for authentication.
- With provider SDK: The application signs users in to the provider manually and then submits the authentication token to App Service for validation. The application code manages the sign-in process, so it is also called client-directed flow or client flow.
This case applies to REST APIs, Azure Functions, JavaScript browser clients, browser apps that need more flexibility in the sign-in process, and native mobile apps that sign users in using the provider's SDK.
Razor
- Razor Pages file names have a .cshtml suffix.
- @page must be the first Razor directive on a page.
- @page makes the file into an MVC action, which means that it handles requests directly, without going through a controller.
- By convention, the PageModel class is called <PageName>Model and is in the same namespace as the page.
- The PageModel class allows separation of the logic of a page from its presentation.
- The page has an OnPostAsync handler method, which runs on POST requests
- The most common handlers are: a) OnGet to initialize state needed for the page, and b) OnPost to handle form submissions.
Comments
Post a Comment