Microsoft Azure Cloud Storage

1 Comment »

Azure Storage is Microsoft’s cloud storage option for use in modern data storage scenarios. Azure Storage offers highly available, massively scalable, dependable, and secure cloud storage for a variety of data objects. Anywhere in the world can access data items in Azure Storage using a REST API over HTTP or HTTPS. For developers building apps or services with.NET Java, Python, JavaScript, C++, or Go, Azure Storage also offers client libraries. Developers and IT professionals can write scripts in Azure PowerShell and Azure CLI to create data management or configuration jobs. Using the Azure portal and Azure Storage Explorer, users can communicate with Azure Storage.

Azure Storage’s Benefits

For programmers and IT professionals, Azure Storage services offer the following benefits:

Strong and Widely Accessible: Redundancy ensures that your data is secure even in the event of brief hardware outages. You may decide to replicate data across data centers or geographical areas for added protection against regional or natural disasters. This kind of data duplication ensures that even in the event of an interruption, the data is still easily accessible.

Secure: Each piece of data written to an Azure storage account is encrypted by the service. You have complete control over who has access to your data thanks to Azure Storage.

Scalable: Azure Storage is designed to be incredibly scalable in order to meet the data storage and performance needs of contemporary applications.

Managed: Azure handles critical problems, updates, and maintenance on your behalf.

Accessible: HTTP or HTTPS can be used to access data saved in Azure Storage from anywhere in the world. Microsoft provides client libraries for Azure Storage in a number of languages, including .NET, Java, Node.js, Python, PHP, Ruby, Go, and others, in addition to an established REST API. Azure Storage supports scripting via Azure PowerShell or Azure CLI. Additionally, the Azure website and Azure Storage Explorer make it simple for you to interact graphically with your data.

Azure Blob Storage and Its Features

Azure Blob Storage is the name of Microsoft’s cloud-based object storage product. Blob storage performs best when used for large-scale unstructured data storage. Unstructured data is data that doesn’t adhere to a predefined data model or standard, such as text or binary data.

Microsoft Azure Blob Storage features –

Access to Unstructured Data and Scalable Storage

Azure Blob Storage allows you to build data lakes to suit your analytics requirements, and it also provides storage so you can build reliable mobile and cloud-native applications. To save money on long-term data storage and to dynamically increase workloads demanding high-performance computing and machine learning, use tiered storage.

Develop dependable cloud-native applications

Blob storage was created from the bottom up to satisfy the demands of cloud-native, online, and mobile application developers in terms of scalability, security, and availability. Use it as the basis for serverless solutions like Azure Functions. The only cloud storage option that provides a premium, SSD-based object storage layer for interactive and low-latency applications is blob storage. The most popular programming frameworks, including as Java,.NET, Python, and Node.js, are also supported by blob storage.

Store petabytes of data effectively

You can cost-effectively store vast amounts of rarely or sporadically accessed data using several storage layers and automated lifecycle management. To avoid worrying about the transition between hardware generations, for instance, utilize Blob storage rather than tape archives.

Build solid data lakes

A highly scalable and affordable data lake solution for big data analytics is Azure Data Lake Storage. By combining the power of a high-performance file system with massive capacity and efficiency, it aids in accelerating your time to insight. Azure Blob Storage’s capabilities are increased by Data Lake Storage, which is built for analytics applications.

Scale up for HPC or out for IoT devices in the billions

Blob storage has the capacity needed to accommodate both the demanding, high-throughput demands of HPC applications and the billions of data points flowing in from IoT endpoints.

Azure Files

You can build highly available network file sharing with Azure Files by utilizing the industry-standard Server Message Block (SMB), Network File System (NFS), and Azure Files REST APIs. The same files can thus be accessed by many VMs both read-only and with write access. The storage client libraries or the REST interface can also be used to read files.

One way that Azure Files differ from files on a corporate file share is that you can access the files from anywhere in the world using a URL that links to the file and contains a shared access signature (SAS) token. Additionally, you can produce SAS tokens, which provide limited access to a private asset for a certain time.

Queue Storage

The Azure Queue service is used to store and retrieve messages. Millions of messages can be stored in a queue, and each message can be up to 64 KB in size. Additionally, queues are frequently used to store asynchronously processed message lists.

If you want to create thumbnails for every image that a customer uploads and you want them to be able to, imagine the following scenario. You could request that your client wait while you create the thumbnails and submit the images. An alternative would be to use a line. When the client is done with their upload, type a message to the queue. Create the thumbnails next, and then have an Azure Function fetch the message from the queue.

A number of storage-related tools and services are offered by Azure. In the Azure Cloud Adoption Framework, under Review your storage options, you may find out which Azure technology is suitable for your situation.

Features in C# 10 Which May Help Every Developer

No Comments »

C# 10 is the latest version of the C# programming language, widely used for developing desktop applications, web applications, games, and other software. C# 10 was released in November 2021 and introduced several new features and improvements over the previous version, C# 9. Some notable features of C# 10 include file-scoped namespaces, global using directives, improved support for interpolated strings, and extended support for pattern matching. Additionally, C# 10 consists of a number of performance improvements and other enhancements designed to make it easier and more efficient for developers to write high-quality code. It is one of the oldest and fast-growing programming languages in the world. Today we will discuss some top features in C# 10 that will help developers write code faster and prettier.

Using Global

The amount of code you need to write will be greatly decreased by this brand-new feature. You may be aware that the beginning of every C# program contains a list of “using” statements that are required for the implementations. However, this can occasionally be repetitive, especially if you’re working with ASP.NET, where a lot of this code gets recycled and acts as “noise” for programmers.

The global keyword is a further brand-new C# 10 feature. If you utilize them internationally, you can select global use for the entire project. In actuality, it is suggested that you create a separate file, such as using.cs, that provides these specifications. This suggests that the remaining project files could be condensed as they don’t have to contain all of these uses. This is referred to as “vertical (space) wastage” by C# developers.

Strings with constant interpolation

With the introduction of string interpolation in C# 6, it is now simple and convenient to apply syntax to a string. Typically, an interpolated string is made up of both strings and expressions. The expression is executed and the resulting string value is added in its place when an interpolated string is resolved to a string.

