.NET Development and AI: Harnessing the Power of C# and Microsoft's AI Platform
The intersection of .NET development and artificial intelligence (AI) has become an increasingly significant area of focus for software engineers and researchers alike. With the rise of advanced AI technologies. One of the trends that we have witnessed in recent years is the seamless integration of C# programming language and Microsoft's AI platform, enabling developers to create innovative software solutions that leverage the power of both.
Software developer today will have several scenarios that can be used to create software that has built in AI. Some of the scenario that commons are:
Adding conversation between your application and AI. For example, you put an AI rewrite feature in the application or have a dialog between your application and AI. On this scenario, we can use Azure OpenAI
Adding predictive maintenance capabilities to your application to forecast when equipment might fail, or sales will rise. On this scenario, we can use ML.NET Model Builder.
Developing chatbot or virtual assistant that can understand and respond to user queries. You can use Azure Open AI, and The Semantic kernel SDK to make it happen.
If you want to build one of the solution you can visit this Collections | Microsoft Learn to make you accelerate the development
When you want to create a solution that uses natural language processing (NLP), you can use a lot of open-source libraries. However, if you take a closer look at the Azure AI, they have NLP features through Azure AI language, and it starts from FREE.
Natural Language Processing (NLP) development with Azure AI involves utilizing Microsoft's suite of tools and services to build, deploy, and manage NLP models and applications. Azure offers a range of NLP-related services such as Azure Cognitive Services, Azure Machine Learning, and Azure Databricks, which provide capabilities for language understanding, sentiment analysis, named entity recognition, and more.
Using Azure AI for NLP development allows developers to harness the power of pre-built models and APIs for common NLP tasks, as well as the flexibility to build custom NLP models using machine learning frameworks like TensorFlow and PyTorch on Azure Machine Learning. Additionally, Azure provides infrastructure and tools for data processing, model training, and deployment, making it a comprehensive platform for NLP development.
By leveraging Azure AI for NLP development, businesses and developers can expedite the creation of language-aware applications, automate text analysis workflows, and gain insights from unstructured data sources. Azure's robust security and compliance features also ensure that NLP applications built on the platform adhere to industry standards and best practices. Overall, Azure AI empowers developers to create sophisticated NLP solutions while benefiting from the scalability, reliability, and performance of the Azure cloud platform.
To create an Azure AI Language project using Visual Studio, follow these steps:
Provision Azure Resources:
Create an Azure Subscription (you can create one for free).
Log into Language Studio.
If it’s your first time logging in, choose a language resource and select “Create a new language resource.” Provide details such as name, location, and resource group.
Use Language Studio with Your Own Text:
Once you’re ready to use Language Studio features on your text data, you’ll need an Azure AI-language resource for authentication and billing. I recommend you do not need to activate this because it needs to be paid, but of course, I recommend you to subscribe when the transaction goes up.
Follow the setup process to create your resource.
You can then call REST APIs and use client libraries programmatically. You can see a lot examples here Language Studio - Microsoft Azure
Remember to choose a location for your Azure AI language resources so the latency of the resources
Some NLP scenarios that you can expect:
Extract information that comes from the document/text. For example, you want to understand the main topic or contribution of an article
Classify text for sentiment analysis, language detection, and custom text classification. For example, you want to moderate content in the forum
Question and answer. For example, creating a Bot for simple question-and-answer.
Summarize information. For example, you want to create meeting notes based on the meeting documents / conversational text
Customize translation. For example, you want to create a translation of a natural language to cat language :D
In this article, we will discuss how to step through a multi-account Azure Environment for Cost Optimization. An organization might need to restructure its multi-accounts. Here is why.
Multi-Account means that the account belongs to each of the responsible roles. This is good when Azure's budget is separated between divisions.
Multi-Account means we can open as many subscriptions as we need. For example, one subscription is for Pay As You Go, one is for DevTest, and others are for Collaboration.
Multi-account means we can consolidate using manage organizations and have separate Microsoft Entra IDs. This is great for companies that build in Microsoft Azure for their customers. So any development won't mess up their Entra ID.
So here are the steps.
Create management groups. Manage your Azure subscriptions at scale with management groups - Azure Governance - Azure governance | Microsoft Learn
Structure your subscriptions, for example,
Research subscription - for research purposes.
Development Subscription - for development purposes
Your customer subscription—managed services for the production server. I recommend you create one subscription for customers with a huge workload.
Product subscription—This is an internal system in the organization, such as a website, internal information system, DevOps subscriptions, and many more.
Structure the organization by managing group roles Organize subscriptions into management groups and assign roles to users - Microsoft Defender for Cloud | Microsoft Learn
Create resource groups based on the Project. Manage resource groups - Azure portal - Azure Resource Manager | Microsoft Learn
Managing tags. The organization should have tags to consolidate tags for any activities such as "safe to delete" "production" "expired" "high transaction" etc. Tag resources, resource groups, and subscriptions with Azure portal - Azure Resource Manager | Microsoft Learn
This article is going with post for Azure Global Bootcamp 2023 that held in Cilacap Indonesia. On this session, I shared about how to use AI in Visual Studio 2022 and Visual Studio Codes, you can grab and see the decks on this post.
If you want to join my live session, you can join at https://bit.ly/globalazure2023 , see you there
Problem
In the past, we move the azure resource through three ways.
Snapshot and copy
Scripting through PowerShell's
Redeploy the solution
It has a lot of activities and manual actions. If you have a lot
Solution
Today, we have a new way to deploy the azure resources namely Azure Resource Mover. You can watch the video here
Problem
Our customer has an issue with their cloud computing expense. They have allocated a VM with over specification with their budget. This is because the VM will work hard in specific time. The customer uses the VM in 09.00 AM and 5 PM. After that the VM is not used.
Requirements
The customer wants you to reduce the cost by downscaling and upscaling the VM based on the time.
Workdays: 09.00 – 17.00 PM
Weekend: Off
//
Solution
You have several solutions to accommodate this.
Turn off the VM outside the workdays and turn of the VM in the workdays (Option A)
Scale down the VM in non-workday, and scale up in the workday (Option B)
Well-Architecture Recommendation
Choosing A, we will get better cost efficiency. However, there is some circumstance when the VM is misbehaving because the cold-start issue.
Choosing B, we still get cost-saving. However, we still pay the downsizing cost
How to do that
We can use many ways to do that. In Azure, you can use Azure Automation. You can read here
Azure Automation Start/Stop VMs during off-hours overview | Microsoft Docs
Azure Automation: Scale-Down VM Size - Microsoft Tech Community
Auto Scale Up and Down VM's with Azure Automation (wordpress.com)
Background
Your customer has a VM (Virtual Machine). The VM contains of Windows Server 2019, SQL Server 2019 Web Edition, and ERP Software. The VM runs on Azure with no redundancy option activated. After a year, the VM has a problem to facilitate the request from the client. Scale up is the first think that we already done. However, the scalability is not fulfilled since one VM means one single point of failure. Therefore, we will make this single VM can be available for scalability purposes. This article will discuss how to prepare scalability environment for VM with 'least effort'
medianet_width = "600";
medianet_height = "250";
medianet_crid = "858385152";
medianet_versionId = "3111299";
Solution
After reading Make all things redundant - Azure Application Architecture Guide | Microsoft Docs, we strongly believe that we need load balancer on our VM and create a snapshot of our VM. On our case, we are very unlucky since the database and the web application is on one VM. Therefore, we need to do some extra steps as follows
Separating between database server and application server. If you are insisting to still make one VM, you will have a risk to lose your data. Snapshot a VM anytime when your database changes is not a good idea. The options are
VM + VM SQL Azure – this is the cheapest one, but you should manage the security and patching by yourself
VM + SQL Azure – if your application cannot be moved to App Service, this is win-win solution
App Service + SQL Azure – this is the most preferred way. Just Be aware of the cost
Replicate the database in multi-region you can do by visiting here
Creating multiple VM with scalability set. On this step, you should create snapshot of your VM and put the VM behind the load balancer. You can do that by reading this tutorial. You can create with snapshot and ARM template to do that.
If you need more than one region. For example, your customer is Europe while your base is in Asia. You can create multi-region VM. You need put the VM behind the Traffic manager. You can read the architecture recommendation here . You should deploy the VM on multiple regions plus you need to maintain the VM by creating regularly snapshot.
Multi-Region in regional pairing. I recommend this one, if your customer still on the same geographical area. Doing regional pair, will make sure that the recovery will be prioritized.
Multi-Region. I recommend this approach if your customer is separated geographically.
Do you have a problem in manage your scalable solution in VM, let's talk!
medianet_width = "600";
medianet_height = "250";
medianet_crid = "858385152";
medianet_versionId = "3111299";
Becoming architect in today computing is no longer easy just like before. In the past, we just need to learn a computer, its architecture, and its software. Today, business uses IT like never before. Virtualization, Client Server, Distributed systems, and of course cloud computing. On this article, we will discuss what we need to learn as professional architect
Professional Architect in Certification
In professional world, certification is a measurement of how career development goes. Therefore, let see what the expectation of certification in professional architect
Azure Solutions Architect
The professional architect should understand
Implement and monitor an Azure infrastructure
Implement management and security solutions
Implement solutions for apps
Implement and manage data platforms
Design monitoring
Design identity and security
Design data storage
Design business continuity
Design infrastructure
AWS Professional Architect
The professional architect on AWS should understand
Design and deploy dynamically scalable, highly available, fault-tolerant, and reliable applications on AWS
Select appropriate AWS services to design and deploy an application based on given requirements
Migrate complex, multi-tier applications on AWS
Design and deploy enterprise-wide scalable operations on AWS
Implement cost-control strategies
Learning as Architect
You can learn to become architect by joining digital training such as:
Microsoft Certified: Azure Solutions Architect Expert - Learn | Microsoft Docs
Exam Readiness: AWS Certified Solutions Architect – Professional | AWS Training & Certification
The Real Architect
You should learn by doing, so lab is better
You should learn by reading a lot of material
You should practices problem – solution
Background
Your organization already has a VM that host web server to the end-user. You want to make the VM can work scalable based on the demand of the end user. You want to distribute incoming network traffic across a group of back-end resources or services such as virtual machines (VMs). You must scale your applications while maintaining throughput and keeping response times low.
Solution
For scalability Azure provides you:
Azure Load Balancer. It works in Layer 4. You can manage VM, NAT, and the virtual network
Application Gateway. It works in Layer 7. You can manage HTTP, HTTPS traffic
medianet_width = "600";
medianet_height = "250";
medianet_crid = "858385152";
medianet_versionId = "3111299";
On this case, we prefer to use Azure Load Balancer (since it's a VM)
Think the scenario, where you want to put the Azure Load Balancer
Public facing. For example, when you have a web server in a public subnet
Private facing. For example, when you want to manage load in private subnet such as database server
Select proper SKU
Basic – communicate with HTTP and TCP protocol, up to 300 instances
Standard – Basic SKU plus HTTPs and with SLA 99.99%
Choose the backend pool. Backend pool is containing the IP address or VM sets that already exist. For Basic you can only access VM in single network, while standard can access in availability set
Availability set
Single VM
VM Scale set
Configure rule of load balancer
Configure session persistence. It will help the user can use same VM when doing transaction
Create health probe. It rules how probe will make use the load balancer activate when certain health conditions
Learn More
https://docs.microsoft.com/en-us/azure/load-balancer/
https://docs.microsoft.com/en-us/learn/modules/improve-app-scalability-resiliency-with-load-balancer/
medianet_width = "600";
medianet_height = "250";
medianet_crid = "858385152";
medianet_versionId = "3111299";
Problem Background
You build a new application in the cloud, and you want to select proper database for your application. There are many choices for database deployment. Today we will discuss tips to choose the right database for your cloud environment. Let's get started!
What are the Issues?
When choosing the database in the cloud, you will have a lot of option such as self-managed database in the cloud or full managed database in the cloud. Although you already have a good benefit when implement a cloud such as scalability, operational simplicity (sharding, backup, recovery, updates), and cost efficiency when implement in the cloud. However, design consideration will become the main issues in the cloud.
medianet_width = "600";
medianet_height = "250";
medianet_crid = "858385152";
medianet_versionId = "3111299";
The Tips
Tips 1 – Leveraging the On-Premises database to the Virtual Machine
When I use this:
You have on-premises database that hosted on a VM. Doing this will make you easy to lift-and-shift
You have legacy database that not compatible with the full managed database services provided by your cloud provider.
You want to manage your database engine by yourself
Tips 2 – Using the full managed database
When I use this:
You don't have time and resources to manage your database. Ease of administration.
You have a compatible database with the cloud provider. Available, durable, and up to date.
You build a new application that use modern infrastructure that leverage the power of the cloud. High performance and good scalability
Tips 3 – Taking Care the cost
Self-managed database will give you lower cost than full-managed database. For the same size, you will get 50% higher cost by using full-managed database vs self-managed database.
Tips 4 – Using the Cloud Optimized Database
Today the cloud provider provides you a modern and serverless cloud optimized database such as Azure Database SQL Serverless or AWS Aurora serverless. These cloud optimized database is managed database just like SQL Azure or RDS. But it has more performance, more modern, more cost (23% higher than full managed database). If you have data intensive transaction you can choose cloud optimized database.
Tips 5 – Using the Non-Relational Database (NoSQL)
Beside the relational database, you will have non-relational database that work more simple, more high performance, and key-value access pattern. If your data can be developed in non-relational way you can use the NoSQL engine such as Cosmo DB or DynamoDB. Please make sure
The cost to store the data in non-relational is higher than relational database. i.e., 1 TB will cost 250 USD / month in DynamoDB while in Aurora will cost you about 100 USD
The availability of NoSQL (99.999) is higher than full managed database (99.99).
Is schema less database, so you don't need database schema only table.
Personal Conclusion
So, what the conclusion so far
For small and cost-effective, you should choose to self-manage is the cheapest option and full control
For more demanding performances you should choose full managed database.
When in doubt or high transaction database you can choose NoSQL
medianet_width = "600";
medianet_height = "250";
medianet_crid = "858385152";
medianet_versionId = "3111299";