Back then, only strings could be interpolated; a string that has been declared as a constant cannot be. However, this capability of string interpolation is now available for strings that have been defined as constants in C# 10, with the restriction that only constant strings may be utilized in the expression.

Extended property patterns

A new feature called extended property patterns is very useful when dealing with nested properties. In the past, weren’t constructors used more explicitly? Nowadays, heavy builders are rarely made; instead, businesses use light builders, where the values of the properties are supplied immediately. In the most recent version of C#, 10, “Required” is a new term for properties. This allows users to make a property mandatory while defining a class. If you try to construct an object without the necessary property, you’ll receive an error at compilation time.

Namespaces for Files

The global keyword C# eliminates vertical waste, and the use of file namespaces eliminates horizontal waste. This feature’s primary goal is to fix the indent issues; however, it’s more of a visual improvement that should make your code appear lot nicer. The namespace can now be declared at the file level using this functionality.

To make use of this capability in all upcoming classes, perform the following actions in Visual Studio 2022:

  • Right-click the project first. Then, select New EditorConfig under Add.
  • Open the Editor configuration file at this time.
  • Click the Code Style tab.
  • Save the file after switching Namespace declarations from Block Spaced to File Scoped.
  • The file-scoped format will be used going forward for creating new CS files.

Checking for Null Parameters

The Null Reference Exception is one of the biggest mistakes your code may make. To avoid this kind of problem, your application architecture must be perfect and function parameter checks must be numerous. We might be able to avoid this problem and enhance the readability and resilience of our code thanks to this new functionality. The goal of the new C# version is to simplify this problem for us. Just after the parameter name, type “Bang bang” by placing two exclamation points. The program will automatically check to see if the newObject is null. The ArgumentNullException would be produced right away if the newObject value is null.

Enhanced #line pragma

The newest version of C#, 10, contains a new format for the #line pragma. You won’t likely use the new layout, but you will still see its impact. More precise outputs are now possible in domain-specific languages (DSLs) like Razor thanks to the advancements. These upgrades allow the Razor engine to enhance the troubleshooting process. You’ll see that debuggers can now highlight your Razor source more accurately.

Terms for the Field

Self-implemented properties have been since C# 3 and are not a new feature. The get and set attributes of the property are the only ways to access the private, anonymous field that the compiler creates once the program has been compiled. One of the exciting features of the current version of C# is an init accessor. With such an accessor, immutable objects gain a lot more flexibility by enabling the caller to change members while creating the object. The field introduced in the most recent edition is a new keyword in the C# programming language. In general, a new field would not be required as of C# Current version 10. This keyword could be used by the init accessor as well.

Conclusion

In this article’s discussion of the new C# features, we learned about some of them. Some of these seem to be substantial improvements, and they seem to have an effect on how we approach and develop C# projects.

Updates to ASP.NET Core in .NET 7 Release Candidate 2

No Comments »

On October 11th, 2022, Microsoft released.NET 7 Release Candidate 2. It is supported in production as the last release candidate (RC) for.NET 7.

Visual Studio 17.4 Preview 3 has been used to test.NET 7 Release Candidate 2. If you want to test out.NET 7 with products from the Visual Studio family, we advise using the preview channel builds. We advise using the most recent Visual Studio 2022 for Mac preview if you use macOS.

We want to highlight the key concepts of .NET 7 in this post and give you resources to delve further into the specifics. For a more thorough list of each enhancement and feature added to .NET 7 Release Candidate 2 you can check the previous posts from .NET’s official website.

C# 11

The most recent version of C#, C# 11, is now accessible in.NET 7.

They openly create and develop C#. To view the most recent C# feature requests and meeting notes, connect to them on the CSharpLang repository. As soon as work is scheduled, you can check the Feature Status page to see how things are going. Create a C# project and set the LangVersion property to Preview to experiment with the C# 11 preview features.

Libraries & SDK

The.NET libraries are always getting better. New APIs with completely new features are frequently added. Existing APIs are receiving performance upgrades, which will benefit you if you simply upgrade. New libraries are being created to help you with your daily tasks. Every new version of.NET brings a wealth of enhancements to the.NET SDK, which contains the essential tools for designing, developing, and maintaining.NET projects. Numerous improvements were already present in earlier preview. To read more about new SDK features, see the following:

Re-enable Reflection Fallback For System.Text.Json source generation

.NET 7 introduced an intentional breaking change which removes silent fallback to reflection-based serialization in System. generators for Text.Json sources. Early customer feedback indicates that a significant number of users have (mostly unintentionally) come to depend on the fallback behavior.

Despite the fact that a workaround for the breaking change has been documented, it still calls for a code change, which may not always be possible. Starting with.NET 7 RC 2, you can use the provided AppContext compatibility switch to globally re-enable reflection fallback. To enable reflection fallback once more for all source-generated contexts in your app, add the following entry to the project file for your application:

<ItemGroup>
  <RuntimeHostConfigurationOption Include="System.Text.Json.Serialization.EnableSourceGenReflectionFallback" Value="true" />
</ItemGroup>

See the post on .NET runtime configuration settings for more details on using AppContext switches.

Implementation of Generic Math interfaces correctly

The.NET runtime ensures that user code correctly implements the.NET Generic Math interfaces that use the Curiously Recurring Template Pattern (CRTP). It specifically issues a warning if a type that implements the CRTP pattern and the.NET Generic Math interfaces fails to fill the generic type parameter with the type itself.

For example:

public readonly struct DateOnly : IParsable<DateOnly> // correct implementation of IParsable<TSelf> interface
{ ... }
public readonly struct MyDate : IParsable<DateOnly> // Warns: "The 'IParsable<TSelf>' requires the 'TSelf' type parameter to be filled with the derived type 'MyDate' " the type parameter TSelf
{ ... }

Some built in operators added in .NET 7 for System. System and IntPtr. In.NET 6 and earlier, UIntPtr behave differently from user-defined operators. Some operators that used to throw when the context was unchecked while overflowing are now only allowed to do so when wrapped in checked context, and some operators that did not previously throw in checked context are now only allowed to throw when the context is unchecked. The analyzer alerts it when it finds the code that might be responsible for those behavioral changes.

For example:

checked
{
    intPtr2 = intPtr1 + 2; // Warns: "Starting with .NET 7 the operator '+' will throw when overflowing in a checked context. Wrap the expression with an 'unchecked' statement to restore the .NET 6 behavior."

    intPtr2 = intPtr1 - 2; // Warns: "Starting with .NET 7 the operator '-' will throw when overflowing in a checked context. Wrap the expression with an 'unchecked' statement to restore the .NET 6 behavior."

    void* ptr = (void*)intPtr1; // Warns: "Starting with .NET 7 the explicit conversion '(void*)IntPtr' will throw when overflowing in a checked context. Wrap the expression with an 'unchecked' statement to restore the .NET 6 behavior."

    intPtr2 = (IntPtr)ptr; // Warns: "Starting with .NET 7 the explicit conversion '(IntPtr)void*' will throw when overflowing in a checked context. Wrap the expression with an 'unchecked' statement to restore the .NET 6 behavior."
}

intPtr1 = (IntPtr)longValue; // Warns: "Starting with .NET 7 the explicit conversion '(IntPtr)Int64' will not throw when overflowing in an unchecked context. Wrap the expression with a 'checked' statement to restore the .NET 6 behavior."

int a = (int)intPtr1; // Warns: "Starting with .NET 7 the explicit conversion '(Int32)IntPtr' will not throw when overflowing in an unchecked context. Wrap the expression with a 'checked' statement to restore the .NET 6 behavior."

Support

The release of.NET 7 is covered by Standard Support. There is no change to the support duration despite the fact that this is the new name for what was previously known as Current. The Standard Support period for.NET releases with odd numbers is 18 months. The 36-month length of Long-Term Support (LTS), as well as its name, have not changed. For more information, see our.NET and.NET Core Support Lifecycle document.

Wrapping Up

.NET is loved for it’s simplicity of C# cause everything can be completed quickly and easily (in C#, everyone who can program can program). Similarly, the Jit itself is intuitive in the way it applies compiler techniques. Finally, a shoutout to SuperPMI.

Releases of .NET include products, libraries, runtime, and tooling, and represent a collaboration across multiple teams inside and outside Microsoft. Give .NET 7 Release Candidate 2 a try and tell us what you think!

Amazon RDS vs Azure SQL: Key Differences

No Comments »

The world of database management has undergone a significant change as a result of multinational corporations switching to cloud-managed databases. However, it can be difficult to meet the needs of the modern world, particularly for on-premise deployments. In contrast, managed cloud databases are relational database services that are scalable and created for the cloud.

Microsoft Azure and Amazon AWS are both great choices for deploying MS SQL Server databases. The dawn of a new era has indeed been heralded by these databases. Prior to selecting an Amazon AWS or Azure migration, it is crucial to compare features, benefits, and limitations. In this article, we’ll examine these well-known databases and offer advice on which one would be best for your company.

Which one is Better?

Cloud computing enables businesses to increase innovation, reduce capital expenditures, increase scalability, and improve teamwork. Naturally, businesses that are unprepared for these changes risk falling behind. The most reputable cloud competitors competing for a bigger share of the cloud pie are AWS and Azure.

Starting with how they present their SQL Server database services, the two cloud service goliaths have a glaringly different service philosophy. Microsoft makes use of the binaries from SQL Server 2019, the most recent iteration. It guarantees that your application always uses the most recent binaries. In contrast, Amazon provides a versioning model that is largely fixed and allows you to select the version you want to use. The following are the main distinctions between Azure SQL and Amazon RDS:

Platform

The cloud-based database products from Microsoft are created with the cloud in mind. For instance, Azure SQL is a service that runs natively on the Microsoft cloud infrastructure.

Although it does not run natively on the cloud platform, Amazon RDS is cloud-capable. Therefore, the majority of MySQL applications should function normally in Amazon RDS.

Performance

As Azure SQL is tier-based, each level is divided into performance tiers ranked by Microsoft’s Database Transaction Units and tailored to a variety of workloads. In order to ensure maximum utilization, Microsoft customers can address workload fluctuations through hosted databases.

Database instances are allotted in Amazon RDS to determine resource allocation. To easily distinguish costs, you must pay for computing and storage separately. Furthermore, Amazon RDS improves query performance.

Features

A versatile, reliable, user-friendly, and stable solution is Amazon RDS. Users can choose as many tools, zones, regions, and replicas as necessary. Users prefer Microsoft products’ enhanced GUI and better integration. However, they think Microsoft can make a lot of security features better.

Users of Microsoft Azure appreciate how easily the platform integrates with on-premises SQL Server, the darknet stack, and table groups. The solution provides simple firewall settings and a very user-friendly interface. Additionally, there are a lot of on-premises features that the cloud might not provide.

Target Market

Microsoft Azure primarily targets enterprise apps with databases that are 5 GB or smaller. Although Azure SQL appears to be limited, there are more details than just the targeted clients.

Amazon RDS, on the other hand, targets a wider user base and provides a high level of flexibility. Per database instance, up to 1 TB of storage is permitted.

Deployment

The biggest difference between Azure SQL and Amazon RDS occurs at this point. Database servers for Azure SQL are not virtual. Instead, they are logical containers that are tailored to the needs of the customer. Additionally, Azure SQL is multi-tenant and does not support specific server-level customization.

Azure focuses on cloud performance rather than hardware in order to fully utilize the intended benefits of cloud computing. Microsoft’s emphasis on only charging for what a customer needs is a good thing. Amazon RDS, on the other hand, offers relational database services using EC2 instances.

RDS is able to allocate resources to databases while provisioning storage space separately thanks to this design. RDS’s factor costs are different from Azure SQL’s because storage is charged separately from computing. The RDS standard level offers storage of up to 6 TB.

Cost

When compared to Amazon RDS, Azure SQL is much more affordable because its databases can be automatically replicated across a variety of systems, providing read scale-outs and a transparent fail-over mechanism in case of hardware failure. However, Amazon RDS has turned off replication on all of its MySQL instances.

As a result, SQL Azure doesn’t provide a substitute for Amazon RDS’s distinctive on-demand snapshot-based backup approach. Instead, when a disaster strikes, data in SQL Azure is automatically backed up and restored. Once more, the user is unaware of this, which contributes to the feature’s high availability.

Scaling

With a storage limit of just 10 GB per database, Microsoft Azure SQL is both highly scalable and cost-effective. As a result, it eliminates the chance that a single overburdened database server will cause performance problems. Additionally, Microsoft’s concept of the shared database has improved performance and scalability with the most recent addition of elastic pools.

Computing and storage fees are charged separately by Amazon RDS. As a result, expanding a database’s size on the Amazon platform is simple. Additionally, the growth of an RDS single database is made simple by Aurora’s ease of automatic scalability as a database product.

Additionally, Amazon RDS supports read-only horizontal scaling, which enables you to add replicas to improve query performance. The Elastic Database tools, on the other hand, are used by Azure SQL to orchestrate a sharding strategy.

Wrapping Up

Azure SQL and Amazon RDS are in fierce competition to provide the best customer experience. A more server-oriented model with robust backward compatibility for apps is offered by Amazon RDS. How you choose between Amazon RDS and Azure SQL largely depends on the kind of technology you already employ. On the other hand, Amazon RDS works best for you if you have a LAMP stack.

Consider the benefits of moving your database to the cloud if you’re still unsure which option to choose. But once more, it depends on your budget, flexibility, and tech preferences. So, when selecting a database system for your business, keep these things in mind.

ASP.NET Authentication: Overview

No Comments »

.NET is a developer platform made up of tools, programming languages, and libraries for building many different types of applications. The base platform provides components that apply to all different types of apps. Additional frameworks, such as ASP.NET, extend .NET with components for building specific types of apps.

ASP.NET is an open source web framework, created by Microsoft, for building modern web apps and services with .NET. ASP.NET is cross platform and runs on Windows, Linux, macOS, and Docker. The server-side web application framework ASP.NET, also known as Active Server Pages Network Enabled Technologies, is free to use. It is intended for use in web development to create interactive websites, programs, and services. Let’s take a closer look at ASP.Net Authentication.

What Is ASP.NET Authentication?

Microsoft’s ASP.NET is an open source framework for creating contemporary web sites, services, and applications. It is supported by Linux, macOS, Windows, and Docker. IAuthenticationService is the foundation of the ASP.NET authentication framework. The service can authenticate users in ASP.NET applications thanks to registered authentication handlers.

ASP.NET Authentication Concepts

Authentication Schemes

A scheme for authentication identifies the authentication handler in charge of generating the appropriate set of claims. The names of authentication handlers and the particular configuration settings for each handler’s instance are known as authentication schemes. Schemes can be used to discuss authentication and challenge or forbid associated handler behavior.

Authentication Handler

The actions of an authentication scheme are carried out by authentication handlers. From AuthenticationHandler <TOptions> or IAuthenticationHandler, handlers can be derived. Authenticating users is its main objective. The associated authentication scheme’s configuration and the context of incoming requests will influence how the authentication handler responds.

The handler creates an AuthenticationTicket object, which represents a user’s identity, if the authentication is successful. A “failure” or “no result” is returned if the authentication fails. The handler offers ways to thwart or oppose actions taken by a user. Unauthorized users will be denied access, while unauthenticated users will be presented with a challenge.

Authentication Challenge

When unauthenticated users try to access a resource that needs authentication, the authorization system takes an additional precaution known as authentication challenges. For instance, if an anonymous user clicks on a login link or requests access to a restricted resource, the IAuthenticationService may issue a challenge. The challenge is issued by the authorization system using a default authentication scheme (or a specified scheme if one exists).

Forbid Action

If authenticated users attempt to access resources without the required permissions, the authorization system triggers the ‘forbid’ action for authentication schemes. Users are informed by forbidden actions when they have been authenticated but are denied access to a resource. The following situations, for instance, may result in the system forbidding authentication:

  • An access-restricted page is redirected to by a cookie authentication scheme.
  • A 403 (forbidden) error is returned by a JWT bearer scheme.
  • A page where users can request access to a protected resource is the destination of an authentication scheme.

ASP.NET Core Identity

An API that supports UI login features is called Core Identity. You can manage a variety of user data elements with it, such as user profiles, passwords, roles, tokens, and claims. Users can create accounts using the login information from ASP.NET Core Identity. A supported external login provider, such as Google, Facebook, Twitter, or Microsoft accounts, can also be used to create accounts.

The SQL Server database that houses usernames, profile information, and passwords is typically used to configure Identity. A different persistent store, like Azure Table Storage, is also an option.

Providers of authentication for each tenant

There is no integrated method for multi-tenant authentication in ASP.NET Core. We advise customers to think about Orchard Core or ABP Framework for multi-tenant authentication even though they are able to create one using the built-in features.

Orchard Core is an ASP.NET Core-based multi-tenant, open-source, and modular app framework and an app framework with a content management system (CMS) added on top. ABP Framework supports various architectural patterns including modularity, microservices, domain driven design, and multi-tenancy. See ABP Framework source on GitHub.

ASP.NET Multi-Factor Authentication

During a sign-in event, multi-factor authentication (MFA) asks the user for multiple forms of identification. Passwords are frequently used as the first identification factor, and a fingerprint scan, a FIDO2 key, or a verification code sent to the user’s phone can be used as the second factor. Adding MFA as a requirement for an application greatly increases the security of authentication.

Using ASP.NET Core Identity offers native support for 2FA (2-factor authentication). Set the IdentityUserTKey> to enable or disable 2FA for a specific user. Property TwoFactorEnabled. When utilizing ASP.NET Core Identity, cMFA with the Time-based One-Time Password (TOTP) algorithm is additionally natively supported. This approach is compatible with authenticator programs like the Google Authenticator and the Microsoft Authenticator.

Users accessing sensitive pages in an ASP.NET Core Identity application can be forced to use MFA. This is beneficial for programs with various levels of access for various identities. Users can log in using their password, for instance, to view profile information, but administrators need MFA to access admin pages.

Wrapping Up

Finding a user’s identity is the first step in user authentication. We take this action to make sure they are who they claim to be. Once we are confident in our ability to trust them, we can log them into our app and give them access to resources that are intended for logged-in users only. Now that you know how to authenticate and log in a user to an ASP.NET application, hopefully you are off to a good start.

Getting Started With .NET MAUI

No Comments »

MAUI has officially been released! With C# & XAML, we can now construct Native Mobile and Desktop applications. Yes, now we can create native Android, iOS, macOS, and Windows applications from a single code base. This is possible by using .NET’s new feature called Multi-platform App UI (MAUI). This is a cross-platform framework called .NET MAUI. MAUI, which stands for Multiple-Platform Application UI, allows us to create applications from a same code base for Android, iOS, Windows, and macOS. In addition, this implies that we can export apps to several platforms from a single project.

What is MAUI?

Multi-Platform App UI, or MAUI, is a free and open-source cross-platform framework. We can create native Android, iOS, macOS, Mac Catalyst, Tizen, and Windows applications using MAUI by using a single code base for all of these platforms.

The successor to Xamarin is the open-source .NET MAUI. Forms with UI controls rebuilt from the ground up for performance and extensibility, extending from mobile to desktop scenarios. You’ll see many similarities between .NET MAUI and Xamarin.Forms if you’ve previously used those tools to create cross-platform user interfaces. There are some differences, though. If necessary, you can add platform-specific source code and resources when developing multi-platform apps with.NET MAUI. The ability to implement as much of your app logic and UI layout in a single code base is one of the main goals of.NET MAUI.

The development of Xamarin.Forms from mobile to desktop applications led to MAUI. If you have experience with Xamarin.Forms, you will have no trouble understanding.NET MAUI.

The .NET MAUI is for such

  • Developers who want to create cross-platform applications using C# and XAML from a single code base.
  • Sharing the same UI layouts and designs across platforms, which reduces the time needed for design implementation.
  • To use the same business logic, code, and testing across all platforms.

Install Visual Studio 2022 Preview

Only the Visual Studio 2022 Preview offers .NET MAUI right now. Obtain the Visual Studio 2022 Preview by clicking here.

Select .NET Multi-platform App UI Development Workload from the list below once it has been downloaded and installed.

It’s best to restart the computer after a successful installation before starting Visual Studio 2022 Preview.

Making the first.NET MAUI application in the preview of Visual Studio 2022

At first, launch the Visual Studio 2022 Preview and Choose to create a new Project and search for MAUI.

.NET MAUI has three categories, .NET MAUI App, .NET MAUI Blazor App, .NET MAUI Class Library.

In upcoming articles, we’ll examine each category in greater detail. The.NET MAUI App currently allows us to create applications from a single code base for Windows, Android, iOS, Mac Catalyst, MAUI, and Tizen.

.NET MAUI Blazor App – These applications are created using Blazor and can run on iOS, Android, Mac Catalyst, Tizen, and WinUI from a single source of code.

Applications can be run on Android, iOS, Mac Catalyst, macOS, Tizen, and Windows thanks to the .NET MAUI Class Library, which was used in their development.

Let’s create our first .NET MAUI App.

Choose to .NET MAUI App from the Project Template options and click Next.

.NET MAUI

Save it in the location by providing the project name.

.NET MAUI

.NET MAUI App uses XAML and is similar to WPF.

.NET MAUI

.NET MAUI Blazor

Now you may ask what is .NET Blazor?

It’s a feature of ASP.NET, the well-known web development framework, is called Blazor. It adds tools and libraries for creating web apps to the.NET developer platform.

Instead of using JavaScript, Blazor enables you to create interactive web user interfaces. Reusable web UI components are implemented in Blazor apps using C#, HTML, and CSS. Because C# is used for both client and server code, you can share code and libraries.

Using WebAssembly, Blazor can execute your client-side C# code right in the browser. You are able to reuse the code and libraries from the server-side components of your application because real.NET is running on WebAssembly.

You could also have Blazor execute your client logic on the server. Using SignalR, a real-time messaging framework, client UI events are returned to the server. The necessary UI changes are sent to the client and merged into the DOM once execution is finished.

In today’s discussion let’s use blazor to export multiple platforms

Using Blazor, we can easily export applications for Multiple Platforms.

Choose .NET MAUI Blazor from the Project Template while creating a new project and save it.

The default project folder structure is shown in the image below. It will be very simple for you to do this if you are already familiar with Blazor.

Similar options for exporting the application to various platforms are available for this project as they are for the.NET MAUI App. Let’s test the program on various platforms.

This project also has similar options to the .NET MAUI App to export the application to Mac, android or iOS platforms. But we will cover that in another article.

Conclusion

This article covered the creation of .NET MAUI applications and how to debug them across various platforms. The debugging for Windows devices, and procedure to create application in Mac, android and iOS devices have not been covered; they will be in subsequent articles later. But we hope that this article will help you to go through with everything related to MAUI if you are new here. Please feel free to share your feedback with us.

How to Use a Priority Queue in .NET version 6

No Comments »

A data structure that operates on a first in, first out (FIFO) principle is a queue. Items are added to the back of the line and taken out of the front. The actions of adding data to the queue are referred to as “enqueue,” while removing data from the queue is referred to as “dequeue.”

A priority queue is a queue type where the items are organized according to the priority values you give them. In.NET 6, support for a priority queue was first made available. The PriorityQueue class in.NET 6 and how to use it in our.NET 6 applications are covered in this article.

You need Visual Studio 2022 installed on your computer in order to work with the code examples provided in this tutorial. Download Visual Studio 2022 here if you don’t already have it.

Create a console application project in Visual Studio

Let’s start by opening Visual Studio and creating a.NET Core Console Application project. To build a new.NET Core Console Application project in Visual Studio, follow the instructions listed below, assuming Visual Studio 2022 is already installed on your computer.

  1. Launch the Visual Studio IDE.
  2. Click on “Create new project.”
  3. In the “Create new project” window, select “Console App (.NET Core)” from the list of templates displayed.
  4. Click Next.
  5. In the “Configure your new project” window shown next, specify the name and location for the new project.
  6. Click Create.

In the sections that follow, we’ll use this project to demonstrate how to work with a priority queue.

Create a priority queue in .NET 6

In.NET 6, a queue is typically a FIFO data structure, where items are added to the back and taken away from the front. In.NET 6, there is a special kind of queue called a priority queue that arranges the items according to the priority values you give them.

Using the constructor of the PriorityQueue class, as shown below, you can create an instance of the class.

The Enqueue() method can be used to add items to a PriorityQueue after it has already been created. Two parameters are accepted by the Enqueue method: the element to be added as a string and the element’s priority as an integer.

Keep in mind that items in a priority queue are arranged according to priority values, descending. As a result, the item with the highest priority (for example, 9) is placed at the back of the queue, and the item with the lowest priority (for example, 0) is placed at the front. The item with the lowest priority value is thus removed by a dequeue.

The Enqueue method is used to add items to a priority queue, as demonstrated by the following snippet of code.

PriorityQueue<string, int> priorityQueue = new PriorityQueue<string, int>();
priorityQueue.Enqueue("Item A", 4);
priorityQueue.Enqueue("Item B", 3);
priorityQueue.Enqueue("Item C", 2);
priorityQueue.Enqueue("Item D", 6);
priorityQueue.Enqueue("Item E", 7);
priorityQueue.Enqueue("Item F", 5);
priorityQueue.Enqueue("Item G", 0);
priorityQueue.Enqueue("Item H", 9);
priorityQueue.Enqueue("Item I", 1);
priorityQueue.Enqueue("Item J", 8);

Retrieve elements from a priority queue in .NET 6

There are two ways to get items out of a PriorityQueue. The Dequeue() method, which returns the queue item with the lowest priority value, is one choice. The Peek() method, which returns the item with the lowest priority value without removing it from the queue, is the alternate choice.

The TryDequeue and TryPeek methods, which handle exceptions internally, are improved versions of the Dequeue and Peek methods. If an item has been successfully removed from the queue, they return true; if not, they return false.

The next piece of code shows you how to display each item’s priority at the console window and remove items from the priority queue.

while (priorityQueue.TryDequeue(out string queueItem, out int priority))
{
 	Console.WriteLine($"Item : {queueItem}. Priority : {priority}");
}

Count the elements in a priority queue in .NET 6

To find out how many items are currently in the priority queue, use the following snippet of code.

int ctr = priorityQueue.Count;
Console.WriteLine($"No of items remaining in the priority queue : {ctr}");

The priority queue will have no available items if you add these lines of code as shown below after the while statement in our program. This is so because each time the TryDequeue method is called, a component of the priority queue is eliminated.

while (priorityQueue.TryDequeue(out string queueItem, out int priority))
{
	Console.WriteLine($"Item : {queueItem}. Priority : {priority}");
}
int ctr = priorityQueue.Count;
Console.WriteLine($"No of items remaining in the priority queue : {ctr}");

If you run our program with the code above, it will display the items of the priority queue and their priority values. Lastly, it will print a value 0, which denotes the total number of elements remaining in the priority queue at the end.

The IComparer interface is used by a priority queue in.NET 6 to determine the priority of the elements stored there. To determine the priorities of elements in a priority queue, you can create your own implementation of the IComparer interface. In a later post here, I’ll go into more detail about this.

A PriorityQueue instance is not thread-safe, it should be noted. To prevent race conditions, you should write your own custom code to handle thread safety. Operating systems frequently use priority queues for load balancing, thread scheduling, and interrupt management. An operating system will keep track of threads in a priority queue and schedule or preempt them as necessary.

Dev Box, A Cloud-Based IDE Service for Developers

No Comments »

Microsoft announced the Microsoft Dev Box during their recent conference. Over the last Construct convention, Microsoft introduced the Microsoft Dev Field. This new cloud service offers builders with safe, coding-ready developer workstations for hybrid groups of all sizes. With the brand new service, the corporate goals to make it simple for builders to shortly entry a pre-configured setting with all of the instruments and assets to jot down code.

Growth organizations can create and maintain Dev Field photographs themselves, with all the developers’ devices and dependencies to assemble and run their functions via way of means of making use of Microsoft Dev Field. As properly as, growth agencies can encompass software deliver codes and binaries which can be generated nightly, allowing developers to run and understand the code right away without being equipped for extended rebuilds. Development teams can consist of their utility supply code and nightly constructed binaries, permitting builders to at once to begin running and expertise the code without looking forward to lengthy re-builds.

It’s no secret that it can often be quite a bit of a process for developers to set up a new physical machine according to their needs. Microsoft argues that with the new Dev Box, IT teams can give newly onboarded developers easy access to a standard development environment without having to configure their own machine. Meanwhile, more senior developers who may be working on different projects — all with their own configurations and conflicting dependencies — can use multiple Dev Boxes to get their work done. And at the same time, IT regains control since the Dev Boxes are integrated with Windows 365 and management tools like Intune and the Microsoft Endpoint Manager.

This is not the first time Microsoft has made virtual development environments available to developers. Earlier this year, the company also launched its Azure Game Development Virtual Machine into preview. The use case here is obviously a bit different, but the idea is pretty much the same. Developers can set up their boxes as needed, with any IDE, SDK or internal tools they need (as long as it runs on Windows) and target any platform their tools support.

The developer workstation is being modified

The dev workstations include an excess of challenges. New developers can spend days putting in a working surroundings and weeks earlier than they make their first commit. Senior developers regularly work throughout a couple of initiatives that may deliver conflicting dependencies and hamper their dev workstation. And we’ve all made an alternate that unexpectedly left us with damaged surroundings. With Microsoft Dev Box, dev groups create and maintain Dev Box pictures with all of the tools and dependencies their devs want to construct and run their applications. Teams can consist of their application source code and nightly constructed binaries, permitting devs to right now begin strolling and expertise the code while not having to watch for lengthy re-builds.

“Developers stay in control of their Dev Boxes with a developer portal that enables them to create and delete their Dev Boxes for any of their projects. Developers can create Dev Boxes to experiment on a proof-of-concept, keep their projects separate, or even parallelize tasks across multiple Dev Boxes to avoid bogging down their primary environment,” Microsoft explains in today’s announcement. “For devs working on legacy apps, they can maintain Dev Boxes for older versions of an application to quickly create an environment that can reproduce and diagnose critical customer issues as they emerge.”

Microsoft Dev Box supports any developer IDE, SDK, or internal tool that runs on Windows. Dev Boxes can target any development workload you can build from a Windows desktop and are particularly well-suited for desktop, mobile, IoT, and gaming. You can even build cross-platform apps using Windows Subsystem for Linux.

Developing Dev Teams

The Dev Box, according to Microsoft, guarantees that developers have the necessary tools and resources at all times, based on project, work, and even role. Dev teams choose from a variety of SKUs when designing Dev Boxes to define the proper level of computation for each project and immediately scale up aging physical hardware. Thanks to Azure Active Directory integration, teams can quickly onboard new team members by assigning them to Azure Active Directory groups that provide them access to the Dev Boxes they require for their projects.

Dev teams ensure remote team members enjoy a high-fidelity experience and gigabit connection speeds wherever they are in the world by putting Dev Boxes in the developer’s local region and connecting over the Azure Global Network. Dev teams can tighten network security while outsourcing to external teams by defining role-based permissions that provide internal developers with more flexibility while limiting access for external contractors.

Security & Management

IT administrators can use Azure Active Directory to put up sophisticated access controls for Dev Box security. For Dev Boxes that access sensitive source code and client data, IT admins can set up conditional access policies that require users to connect through a compliant device, demand multifactor authentication (MFA), or implement risk-based sign-in policies.

Importantly, Microsoft Dev Box isn’t just for developers; because it’s integrated with Windows 365, IT managers can easily manage Dev Boxes alongside Cloud PCs in Microsoft Intune and Microsoft Endpoint Manager. IT admins may send zero-day patches to all devices throughout their enterprise using Intune’s expedited quality updates. If a developer’s Dev Box is hacked, IT administrators can isolate it while assisting the developer in reinstalling the software on a fresh Dev Box.

Conclusion

To keep costs down, developers can obviously spin their machines down at night and start them up in the morning. And to manage those costs across teams, Microsoft will also offer a single view to see all of a team’s boxes.

Microsoft Dev Box is now in private beta and will be released to the general public in the coming months. Visit here to learn more about Microsoft Dev Box and see demos.

Reasons To Choose Azure Over AWS

No Comments »

It’s not too long ago that the conversation around cloud services was, “they’re coming, so get ready.”

Today, clouds are normal, and we use it in our personal lives and in business. In fact, it’s predicted that spending on cloud services will more than double from $229 billion in 2019 to around $500 billion by 2023. Well, there are three major players in the cloud services world: AWS (Amazon Web Services), Google Cloud Platform (Google’s offering) and Microsoft Azure. We will be talking about AWS and Azure only. Although AWS is the public cloud market share leader, Azure is making gains and is the perfect choice for larger organisations already using Microsoft products.

Let’s take a look at some of the reasons why Microsoft Azure is better than AWS. But first let’s see…

What is AZURE?

Microsoft Azure, often referred to as Azure, is a cloud computing service operated by Microsoft for application management via Microsoft-managed data centers. Azure was launched in 2010 and it emerges as one of the biggest commercial cloud service providers. It offers a wide range of integrated cloud services and functionalities such as analytics, computing, networking, database, storage, mobile and web applications that seamlessly integrate with your environment in order to achieve efficiency and scalability.

What is AWS?

Amazon Web Services, Inc. is a subsidiary of Amazon that provides on-demand cloud computing platforms and APIs to individuals, companies, and governments, on a metered pay-as-you-go basis. AWS services are designed in such a way that they work with each other and produce a scalable and efficient outcome. AWS offering services are categorized into 3 types such as Infrastructure as a service (IaaS), software as a service (SaaS) and platform as a service (PaaS). AWS was launched in 2006 and became the best cloud platform among currently available cloud platforms. Cloud platforms offer various advantages such as management overhead reduction, cost minimization, etc.

Key Differences

Value and Cost-effectiveness

Azure is a natural choice for thousands of organisations that are already Microsoft houses. Most enterprise-level companies already use and are familiar with the Microsoft suite, and generally have an Enterprise Agreement in place. When this is the case, Azure offers cost-savings compared to AWS through discounts on licensing for Azure. You can also use your existing Windows Server and SQL Server licences with Software Assurance to pay a reduced rate when moving to Azure. It also allows companies to get more value from their existing Microsoft investment through full integration with Office 365 and Active Directory. For companies moving their Windows Server to the cloud, Microsoft has offers such as extended security updates included in the cost.

AWS follows pay as you go and they charge per hour whereas Azure also follows pay as you go model and they charge per minute which provides more exact pricing model than AWS.

PaaS Capabilities

Both Azure and AWS offer similar IaaS capabilities for virtual machines, networking, and storage. However, Azure provides stronger PaaS capabilities which is an important piece of Cloud infrastructure today.

Microsoft Azure PaaS provides application developers with the environment, tools, and building blocks that they need to rapidly build and deploy new cloud services. It also provides the vital ‘dev-ops’ connections which are important for monitoring, managing, and continually fine tuning those apps. With Azure PaaS, much of the infrastructure management is taken care of behind the scenes by Microsoft. Thus, Azure development allows for a 100% focus on innovation.

Security

From a security perspective, Microsoft is for industry-leading security than the Amazon. They were recognised as a Leader in security. Microsoft’s security is so robust it’s trusted by government bodies as well as enterprises; 95% of fortune 500 companies use Azure. 8 trillion threat signals are analysed by Microsoft every day, with more than $1 billion dollars spent each year on security research and development. Azure also provides more than 90 compliance offerings and is the most trusted cloud by US government agencies.

.Net Compatibility

Azure’s compatibility with the .Net programming language is one of the most useful benefits of Azure, which gives Microsoft a clear upper hand over AWS and the rest of the competitors. Azure has been built and optimized to work consistently with both old and new applications developed using the .Net programming framework. It is much easier and straightforward for enterprises to move their Windows apps to Azure Cloud as opposed to AWS or others. Thus for the several organizations that use .Net based enterprise apps, Azure is the obvious choice.

Cloud Connectivity & Performance

While Amazon is still testing the hybrid waters, Azure already has its hybrid capabilities in place. It seamlessly connects datacenters to the Cloud. Azure provides a consistent platform which facilities easy mobility between on-premises and the public Cloud.

Unlike AWS, hybrid apps can be developed on Azure which can take advantage of the resources available within datacenters, at the service provider’s end, or within Azure itself. Azure also provides a broader range of hybrid connections including virtual private networks (VPNs), caches, content delivery networks (CDNs), and ExpressRoute connections to improve usability and performance.

Conclusion

After this overview of the Differences Between AWS vs AZURE cloud providers, hope you will have a better understanding of the services offered by these AWS vs AZURE providers and choose a cloud provider based on your requirements. If you are looking for Infrastructure as a service or wide range of service and tools then you can choose AWS. If you are looking for windows integration or a good platform as a service (PaaS) cloud provider then you can choose Azure. The choise is always your to make.

Improve Your Model’s Performance and Accuracy with ML.NET’s New Update

No Comments »

Automated Machine Learning (AutoML) is one of the fascinating subfields of Data Science right now. It sounds fantastic for those who are unfamiliar with machine learning, but it concerns present Data Scientists a lot. The media presentation of AutoML suggests that the technology has the potential to drastically transform the way we produce models by removing the need for Data Scientists. In principle, utilizing AutoML to automate the process entirely is a brilliant idea, but it introduces several opportunities for bias and misunderstanding in practice. Machine learning model training can be a time-consuming process. Automated Machine Learning (AutoML) makes identifying the best strategy for your circumstance and dataset easier.

ML.NET is an open-source, cross-platform machine learning framework for .NET developers that allows custom machine learning to be integrated into .NET applications. Microsoft changed the AutoML implementation in its Model Builder and ML.NET CLI tools based on Microsoft Research’s Neural Network Intelligence (NNI) and Fast and Lightweight AutoML (FLAML) technology last year.

New AutoML Updates

Training machine learning models is a time-consuming and iterative task. Automated Machine Learning (AutoML) automates that process by making it easier to find the best algorithm for your scenario and dataset. AutoML is the backend that powers the training experiences in Model Builder and the ML.NET CLI. Last year we announced updates to the AutoML implementation in our Model Builder and ML.NET CLI tools based Neural Network Intelligence (NNI) and Fast and Lightweight AutoML (FLAML) technologies from Microsoft Research. These updates provided a few benefits and improvements over the previous solution which include:

  • Increase in the number of models explored.
  • Improved time-out error rate.
  • Improved performance metrics (for example, accuracy and R-squared).

The Experiment API

An experiment is a collection of training runs or trials. Each trial produces information about itself such as:

Evaluation metrics: The metrics used to assess the predictive capabilities of a model.

Pipeline: The algorithm and hyperparameters used to train a model.The experiment API includes a set of AutoML defaults, making it easier to add to a training pipeline. The dataPrepPipeline in this code snippet is a sequence of transforms to get the data into the proper format for training. The AutoML components required to train a regression model are added to that pipeline.

The same idea holds for other supported cases, such as categorization. When building an experiment using the training pipeline, one may choose the length of the training, the training and validation sets, and the evaluation measure they are optimizing. After setting up the pipeline and experiment, call the Run function to begin training.

// Configure AutoML pipeline
var experimentPipeline =    
    dataPrepPipeline
        .Append(mlContext.Auto().Regression(labelColumnName: "fare_amount"));

// Configure experiment
var experiment = mlContext.Auto().CreateExperiment()
                   .SetPipeline(experimentPipeline)
                   .SetTrainingTimeInSeconds(50)
                   .SetDataset(trainTestSplit.TrainSet, validateTestSplit.TrainSet)
                   .SetEvaluateMetric(RegressionMetric.RSquared, "fare_amount", "Score");

// Run experiment
var result = await experiment.Run();

In this code snippet, the dataPrepPipeline is the series of transforms to get the data into the right format for training. The AutoML components to train a regression model are appended onto that pipeline. The same concept applies for other supported scenarios like classification.

What’s next for ML.NET?

We’re actively working towards the areas outlined in our roadmap.

Deep Learning

A few months ago we shared our plan for deep learning. A significant portion of that plan revolves around improving ONNX experiences for consumption and enabling new scenarios through TorchSharp, A .NET library that provides access to the library that powers PyTorch. Some of the progress we’ve made towards this plan includes:

Enabled global GPU flags for ONNX inferencing. Prior to this update, when you wanted to use the GPU for inferencing with ONNX models, the FallbackToCpu and GpuDeviceId flags in the ApplyOnnxModel transform were not saved as part of the pipeline. As a result, you had to fit the pipeline every time. We’ve made these flags accessible as part of the MLContext so you can save them as part of your model.

TorchSharp targets .NET Standard. TorchSharp originally targeted .NET 5. As part of our work in enabling TorchSharp integrations into ML.NET, we’ve updated TorchSharp to target .NET Standard.

We’re excited to share with you the progress we’ve made integrating TorchSharp with ML.NET in the coming weeks. Stay tuned for the blog post.

.NET DataFrame

Clean and representative data improves the performance of the model. As a result, data analysis, cleansing, and preparation for training is a crucial stage in the machine learning workflow. A few years back, we introduced the DataFrame type to.NET as a preview in Microsoft.Data.Analysis NuGet package. The DataFrame is still in preview. as it is very important for someone to have the tools to perform data cleaning and processing tasks and have started to organize and prioritize feedback, they address existing stability and developer experience pain points. The feedback is being organized as part of a GitHub issue.

MLOps

Machine Learning Operations (MLOps) is like DevOps for the machine learning lifecycle. This includes things like model deployment & management and data tracking, which help with productionizing machine learning models. We’re constantly evaluating ways to improve this experience with ML.NET.

Recently we published a blog post that guides you through the process of setting up Azure Machine Learning Datasets, training an ML.NET model using the ML.NET CLI and configuring a retraining pipeline with Azure Devops. For more details, check out the post Train an ML.NET model in Azure ML.

Conclusion

Machine Learning Operations (MLOps) is a machine learning lifecycle equivalent to DevOps. It comprises features such as model deployment and administration and data tracking, which aids in producing machine learning models. Microsoft continually strives for ways to improve the ML .NET experience. These are some updates brought in by Microsoft ib their ML .NET framework, which will help developers better their workflow.

« go backkeep looking »