<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Pratik Learn Directory]]></title><description><![CDATA[Pratik Learn Directory]]></description><link>https://hashnode.pratikpathak.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1666526264953/DvtSKnq5v.png</url><title>Pratik Learn Directory</title><link>https://hashnode.pratikpathak.com</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 21:34:04 GMT</lastBuildDate><atom:link href="https://hashnode.pratikpathak.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[The reason I hate Windows 11]]></title><description><![CDATA[Prove me wrong but....
The best operating system is Windows 7 (after windows xp professional)
I still remember the days when I played GTA Vice City on Windows 7, the best OS ever
I was able to install any developing software and never faced any issue...]]></description><link>https://hashnode.pratikpathak.com/the-reason-i-hate-windows-11</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/the-reason-i-hate-windows-11</guid><category><![CDATA[General Programming]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Windows]]></category><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Sat, 27 Sep 2025 02:39:00 GMT</pubDate><content:encoded><![CDATA[<p>Prove me wrong but....</p>
<p>The best operating system is Windows 7 (after windows xp professional)</p>
<p>I still remember the days when I played GTA Vice City on Windows 7, the best OS ever</p>
<p>I was able to install any developing software and never faced any issue "Driver reinforcement Signature" -&gt; those who know this issue are legend</p>
<p>and then the Windows 10 came,
UI - Good
System - Good
Perfomance - Bad</p>
<p>But slowly i moved to Win 10 
why?
Windows 7 discontinued</p>
<p>and Windows 11 came into picture
Cannot move taskbar to left/right
Changed the context menu
High Ram Usage
Bigger disk storage
Promised Android app support but done using emulator (similar to bluestack)
etc etc</p>
<p>The only good thing about is WSL integration (my personal opinion)
and you can zip a file just by right click
what is your fav feature in Win11?</p>
<p>and now it's time to say goodbuy to Windows 10, though windows 10 was not perfect but its way way better than windows 11</p>
<p>If you have to choose between Windows 7 or Windows 10 or Windows 11, what you will choose?
Windows 8 user please stay away...</p>
]]></content:encoded></item><item><title><![CDATA[It’s 2025 and You Still Use Useless VS Code Extensions, Developers 20 VScode Extensions]]></title><description><![CDATA[Okay, okay, I get it. It’s 2025, and I’m still clinging to some of these VS Code extensions like they’re the last roll of toilet paper in a pandemic. 🤦‍♂️ But hey, if it ain’t broke, don’t fix it, right? Well, maybe “ain’t broke” is a bit of an exag...]]></description><link>https://hashnode.pratikpathak.com/its-2025-and-you-still-use-useless-vs-code-extensions-developers-20-vscode-extensions</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/its-2025-and-you-still-use-useless-vs-code-extensions-developers-20-vscode-extensions</guid><category><![CDATA[Python]]></category><category><![CDATA[VS Code Extensions]]></category><category><![CDATA[VS Code]]></category><category><![CDATA[Developer]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[Programming Tips]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Devops articles]]></category><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Sat, 31 May 2025 12:09:47 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1748693287949/15957453-d05b-4f05-94ce-85ea6241c5fa.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p>Okay, okay, I get it. It’s 2025, and I’m <em>still</em> clinging to some of these VS Code extensions like they’re the last roll of toilet paper in a pandemic. 🤦‍♂️ But hey, if it ain’t broke, don’t fix it, right? Well, maybe “ain’t broke” is a bit of an exaggeration for some of them. It’s probably time for a serious extension audit.</p>
<p>Let’s be honest with ourselves, some of these extensions are probably doing more harm than good – slowing things down, causing weird conflicts, or just generally being… useless. So, I’m doing this for myself as much as for anyone else who might stumble upon this.</p>
<h3 id="heading-its-2025-and-you-still-use-useless-vs-code-extensions-here-are-the-top-20-vs-code-extensions-for-developers">It’s 2025 and You Still Use Useless VS Code Extensions. Here are the Top 20 VS Code Extensions for Developers.</h3>
<p>Alright, self, let’s dive into this. Time to Marie Kondo my extension list and spark some joy (and productivity!). Here are the 20 extensions that I, a discerning (or so I like to think) developer, believe are <em>actually</em> essential in 2025. No more excuses for a cluttered, inefficient VS Code setup!</p>
<h3 id="heading-1-github-copilot">1. GitHub Copilot 🚀</h3>
<p>Let’s just get this one out of the way. Yes, it’s AI. Yes, it’s sometimes uncannily smart, and other times it suggests the digital equivalent of putting pineapple on pizza (controversial, I know). But for boilerplate code, quick suggestions, and generally acting as a coding companion, it’s pretty darn useful. It helps write code faster and smarter by providing inline suggestions.</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=GitHub.copilot">GitHub Copilot on VS Code Marketplace</a></li>
</ul>
<h3 id="heading-2-tabnine">2. Tabnine 🤖</h3>
<p>Another AI code completion tool. I like to have options, okay? Tabnine uses machine learning to provide intelligent code completions based on your project’s context and your coding habits. It supports a ton of languages and can really speed things up when you’re in the zone.</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=TabNine.tabnine-vscode">Tabnine AI Autocomplete on VS Code Marketplace</a></li>
</ul>
<h3 id="heading-3-gocodeo">3. GoCodeo ✨</h3>
<p>This one’s a newer kid on the block but gaining traction fast. It’s pitched as an AI-powered full-stack development assistant right inside VS Code. From code generation to deployment, it aims to streamline the whole process. If you’re looking to consolidate your toolchain and get a bit of AI help across the board, this is definitely worth a look.</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=GoCodeo.gocodeo">GoCodeo on VS Code Marketplace</a></li>
</ul>
<h3 id="heading-4-eslint">4. ESLint 🧐</h3>
<p>If you’re writing JavaScript or TypeScript and <em>not</em> using ESLint, we need to have a serious talk. Seriously. It analyzes your code to find problems and enforce coding standards. It’s like having a very pedantic but ultimately helpful friend looking over your shoulder, preventing you from making silly mistakes before they become big headaches.</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint">ESLint on VS Code Marketplace</a></li>
</ul>
<h3 id="heading-5-prettier-code-formatter">5. Prettier – Code formatter 💅</h3>
<p>My eyes! They bleed without Prettier. This opinionated code formatter keeps your code looking consistent and clean across your projects. No more debates about tabs vs. spaces or where that curly brace should go. Just hit save, and boom – pretty, readable code. It’s a sanity-saver, especially on team projects.</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode">Prettier – Code formatter on VS Code Marketplace</a></li>
</ul>
<h3 id="heading-6-sonarlint">6. SonarLint 🛡️</h3>
<p>This extension helps you find and fix bugs and security issues as you code. It runs in the background, highlighting problems and even offering in-context guidance on how to fix them. Think of it as an early warning system for code smells and potential vulnerabilities, helping you write more robust and secure applications.</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarlint-vscode">SonarLint on VS Code Marketplace</a></li>
</ul>
<h3 id="heading-7-code-spell-checker">7. Code Spell Checker 📝</h3>
<p>Typos in code are embarrassing. Typos in comments are… still embarrassing, and can even be misleading. This extension is a lifesaver for catching those sneaky spelling mistakes in your code (string literals, variable names) and comments. It supports multiple languages too!</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker">Code Spell Checker on VS Code Marketplace</a></li>
</ul>
<h3 id="heading-8-gitlens-git-supercharged-git">8. GitLens — Git supercharged GIT</h3>
<p>If you use Git (and you <em>should</em> be using Git), GitLens is an absolute must-have. It supercharges the built-in Git capabilities, allowing you to see code authorship (blame), seamlessly explore revision history, compare branches, and gain valuable insights into your codebase’s evolution, all without leaving the editor. It’s incredibly powerful.</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens">GitLens — Git supercharged on VS Code Marketplace</a></li>
</ul>
<h3 id="heading-9-live-share">9. Live Share 🧑‍💻👩‍💻</h3>
<p>This one feels like magic every time I use it. It enables real-time collaborative editing and debugging. Perfect for pair programming, remote Gituations, or just getting a quick second pair of eyes on some tricky code. You can share your workspace, terminal, and even debugging sessions.</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare">Live Share on VS Code Marketplace</a></li>
</ul>
<p>Also Read: <a target="_blank" href="https://pratikpathak.com/azure-devops-vs-jira/">Why Azure Ops is better than Jira</a></p>
<h3 id="heading-10-python-by-microsoft">10. Python (by Microsoft) 🐍</h3>
<p>If Python is your jam, this is the foundational extension. It provides rich support including IntelliSense (Pylance), linting (Flake8, Pylint), debugging, code navigation, code formatting, refactoring, and environment switching. It’s the official, comprehensive Python toolkit for VS Code.</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ms-python.python">Python on VS Code Marketplace</a></li>
</ul>
<h3 id="heading-11-pylance-by-microsoft">11. Pylance (by Microsoft) ⚡️</h3>
<p>Also for Python developers, Pylance offers fast static type checking and comprehensive language support. It includes features like intelligent type completion, signature help, auto-imports, and dead code detection. It works alongside the main Python extension to give you a supercharged Python experience.</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance">Pylance on VS Code Marketplace</a> (often bundled with the Python extension)</li>
</ul>
<p>Also Read: <a target="_blank" href="https://pratikpathak.com/kali-linux-live-usb-persistence/">[Updated] Create Kali Linux Live USB with Persistence storage 2025</a></p>
<h3 id="heading-12-tailwind-css-intellisense">12. Tailwind CSS IntelliSense 🌬️</h3>
<p>If you’re working with Tailwind CSS, this extension is a game-changer. It provides autocompletion for utility classes, syntax highlighting, and linting. It even shows you the CSS that a Tailwind class generates on hover. Makes working with Tailwind so much smoother.</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss">Tailwind CSS IntelliSense on VS Code Marketplace</a></li>
</ul>
<h3 id="heading-13-live-server">13. Live Server 🌐</h3>
<p>A simple but incredibly useful extension for web developers. It launches a local development server with a live reload feature, so you can see your changes in the browser instantly as you code HTML, CSS, and JavaScript. No more manual refreshing!</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer">Live Server on VS Code Marketplace</a></li>
</ul>
<h3 id="heading-14-auto-rename-tag">14. Auto Rename Tag 🔄</h3>
<p>Such a small thing, but oh-so-helpful, especially when wrangling complex HTML or XML structures. When you rename an opening HTML/XML tag, it automatically renames the corresponding closing tag, and vice-versa. Saves a surprising amount of time and prevents silly mistakes that can break your layout.</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag">Auto Rename Tag on VS Code Marketplace</a></li>
</ul>
<h3 id="heading-15-path-intellisense">15. Path Intellisense 📁</h3>
<p>No more fumbling around trying to remember file paths or making typos in them. This extension autocompletes filenames and paths, making it quicker and easier to import modules, link to assets, or reference other files in your project.</p>
<ul>
<li>Install: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense">Path Intellisense on VS Code Marketplace</a></li>
</ul>
<p><strong>Wanna know the most important remaining 5 extension?</strong> Click here : <a target="_blank" href="https://pratikpathak.com/vscode-extensions-must-have/">Most Important 5 Vscode Extension</a></p>
<p>Whew! Okay, that’s 20. My VS Code already feels lighter, faster, and more purposeful. It’s a bit like cleaning out your digital garage – you find some treasures you forgot you had, toss out a lot of accumulated junk, and end up with a much more efficient and pleasant workspace.</p>
<p>Of course, “essential” is subjective, and the best extensions for you will always depend on your specific workflow, the programming languages you use daily, and your personal preferences. But I’m pretty confident that this list provides a solid foundation for most developers looking to stay productive, write better code, and maybe even enjoy their coding environment a bit more in 2025.</p>
<p>Now, if you’ll excuse me, I have some actual coding to do in my newly revamped, “non-useless” VS Code environment. 😉 It’s time to put these tools to work!</p>
]]></content:encoded></item><item><title><![CDATA[I Saw The Power of Azure AI Agent Service]]></title><description><![CDATA[Azure AI Agent Service is Microsoft’s powerful tool for creating smart, conversational AI assistants. It can be regarded as a platform that enables you to build intelligent chatbots that can understand and respond to users in natural ways. In today’s...]]></description><link>https://hashnode.pratikpathak.com/i-saw-the-power-of-azure-ai-agent-service</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/i-saw-the-power-of-azure-ai-agent-service</guid><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Fri, 10 Jan 2025 16:15:33 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1736525697890/a002176e-a2f6-4450-90f2-54f7c03c5f2f.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p>Azure AI Agent Service is Microsoft’s powerful tool for creating smart, conversational AI assistants. It can be regarded as a platform that enables you to build intelligent chatbots that can understand and respond to users in natural ways. In today’s digital world, businesses need to interact with customers 24/7, and conversational AI comes in handy. It is part of a bigger family of AI tools that Microsoft has, which makes it easier for companies to add AI capabilities to their applications.</p>
<h2 id="heading-introduction-to-azure-ai-agent-service"><strong>Introduction to Azure AI Agent Service</strong></h2>
<p><strong>We have tried every automation tool in the world, and nothing seems to stick.” That’s what James, DevOps lead at a healthcare startup, told us before discovering Azure AI Agent</strong>. His team was drowning in routine infrastructure monitoring tasks until they implemented an AI agent that could detect, diagnose, and even resolve common server issues automatically. Now, their system maintenance is proactive rather than reactive.</p>
<p>Fundamentally, Azure AI Agent serves as a smart mediator between users and complex systems. Using advanced natural language processing, or NLP, to decipher queries, it can read meaning into user queries and answer in the appropriate context. More specifically, its strength is the ease of integration with other Azure services – database access, workflow automation triggering, and real-time data analysis.</p>
<p>The service is notable because of its adaptability towards varying business scenarios. That might be in handling customer support calls, facilitating internal IT helpdesk operations, or complex business processing. Azure AI Agent, therefore, can be specifically crafted to meet the organizational need by being able to manage even multi-turn conversations-thence it can sustain contextual thought throughout an interaction. As such, it becomes perfectly suited for natural-flow dialogues rather than straightforward questions and answers.</p>
<h2 id="heading-importance-of-conversational-ai-in-modern-applications">Importance of conversational AI in modern applications</h2>
<p>Essentially, the Azure AI Agent Service is changing how businesses communicate with their customers and carry out internal processes. This is because it brings together superior natural language understanding capabilities and seamless integration to help organizations build AI assistants that are truly intelligent and responsive to user needs. It’s whether in the case of handling customer inquiries, support for internal operations, or even facilitating complex business processes; the AI agents can handle them all in remarkably efficient ways.</p>
<p>What makes the Azure AI Agent Service especially powerful is its feature set. The platform is truly great at natural language understanding, so it can actually understand what users want to say even when they put questions in different words. It supports multiple communication channels, from Microsoft Teams to web applications, so that your AI assistant is there where your users are. Integration with Azure OpenAI models, including GPT and Codex, supports sophisticated conversations that feel almost natural and contextually right.</p>
<h3 id="heading-core-features"><strong>Core Features</strong></h3>
<p>The service comes packed with useful features that make it stand out:</p>
<ul>
<li><p>It’s really good at understanding what people are saying, even when they phrase things differently</p>
</li>
<li><p>You can use it across different platforms – whether it’s Microsoft Teams, your website, or mobile apps</p>
</li>
<li><p>It works seamlessly with advanced AI models from Azure OpenAI, letting your bot give smart, contextual responses</p>
</li>
<li><p>You can easily connect it to other systems and track how well it’s performing</p>
</li>
<li><p>It comes with built-in tools to monitor how your bot is doing and what users are asking about</p>
</li>
</ul>
<h3 id="heading-use-cases"><strong>Use Cases</strong></h3>
<p>There are lots of ways to use Azure AI Agent Service:</p>
<ul>
<li><p><strong>Customer Service:</strong> It can handle common questions, freeing up your support team</p>
</li>
<li><p><strong>Internal Help Desks:</strong> Helps employees find information about company policies or IT issues</p>
</li>
<li><p><strong>Shopping Assistant:</strong> Guides customers through products and answers questions about items</p>
</li>
<li><p><strong>Healthcare Helper:</strong> Helps patients book appointments or get basic medical information</p>
</li>
<li><p><strong>Business Tools:</strong> Can be customized for specific business needs like handling orders or checking inventory</p>
</li>
</ul>
<h2 id="heading-getting-started">Getting Started</h2>
<p>Getting started with Azure AI Agent Service is surprisingly easy. The architecture follows a modular approach, so developers can build and scale their solutions efficiently. This process includes creating a bot in the Azure portal, defining the conversation flows, and bringing in desired capabilities through Azure Cognitive Services. The development tools and SDKs the platform offers are very thorough, making it accessible to teams who have never undertaken AI implementation before.</p>
<p>This differentiates Azure AI Agent Service from its alternative peers such as AWS Lex or Google Dialogflow because of the integration it allows within the larger Azure platform, providing unprecedented scalability and flexibility to business applications to scale from small to larger with the changing needs. Inbuilt analytics and monitoring give a business great insight into how its users interact and how they can be optimized for the better.</p>
<p>With proven best practices in place, success with Azure AI Agent Service comes down to simply following the rules. A clear objective to start should be accompanied by the slow addition of features based on user feedback. Overcomplicating conversation flows or neglecting proper testing could lead to less desirable results. In the future, Microsoft will continue to develop the platform further, aiming at even more natural conversations and greater integration capabilities.</p>
<h3 id="heading-prerequisites">Prerequisites</h3>
<ul>
<li><p>An <strong>Azure subscription</strong> (you can create one for free if you don’t have it)</p>
</li>
<li><p>The latest version of <strong>.NET installed</strong> on your development machine</p>
</li>
<li><p>Azure AI Developer <strong>RBAC role permissions</strong></p>
</li>
<li><p><strong>Azure CLI with the machine learning</strong> extension installed and updated</p>
</li>
</ul>
<h3 id="heading-basic-setup-process">Basic Setup Process</h3>
<p>Azure AI Agent Service offers two setup options:</p>
<ol>
<li><strong>Basic Setup</strong></li>
</ol>
<ul>
<li><p>Uses Microsoft-managed multitenant search and storage resources</p>
</li>
<li><p>Simpler to get started</p>
</li>
<li><p>Limited visibility into underlying resources</p>
</li>
<li><p>Ideal for testing and smaller implementations</p>
</li>
</ul>
<ol start="2">
<li><strong>Standard Setup</strong></li>
</ol>
<ul>
<li><p>Uses customer-owned, single-tenant resources</p>
</li>
<li><p>Full control over resources</p>
</li>
<li><p>Complete visibility into operations</p>
</li>
<li><p>Better suited for enterprise applications</p>
</li>
<li><p>Includes dedicated storage account, key vault, and Azure AI Search</p>
</li>
</ul>
<h3 id="heading-step-by-step-implementation-guide">Step-by-Step Implementation Guide</h3>
<ol>
<li><strong>Set up your Azure AI Hub</strong></li>
</ol>
<ul>
<li><p>Create an <a target="_blank" href="https://ai.azure.com/">Azure AI Hub</a> to establish your app environment</p>
</li>
<li><p>Set up necessary Azure resources</p>
</li>
<li><p>Create an Azure AI Hub under your Project</p>
</li>
</ul>
<p><img src="https://pratikpathak.com/wp-content/uploads/2024/12/Screenshot-2024-12-22-014114-1.png" alt="Hub Creation" /></p>
<p><em>The Power of Azure AI Agent Service: Master Conversational AI 2</em></p>
<ol>
<li><strong>Resource Configuration</strong></li>
</ol>
<ul>
<li><p>Connect an Azure OpenAI resource or Azure AI Services</p>
</li>
<li><p>Choose between Basic or Standard setup based on your needs</p>
</li>
</ul>
<ol start="2">
<li><p>Configure model selection (default is gpt-4o-mini in eastus region)</p>
</li>
<li><p><strong>Code Implementation</strong></p>
</li>
</ol>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> azure.ai.agents <span class="hljs-keyword">import</span> AgentsClient
<span class="hljs-keyword">from</span> azure.identity <span class="hljs-keyword">import</span> DefaultAzureCredential
<span class="hljs-keyword">from</span> azure.ai.agents.models <span class="hljs-keyword">import</span> ToolDefinition, CodeInterpreterToolDefinition, MessageRole

<span class="hljs-comment"># Retrieve the Azure AI connection string from the environment</span>
connection_string = os.getenv(<span class="hljs-string">"AZURE_AI_CONNECTION_STRING"</span>)

<span class="hljs-comment"># Create an AgentsClient instance</span>
client = AgentsClient(endpoint=connection_string, credential=DefaultAzureCredential())

<span class="hljs-comment"># Create an Agent</span>
agent_response = client.create_agent(
    model=<span class="hljs-string">"gpt-4o"</span>,
    name=<span class="hljs-string">"Math Tutor"</span>,
    instructions=<span class="hljs-string">"You are a personal math tutor."</span>,
    tools=[CodeInterpreterToolDefinition()]
)

<span class="hljs-comment"># Create a Thread</span>
thread_response = client.create_thread()

<span class="hljs-comment"># Add a Message</span>
message_response = client.create_message(
    thread_id=thread_response.id,
    role=MessageRole.USER,
    content=<span class="hljs-string">"Your message here"</span>
)

<span class="hljs-comment"># Print the responses</span>
print(<span class="hljs-string">"Agent created:"</span>, agent_response)
print(<span class="hljs-string">"Thread created:"</span>, thread_response)
print(<span class="hljs-string">"Message response:"</span>, message_response)
</code></pre>
<blockquote>
<p><a target="_blank" href="https://pratikpathak.com/azure-ai-language-in-5-minutes/">Master Azure AI Language in 5 Minutes</a></p>
</blockquote>
<iframe sandbox="allow-scripts" src="https://pratikpathak.com/azure-ai-language-in-5-minutes/embed/#?secret=ogACmVOCln#?secret=zboAloabsU" width="600" height="338"></iframe>

<p><strong>Key Components</strong></p>
<p>Understanding these components is crucial for effective implementation:</p>
<ul>
<li><p><strong>Agent</strong> : The custom AI that utilizes AI models and tools</p>
</li>
<li><p><strong>Thread</strong> : A conversation session between agent and user</p>
</li>
<li><p><strong>Message</strong> : Content created by either agent or user</p>
</li>
<li><p><strong>Run</strong> : The activation of an agent based on thread contents</p>
</li>
<li><p><strong>Tools</strong> : Extensions that enhance agent capabilities</p>
</li>
</ul>
<h2 id="heading-real-world-examples">Real World Examples</h2>
<p>In the health sector, a regional health network is another great example of a successful implementation. Their AI agents have streamlined many aspects of operations, changing their interaction with patients fundamentally. The system manages appointment scheduling and reminders, answers frequently asked medical questions, and directs patients to the correct departments efficiently. It also conducts preliminary symptom assessments, which reduces the administrative workload of staff significantly. It has been very impactful, having reduced the administrative staff workload by 35%.</p>
<p>The financial services sector has also seen the innovative applications of Azure AI Agent Service. A leading bank implemented AI agents across a range of customer touchpoints that have transformed the delivery of its services. This implementation covers account inquiries, fraud detection alerts, and investment portfolio recommendations. Preliminary loan application assessments are also managed, as well as customer onboarding processes, thereby showing the applicability of Azure AI Agent Service to handle complex financial operations.</p>
<h2 id="heading-comparison-with-other-services">Comparison with Other Services</h2>
<p>Azure AI Agent Service differs from its competitors through several critical advantages. Integration capabilities mark the first key difference of the platform. While AWS Lex or Google Dialogflow cannot compete with Azure AI Agent Service in terms of connection to the entire Azure ecosystem, the latter boasts native integration with Azure OpenAI services and built-in compatibility with the Microsoft 365 suite.</p>
<p>The development experience is what makes Azure AI Agent Service stand out in many aspects. It supports more extensive SDKs compared to AWS Lex and better enterprise-grade security features compared to Dialogflow. Its scalability options for large deployments are way ahead of the competition and very suitable for enterprise-level implementations.</p>
<p>From a cost perspective, Azure AI Agent Service offers a compelling value proposition. The platform boasts a much more flexible pricing model compared to its peers, accompanied by better resource utilization via intelligent scaling. For most enterprise implementations, this often translates into a lower total cost of ownership, and hence is very attractive for organizations of all sizes.</p>
<h2 id="heading-challenges-and-best-practices">Challenges and Best Practices</h2>
<p>There are many common challenges that occur when organizations implement Azure AI Agent Service. One of the major issues is ensuring consistency in the flow of conversation across various channels and the ability to maintain context during long conversations. Organizations need to effectively handle unexpected user inputs and manage the intricacies of integration with legacy systems.<br />Several best practices have emerged to address these challenges:</p>
<ul>
<li><p>Start small but expand gradually, depending on positive feedback and usage<br />  • Design conversation flows that remain natural but with a good sense of purpose</p>
</li>
<li><p>Implement robust error handling mechanisms and comprehensive testing scenarios</p>
</li>
</ul>
<p>The development process benefits from following established guidelines. Version control for conversation flows ensures consistency and enables collaborative development. Comprehensive testing scenarios should cover both expected and edge cases. Regular monitoring and logging of all interactions provide valuable insights for continuous improvement.</p>
<h2 id="heading-future-of-azure-ai-agent-service">Future of Azure AI Agent Service</h2>
<p>The future of Azure AI Agent Service looks promising, with Microsoft continuously enhancing its capabilities. Upcoming features include more sophisticated natural language understanding capabilities and improved context awareness and memory systems. The platform is evolving to include advanced sentiment analysis integration and more nuanced handling of multi-turn conversations.</p>
<p>According to industry trends, there is a growing demand to make AI more personal than ever. Emphasis today is being laid on multifaceted capabilities, high-end privacy features, improved emotional intelligence in responses, and the further development of automation for complex business procedures. These aspects are changing the landscape and position the Azure AI Agent Service to be the forerunner in conversational AI.</p>
<h2 id="heading-call-to-action">Call to Action</h2>
<p>Getting started with your Azure AI Agent Service journey begins with the right access to resources and support. Start by signing up for an <a target="_blank" href="https://azure.microsoft.com/en-us/pricing/purchase-options/azure-account?icid=ai-studio">Azure free trial account</a>, which provides ample opportunity to explore the service’s capabilities. The comprehensive documentation available through the Azure AI Agent Service Docs serves as your primary guide, while the Microsoft Learn AI workshops offer structured learning opportunities.</p>
<p>Support that can be found at a community level in the azure AI is forums and other discussion groups, through these, you will find professionals and developers and even experts in solution architecture. Several sample projects are provided across the Azure AI Agent in GitHub. Technical support questions can be directed through an expertly assisted system hosted on the Azure Support Portal.</p>
]]></content:encoded></item><item><title><![CDATA[3 Steps to Fine-Tuning Azure AI Services for Maximum Impact]]></title><description><![CDATA[Fine-tuning in Azure AI Services is customizing pre-trained machine learning models to suit specific use cases or applications better. Azure provides pre-trained AI models for natural language processing, computer vision, and more. While these models...]]></description><link>https://hashnode.pratikpathak.com/3-steps-to-fine-tuning-azure-ai-services-for-maximum-impact</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/3-steps-to-fine-tuning-azure-ai-services-for-maximum-impact</guid><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Fri, 10 Jan 2025 16:14:43 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1736525661063/c41f11a0-9509-4330-a264-d37b7200a31f.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p>Fine-tuning in <strong>Azure AI Services</strong> is customizing pre-trained machine learning models to suit specific use cases or applications better. Azure provides pre-trained AI models for <strong>natural language processing, computer vision, and more</strong>. While these models are general-purpose, fine-tuning allows you to adapt them to domain-specific tasks by retraining them with your own labeled data.</p>
<p>Imagine training a chatbot to be used in medical applications. The general model probably does not have the depth of medical terminology. Fine-tuning with healthcare-specific data would ensure the chatbot understands the medical domain and communicates with the same accuracy.</p>
<h2 id="heading-introduction-to-fine-tuning"><strong>Introduction to Fine-Tuning</strong></h2>
<p>In the era of intelligent automation, businesses are increasingly turning to AI to streamline operations and deliver personalized experiences. Azure AI Services offers a suite of pre-trained models that can handle everything from natural language processing to computer vision. But what if your application demands a tailored solution? This is where <strong>fine-tuning</strong> steps in.<br /><strong>Fine-tuning</strong> is the process of taking a pre-trained model and further training it on a specific dataset to optimize its performance for particular tasks or domains. It’s like taking an experienced customer service representative and training them specifically in your company’s products, policies, and communication style.</p>
<h3 id="heading-why-fine-tuning-is-essential-in-ai-applications"><strong>Why fine-tuning is essential in AI applications</strong></h3>
<p>Fine-tuning has become a necessity in modern AI applications for several reasons:</p>
<ul>
<li><p><strong>Cost Efficiency:</strong> Training models from scratch requires enormous computational resources and data</p>
</li>
<li><p><strong>Time Savings:</strong> Fine-tuning can achieve excellent results in hours or days rather than weeks or months</p>
</li>
<li><p><strong>Specialization:</strong> Models can be optimized for specific industries, terminology, or tasks</p>
</li>
<li><p><strong>Performance:</strong> Fine-tuned models often significantly outperform generic models in specialized tasks</p>
</li>
</ul>
<h2 id="heading-pre-trained-models-in-azure">Pre-Trained Models in Azure</h2>
<p>The pre-trained models in Azure are ready-to-use AI tools that can understand text, analyze images, and process documents. Think of them as pre-built expert systems that already know how to do specific tasks. The primary types include language models, such as GPT-4, which can write and understand text; vision models, which can identify objects in images; and document models, which can extract information from forms and receipts.</p>
<p>What’s unique about these models is that they are already pre-trained on huge amounts of data. Just think of it like having an experienced assistant who has already learned from millions of examples; you can use them immediately, saving both time and money because you don’t need to teach them the basics. While they work wonderfully straight out of the box, you can also fine-tune them to better understand your specific needs, such as teaching them about the terminology of your industry or even recognizing your company’s specific documents.</p>
<p>These models are especially good for businesses that want to add AI capabilities to an application without starting from scratch. Whether you need to automate a customer service chatbot, analyze pictures for quality control, or automatically process stacks of invoices, there’s probably a pre-trained model that can give you a quick start to action.</p>
<h3 id="heading-azure-ai-services-and-their-relevance-to-fine-tuning"><strong>Azure AI Services and Their Relevance to Fine-tuning</strong></h3>
<p>Azure AI Services offers a whole ecosystem for fine-tuning different types of AI models:</p>
<ul>
<li><p><strong>Azure OpenAI Service:</strong> Customizing language models</p>
</li>
<li><p><strong>Custom Vision:</strong> Specialized image recognition tasks</p>
</li>
<li><p><strong>Form Recognizer:</strong> Document processing and data extraction</p>
</li>
<li><p><strong>Speech Services:</strong> Audio processing and speech recognition</p>
</li>
<li><p><strong>Language Service:</strong> Natural language processing tasks</p>
</li>
</ul>
<h2 id="heading-fine-tuning-process">Fine-Tuning Process</h2>
<p>The process begins by <strong>preparing your data</strong> , which equates to gathering the perfect teaching material. You will need examples related to your needs, scrub these examples to remove mistakes, and then further prepare them in a structured way that the model is going to understand. It is important that this data be divided into two sets: one for <strong>learning (training)</strong> and another for** validation (testing) purposes**, just like one would want to test the student with different questions from what they studied.</p>
<p>Next comes <strong>choosing the right model</strong> , Azure offers different types of models, each with their own strengths. Think of it like choosing between different types of teachers – some are better at languages, others at visual recognition. You’ll also need to decide to the extent that you want your model trained and set up appropriately in your Azure workspace.</p>
<p>The actual <strong>training process</strong> in Azure is pretty straightforward. You upload your prepared data, set a few key parameters (like how long to train and how carefully), and let Azure do its thing. You can observe the progress in real time, just as you do when you track a student’s learning progress.</p>
<p>Finally, you will <strong>test how well</strong> your newly trained model performs. Does it handle your specific cases better than the original model? If not, you might need to adjust your approach and try again.</p>
<p>Azure makes this whole process easier with user-friendly tools like Azure CLI, Azure Machine Learning Studio, Azure OpenAI Studio, and Custom Vision Portal</p>
<h2 id="heading-fine-tuning-with-azure-openai">Fine-Tuning with Azure OpenAI</h2>
<ol>
<li>Consider Python Language for your <strong>Data Preparation</strong></li>
</ol>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> json

<span class="hljs-comment"># Recommended: Include at least 50 diverse examples</span>
<span class="hljs-comment"># Ensure consistent system message across examples</span>

<span class="hljs-comment"># Create your training data in JSONL format</span>
training_data = [
    {
        <span class="hljs-string">"messages"</span>: [
            {<span class="hljs-string">"role"</span>: <span class="hljs-string">"system"</span>, <span class="hljs-string">"content"</span>: <span class="hljs-string">"You are a helpful assistant."</span>},
            {<span class="hljs-string">"role"</span>: <span class="hljs-string">"user"</span>, <span class="hljs-string">"content"</span>: <span class="hljs-string">"How do I return an item?"</span>},
            {<span class="hljs-string">"role"</span>: <span class="hljs-string">"assistant"</span>, <span class="hljs-string">"content"</span>: <span class="hljs-string">"To return an item, please..."</span>}
        ]
    }
    <span class="hljs-comment"># Add more examples following the same format</span>
]

<span class="hljs-comment"># Save to JSONL file</span>
<span class="hljs-keyword">with</span> open(<span class="hljs-string">'training_data.jsonl'</span>, <span class="hljs-string">'w'</span>) <span class="hljs-keyword">as</span> f:
    <span class="hljs-keyword">for</span> entry <span class="hljs-keyword">in</span> training_data:
        f.write(json.dumps(entry) + <span class="hljs-string">'\n'</span>)
</code></pre>
<ol>
<li><p>Confirm the <strong>Model Selection</strong> for (e.g., GPT-3.5) Set hyperparameters and Configure training environment</p>
</li>
<li><p><strong>Training</strong> Implementation</p>
</li>
</ol>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> azure.openai <span class="hljs-keyword">import</span> OpenAI

<span class="hljs-comment"># Setup client</span>
client = OpenAI(
    azure_endpoint=<span class="hljs-string">"YOUR_AZURE_ENDPOINT"</span>,
    api_key=<span class="hljs-string">"YOUR_API_KEY"</span>,
    api_version=<span class="hljs-string">"2024-02-15-preview"</span>
)

<span class="hljs-comment"># Hyperparameter meanings:</span>
<span class="hljs-comment"># n_epochs: Number of training iterations (3 is good for most cases)</span>
<span class="hljs-comment"># batch_size: Number of training examples processed together</span>
<span class="hljs-comment"># learning_rate_multiplier: Controls how quickly model adapts</span>

<span class="hljs-comment"># Start fine-tuning</span>
response = client.fine_tunes.create(
    model=<span class="hljs-string">"gpt-35-turbo"</span>,
    training_file=<span class="hljs-string">"training_data.jsonl"</span>,
    hyperparameters={
        <span class="hljs-string">"n_epochs"</span>: <span class="hljs-number">3</span>,
        <span class="hljs-string">"batch_size"</span>: <span class="hljs-number">4</span>,
        <span class="hljs-string">"learning_rate_multiplier"</span>: <span class="hljs-number">0.1</span>
    }
)

fine_tune_id = response.id
</code></pre>
<ol>
<li>Deploy and Use Model</li>
</ol>
<pre><code class="lang-python"><span class="hljs-comment"># Deploy the fine-tuned model</span>
deployment = client.deployments.create(
    model=fine_tune_id,
    deployment_name=<span class="hljs-string">"my-fine-tuned-model"</span>
)

<span class="hljs-comment"># Use the model</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">get_model_response</span>(<span class="hljs-params">prompt</span>):</span>
    response = client.chat.completions.create(
        model=deployment.id,
        messages=[{<span class="hljs-string">"role"</span>: <span class="hljs-string">"user"</span>, <span class="hljs-string">"content"</span>: prompt}]
    )
    <span class="hljs-keyword">return</span> response.choices[<span class="hljs-number">0</span>].message.content

<span class="hljs-comment"># Example usage</span>
prompt = <span class="hljs-string">"How can I track my order?"</span>
response = get_model_response(prompt)
print(response)
</code></pre>
<p>OpenAI can perform Use Cases like <strong>Custom Chatbots</strong> , <strong>Content Generation</strong> , <strong>Document Analysis</strong></p>
<h2 id="heading-fine-tuning-in-computer-vision">Fine-Tuning in Computer Vision</h2>
<ol>
<li>Let’s see <strong>Custom Vision</strong> <strong>Service Implementation</strong> in python</li>
</ol>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> azure.cognitiveservices.vision.customvision.training <span class="hljs-keyword">import</span> CustomVisionTrainingClient
<span class="hljs-keyword">import</span> os

<span class="hljs-comment"># Recommended: Include diverse image examples per category</span>
<span class="hljs-comment"># Ensure proper image labeling and organization</span>

<span class="hljs-comment"># Setup training data structure</span>
training_data = {
    <span class="hljs-string">"product_images"</span>: {
        <span class="hljs-string">"tags"</span>: [<span class="hljs-string">"electronics"</span>, <span class="hljs-string">"clothing"</span>, <span class="hljs-string">"accessories"</span>],
        <span class="hljs-string">"image_paths"</span>: [
            <span class="hljs-string">"./dataset/electronics/*.jpg"</span>,
            <span class="hljs-string">"./dataset/clothing/*.jpg"</span>,
            <span class="hljs-string">"./dataset/accessories/*.jpg"</span>
        ]
    }
}

<span class="hljs-comment"># Create project and upload images</span>
trainer = CustomVisionTrainingClient(
    <span class="hljs-string">"YOUR_TRAINING_KEY"</span>,
    endpoint=<span class="hljs-string">"YOUR_ENDPOINT"</span>
)

project = trainer.create_project(
    <span class="hljs-string">"Product Classification"</span>,
    domain_type=<span class="hljs-string">"Classification"</span>
)
</code></pre>
<ol>
<li>Configure <strong>Training Settings</strong> and Set Up Environment</li>
</ol>
<pre><code class="lang-python"><span class="hljs-comment"># Setup training configuration</span>
training_config = {
    <span class="hljs-string">"project_id"</span>: project.id,
    <span class="hljs-string">"training_type"</span>: <span class="hljs-string">"Classification"</span>, <span class="hljs-comment"># or "Detection"</span>
    <span class="hljs-string">"export_capabilities"</span>: {
        <span class="hljs-string">"format"</span>: <span class="hljs-string">"ONNX"</span>, <span class="hljs-comment"># Export format</span>
        <span class="hljs-string">"platform"</span>: <span class="hljs-string">"TensorFlow"</span> <span class="hljs-comment"># Target platform</span>
    },
    <span class="hljs-string">"advanced_settings"</span>: {
        <span class="hljs-string">"use_transfer_learning"</span>: <span class="hljs-literal">True</span>,
        <span class="hljs-string">"balance_training_data"</span>: <span class="hljs-literal">True</span>
    }
}

<span class="hljs-comment"># Initialize training environment</span>
tags = {}
<span class="hljs-keyword">for</span> tag_name <span class="hljs-keyword">in</span> training_data[<span class="hljs-string">"product_images"</span>][<span class="hljs-string">"tags"</span>]:
    created_tag = trainer.create_tag(project.id, tag_name)
    tags[tag_name] = created_tag
</code></pre>
<ol>
<li><strong>Training Implementation</strong></li>
</ol>
<pre><code class="lang-python"><span class="hljs-comment"># Upload and tag images</span>
<span class="hljs-keyword">for</span> image_path <span class="hljs-keyword">in</span> image_paths:
    <span class="hljs-keyword">with</span> open(image_path, <span class="hljs-string">"rb"</span>) <span class="hljs-keyword">as</span> image_data:
        trainer.create_images_from_data(
            project.id,
            image_data.read(),
            [tags[<span class="hljs-string">"electronics"</span>].id] <span class="hljs-comment"># Assign appropriate tag</span>
        )

<span class="hljs-comment"># Start training</span>
iteration = trainer.train_project(project.id)

<span class="hljs-comment"># Monitor training progress</span>
<span class="hljs-keyword">while</span> iteration.status != <span class="hljs-string">"Completed"</span>:
    iteration = trainer.get_iteration(project.id, iteration.id)
    print(<span class="hljs-string">f"Training status: <span class="hljs-subst">{iteration.status}</span>"</span>)

<span class="hljs-comment"># Publish the model</span>
trainer.publish_iteration(
    project.id,
    iteration.id,
    <span class="hljs-string">"my-model-endpoint"</span>
)
</code></pre>
<p>Use Case examples like <strong>Image Classification</strong> (upload labeled images, Train model) and <strong>Object Detection</strong> ( Evaluate performance, Mark objects in images)</p>
<h2 id="heading-fine-tuning-with-azure-document-intelligence"><strong>Fine-Tuning with Azure Document Intelligence</strong></h2>
<ol>
<li>Consider Python Language for your <strong>Document Analysis Setup</strong></li>
</ol>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> azure.ai.formrecognizer <span class="hljs-keyword">import</span> DocumentAnalysisClient
<span class="hljs-keyword">from</span> azure.core.credentials <span class="hljs-keyword">import</span> AzureKeyCredential

<span class="hljs-comment"># Setup document training data</span>
training_docs = {
    <span class="hljs-string">"source"</span>: <span class="hljs-string">"YOUR_CONTAINER_SAS_URL"</span>,
    <span class="hljs-string">"document_types"</span>: [<span class="hljs-string">"invoices"</span>, <span class="hljs-string">"receipts"</span>, <span class="hljs-string">"contracts"</span>],
    <span class="hljs-string">"labeled_data_count"</span>: <span class="hljs-number">5</span> <span class="hljs-comment"># Minimum per document type</span>
}

<span class="hljs-comment"># Initialize client</span>
document_client = DocumentAnalysisClient(
    endpoint=<span class="hljs-string">"YOUR_ENDPOINT"</span>,
    credential=AzureKeyCredential(<span class="hljs-string">"YOUR_KEY"</span>)
)
</code></pre>
<ol>
<li><strong>Model Training Configuration</strong></li>
</ol>
<pre><code class="lang-python"><span class="hljs-comment"># Configure custom model</span>
model_config = {
    <span class="hljs-string">"model_id"</span>: <span class="hljs-string">"my-custom-document-model"</span>,
    <span class="hljs-string">"description"</span>: <span class="hljs-string">"Custom model for business documents"</span>,
    <span class="hljs-string">"build_mode"</span>: <span class="hljs-string">"template"</span>, <span class="hljs-comment"># or "neural"</span>
    <span class="hljs-string">"training_data"</span>: {
        <span class="hljs-string">"container_url"</span>: training_docs[<span class="hljs-string">"source"</span>],
        <span class="hljs-string">"prefix"</span>: <span class="hljs-string">"training/"</span>
    }
}

<span class="hljs-comment"># Start model training</span>
poller = document_client.begin_build_model(
    model_config[<span class="hljs-string">"training_data"</span>][<span class="hljs-string">"container_url"</span>],
    description=model_config[<span class="hljs-string">"description"</span>],
    model_id=model_config[<span class="hljs-string">"model_id"</span>]
)

model = poller.result()
</code></pre>
<ol>
<li><strong>Implementation and Usage</strong></li>
</ol>
<pre><code class="lang-python"><span class="hljs-comment"># Analyze documents with trained model</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">analyze_document</span>(<span class="hljs-params">file_path, model_id</span>):</span>
    <span class="hljs-keyword">with</span> open(file_path, <span class="hljs-string">"rb"</span>) <span class="hljs-keyword">as</span> doc:
        poller = document_client.begin_analyze_document(
            model_id,
            doc
        )
    result = poller.result()

    <span class="hljs-comment"># Extract key information</span>
    extracted_data = {
        <span class="hljs-string">"fields"</span>: result.key_value_pairs,
        <span class="hljs-string">"tables"</span>: result.tables,
        <span class="hljs-string">"pages"</span>: len(result.pages)
    }
    <span class="hljs-keyword">return</span> extracted_data

<span class="hljs-comment"># Example usage</span>
result = analyze_document(<span class="hljs-string">"sample_invoice.pdf"</span>, model_config[<span class="hljs-string">"model_id"</span>])
</code></pre>
<p>Use cases like <strong>Industry Applications</strong> include Legal(Contract analysis), Financial Services( Invoice processing), and Healthcare(Medical record analysis)</p>
<blockquote>
<p>Remember: You don’t need to be an AI expert to get started. Azure provides tools and guides to help you along the way. The most important thing is understanding what you want the AI to do for your business.</p>
<p><cite>Pratik Pathak</cite></p>
<p><a target="_blank" href="https://pratikpathak.com/power-of-azure-ai-agent-service/">The Power of Azure AI Agent Service: Master Conversational AI</a></p>
</blockquote>
<iframe sandbox="allow-scripts" src="https://pratikpathak.com/power-of-azure-ai-agent-service/embed/#?secret=fKbl8swbXv#?secret=kqElUKHd3B" width="600" height="338"></iframe>

<ol>
<li><strong>Advantages of Fine-Tuning</strong></li>
</ol>
<p>Fine-tuning AI models makes them understand your needs better. It is almost like teaching a new employee about your company – the more specific training they get, the better they perform. In short, the fewer mistakes it makes and handles unusual cases better.</p>
<p>It also saves time and money. Instead of building everything from scratch, you are improving what already exists. This means that you’ll be able to get your AI solution up and running more quickly and will cost less to maintain over time.</p>
<ol>
<li><strong>Fine-Tuning Challenges</strong></li>
</ol>
<p>Data quality and quantity will be the first challenge you will need enough good-quality examples for the model to learn appropriately, just as teaching someone to cook will require good recipes and quality ingredients. The data should ideally represent the real world in all aspects and be well-tagged.</p>
<p>Technical considerations also pose significant challenges:</p>
<ul>
<li><p>Computing resource requirements for training</p>
</li>
<li><p>Data storage infrastructure needs</p>
</li>
<li><p>Training duration and optimization</p>
</li>
<li><p>Preventing overfitting while ensuring genuine learning</p>
</li>
</ul>
<ol>
<li><strong>Best Practices for Fine-Tuning</strong></li>
</ol>
<p>Begin with small, well-organized, and clean datasets Implement batch processing and regular testing Monitor and measure improvements consistently Benchmark against existing systems for performance comparison</p>
<h2 id="heading-getting-started-with-azure-ai">Getting Started with Azure AI</h2>
<p>To start using Azure AI, follow these simple steps:</p>
<ol>
<li>Create your Azure account:</li>
</ol>
<ul>
<li><p>Sign up here: <a target="_blank" href="https://azure.microsoft.com/free">Azure Portal</a></p>
</li>
<li><p>Get $200 free credit for 30 days to try services</p>
</li>
</ul>
<ol start="2">
<li>Set up your AI services:</li>
</ol>
<ul>
<li><p>Go to Azure Portal: <a target="_blank" href="https://portal.azure.com">Click Here</a></p>
</li>
<li><p>Click “Create a resource”</p>
</li>
<li><p>Search for “AI Services” or the specific service you need</p>
</li>
</ul>
<ol start="3">
<li>Get your API keys:</li>
</ol>
<ul>
<li><p>Open your created resource</p>
</li>
<li><p>Find “Keys and Endpoint” in the left menu</p>
</li>
<li><p>Copy your key and endpoint URL</p>
</li>
</ul>
<p>Tools you’ll need:</p>
<ul>
<li><p><a target="_blank" href="https://portal.azure.com">Azure Portal</a></p>
</li>
<li><p><a target="_blank" href="https://code.visualstudio.com">Visual Studio Code</a></p>
</li>
</ul>
<p>Need help? Visit:</p>
<ul>
<li><p><a target="_blank" href="https://azure.microsoft.com/support/options">Azure Support</a></p>
</li>
<li><p><a target="_blank" href="https://learn.microsoft.com/answers/products/azure">Azure Community</a></p>
</li>
</ul>
<blockquote>
<p><strong>Note</strong> : The links provided are direct official Microsoft Azure resources. Always check Azure’s documentation for the most up-to-date information.</p>
</blockquote>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Fine-tuning Azure AI Services represents a powerful approach to creating specialized AI solutions. By following this guide, you can Create custom AI solutions for your specific needs, Optimize model performance for your domain, and Reduce development time and costs</p>
<h2 id="heading-faqs">FAQs</h2>
<h3 id="heading-how-much-data-do-i-need-for-fine-tuning"><strong>How much data do I need for fine-tuning?</strong></h3>
<p>You can start with as few as 50 good examples, but more is better. <strong>For best results, aim for 500-1000 examples</strong> that match your specific needs. Remember – quality matters more than quantity, so make sure your examples are accurate and cover different scenarios you want the model to handle.</p>
<h3 id="heading-what-are-the-costs-involved"><strong>What are the costs involved?</strong></h3>
<p>The main costs come from two things training the model and using it. You’ll pay for the computer power used during training and then for each time you use the model. The exact cost depends on <strong>how big your model is and how much you use it.</strong> Azure charges based on your usage, similar to a pay-as-you-go phone plan.</p>
<h3 id="heading-how-long-does-fine-tuning-typically-take"><strong>How long does fine-tuning typically take?</strong></h3>
<p>With a small dataset, you can have a <strong>working model in 2-3 hours.</strong> Larger datasets might take 6-8 hours. The time mostly depends on how much data you have and how complex your task is. Think of it like teaching someone new skills – simpler tasks take less time.</p>
<h3 id="heading-can-i-update-my-fine-tuned-model"><strong>Can I update my fine-tuned model?</strong></h3>
<p><strong>Yes!</strong> You can update your model anytime with new examples. It’s like teaching someone new things over time. You can keep your old version while testing the new one, and if the new version isn’t better, you can always go back to the previous one.</p>
]]></content:encoded></item><item><title><![CDATA[I Mastered Azure AI Language in 5 Minutes]]></title><description><![CDATA[In a world that runs on communication, the ability to analyze and understand human language is a transformative force. From chatbots that provide instant support to tools that extract actionable insights from unstructured data, language-focused artif...]]></description><link>https://hashnode.pratikpathak.com/i-mastered-azure-ai-language-in-5-minutes</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/i-mastered-azure-ai-language-in-5-minutes</guid><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Fri, 10 Jan 2025 16:14:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1736525617473/00b3fa5c-d093-482b-b830-8d0f9b88295f.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p>In a world that runs on communication, the ability to analyze and understand human language is a transformative force. From chatbots that provide instant support to tools that extract actionable insights from unstructured data, language-focused artificial intelligence (AI) is reshaping industries. <strong>Azure AI Language, a comprehensive suite of natural language processing (NLP) services</strong>, brings these possibilities to life by enabling organizations to harness the power of language.</p>
<p>Think of how global companies streamline customer support with intelligent chatbots, health care providers deciphering patient feedback for better care, or content creators summarizing lengthy reports into digestible insights. Azure AI Language is the catalyst that bridges human communication with technological intelligence, empowering applications to process, understand, and generate human language with unprecedented efficiency.</p>
<p>In this blog, we will guide you through the capabilities, benefits, and real-world applications of Azure AI Language. Whether you are a developer building the next-gen chatbot or a business owner seeking insights from customer reviews, Azure AI Language makes it possible.</p>
<h2 id="heading-what-is-azure-ai-language">What is Azure AI Language?</h2>
<p>Azure AI Language is a robust set of services designed to analyze, interpret, and generate human language. Being a part of Microsoft’s Azure AI Services, it applies the latest NLP technologies in processing text and speech data, thereby providing for intelligent applications across various industries.</p>
<h2 id="heading-azure-ai-language-core-capabilities">Azure AI Language Core Capabilities</h2>
<p>Azure AI Language provides a comprehensive range of natural language processing capabilities in several key categories:</p>
<h3 id="heading-basic-text-analytics">Basic Text Analytics</h3>
<ul>
<li><p><strong>Language Detection:</strong> Automatically detect the language of input text and supports more than 100 languages</p>
</li>
<li><p><strong>Sentiment Analysis and Opinion Mining:</strong> Extract detailed opinions about specific aspects of products or services and determine sentiment, such as positive, negative, and neutral</p>
</li>
<li><p><strong>Key Phrase Extraction</strong> : Automatic identification and extraction of main points and important concepts from text</p>
</li>
<li><p><strong>Named Entity Recognition (NER)</strong>: Identify and categorize entities such as people, places, organizations, and quantities in text</p>
</li>
</ul>
<h3 id="heading-healthcare-and-clinical-analysis">Healthcare and Clinical Analysis</h3>
<ul>
<li><p><strong>Text Analytics for Health</strong> : Process and extract insights from unstructured medical text, including conditions, medications, procedures, and symptoms</p>
</li>
<li><p><strong>Custom Text Analytics for Health</strong> : Tailor health text analysis models to specific medical domains or specialized healthcare terminology</p>
</li>
<li><p><strong>Protected Health Information (PHI) Detection</strong>: Identify and handle sensitive healthcare information in compliance with privacy regulations</p>
</li>
</ul>
<h3 id="heading-advanced-understanding-and-analysis">Advanced Understanding and Analysis</h3>
<ul>
<li><p><strong>Question Answering</strong> : Create knowledge bases that can automatically answer user questions based on your custom documents and content</p>
</li>
<li><p><strong>CLU (Conversational Language Understanding)</strong>: Create complex models for the interpretation of the intent and extracting the important information expressed in user communications</p>
</li>
<li><p><strong>Entity Linking</strong> : Tie named entities to a concrete real-world concept as well as distinguish entities whose name is also shared with different other things</p>
</li>
<li><p><strong>Document Summarization</strong> : Automatically summarizes a lengthy piece of document to capture a precise yet brief abstract without losing significant details</p>
</li>
<li><p><strong>Content Safety</strong> : Discover and cleanse dangerous or harmful content</p>
</li>
</ul>
<h3 id="heading-customization-and-training">Customization and Training</h3>
<ul>
<li><p><strong>Custom NER (Custom Named Entity Recognition)</strong>: Train models to identify and categorize industry-specific, or domain-specific, entities</p>
</li>
<li><p><strong>Custom Text Classification</strong> : Train proprietary models to classify text by specific requirements</p>
</li>
<li><p><strong>Orchestration Workflow</strong> : Complex language processing pipeline composed of various capabilities</p>
</li>
<li><p><strong>Translation</strong> Use Azure Translator to translate texts among hundreds of language combinations</p>
</li>
<li><p><strong>Custom translation</strong> : Train translation models specific to your industry, thereby maintaining the style and special terminologies</p>
</li>
</ul>
<p>Each of these capabilities can be used in a standalone fashion or in a combined way to produce the most powerful language processing solution. For instance, you could use Language Detection for routing customer feedback to teams, then apply Sentiment Analysis and Key Phrase Extraction to understand customer concerns and apply PII Detection so that sensitive information is treated properly.</p>
<p>The real power of Azure AI Language lies in its flexibility, mixing and matching through APIs and SDKs to create solutions tailored to your specific needs, whether it is a customer service bot, analysis of medical records, or processing global market feedback.</p>
<h2 id="heading-benefits-of-azure-ai-language">Benefits of Azure AI Language</h2>
<p>Azure AI Language offers superb <strong>scalability</strong> , from small projects up to enterprise-scale applications that deliver consistent performance without respect to workload size. Service pre-built, state-of-the-art models make fast development possible, letting an organization implement sophisticated language processing capabilities without having to begin from scratch.</p>
<p>It is shining in terms of integration, working wonderfully well with other Azure services, such as <strong>Cognitive Search, Logic Apps, and Power Automate, towards making comprehensive solutions.</strong> In short, seamless connectivity can empower developers to build solid applications that make the full strength of the Azure Ecosystem.</p>
<p>Azure AI Language has been designed following a <strong>pay-as-you-go model</strong> and hence is cost-efficient in the most remarkable way. The organization only pays for what it uses, thus becoming an economical choice for businesses of all sizes. Flexible pricing, built-in security features, and comprehensive development tools make Azure AI Language a practical and powerful solution for modern language processing needs.</p>
<h2 id="heading-how-it-works">How it works</h2>
<p>In fact, the straightforward yet powerful way of operating Azure AI Language converts <strong>raw text into actionable insights</strong>. The service runs the input data through a broad range of APIs and SDKs; natural language processing models will look at the content in that data and convert it to structured, meaningful results.</p>
<p>The workflow usually starts from when your application sends text data to Azure AI Language through a secure API endpoint. Depending on the selected service, whether it’s sentiment analysis, entity recognition, or language understanding, the platform’s advanced models process this input using machine learning algorithms. The service then <strong>returns structured output in JSON format</strong> , making it easy to integrate the results into your applications.</p>
<p>For instance, when parsing <strong>customer feedback</strong> , the service can simultaneously identify the <strong>language, assess sentiment, pull out key topics</strong> , and identify important entities like product names or locations from a single piece of text. It can then be used to generate reports, trigger automated responses, or feed into other business processes, all in a smooth flow of linguistic intelligence through your organization.</p>
<p>In Short Azure AI Language simplifies the NLP workflow:</p>
<ol>
<li><p><strong>Input Data</strong> : Text from documents, customer reviews, or chat logs.</p>
</li>
<li><p><strong>Processing</strong> : Analyze the text using Azure AI Language APIs or SDKs.</p>
</li>
<li><p><strong>Output Insights</strong> : Obtain actionable results like sentiments, summaries, or translations.</p>
</li>
</ol>
<h2 id="heading-start-with-azure-ai-language">Start with Azure AI Language</h2>
<p>Setting up Azure AI Language is simple. Follow these steps to begin:</p>
<ol>
<li><p><strong>Create an Azure Account</strong> : Sign up for an Azure account to access <a target="_blank" href="https://azure.microsoft.com/en-us/products/ai-services/ai-language">Azure AI Language</a> services.</p>
</li>
<li><p><strong>Explore the Portal</strong> : Navigate the <a target="_blank" href="https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/TextAnalytics">Azure porta</a>l to access the Text Analytics API, Translator, or other language tools.</p>
</li>
<li><p><strong>Implement APIs</strong> : Use SDKs and APIs to integrate Azure AI Language capabilities into your application.</p>
</li>
</ol>
<blockquote>
<p><a target="_blank" href="https://pratikpathak.com/app-service-6-months-in-just-5-minutes/">What I Learned About App Service: 6 Months in Just 5 Minutes</a></p>
</blockquote>
<iframe sandbox="allow-scripts" src="https://pratikpathak.com/app-service-6-months-in-just-5-minutes/embed/#?secret=8EdAoJmLr4#?secret=axXpCRdiAR" width="600" height="338"></iframe>

<h2 id="heading-impact-of-azure-ai-language">Impact of Azure AI Language</h2>
<p>A global e-commerce leader transformed its customer service operations using Azure AI Language. The company implemented an intelligent support system that processes over 100,000 customer inquiries daily across 12 languages. By leveraging sentiment analysis and intent recognition, the platform automatically routes queries to appropriate departments and prioritizes urgent issues. This implementation reduced response times by 60% and increased customer satisfaction scores by 35%, while cutting operational costs by 40%. The system also provides valuable insights into common customer concerns, enabling proactive improvements to their service delivery.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>As NLP technologies evolve, Azure AI Language is poised to lead innovations in intelligent language processing. From empowering multilingual communication to enhancing human-machine interactions, the possibilities are limitless.</p>
<p>Azure AI Language transforms how businesses and developers interact with language. By unlocking insights and automating workflows, it creates opportunities to innovate and excel in a connected world.</p>
]]></content:encoded></item><item><title><![CDATA[That's how I Use 100% of Azure Databases]]></title><description><![CDATA[Azure Databases are powerful tools in the cloud for managing data that change how businesses work with information. They offer database services that are easy to grow, safe, and flexible, meeting the needs of any organization, from small startups to ...]]></description><link>https://hashnode.pratikpathak.com/thats-how-i-use-100-of-azure-databases</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/thats-how-i-use-100-of-azure-databases</guid><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Fri, 10 Jan 2025 16:13:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1736525577314/3fd44862-a6a0-4bc9-87b5-a5f728ae2c1c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p>Azure Databases are powerful tools in the cloud for managing data that change how businesses work with information. They offer database services that are easy to grow, safe, and flexible, meeting the needs of any organization, from small startups to big companies. With options like <strong>SQL Database, and Cosmos DB.</strong> Azure Databases solve complicated infrastructure problems, lower operational costs, and let companies focus on new ideas instead of dealing with technical difficulties.</p>
<h2 id="heading-why-azure-databases-matter">Why Azure Databases Matter</h2>
<p>In today’s digital world, Data is the backbone of every industry. It includes personal information, financial transactions, or critical business insights, data powers the modern world. But the fast rise in cybercrime has made data security a big worry. Cyberattacks like data breaches and identity theft are increasing quickly, putting both people and organizations at risk. It is very important to use technologies that can manage data well and protect it from malicious attackers.</p>
<p>In this scenario, Azure Databases are a trustworthy choice. With strong security features, easy scalability, and many database options, Azure helps users manage their data safely and effectively. Based on Microsoft’s cloud infrastructure, Azure Databases offer full encryption and advanced threat protection and follow industry rules to keep your data secure. By using Azure Databases, offers a variety of databases that support different use cases, including <strong>relational, non-relational (NoSQL), in-memory, and analytics solutions.</strong></p>
<p>This blog explores how to unlock the full potential of Azure Databases so that the effective use of database technologies meets the highest standards of security.</p>
<h2 id="heading-types-of-azure-databases">Types of Azure Databases</h2>
<p>Azure provides many different database services to address various data management needs, such as relational data storage, NoSQL solutions, and caching systems. Here is a summary of the main types of Azure databases:</p>
<h3 id="heading-relational-databases">Relational Databases</h3>
<p>Azure offers several relational database services, such as <strong>Azure SQL Database, Azure Database for MySQL, Azure Database for MariaDB,</strong> and <strong>Azure Database for PostgreSQL.</strong> These fully managed services deliver high availability, security, and scalability for cloud-based applications. <strong>SQL Server on Azure Virtual Machines</strong> also allows full control over SQL Server instances in the cloud for more flexible configurations and workloads.</p>
<p><img src="https://pratikpathak.com/wp-content/uploads/2024/12/Azure-Relational-Databases_with_metadata-1024x576.png" alt="Azure Relational Databases with metadata" /></p>
<p><em>How to Use 100% of Azure Databases 3</em></p>
<h4 id="heading-azure-sql-database">Azure SQL Database</h4>
<p>It is a fully managed relational database-as-a-service( <strong>DBaaS</strong> ) based on Microsoft SQL Server.</p>
<p><strong>Key Features:</strong> It has automatic scaling, built-in AI for improving queries, and strong security with data encryption and threat detection. The service ensures high availability with automated backups and disaster recovery reducing manual intervention.</p>
<p><strong>Use Case:</strong> Very apt for transactional applications, modern web applications, and reporting systems. Especially useful for applications requiring high performance, such as e-commerce platforms, customer relationship management(CRM) systems, and business intelligence solutions.</p>
<h4 id="heading-azure-database-for-mysql">Azure Database for MySQL</h4>
<p>These are fully managed <strong>MySQL services</strong> offered to the clients having enterprise-grade security and high scalability.</p>
<p><strong>Key Features:</strong> High availability, automated backups, and open-source compatibility. It offers seamless scaling and automatic patching, ensuring minimal downtime. The service is designed to handle unpredictable workloads with monitoring and diagnostics.</p>
<p><strong>Use Case:</strong> It is used for blogging platforms, content management systems, and e-commerce stores. Well-suited for applications that require a stable, open-source relational database with the flexibility to scale as needed for future.</p>
<h4 id="heading-azure-database-for-mariadb">Azure Database for MariaDB</h4>
<p>This is an <strong>enterprise-ready</strong> database service built on the MariaDB community edition.</p>
<p><strong>Key Features:</strong> Advanced security, flexible scaling, and seamless integration with other Azure services. It also offers automatic backups, patch management, and customizable configurations for workload optimization.</p>
<p><strong>Use Case:</strong> Used widely in SaaS applications and data-driven projects that require open-source solutions. It is perfect for organizations looking to migrate from on-premises MariaDB environments or build new cloud-based applications.</p>
<h4 id="heading-azure-database-for-postgresql"><strong>Azure Database for PostgreSQL</strong></h4>
<p>A strong <strong>open-source database service</strong> , which can be established in one server or more flexible servers.</p>
<p><strong>Key features</strong> : high availability, understanding of advanced query performance, and compatibility with numerous tools like PostgreSQL extensions. This gives automatic backups and industry-grade security through encryption, among others.</p>
<p><strong>Use Case:</strong> Usually applied to data analysis, map-related data, and complex questions. Good for businesses requiring deep data reliability, support of data types JSON, and strong systems of reporting.</p>
<h4 id="heading-sql-server-on-azure-virtual-machines"><strong>SQL Server on Azure Virtual Machines</strong></h4>
<p>A flexible cloud database service with <strong>full control over SQL Server and VM configurations</strong>.</p>
<p><strong>Key Features:</strong> High availability, advanced query performance, and support for various SQL Server editions. Automated backups and robust security features, such as Transparent Data Encryption (TDE) and Azure Security Center integration.</p>
<p><strong>Use Cases:</strong> Best suited for enterprise applications and business intelligence and hybrid cloud environments used in scenarios requiring high availability, such as finance or healthcare.</p>
<h3 id="heading-non-relational-databases">Non-Relational Databases</h3>
<p>Azure also provides more robust non-relational database services such as <strong>Azure Cosmos DB, Azure Blob Storage, Azure Table Storage, Azure Data Lake Storage and Azure Cache for Redis</strong>. These services provide high scalability, low latency in accessing data, and flexible storage of data across different kinds of unstructured and semi-structured types. Global distribution and caching in memory make them the best services for applications requiring speedy access to data and having a requirement for flexibility in modern application development.</p>
<p><img src="https://pratikpathak.com/wp-content/uploads/2024/12/Azure-Non-Relational-Databases-1024x576.png" alt="Non Relational Databases" /></p>
<p><em>How to Use 100% of Azure Databases 4</em></p>
<h4 id="heading-azure-cosmos-db"><strong>Azure Cosmos DB</strong></h4>
<p>This is a globally distributed, <strong>multi-model NoSQL database</strong> that targets high performance and low latency across many applications.</p>
<p><strong>Key Features</strong> : Multi-region replication; assured low latency support, supports multiple data models(document, graph, and key-value). It offers comprehensive SLAs for performance, availability, and consistency.</p>
<p><strong>Use case:</strong> Excellent for real-time applications, IoT applications, and e-commerce site platforms. Mobile apps, gaming backends, and social media platforms require rapid response times and global distribution.</p>
<h4 id="heading-azure-blob-storage">Azure Blob Storage</h4>
<p>A scalable type of storage solution that could provide support for <strong>unstructured files</strong> such as images, videos, and logs.</p>
<p><strong>Key Features:</strong> Low-cost storage options, integration with data analytics tools such as Azure Data Lake Analytics, and safe access to data using secure encryption when stored and while in motion. Detailed access control is allowed by integration with Azure Active Directory (AAD).</p>
<p><strong>Use Case:</strong> Good for backup, media, or large datasets for machine learning, data storage, or disaster recovery. It is also used to serve static website content or big data storage.</p>
<h4 id="heading-azure-table-storage">Azure Table Storage</h4>
<p>A <strong>NoSQL store</strong> designed for large applications that need simple queries.</p>
<p><strong>Key Features:</strong> Storage that can grow, has low delay, is cheap, and has a flexible design. It allows quick access to data and works well for large amounts of non-relational data, with automatic division to improve performance.</p>
<p><strong>Use Case:</strong> Great for keeping organized data sets, like device logs or user profiles, often used in telemetry, IoT apps, or large event logging.</p>
<h4 id="heading-azure-data-lake-storage"><strong>Azure Data Lake Storage</strong></h4>
<p>A scalable and secure data storage service <strong>optimized for big data analytics</strong> , capable of storing both structured and unstructured data.</p>
<p><strong>Key Features:</strong> Built to handle large volumes of data with high throughput.<br />Seamless integration with analytics services like Azure HDInsight and Azure Databricks.<br />Advanced security with features like encryption at rest and role-based access control.</p>
<p><strong>Use Case:</strong> Ideal for big data analytics, data warehousing and storing large amounts of unstructured data for use with machine learning and real-time analytics.</p>
<h4 id="heading-azure-cache-for-redis">Azure Cache for Redis</h4>
<p>A fast in-memory <strong>caching solution</strong> to store data right away, it is useful for caching and message analysis.</p>
<p><strong>Key Features:</strong> Quick data processing with very low delay, supports session storage, leaderboards, and real-time analytics. Provides automatic scaling and data saving options to ensure it is always available.</p>
<p><strong>Use Case:</strong> Frequently applied to make applications work better in terms of reducing the load of database queries, improving user experiences through efficient session management, and fetching data in real-time faster in applications like gaming, e-commerce, and other social media platforms.</p>
<h2 id="heading-strategic-implementation-approaches"><strong>Strategic Implementation Approaches</strong></h2>
<p>To maximize the potential of Azure Databases, businesses should adopt strategic implementation approaches that focus on flexibility, performance, and cost efficiency.</p>
<p><strong>1. Multi-Model Database Strategy</strong> :</p>
<p>Modern applications often require multiple data models to handle diverse business needs. Instead of relying on a single solution, Azure enables businesses to create a harmonious ecosystem of databases that work seamlessly together.</p>
<p>A comprehensive approach may involve:</p>
<ul>
<li><p><strong>Azure Cosmos DB:</strong> Globally distributed, real-time user profiles and flexible NoSQL storage.</p>
</li>
<li><p><strong>Azure SQL Database:</strong> Transactional business logic and structured data storage.</p>
</li>
<li><p><strong>Azure Blob Storage:</strong> Media and large file management, for example, images and logs.</p>
</li>
<li><p><strong>Azure Cache for Redis:</strong> High-speed temporary data storage to improve the performance of the application.</p>
</li>
</ul>
<h3 id="heading-example-use-case"><strong>Example Use Case :</strong></h3>
<p>A modern e-commerce platform relies on the suite of services offered by Azure to deliver seamless and scalable user experiences. Using Azure Cosmos DB for globally accessible user account data, Azure SQL Database for managing transactional orders, Blob Storage for storing product images and assets, and Redis Cache for real-time performance, businesses ensure fast, reliable, and personalized interactions. This cloud architecture allows platforms to handle large-scale traffic while maintaining high availability and responsiveness.</p>
<ul>
<li><p>User account data is stored and globally accessible through Cosmos DB.</p>
</li>
<li><p>Transactional records and order details are in Azure SQL Database.</p>
</li>
<li><p>Product images and large assets are in Blob Storage.</p>
</li>
<li><p>Redis Cache enhances real-time experience of the user, such as serving fast-loading product listings or managing user sessions.</p>
</li>
</ul>
<h4 id="heading-performance-and-cost-optimization"><strong>Performance and Cost Optimization</strong> :</h4>
<p>Performance optimization in Azure is a continuous process, not a one-time task. Azure provides robust tools to <strong>monitor</strong> , <strong>analyze</strong> , and <strong>automatically adjust</strong> database performance.</p>
<ul>
<li><p><strong>Azure SQL Intelligent Performance Tools</strong> : Tools like Query Performance Insight and Automatic Tuning help identify and optimize slow queries.</p>
</li>
<li><p><strong>Scalability with Elastic Pools</strong> : Allows databases to share resources efficiently, ensuring cost savings.</p>
</li>
<li><p><strong>Azure Monitor and Azure Advisor</strong> : These tools provide performance recommendations and proactive alerts.</p>
</li>
<li><p>Azure’s cost management tools enable businesses to avoid <strong>overprovisioning infrastructure</strong> by dynamically scaling resources to match workloads.</p>
</li>
</ul>
<h3 id="heading-code-example-multi-database-integration"><strong>Code Example: Multi-Database Integration</strong></h3>
<p>This section demonstrates how you can implement a <strong>multi-database strategy</strong> by connecting various Azure database services in a Python-based application.<br />Before diving into Azure Database implementations, ensure you have the proper devlopement environment ready:</p>
<p>This example demonstrates:</p>
<ol>
<li><p>Storing user profiles in <strong>Cosmos DB</strong>.</p>
</li>
<li><p>Uploading media assets to <strong>Blob Storage</strong>.</p>
</li>
<li><p>Recording transactional data in <strong>Azure SQL Database</strong>.</p>
</li>
</ol>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> azure.cosmos <span class="hljs-keyword">import</span> CosmosClient
<span class="hljs-keyword">from</span> azure.storage.blob <span class="hljs-keyword">import</span> BlobServiceClient
<span class="hljs-keyword">import</span> pyodbc

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">DataManagementService</span>:</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span> (<span class="hljs-params">self, config</span>):</span>
        <span class="hljs-comment"># Initialize database clients</span>
        self.cosmos_client = CosmosClient(config[<span class="hljs-string">'cosmos_endpoint'</span>], config[<span class="hljs-string">'cosmos_key'</span>])
        self.blob_service = BlobServiceClient(account_url=config[<span class="hljs-string">'blob_account_url'</span>], credential=config[<span class="hljs-string">'blob_key'</span>])
        self.sql_connection = pyodbc.connect(config[<span class="hljs-string">'sql_connection_string'</span>])

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">store_user_profile</span>(<span class="hljs-params">self, user_data</span>):</span>
        <span class="hljs-comment"># Store user profiles in Cosmos DB</span>
        container = self.cosmos_client.get_database_client(<span class="hljs-string">'users'</span>).get_container_client(<span class="hljs-string">'profiles'</span>)
        container.create_item(body=user_data)

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">upload_user_asset</span>(<span class="hljs-params">self, file_path, user_id</span>):</span>
        <span class="hljs-comment"># Upload assets to Blob Storage</span>
        blob_client = self.blob_service.get_blob_client(container=<span class="hljs-string">'assets'</span>, blob=<span class="hljs-string">f"<span class="hljs-subst">{user_id}</span>/file.jpg"</span>)
        <span class="hljs-keyword">with</span> open(file_path, <span class="hljs-string">"rb"</span>) <span class="hljs-keyword">as</span> data:
            blob_client.upload_blob(data)

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">store_transaction_record</span>(<span class="hljs-params">self, transaction_data</span>):</span>
        <span class="hljs-comment"># Store transactional data in Azure SQL</span>
        cursor = self.sql_connection.cursor()
        cursor.execute(<span class="hljs-string">"INSERT INTO Transactions (UserID, Amount) VALUES (?, ?)"</span>, transaction_data[<span class="hljs-string">'user_id'</span>], transaction_data[<span class="hljs-string">'amount'</span>])
        self.sql_connection.commit()
</code></pre>
<h3 id="heading-pricing">Pricing</h3>
<p>When considering Azure databases, <a target="_blank" href="https://azure.microsoft.com/en-gb/pricing/">pricing</a> is determined by several factors, including the database type, resource allocation, and region. For instance, SQL Database pricing is based on the service tier (Basic, Standard, or Premium) and includes charges for compute, storage, and backup. Azure Virtual Machines hosting SQL Server incur costs for both the VM and the SQL Server license. Additionally, users can opt for pay-as-you-go or reserved pricing models, which can offer savings based on commitment length. Azure also provides cost management tools to estimate and monitor expenses, ensuring you can tailor your database usage to fit your budget.</p>
<blockquote>
<p>Azure continues to evolve, consistently offering powerful and innovative solutions for businesses. With its constant upgrades and cutting-edge technologies, Azure remains a top choice for building scalable, secure, and efficient applications. Explore more about Azure’s capabilities<br /><a target="_blank" href="https://azure.microsoft.com">here</a>.</p>
</blockquote>
<p><a target="_blank" href="https://pratikpathak.com/azure-openai-zero-to-hero/">Also Read</a></p>
]]></content:encoded></item><item><title><![CDATA[Azure DevOps in Action: Automate, Collaborate, Deliver]]></title><description><![CDATA[Azure DevOps is a collection of tools developed by Microsoft that allows developers to ease the software development and delivery process. It allows organizations to improve their products and help teams work smarter and faster using traditional soft...]]></description><link>https://hashnode.pratikpathak.com/azure-devops-in-action-automate-collaborate-deliver</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/azure-devops-in-action-automate-collaborate-deliver</guid><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Fri, 10 Jan 2025 16:12:43 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1736525536245/5fa4d8a5-735b-4d9b-b5b3-44eca1cc530b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p>Azure DevOps is a collection of tools developed by Microsoft that allows developers to ease the software development and delivery process. It allows organizations to improve their products and help teams work smarter and faster using traditional software development approaches.</p>
<p>Azure DevOps is accessible through web browsers and has an entire DevOps lifecycle enabling collaboration, project tracking, automation, and continuous delivery of software applications.</p>
<h2 id="heading-what-is-azure-devops">What is Azure DevOps</h2>
<p>In today’s fast-paced development landscape, Azure DevOps from Microsoft designed to streamline development process, collaboration and support CI/CD pipelines. Whether you’re a startup or an enterprise, Azure DevOps offers tools to automate workflows, manage projects, and ensure smooth delivery.</p>
<p><strong>It has inbuilt features like</strong></p>
<p>| <strong>Repos</strong> | Unlimited private Git repositories<br />Team Foundation Version Control (TFVC) | | <strong>Boards</strong> | Kanban and Scrum boards<br />Customizable workflow states | | <strong>Pipelines</strong> | Automated build and deployment processes | | <strong>Test Plans</strong> | Manual and exploratory testing<br />Test case management | | <strong>Artifacts</strong> | Support for multiple package types (NuGet, npm, Maven, Python) |</p>
<h2 id="heading-core-features-of-azure-devops"><strong>Core Features of Azure DevOps</strong></h2>
<p><img src="https://pratikpathak.com/wp-content/uploads/2024/12/Boards-Overview.png" alt="Boards Overview" /></p>
<p><em>Boards</em></p>
<p><img src="https://pratikpathak.com/wp-content/uploads/2024/12/Repos-Overview.png" alt="Repos Overview" /></p>
<p><em>Repos</em></p>
<h3 id="heading-azure-boards">Azure Boards</h3>
<p>Azure Boards is a complete set of Agile tools to help teams plan, track, and discuss work across their projects. It includes customizable Kanban boards, interactive backlogs, and sprint planning features, making it an essential tool for Agile and Scrum teams. With Azure Boards, teams can visualize project progress, prioritize tasks, and link work items to commits and pull requests in Azure Repos</p>
<ul>
<li><p>Supports tracking of user stories, bugs, epics, and tasks.</p>
</li>
<li><p>Agile boards and backlogs for sprint planning and work tracking.</p>
</li>
<li><p>Customizable Kanban boards for managing tasks visually.</p>
</li>
<li><p>Integrated dashboards to track progress and generate insights.</p>
</li>
</ul>
<p>This tight integration will ensure traceability across the development lifecycle, giving stakeholders and developers an integrated view of the project. Its flexibility, along with rich analytics dashboards, makes it very easy to adapt to any workflow while improving team productivity.</p>
<h3 id="heading-azure-repos">Azure Repos</h3>
<p>Azure Repos is a powerful version control system that supports both Git (distributed version control system), and Team Foundation Version Control, TFVC ( centralized version control system). Here, developers can collaboratively manage their code for the very efficient tracking of change in code revisions over time.</p>
<ul>
<li><p>Unlimited private Git repositories for storing and managing your code.</p>
</li>
<li><p>Advanced code review processes and prevent bugs.</p>
</li>
<li><p>Pull requests with built-in code reviews and comments to ensure code quality.</p>
</li>
<li><p>Branch policies to enforce workflows and protect important branches.</p>
</li>
</ul>
<p>Azure Repos provides tools for pull requests, code reviews, and branch policies, so teams are allowed to maintain the quality of the code and ensure that no bugs get into the main branch. Rich integrations and seamless workflows make it a critical tool for distributed teams working on collaborative projects, managing any size and complexity of codebases.</p>
<h3 id="heading-azure-pipelines">Azure Pipelines</h3>
<p>Azure Pipelines is the core of CI/CD in Azure DevOps, meant for automating the build, test, and deployment phases of the software development process. It supports all platforms such as Windows, Linux, and macOS, and integrates with many popular development languages, including Python, Java, Node.js, and.NET. Using a YAML file or through the GUI, developers can define a workflow for Azure Pipelines with lots of flexibility for beginners as well as experienced professionals.</p>
<ul>
<li><p>Multi-platform support for Windows, macOS, and Linux.</p>
</li>
<li><p>Build and deploy applications in multiple languages, including .NET, Java, Python, Node.js, etc.</p>
</li>
<li><p>Integration with GitHub, Bitbucket, and other repositories.</p>
</li>
<li><p>Containerized builds and deployments using Docker and Kubernetes.</p>
</li>
</ul>
<p>In addition, it is possible to deploy to virtual machines, containers, to a Kubernetes cluster, and other cloud platforms such as Azure or AWS. Using Azure Pipelines, teams can achieve quicker and more reliable software delivery by reducing the need for human intervention.</p>
<h3 id="heading-azure-test-plans">Azure Test Plans</h3>
<p>Azure Test Plans streamlining testing-aiming to support manual and exploratory in addition to automated testing-but indeed brings benefits around manual case planning/organization through test case definition, plan authoring, execution, result tracking, and more into deeper reporting. Teams may thereby better assimilate and integrate Azure Test Plans to their CI/CD Pipelines to ensure quality adherence before deployment.</p>
<ul>
<li><p>Integration with CI/CD pipelines for automated testing.</p>
</li>
<li><p>Exploratory testing tools for ad-hoc and unscripted testing.</p>
</li>
<li><p>Manual testing capabilities with detailed test case tracking.</p>
</li>
<li><p>Test analytics and reporting to identify trends and areas for improvement.</p>
</li>
</ul>
<p>With features like browser-based testing and rich data capturing during test execution, the teams are better equipped to spot and solve problems. As it is able to be integrated with the development pipeline, Azure Test Plans fosters a culture of quality and reliability in software delivery.</p>
<h3 id="heading-azure-artifacts">Azure Artifacts</h3>
<p>Azure Artifacts simplifies package management and sharing across teams and projects. It serves as a universal package repository for tools such as NuGet, npm, Maven, and Python. Through Azure Artifacts, developers are able to store and manage their dependencies, avoiding duplication while ensuring consistency in the build. It also supports integration with Azure Pipelines that helps in automatic publishing and consumption of packages in the course of the CI/CD process.</p>
<ul>
<li><p>Create, host, and share packages using Maven, npm, NuGet, and Python.</p>
</li>
<li><p>Integration with CI/CD pipelines to automate package usage.</p>
</li>
<li><p>Access control and security to restrict package usage within the organization.</p>
</li>
<li><p>Upstream sources to seamlessly integrate external packages.</p>
</li>
</ul>
<p>With Azure Artifacts, teams centralize package management, avoiding problems like version conflicts and making sure that all projects rely on approved and secure dependencies. This capability is extremely valuable for organizations managing large and complex software ecosystems.</p>
<h2 id="heading-setting-up-azure-devops">Setting Up Azure DevOps</h2>
<h3 id="heading-step-1-creating-an-azure-devops-organization"><strong>Step 1</strong> : Creating an Azure DevOps Organization</h3>
<ul>
<li><p>Visit <a target="_blank" href="https://portal.azure.com/#view/AzureTfsExtension/OrganizationsTemplateBlade">dev.azure.com</a></p>
</li>
<li><p>Sign in with your Microsoft account</p>
</li>
<li><p>Once Logged in, Click on the <a target="_blank" href="https://aex.dev.azure.com/">My Azure DevOps Organizations</a></p>
</li>
<li><p>Click “New Organization”</p>
</li>
<li><p>Choose a unique organization name Select your region</p>
</li>
</ul>
<p><img src="https://pratikpathak.com/wp-content/uploads/2024/12/Organization-Creation-2-1024x492.png" alt="Organization Creation" /></p>
<p><em>Azure devOps Organization Creation</em></p>
<h3 id="heading-configuring-your-first-project">Configuring Your First Project</h3>
<ul>
<li><p>Provide a project name</p>
</li>
<li><p>Choose visibility (Private/Public)</p>
</li>
<li><p>Click “Create Project”</p>
</li>
</ul>
<p><img src="https://pratikpathak.com/wp-content/uploads/2024/12/Screenshot-2024-12-16-115940.png" alt="Creating a project" /></p>
<p><em>Azure DevOps in Action: Automate, Collaborate, Deliver 9</em></p>
<ul>
<li><strong>Set Up Your Project Dashboard</strong> : Once your project is created, you’ll be taken to the project’s dashboard, where you can begin configuring Azure Boards, Repos, and Pipelines.</li>
</ul>
<h3 id="heading-step-3-configuring-azure-repos">Step 3: Configuring Azure Repos</h3>
<p>In this step, you’ll configure your version control system, which is an essential part of any software development project. Azure Repos supports Git repositories, allowing teams to collaborate on code. To set up Azure Repos:</p>
<ol>
<li><p><strong>Navigate to the Repos Section</strong> : In your project dashboard, click on <strong>Repos</strong> in the left-hand navigation menu.</p>
</li>
<li><p><strong>Create a New Repository</strong> : Click on the “New Repository” button to create a Git repository. You can choose to initialize it with a README file, or you can leave it empty for now.</p>
</li>
<li><p><strong>Clone the Repository</strong> : Once the repository is created, clone it to your local development environment using the provided Git URL. You can do this by running the command</p>
</li>
</ol>
<pre><code class="lang-python">git clone &lt;repository-url&gt;
</code></pre>
<ol>
<li><strong>Start Adding Code</strong> : After cloning, you can begin adding your code files, commit changes, and push them to the Azure DevOps repository.</li>
</ol>
<h3 id="heading-step-4-creating-your-first-pipeline"><strong>Step 4: Creating Your First Pipeline</strong></h3>
<p>Now that your project and repository are set up, let’s create a <strong>CI/CD pipeline</strong> to automate the build, test, and deployment processes. Azure Pipelines is where this happens. Here’s how to set up a simple pipeline:</p>
<ol>
<li><p><strong>Navigate to Pipelines</strong> : In the project dashboard, select the <strong>Pipelines</strong> option from the left-hand menu.</p>
</li>
<li><p><strong>Create a New Pipeline</strong> : Click on the “New Pipeline” button.</p>
</li>
<li><p><strong>Choose the Source</strong> : Select <strong>Azure Repos Git</strong> as the source for your pipeline. You can also connect external repositories like GitHub or Bitbucket.</p>
</li>
<li><p><strong>Select a Template or YAML File</strong> : Azure Pipelines offers both visual designer templates and YAML-based pipelines. For this example, you can choose to use a YAML file (we will define it manually), or you can use one of the pre-configured templates.</p>
</li>
<li><p><strong>Configure Build Steps</strong> : If using a YAML pipeline, define the steps for building, testing, and deploying your application.</p>
</li>
</ol>
<p>Here is an example for a .NET application:</p>
<pre><code class="lang-python">trigger:
  - main

pool:
  vmImage: <span class="hljs-string">'ubuntu-latest'</span>

variables:
  solution: <span class="hljs-string">'**/*.sln'</span>
  buildPlatform: <span class="hljs-string">'Any CPU'</span>
  buildConfiguration: <span class="hljs-string">'Release'</span>

steps:
- task: DotNetCoreCLI@<span class="hljs-number">2</span>
  inputs:
    command: <span class="hljs-string">'restore'</span>
    projects: <span class="hljs-string">'**/*.csproj'</span>

- task: DotNetCoreCLI@<span class="hljs-number">2</span>
  inputs:
    command: <span class="hljs-string">'build'</span>
    projects: <span class="hljs-string">'**/*.csproj'</span>
    configuration: <span class="hljs-string">'$(buildConfiguration)'</span>

- task: DotNetCoreCLI@<span class="hljs-number">2</span>
  inputs:
    command: <span class="hljs-string">'publish'</span>
    publishWebProjects: true
    configuration: <span class="hljs-string">'$(buildConfiguration)'</span>

- task: AzureWebApp@<span class="hljs-number">1</span>
  inputs:
    azureSubscription: <span class="hljs-string">'Your-Azure-Subscription'</span>
    appName: <span class="hljs-string">'YourWebAppName'</span>
</code></pre>
<h2 id="heading-best-practices-for-azure-devops"><strong>Best Practices for Azure DevOps</strong></h2>
<ol>
<li><p><strong>Automate with CI/CD:</strong> Implement an automated pipeline for building, testing, and deploying to expedite the delivery process along with its consistency.</p>
</li>
<li><p><strong>Structure your Repositories:</strong> Use concise names, have a standard branching strategy, and generally do not store large files in Git.</p>
</li>
<li><p><strong>Introduce Testing Early:</strong> Include as much automated and manual testing into your CI/CD pipeline so that the quality would be assured before deployment to the environment.</p>
</li>
<li><p>**Secure Environment: ** Implement role-based access control, use Azure Key Vault to deal with permissions and secrets.</p>
</li>
</ol>
<blockquote>
<p><strong>Role-Based Access Control (RBAC)</strong> is one of the critical features to secure your Azure DevOps environment. It enables you to control who can access specific resources and what they can do. Defining roles and assigning them to users or groups ensures that only authorized individuals can make changes to code, configurations, or pipelines. This helps protect your project from unauthorized access and reduces the risk of accidental or malicious changes.<br />With RBAC, teams can enforce the principle of least privilege, ensuring that users only have the permissions necessary to complete their tasks, enhancing both security and compliance across the development lifecycle.</p>
<p><a target="_blank" href="https://pratikpathak.com/app-service-6-months-in-just-5-minutes/">What I Learned About App Service: 6 Months in Just 5 Minutes</a></p>
</blockquote>
<iframe sandbox="allow-scripts" src="https://pratikpathak.com/app-service-6-months-in-just-5-minutes/embed/#?secret=SBGK6799jP#?secret=mUX6XIQSP7" width="600" height="338"></iframe>

<h3 id="heading-challenges-for-beginners"><strong>Challenges for Beginners</strong></h3>
<ul>
<li><p>Pipeline configurations can be complex at first—use the Azure DevOps Marketplace for pre-built templates.</p>
</li>
<li><p>Understanding YAML is very important to define the pipeline correctly.</p>
</li>
<li><p>Integration Problems connecting to existing dev toolsets requires planning. Prepare for challenges with compatibility.</p>
</li>
<li><p>Permission Management Navigating access controls can be tricky. Balance security with team productivity.</p>
</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Azure DevOps is the future of software development, unified platform that breaks down silos, supports collaboration, and accelerating innovation. It will enable small startups and large corporations alike to achieve their transformation needs with the right tools for developing your process.</p>
<p>Join the journey to Azure DevOps journey with the <a target="_blank" href="https://azure.microsoft.com/en-us/services/devops/">free tier</a> today!</p>
<h2 id="heading-faq">FAQ</h2>
<h3 id="heading-1-what-is-the-difference-between-azure-devops-and-github-actions"><strong>1 . What is the difference between Azure DevOps and GitHub Actions?</strong></h3>
<p>While both Azure DevOps and GitHub Actions offer CI/CD capabilities, Azure DevOps is a complete DevOps suite with tools for project management, version control, testing, and artifact management. GitHub Actions, on the other hand, is focused primarily on CI/CD for GitHub repositories. Azure DevOps provides a broader set of features for enterprise-level DevOps needs, while GitHub Actions is more streamlined for GitHub-centric workflows.</p>
<h3 id="heading-2-can-azure-devops-be-used-for-both-open-source-and-private-projects"><strong>2. Can Azure DevOps be used for both open-source and private projects?</strong></h3>
<p>Yes, Azure DevOps supports both open-source and private projects. You can create unlimited private Git repositories with Azure Repos, and the platform also allows for public repositories, making it an excellent choice for open-source development. Azure DevOps also offers flexibility in visibility and access settings for different teams and projects.</p>
<h3 id="heading-3-how-can-i-integrate-azure-devops-with-other-tools"><strong>3. How can I integrate Azure DevOps with other tools?</strong></h3>
<p>Azure DevOps integrates with a wide variety of third-party tools such as GitHub, Jenkins, Slack, and others. You can also use REST APIs and extensions from the Azure DevOps Marketplace to integrate with different tools, enhancing your CI/CD pipelines and project management workflows.</p>
<h3 id="heading-4-can-i-use-azure-devops-for-non-microsoft-technologies"><strong>4. Can I use Azure DevOps for non-Microsoft technologies?</strong></h3>
<p>Yes, Azure DevOps supports a wide range of programming languages and frameworks, including Java, Python, Node.js, and more. It works across platforms like Windows, macOS, and Linux, making it versatile for projects that use non-Microsoft technologies.</p>
]]></content:encoded></item><item><title><![CDATA[Azure OpenAI in a single page: Zero to Hero – A Complete Integration Guide]]></title><description><![CDATA[canonical_url: https://pratikpathak.com/azure-openai-zero-to-hero/
In the fast-moving world of artificial intelligence, Azure OpenAI Service is emerging as a game-changer that bridges the gap between cutting-edge language models and enterprise-grade ...]]></description><link>https://hashnode.pratikpathak.com/azure-openai-in-a-single-page-zero-to-hero-a-complete-integration-guide-1</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/azure-openai-in-a-single-page-zero-to-hero-a-complete-integration-guide-1</guid><category><![CDATA[Azure]]></category><category><![CDATA[openai]]></category><category><![CDATA[genai]]></category><category><![CDATA[Azure OpenAI]]></category><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Thu, 09 Jan 2025 17:36:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1736444075389/50da3fdf-5687-4f7d-bfbb-10544a184a84.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<h2 id="heading-canonicalurl-httpspratikpathakcomazure-openai-zero-to-hero">canonical_url: https://pratikpathak.com/azure-openai-zero-to-hero/</h2>
<p>In the fast-moving world of artificial intelligence, Azure OpenAI Service is emerging as a game-changer that bridges the gap between cutting-edge language models and enterprise-grade cloud infrastructure. This innovative service provides developers and organizations direct access to some of the most powerful AI models built by OpenAI, all within the secure and robust Microsoft Azure ecosystem.</p>
<hr />
<h2 id="heading-what-is-azure-openai-service">What is Azure OpenAI Service?</h2>
<p>Azure OpenAI Service is a powerful cloud platform offering REST API access to state-of-the-art language models, including <strong>GPT-4o</strong> , <strong>GPT-4</strong> , <strong>GPT-3.5-Turbo</strong> , and a range of specialized models. Unlike traditional AI services, Azure OpenAI combines the advanced capabilities of OpenAI’s models with Microsoft’s enterprise-level security, compliance, and scalability.</p>
<hr />
<h2 id="heading-why-azure-openai">Why Azure OpenAI ?</h2>
<p>Azure OpenAI is not just another AI tool but a holistic solution designed to transform the way businesses use artificial intelligence. Here are some key advantages:</p>
<ul>
<li><p>From text generation and summarization to image understanding and code translation, Azure OpenAI offers models for virtually every AI-driven task.</p>
</li>
<li><p>Features such as virtual network support, managed identity through Microsoft Entra ID, and strong content filtering make it possible to deploy AI solutions with minimal risk.</p>
</li>
<li><p>Azure integrates responsible AI principles into its models, minimizing harm and promoting the effective use of AI.</p>
</li>
</ul>
<hr />
<h2 id="heading-azure-openai-models">Azure OpenAI Models</h2>
<h3 id="heading-advanced-language-models">Advanced Language Models</h3>
<p>Advanced language models in Azure OpenAI excel in understanding and generating complex natural language. They are designed for applications needing deep reasoning and contextual awareness. A few of the prominent models are</p>
<ul>
<li><p><strong>GPT-4o &amp; GPT-4o Mini</strong> : Latest models with sophisticated reasoning and multimodal abilities.</p>
</li>
<li><p><strong>GPT-4 Series</strong> : Powerful models for complex language understanding and generation.</p>
</li>
<li><p><strong>GPT-3.5-Turbo</strong> : Efficient models for a wide range of natural language tasks.</p>
</li>
</ul>
<h3 id="heading-specialized-models">Specialized Models</h3>
<p>These models have been specifically designed for certain tasks: generating images, speech-to-text capabilities, and more precise similarity analysis. They further support the language models because they are multimodal and domain-specific. The most specialized models in the list include:</p>
<ul>
<li><p><strong>Embeddings</strong> : Converts text into numerical vectors for advanced similarity analysis.</p>
</li>
<li><p><strong>DALL-E</strong> : Generates original images from text descriptions.</p>
</li>
<li><p><strong>Whisper</strong> : Transcribes and translates speech to text.</p>
</li>
<li><p><strong>Text-to-Speech</strong> : Synthesizes spoken language from text (currently in preview).</p>
</li>
</ul>
<hr />
<h2 id="heading-getting-started-with-azure-openai-service">Getting Started with Azure OpenAI Service</h2>
<p>Integration of Azure OpenAI into your projects is straightforward. Follow these steps:</p>
<ol>
<li><p><strong>Create an Azure OpenAI Service resource</strong> in your subscription.</p>
</li>
<li><p><strong>Deploy your desired model</strong> based on project needs.</p>
</li>
<li><p><strong>Begin making calls to APIs</strong> using REST APIs or SDKs.</p>
</li>
</ol>
<p>Whether you’re building intelligent chatbots, generating advanced content, or developing AI-driven applications, Azure OpenAI Service provides the flexibility and power needed with the security you can rely on.</p>
<p>In the upcoming sections of this blog, we’ll dive deep into implementation strategies, best practices, and real-world use cases that showcase the transformative potential of Azure OpenAI Service.</p>
<hr />
<h2 id="heading-core-benefits">Core Benefits</h2>
<h3 id="heading-1-rich-model-selection">1. Rich Model Selection</h3>
<ul>
<li><p>Access to advanced AI models for a wide range of tasks.</p>
</li>
<li><p>Supports capabilities like text-to-image generation, image-to-text understanding, and more.</p>
</li>
</ul>
<h3 id="heading-2-enterprise-grade-security">2. Enterprise-Grade Security</h3>
<ul>
<li><p><strong>Virtual Network Support</strong> : Ensures secure communication within private networks.</p>
</li>
<li><p><strong>Microsoft Entra ID Managed Identity</strong> : Simplifies authentication and access management.</p>
</li>
<li><p><strong>Strong Content Filtering</strong> : Mitigates risks by identifying and blocking harmful or inappropriate content.</p>
</li>
</ul>
<h3 id="heading-3-responsible-ai-framework">3. Responsible AI Framework</h3>
<ul>
<li><p><strong>Ethical AI Design Principles</strong> : Promotes fair, transparent, and accountable use of AI.</p>
</li>
<li><p><strong>Harm Minimization</strong> : Reduces the potential for misuse or unintended consequences.</p>
</li>
</ul>
<hr />
<h2 id="heading-chat-integration-with-azure-openai-service">Chat Integration with Azure OpenAI Service</h2>
<p>This section will guide you step-by-step to authenticate and integrate Azure OpenAI in your project.</p>
<h3 id="heading-step-1-set-up-your-project">Step 1: Set Up Your Project</h3>
<ol>
<li><p><strong>Initialize a new Python project</strong><br /> Open your favorite development environment. We recommend <strong>Visual Studio Code</strong>.</p>
</li>
<li><p><strong>Create and configure your project</strong></p>
</li>
</ol>
<ul>
<li><p>Create a new folder for your project, and open it in the editor.</p>
</li>
<li><p>Initialize a Python virtual environment:</p>
</li>
</ul>
<pre><code class="lang-plaintext">     python -m venv venv
     source venv/bin/activate # On Windows: venv\Scripts\activate
     pip install --upgrade pip
</code></pre>
<ol>
<li><strong>Install required packages</strong></li>
</ol>
<pre><code class="lang-plaintext">pip install python-dotenv openai azure-identity azure-keyvault-secrets
</code></pre>
<ol>
<li><strong>Set up environment variables</strong></li>
</ol>
<ul>
<li><p>Create a <code>.env</code> file in your project folder.</p>
</li>
<li><p>Add the following environment variables:</p>
</li>
</ul>
<pre><code class="lang-plaintext">AZURE_OPENAI_ENDPOINT=&lt;Your Azure OpenAI endpoint&gt;
AZURE_OPENAI_API_KEY=&lt;Your API key&gt; # Omit this if using Key Vault
AZURE_KEY_VAULT_URL=https://&lt;Your-Key-Vault-Name&gt;.vault.azure.net/
</code></pre>
<h3 id="heading-step-2-create-an-azure-openai-service">Step 2: Create an Azure OpenAI Service</h3>
<ol>
<li><p><strong>Log in to the</strong> <a target="_blank" href="https://portal.azure.com"><strong>Azure Portal</strong></a><strong>.</strong></p>
</li>
<li><p><strong>Deploy the Azure OpenAI service:</strong></p>
</li>
</ol>
<ul>
<li><p>Search for <strong>Azure OpenAI Service</strong> and click <strong>Create</strong>.</p>
</li>
<li><p>Select your subscription, resource group, and region, and deploy the service.</p>
</li>
</ul>
<ol start="3">
<li><strong>Copy endpoint and keys:</strong></li>
</ol>
<ul>
<li><p>Navigate to the <strong>Keys and Endpoint</strong> tab in your Azure OpenAI Service.</p>
</li>
<li><p>Copy the <strong>Endpoint</strong> and <strong>Key</strong> for later use.</p>
</li>
</ul>
<h3 id="heading-step-3-optional-set-up-azure-key-vault">Step 3: (Optional) Set Up Azure Key Vault</h3>
<p>For added security, use Azure Key Vault to store your API keys.</p>
<ol>
<li><p><strong>Create a Key Vault</strong></p>
</li>
<li><p>Search for <strong>Azure Key Vault</strong> in the Azure Portal and click <strong>Create</strong>.</p>
</li>
<li><p><strong>Add a new secret</strong></p>
</li>
</ol>
<ul>
<li><p>Name: <code>OpenAIAPIKey</code></p>
</li>
<li><p>Value: Paste your Azure OpenAI API key.</p>
</li>
</ul>
<ol start="3">
<li>Use the following code to retrieve the key from Key Vault:</li>
</ol>
<pre><code class="lang-plaintext">from azure.identity import DefaultAzureCredential
from azure.keyvault.secrets import SecretClient

# Use Azure managed credentials
credential = DefaultAzureCredential()
key_vault_url = "https://your-keyvault.vault.azure.net/"
secret_client = SecretClient(vault_url=key_vault_url, credential=credential)

# Retrieve OpenAI credentials securely
openai_key = secret_client.get_secret("OpenAIAPIKey")
</code></pre>
<h3 id="heading-step-4-comprehensive-chat-implementation">Step 4: Comprehensive Chat Implementation</h3>
<p>Use the following code to implement the chat application:</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> List, Dict, Optional
<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> dotenv <span class="hljs-keyword">import</span> load_dotenv
<span class="hljs-keyword">from</span> openai <span class="hljs-keyword">import</span> AzureOpenAI
<span class="hljs-keyword">import</span> logging
<span class="hljs-keyword">from</span> logging.handlers <span class="hljs-keyword">import</span> RotatingFileHandler

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">AzureOpenAIChat</span>:</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span> (<span class="hljs-params">
        self, 
        deployment_name: str = <span class="hljs-string">"gpt-4o"</span>, 
        max_tokens: int = <span class="hljs-number">300</span>, 
        temperature: float = <span class="hljs-number">0.7</span>
    </span>):</span>
        <span class="hljs-string">"""
        Initialize Azure OpenAI Chat Client with enhanced configuration.

        Args:
            deployment_name (str): Deployed model name
            max_tokens (int): Maximum response length
            temperature (float): Response creativity
        """</span>
        load_dotenv()

        <span class="hljs-comment"># Enhanced logging configuration</span>
        self._configure_logging()

        self.client = AzureOpenAI(
            azure_endpoint=os.getenv(<span class="hljs-string">'AZURE_OPENAI_ENDPOINT'</span>),
            api_key=os.getenv(<span class="hljs-string">'AZURE_OPENAI_API_KEY'</span>),
            api_version=<span class="hljs-string">"2024-02-01"</span>
        )

        self.deployment_name = deployment_name
        self.max_tokens = max_tokens
        self.temperature = temperature
        self.conversation_history: List[Dict[str, str]] = []

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">_configure_logging</span>(<span class="hljs-params">self</span>):</span>
        <span class="hljs-string">"""Configure robust logging mechanism."""</span>
        logging.basicConfig(
            level=logging.INFO,
            format=<span class="hljs-string">'%(asctime)s - %(name)s - %(levelname)s - %(message)s'</span>,
            handlers=[
                RotatingFileHandler(
                    <span class="hljs-string">'azure_openai_chat.log'</span>, 
                    maxBytes=<span class="hljs-number">10</span>*<span class="hljs-number">1024</span>*<span class="hljs-number">1024</span>, <span class="hljs-comment"># 10MB</span>
                    backupCount=<span class="hljs-number">5</span>
                ),
                logging.StreamHandler()
            ]
        )
        self.logger = logging.getLogger( __name__ )

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">start_conversation</span>(<span class="hljs-params">
        self, 
        system_prompt: str = <span class="hljs-string">"You are a helpful AI assistant"</span>
    </span>) -&gt; <span class="hljs-keyword">None</span>:</span>
        <span class="hljs-string">"""Initialize conversation with system context."""</span>
        self.conversation_history = [
            {<span class="hljs-string">"role"</span>: <span class="hljs-string">"system"</span>, <span class="hljs-string">"content"</span>: system_prompt}
        ]
        self.logger.info(<span class="hljs-string">"Conversation initialized"</span>)

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">add_user_message</span>(<span class="hljs-params">self, message: str</span>) -&gt; <span class="hljs-keyword">None</span>:</span>
        <span class="hljs-string">"""Add user message to conversation."""</span>
        self.conversation_history.append({
            <span class="hljs-string">"role"</span>: <span class="hljs-string">"user"</span>, 
            <span class="hljs-string">"content"</span>: message
        })
        self.logger.info(<span class="hljs-string">f"User message added: <span class="hljs-subst">{message[:<span class="hljs-number">50</span>]}</span>..."</span>)

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">generate_response</span>(<span class="hljs-params">
        self, 
        max_tokens: Optional[int] = None,
        temperature: Optional[float] = None
    </span>) -&gt; Optional[str]:</span>
        <span class="hljs-string">"""Generate AI response with configurable parameters."""</span>
        <span class="hljs-keyword">try</span>:
            response = self.client.chat.completions.create(
                model=self.deployment_name,
                messages=self.conversation_history,
                max_tokens=max_tokens <span class="hljs-keyword">or</span> self.max_tokens,
                temperature=temperature <span class="hljs-keyword">or</span> self.temperature
            )

            ai_response = response.choices[<span class="hljs-number">0</span>].message.content

            <span class="hljs-keyword">if</span> ai_response:
                self.conversation_history.append({
                    <span class="hljs-string">"role"</span>: <span class="hljs-string">"assistant"</span>, 
                    <span class="hljs-string">"content"</span>: ai_response
                })
                self.logger.info(<span class="hljs-string">"Response generated successfully"</span>)
                <span class="hljs-keyword">return</span> ai_response

            self.logger.warning(<span class="hljs-string">"Empty response received"</span>)
            <span class="hljs-keyword">return</span> <span class="hljs-literal">None</span>

        <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
            self.logger.error(<span class="hljs-string">f"Response generation error: <span class="hljs-subst">{e}</span>"</span>)
            <span class="hljs-keyword">return</span> <span class="hljs-literal">None</span>

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">reset_conversation</span>(<span class="hljs-params">self</span>) -&gt; <span class="hljs-keyword">None</span>:</span>
        <span class="hljs-string">"""Reset conversation history."""</span>
        self.conversation_history = []
        self.logger.info(<span class="hljs-string">"Conversation reset"</span>)

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">main</span>():</span>
    chat = AzureOpenAIChat()
    chat.start_conversation(
        <span class="hljs-string">"You are a technical assistant specializing in cloud computing"</span>
    )

    <span class="hljs-keyword">try</span>:
        <span class="hljs-keyword">while</span> <span class="hljs-literal">True</span>:
            user_input = input(<span class="hljs-string">"You: "</span>)
            <span class="hljs-keyword">if</span> user_input.lower() <span class="hljs-keyword">in</span> [<span class="hljs-string">'exit'</span>, <span class="hljs-string">'quit'</span>]:
                <span class="hljs-keyword">break</span>

            chat.add_user_message(user_input)
            response = chat.generate_response()

            <span class="hljs-keyword">if</span> response:
                print(<span class="hljs-string">"AI:"</span>, response)

    <span class="hljs-keyword">except</span> KeyboardInterrupt:
        print(<span class="hljs-string">"\nConversation terminated."</span>)
    <span class="hljs-keyword">finally</span>:
        chat.reset_conversation()

<span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">" __main__"</span>:
    main()
</code></pre>
<h3 id="heading-step-5-run-your-application">Step 5: Run Your Application</h3>
<ol>
<li><p>Save the above code as <code>azure_chat.py</code>.</p>
</li>
<li><p>Run the script:</p>
</li>
</ol>
<pre><code class="lang-plaintext">python azure_chat.py
</code></pre>
<ol>
<li>Interact with the AI in the terminal. Type <code>exit</code> to terminate the session.</li>
</ol>
<p>Your <strong>chat application</strong> is now <strong>ready</strong> to be integrated into your project or deployed to production! 🎉</p>
<h3 id="heading-key-implementation-features">Key Implementation Features</h3>
<p><strong>Flexible Configuration</strong></p>
<ol>
<li><p>Dynamic model selection</p>
</li>
<li><p>Configurable response parameters</p>
</li>
<li><p>Secure credential management</p>
</li>
</ol>
<p><strong>Conversation Management</strong></p>
<ol>
<li><p>Maintain conversation context</p>
</li>
<li><p>Easy message appending</p>
</li>
<li><p>Simple conversation reset</p>
</li>
</ol>
<p><strong>Error Handling</strong></p>
<ol>
<li><p>Comprehensive exception management</p>
</li>
<li><p>Robust logging for debugging</p>
</li>
<li><p>Graceful error recovery</p>
</li>
</ol>
<hr />
<h3 id="heading-best-practices">Best Practices</h3>
<ol>
<li><p>Use <strong>environment variables</strong> for sensitive information</p>
</li>
<li><p>Implement <strong>comprehensive error logging</strong></p>
</li>
<li><p>Configure <strong>appropriate token limits</strong></p>
</li>
<li><p>Manage <strong>conversation history efficiently</strong></p>
</li>
<li><p>Leverage <strong>Azure’s advanced security features</strong></p>
</li>
</ol>
<p><strong><em>Recommended</em></strong> <code>.env</code> Configuration</p>
<hr />
<pre><code class="lang-plaintext">AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_API_KEY=your_secure_api_key
</code></pre>
<h3 id="heading-limitations-and-considerations">Limitations and Considerations</h3>
<p>While Azure OpenAI Service offers remarkable capabilities, it’s crucial to understand its limitations:</p>
<ol>
<li><p>Token-based pricing can become expensive for high-volume applications</p>
</li>
<li><p>Some models have <strong>context length restrictions</strong></p>
</li>
<li><p>Occasional <strong>API latency</strong> might impact real-time applications</p>
</li>
<li><p><strong>Continuous model updates</strong> require adaptation</p>
</li>
</ol>
<hr />
<hr />
<h2 id="heading-frequently-asked-questions">Frequently Asked Questions</h2>
<h3 id="heading-q-how-do-i-choose-the-right-model">Q: How do I choose the right model?</h3>
<p>To choose the right model, consider using GPT-3.5-Turbo for cost-effective, general tasks. For more complex reasoning or high-accuracy requirements, opt for GPT-4. If your project requires multimodal capabilities, GPT-4o is the most advanced option.</p>
<h3 id="heading-q-what-are-the-main-differences-between-models">Q: What are the main differences between models?</h3>
<p>The main differences between models lie in the complexity of reasoning, contextual understanding, computational resources required, and cost per token.</p>
<h3 id="heading-q-how-can-i-integrate-azure-openai-into-my-project">Q: How can I integrate Azure OpenAI into my project?</h3>
<p>To integrate Azure OpenAI into your project, start by creating an Azure OpenAI resource in your subscription. Deploy the model you want to use, then call the APIs via REST or SDKs, and begin building your application.</p>
<h3 id="heading-q-is-there-a-cost-associated-with-using-azure-openai">Q: Is there a cost associated with using Azure OpenAI?</h3>
<p>Yes, Azure OpenAI is a paid service. Pricing depends on the model you use and the number of tokens processed. For more details, please refer to <a target="_blank" href="https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/">Azure’s pricing page</a>.</p>
<h3 id="heading-q-what-security-features-does-azure-openai-offer">Q: What security features does Azure OpenAI offer?</h3>
<p>Azure OpenAI provides robust security features, including virtual network support for secure communication, managed identity via Microsoft Entra ID, content filtering to ensure safe interactions, and compliance with industry standards like GDPR and HIPAA.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Azure OpenAI Service represents a pivotal moment in democratizing advanced AI capabilities. By combining OpenAI’s cutting-edge models with Microsoft’s enterprise infrastructure, developers and organizations can unlock unprecedented possibilities in natural language processing, generation, and multimodal AI applications.</p>
<p>As AI continues to evolve, Azure OpenAI Service stands at the forefront, offering a robust, secure, and flexible platform for innovation.</p>
<h2 id="heading-next-steps">Next Steps</h2>
<ol>
<li><p><a target="_blank" href="https://portal.azure.com/">Create an Azure account</a></p>
</li>
<li><p><a target="_blank" href="https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/overview">Enable OpenAI service</a></p>
</li>
<li><p>Experiment with different models</p>
</li>
<li><p>Start integrating AI capabilities into your projects #Check Out These as well</p>
</li>
</ol>
<ul>
<li><p><a target="_blank" href="https://pratikpathak.com/app-service-6-months-in-just-5-minutes/">What I Learned About App Service: 6 Months in Just 5 Minutes</a></p>
</li>
<li><p><a target="_blank" href="https://pratikpathak.com/azure-openai-zero-to-hero/">Azure OpenAI: Zero to Hero – A Complete Integration Guide</a></p>
</li>
<li><p><a target="_blank" href="https://pratikpathak.com/coordinator-speaker-at-tech24vision/">Coordinator/Speaker at Tech24Vision</a></p>
</li>
<li><p><a target="_blank" href="https://pratikpathak.com/azure-ai-services-building-tomorrows-intelligence/">Azure AI Services: Building Tomorrow’s Intelligence, Today 🤖</a></p>
</li>
<li><p><a target="_blank" href="https://pratikpathak.com/lets-learn-git-and-github-workshop-at-gat/">Let’s Learn Git and GitHub Workshop at GAT</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[What I Learned About App Service: 6 Months in Just 5 Minutes]]></title><description><![CDATA[Azure App Service is packed with features that simplify your development journey with automated updates, flexible deployment options (GitHub, Docker Hub, Azure DevOps), and global hosting across Microsoft’s data centers. With built-in compliance to s...]]></description><link>https://hashnode.pratikpathak.com/what-i-learned-about-app-service-6-months-in-just-5-minutes</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/what-i-learned-about-app-service-6-months-in-just-5-minutes</guid><category><![CDATA[Azure]]></category><category><![CDATA[appservices]]></category><category><![CDATA[Azure App Service]]></category><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Tue, 10 Dec 2024 18:06:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1733853775140/8b57bc2b-289f-4923-9b43-833b729ea4cd.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p>Azure App Service is packed with features that simplify your development journey with automated updates, flexible deployment options (GitHub, Docker Hub, Azure DevOps), and global hosting across Microsoft’s data centers. With built-in compliance to standards like ISO, SOC, and PCI, it ensures security and scalability for your applications, making it the ideal platform for modern development.</p>
<h2 id="heading-introduction-to-azure-app-service"><strong>Introduction to Azure App Service</strong></h2>
<p>Azure App Service is a complete managed platform-as-a-service (PaaS) offering from Microsoft designed to simplify the complexity of hosting web applications, REST APIs, and mobile backends.</p>
<p>It offers first-class support for multiple programming languages and frameworks, including .NET, Java, Python, Node.js, and more. This allows developers to focus on creating great software without worrying about infrastructure management.</p>
<p>Whether you’re deploying a website for a small business or a global enterprise, Azure App Service scales seamlessly to meet all customer needs.</p>
<h2 id="heading-why-choose-azure-app-service">Why Choose Azure App Service?</h2>
<p>Azure App Service stands out due to its rich feature set and unparalleled flexibility. One of its most compelling features is automated platform management, which handles updates for the underlying operating system and application frameworks. This means you spend less time worrying about patches and more time building your application.</p>
<p>App Service also supports containerization, where developers can deploy custom Linux or Windows containers. This makes running applications that require a specific runtime environment or configuration easy.</p>
<p>From a security point of view, Azure adheres to international standards like ISO, SOC, and PCI, which helps to keep businesses handling sensitive information at ease.</p>
<h2 id="heading-what-makes-azure-app-service-special">What Makes Azure App Service Special?</h2>
<p>It is an HTTP-based platform that can fit so many different types of applications. Developers can use this to host traditional web applications, build modern serverless APIs, or create strong mobile backends. With Azure App Service, developers could work with a vast language as it is flexible. A team can work on applications using technologies they already use.</p>
<p>Azure also integrates deeply with DevOps pipelines, enabling continuous integration and deployment from platforms like Azure DevOps, GitHub, and Docker Hub. With App Service, you can deploy in seconds, ensuring your updates reach users faster.</p>
<h2 id="heading-hosting-options-app-service-plans-vs-app-service-environments"><strong>Hosting Options: App Service Plans vs. App Service Environments</strong></h2>
<p>Azure App Service offers two main hosting options to meet the various needs of applications: App Service Plans and App Service Environments (ASE). These hosting options determine the compute resources and levels of isolation available to your applications</p>
<h3 id="heading-app-service-plans"><strong>App Service Plans</strong></h3>
<p>It will decide your application’s compute resources in terms of virtual machines allocated to it. Some considerations of App Service Plan are a region, pricing tier, and scale type. Depending on the necessity of your application, there are several tiers:</p>
<ul>
<li><p><strong>Shared Compute</strong> : Suitable for development, testing, and training because it is economical; not preferable for production workloads.</p>
</li>
<li><p><strong>Dedicated Compute</strong> : Three tiers: Basic, Standard, and Premium – increases performance, scaling, and additional features.</p>
</li>
<li><p><strong>Isolated Tier</strong> : For enterprise applications that have particularly strong compliance requirements it is available, providing the highest isolation of network and compute resources on a Virtual Network (VNet).</p>
</li>
</ul>
<h3 id="heading-app-service-environments-ase"><strong>App Service Environments (ASE)</strong></h3>
<p>For applications requiring enhanced security and full isolation, ASE provides a premium hosting environment. It operates within your Azure Virtual Network, offering total control over network traffic and robust scalability (up to 100 instances per plan). This is ideal for industries like finance, healthcare, and government where compliance and data privacy are critical.</p>
<p>Choose the hosting option correctly to ensure your application’s infrastructure aligns with performance, scalability, and security requirements.</p>
<h2 id="heading-deployment-models-select-your-model">Deployment Models: Select Your Model</h2>
<p>Once you’ve chosen your hosting option, Azure App Service offers two deployment models to suit different scenarios:</p>
<h3 id="heading-public-multitenant-service"><strong>Public Multitenant Service</strong></h3>
<p>This shared hosting environment uses resources across multiple tenants and is, therefore, a cost-effective solution for most applications. It is ideal for businesses with moderate traffic and predictable workloads. Apps under this model can scale up to 30 instances, providing flexibility without the need for dedicated infrastructure.</p>
<h3 id="heading-app-service-environment-ase-v3">App Service Environment (ASE) v3</h3>
<p>For applications that require more isolation and control, ASE v3 provides a fully dedicated hosting environment. It ensures that your application is completely unaffected by other Azure tenants and provides advanced security as it runs within your VNet. With scalability up to 100 instances, ASE v3 is well-suited for mission-critical applications in industries like healthcare and finance.</p>
<h2 id="heading-how-to-deploy-different-applications-on-azure-app-service"><strong>How to Deploy Different Applications on Azure App Service</strong></h2>
<blockquote>
<h3 id="heading-creating-an-app-servicehttpsportalazurecombrowsemicrosoftweb2fsites"><a target="_blank" href="https://portal.azure.com/#browse/Microsoft.Web%2Fsites">Creating an App Service</a></h3>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1733853774225/8bcf4ccf-fe49-4ca4-ac5b-d834408bc502.png" alt="Creating an App Service" /></p>
<blockquote>
<pre><code class="lang-plaintext">**Choose Preferred Model**
</code></pre>
</blockquote>
<h3 id="heading-deploy-aspnet-applications"><strong>Deploy ASP.NET Applications</strong></h3>
<p><strong>Create an App Service:</strong> Go to the Azure portal and create a new App Service for your ASP.NET application.<br /><strong>Select .NET Framework or .NET Core:</strong> Choose the appropriate runtime (either .NET Framework for Windows or .NET Core for Linux).<br /><strong>Publish from Visual Studio:</strong> Use Visual Studio to publish your application directly to Azure. You can also use Azure DevOps for CI/CD.<br /><strong>Configure Application Settings:</strong> Set up any necessary app settings (e.g., connection strings, environment variables) via the Azure portal.<br /><strong>Test the Application:</strong> Once deployed, verify your app is running smoothly by visiting the provided URL.</p>
<h3 id="heading-deploy-nodejs-applications"><strong>Deploy Node.js Applications</strong></h3>
<p><strong>Create an App Service:</strong> Set up a new App Service and select Node.js as the runtime.<br /><strong>Push Code to GitHub or Azure Repos:</strong> Push your application code to a Git repository (e.g., GitHub, Azure Repos).<br /><strong>Set up Continuous Deployment:</strong> Configure Continuous Deployment (CD) through GitHub Actions or Azure DevOps pipelines.<br /><strong>Configure Environment Variables:</strong> Set any required environment variables like database URLs or API keys in the Azure portal.<br /><strong>Deploy and Test:</strong> After deployment, ensure your app works correctly by accessing the public URL.</p>
<h3 id="heading-deploy-php-applications"><strong>Deploy PHP Applications</strong></h3>
<p><strong>Create an App Service:</strong> In the Azure portal, create an App Service and select PHP as the runtime.<br /><strong>Prepare Code for Deployment:</strong> Upload your PHP code via Git, FTP, or Azure DevOps.<br /><strong>Connect to MySQL Database:</strong> If needed, configure and connect to Azure Database for MySQL.<br /><strong>Set Application Settings:</strong> Define any required environment variables or app settings in the Azure portal.<br /><strong>Deploy and Monitor:</strong> After deployment, monitor app performance and troubleshoot any issues using Azure Monitor.</p>
<h3 id="heading-deploy-wordpress-applications"><strong>Deploy WordPress Applications</strong></h3>
<p><strong>Create WordPress App Service:</strong> Go to the Azure Marketplace and deploy a pre-configured WordPress application.<br /><strong>Set Up MySQL Database:</strong> Azure will automatically provision a MySQL database for your WordPress site.<br /><strong>Configure WordPress:</strong> Complete the WordPress setup (e.g., admin credentials) via the browser after deployment.<br /><strong>Customize and Upload Content:</strong> Customize the theme and upload your content through the WordPress admin panel.<br /><strong>Scale and Secure:</strong> Configure auto-scaling based on traffic and secure your site with Azure’s security features.</p>
<h3 id="heading-deploy-java-applications"><strong>Deploy Java Applications</strong></h3>
<p><strong>Create an App Service:</strong> Set up a new App Service and select Java as the runtime.<br /><strong>Push Code to GitHub or Azure Repos:</strong> Push your Java application code to a Git repository.<br /><strong>Set Up Continuous Deployment:</strong> Configure a CI/CD pipeline using Azure DevOps or GitHub Actions to automate deployments.<br /><strong>Configure Java Runtime:</strong> Choose the correct Java version and any specific settings needed for your app.<br /><strong>Test the Application:</strong> Once deployed, test the app by accessing it via the provided URL.</p>
<h3 id="heading-deploy-python-applications"><strong>Deploy Python Applications</strong></h3>
<p><strong>Create an App Service:</strong> In the Azure portal, create a new App Service and select Python as the runtime.<br /><strong>Push Code to GitHub or Azure Repos:</strong> Push your Python code to a Git repository like GitHub.<br /><strong>Configure Database and Storage:</strong> Set up connections to databases (e.g., Azure Database for PostgreSQL or MySQL) or Azure Blob Storage.<br /><strong>Set Up Continuous Deployment:</strong> Use Azure DevOps or GitHub Actions for automated deployment.<br /><strong>Deploy and Monitor:</strong> Once the application is deployed, monitor it using Azure’s built-in diagnostic tools.</p>
<blockquote>
<p><a target="_blank" href="https://pratikpathak.com/azure-ai-services-building-tomorrows-intelligence/">Azure AI Services: Building Tomorrow’s Intelligence, Today 🤖</a></p>
</blockquote>
<iframe sandbox="allow-scripts" src="https://pratikpathak.com/azure-ai-services-building-tomorrows-intelligence/embed/#?secret=DRoQAbXpUO#?secret=CEnAmSDfn0" width="600" height="338"></iframe>

<h3 id="heading-scaling-in-azure-app-service"><strong>Scaling in Azure App Service</strong></h3>
<p>Azure App Service offers both vertical and horizontal scaling to meet your application needs.</p>
<p>Vertical scaling increases the computing power of your instance (e.g., moving from small to medium for more CPU, memory, and storage).<br />Horizontal scaling adds more application instances to handle increased traffic, distributing workloads efficiently across multiple servers.<br />With autoscaling, you can define rules to automatically adjust resources, such as adding more instances when CPU usage exceeds a threshold, ensuring optimal performance and cost control.</p>
<h3 id="heading-monitoring-and-diagnostics"><strong>Monitoring and Diagnostics</strong></h3>
<p>Azure App Service provides robust monitoring tools to track application performance and troubleshoot issues. Built-in diagnostics capture logs on errors, request tracing, and behavior, which can be stored in Azure Storage or analyzed using Azure Monitor or Application Insights for deeper insights.</p>
<p>Application Insights offers advanced features like transaction tracing and anomaly detection, helping you identify bottlenecks and optimize performance.<br />Integrated security monitoring tracks inbound and outbound traffic to ensure your application is secure and highly available.</p>
<h3 id="heading-practical-use-cases"><strong>Practical Use Cases</strong></h3>
<ul>
<li><p>Small Business Websites: Ideal for low-traffic, cost-effective hosting.</p>
</li>
<li><p>Enterprise Applications: Designed for large-scale, compliance-focused deployments.</p>
</li>
<li><p>Mobile Backends: Easy integration with Azure Notification Hub for push notifications.</p>
</li>
<li><p>APIs: High-performance hosting with security and throttling via Azure API Management.</p>
</li>
<li><p>Whether you’re building for small-scale needs or managing global operations, Azure App Service offers the scalability and tools to help your application succeed.</p>
</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<blockquote>
<p>Azure App Service is a one-stop solution for modern application hosting, offering flexibility, security, and scalability. With its robust features, multiple deployment options, and seamless DevOps integration, it empowers businesses to deliver high-quality applications quickly and efficiently.</p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[Azure OpenAI in a single page: Zero to Hero – A Complete Integration Guide]]></title><description><![CDATA[In the fast-moving world of artificial intelligence, Azure OpenAI Service is emerging as a game-changer that bridges the gap between cutting-edge language models and enterprise-grade cloud infrastructure. This innovative service provides developers a...]]></description><link>https://hashnode.pratikpathak.com/azure-openai-in-a-single-page-zero-to-hero-a-complete-integration-guide</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/azure-openai-in-a-single-page-zero-to-hero-a-complete-integration-guide</guid><category><![CDATA[Azure]]></category><category><![CDATA[Azure OpenAI]]></category><category><![CDATA[openai]]></category><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Tue, 10 Dec 2024 18:05:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1733853797587/39048d76-d22d-4665-a5a9-fe18bca7db0b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p>In the fast-moving world of artificial intelligence, Azure OpenAI Service is emerging as a game-changer that bridges the gap between cutting-edge language models and enterprise-grade cloud infrastructure. This innovative service provides developers and organizations direct access to some of the most powerful AI models built by OpenAI, all within the secure and robust Microsoft Azure ecosystem.</p>
<hr />
<h2 id="heading-what-is-azure-openai-service">What is Azure OpenAI Service?</h2>
<p>Azure OpenAI Service is a powerful cloud platform offering REST API access to state-of-the-art language models, including <strong>GPT-4o</strong> , <strong>GPT-4</strong> , <strong>GPT-3.5-Turbo</strong> , and a range of specialized models. Unlike traditional AI services, Azure OpenAI combines the advanced capabilities of OpenAI’s models with Microsoft’s enterprise-level security, compliance, and scalability.</p>
<hr />
<h2 id="heading-why-azure-openai">Why Azure OpenAI ?</h2>
<p>Azure OpenAI is not just another AI tool but a holistic solution designed to transform the way businesses use artificial intelligence. Here are some key advantages:</p>
<ul>
<li><p>From text generation and summarization to image understanding and code translation, Azure OpenAI offers models for virtually every AI-driven task.</p>
</li>
<li><p>Features such as virtual network support, managed identity through Microsoft Entra ID, and strong content filtering make it possible to deploy AI solutions with minimal risk.</p>
</li>
<li><p>Azure integrates responsible AI principles into its models, minimizing harm and promoting the effective use of AI.</p>
</li>
</ul>
<hr />
<h2 id="heading-azure-openai-models">Azure OpenAI Models</h2>
<h3 id="heading-advanced-language-models">Advanced Language Models</h3>
<p>Advanced language models in Azure OpenAI excel in understanding and generating complex natural language. They are designed for applications needing deep reasoning and contextual awareness. A few of the prominent models are</p>
<ul>
<li><p><strong>GPT-4o &amp; GPT-4o Mini</strong> : Latest models with sophisticated reasoning and multimodal abilities.</p>
</li>
<li><p><strong>GPT-4 Series</strong> : Powerful models for complex language understanding and generation.</p>
</li>
<li><p><strong>GPT-3.5-Turbo</strong> : Efficient models for a wide range of natural language tasks.</p>
</li>
</ul>
<h3 id="heading-specialized-models">Specialized Models</h3>
<p>These models have been specifically designed for certain tasks: generating images, speech-to-text capabilities, and more precise similarity analysis. They further support the language models because they are multimodal and domain-specific. The most specialized models in the list include:</p>
<ul>
<li><p><strong>Embeddings</strong> : Converts text into numerical vectors for advanced similarity analysis.</p>
</li>
<li><p><strong>DALL-E</strong> : Generates original images from text descriptions.</p>
</li>
<li><p><strong>Whisper</strong> : Transcribes and translates speech to text.</p>
</li>
<li><p><strong>Text-to-Speech</strong> : Synthesizes spoken language from text (currently in preview).</p>
</li>
</ul>
<hr />
<h2 id="heading-getting-started-with-azure-openai-service">Getting Started with Azure OpenAI Service</h2>
<p>Integration of Azure OpenAI into your projects is straightforward. Follow these steps:</p>
<ol>
<li><p><strong>Create an Azure OpenAI Service resource</strong> in your subscription.</p>
</li>
<li><p><strong>Deploy your desired model</strong> based on project needs.</p>
</li>
<li><p><strong>Begin making calls to APIs</strong> using REST APIs or SDKs.</p>
</li>
</ol>
<p>Whether you’re building intelligent chatbots, generating advanced content, or developing AI-driven applications, Azure OpenAI Service provides the flexibility and power needed with the security you can rely on.</p>
<p>In the upcoming sections of this blog, we’ll dive deep into implementation strategies, best practices, and real-world use cases that showcase the transformative potential of Azure OpenAI Service.</p>
<hr />
<h2 id="heading-core-benefits">Core Benefits</h2>
<h3 id="heading-1-rich-model-selection">1. Rich Model Selection</h3>
<ul>
<li><p>Access to advanced AI models for a wide range of tasks.</p>
</li>
<li><p>Supports capabilities like text-to-image generation, image-to-text understanding, and more.</p>
</li>
</ul>
<h3 id="heading-2-enterprise-grade-security">2. Enterprise-Grade Security</h3>
<ul>
<li><p><strong>Virtual Network Support</strong> : Ensures secure communication within private networks.</p>
</li>
<li><p><strong>Microsoft Entra ID Managed Identity</strong> : Simplifies authentication and access management.</p>
</li>
<li><p><strong>Strong Content Filtering</strong> : Mitigates risks by identifying and blocking harmful or inappropriate content.</p>
</li>
</ul>
<h3 id="heading-3-responsible-ai-framework">3. Responsible AI Framework</h3>
<ul>
<li><p><strong>Ethical AI Design Principles</strong> : Promotes fair, transparent, and accountable use of AI.</p>
</li>
<li><p><strong>Harm Minimization</strong> : Reduces the potential for misuse or unintended consequences.</p>
</li>
</ul>
<hr />
<h2 id="heading-chat-integration-with-azure-openai-service">Chat Integration with Azure OpenAI Service</h2>
<p>This section will guide you step-by-step to authenticate and integrate Azure OpenAI in your project.</p>
<h3 id="heading-step-1-set-up-your-project">Step 1: Set Up Your Project</h3>
<ol>
<li><p><strong>Initialize a new Python project</strong><br /> Open your favorite development environment. We recommend <strong>Visual Studio Code</strong>.</p>
</li>
<li><p><strong>Create and configure your project</strong></p>
</li>
</ol>
<ul>
<li><p>Create a new folder for your project, and open it in the editor.</p>
</li>
<li><p>Initialize a Python virtual environment:</p>
</li>
</ul>
<pre><code class="lang-plaintext">     python -m venv venv
     source venv/bin/activate # On Windows: venv\Scripts\activate
     pip install --upgrade pip
</code></pre>
<ol>
<li><strong>Install required packages</strong></li>
</ol>
<pre><code class="lang-plaintext">pip install python-dotenv openai azure-identity azure-keyvault-secrets
</code></pre>
<ol>
<li><strong>Set up environment variables</strong></li>
</ol>
<ul>
<li><p>Create a <code>.env</code> file in your project folder.</p>
</li>
<li><p>Add the following environment variables:</p>
</li>
</ul>
<pre><code class="lang-plaintext">AZURE_OPENAI_ENDPOINT=&lt;Your Azure OpenAI endpoint&gt;
AZURE_OPENAI_API_KEY=&lt;Your API key&gt; # Omit this if using Key Vault
AZURE_KEY_VAULT_URL=https://&lt;Your-Key-Vault-Name&gt;.vault.azure.net/
</code></pre>
<h3 id="heading-step-2-create-an-azure-openai-service">Step 2: Create an Azure OpenAI Service</h3>
<ol>
<li><p><strong>Log in to the</strong> <a target="_blank" href="https://portal.azure.com"><strong>Azure Portal</strong></a><strong>.</strong></p>
</li>
<li><p><strong>Deploy the Azure OpenAI service:</strong></p>
</li>
</ol>
<ul>
<li><p>Search for <strong>Azure OpenAI Service</strong> and click <strong>Create</strong>.</p>
</li>
<li><p>Select your subscription, resource group, and region, and deploy the service.</p>
</li>
</ul>
<ol start="3">
<li><strong>Copy endpoint and keys:</strong></li>
</ol>
<ul>
<li><p>Navigate to the <strong>Keys and Endpoint</strong> tab in your Azure OpenAI Service.</p>
</li>
<li><p>Copy the <strong>Endpoint</strong> and <strong>Key</strong> for later use.</p>
</li>
</ul>
<h3 id="heading-step-3-optional-set-up-azure-key-vault">Step 3: (Optional) Set Up Azure Key Vault</h3>
<p>For added security, use Azure Key Vault to store your API keys.</p>
<ol>
<li><p><strong>Create a Key Vault</strong></p>
</li>
<li><p>Search for <strong>Azure Key Vault</strong> in the Azure Portal and click <strong>Create</strong>.</p>
</li>
<li><p><strong>Add a new secret</strong></p>
</li>
</ol>
<ul>
<li><p>Name: <code>OpenAIAPIKey</code></p>
</li>
<li><p>Value: Paste your Azure OpenAI API key.</p>
</li>
</ul>
<ol start="3">
<li>Use the following code to retrieve the key from Key Vault:</li>
</ol>
<pre><code class="lang-plaintext">from azure.identity import DefaultAzureCredential
from azure.keyvault.secrets import SecretClient

# Use Azure managed credentials
credential = DefaultAzureCredential()
key_vault_url = "https://your-keyvault.vault.azure.net/"
secret_client = SecretClient(vault_url=key_vault_url, credential=credential)

# Retrieve OpenAI credentials securely
openai_key = secret_client.get_secret("OpenAIAPIKey")
</code></pre>
<h3 id="heading-step-4-comprehensive-chat-implementation">Step 4: Comprehensive Chat Implementation</h3>
<p>Use the following code to implement the chat application:</p>
<pre><code class="lang-plaintext">from typing import List, Dict, Optional
import os
from dotenv import load_dotenv
from openai import AzureOpenAI
import logging
from logging.handlers import RotatingFileHandler

class AzureOpenAIChat:
    def __init__ (
        self, 
        deployment_name: str = "gpt-4o", 
        max_tokens: int = 300, 
        temperature: float = 0.7
    ):
        """
        Initialize Azure OpenAI Chat Client with enhanced configuration.

        Args:
            deployment_name (str): Deployed model name
            max_tokens (int): Maximum response length
            temperature (float): Response creativity
        """
        load_dotenv()

        # Enhanced logging configuration
        self._configure_logging()

        self.client = AzureOpenAI(
            azure_endpoint=os.getenv('AZURE_OPENAI_ENDPOINT'),
            api_key=os.getenv('AZURE_OPENAI_API_KEY'),
            api_version="2024-02-01"
        )

        self.deployment_name = deployment_name
        self.max_tokens = max_tokens
        self.temperature = temperature
        self.conversation_history: List[Dict[str, str]] = []

    def _configure_logging(self):
        """Configure robust logging mechanism."""
        logging.basicConfig(
            level=logging.INFO,
            format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
            handlers=[
                RotatingFileHandler(
                    'azure_openai_chat.log', 
                    maxBytes=10*1024*1024, # 10MB
                    backupCount=5
                ),
                logging.StreamHandler()
            ]
        )
        self.logger = logging.getLogger( __name__ )

    def start_conversation(
        self, 
        system_prompt: str = "You are a helpful AI assistant"
    ) -&gt; None:
        """Initialize conversation with system context."""
        self.conversation_history = [
            {"role": "system", "content": system_prompt}
        ]
        self.logger.info("Conversation initialized")

    def add_user_message(self, message: str) -&gt; None:
        """Add user message to conversation."""
        self.conversation_history.append({
            "role": "user", 
            "content": message
        })
        self.logger.info(f"User message added: {message[:50]}...")

    def generate_response(
        self, 
        max_tokens: Optional[int] = None,
        temperature: Optional[float] = None
    ) -&gt; Optional[str]:
        """Generate AI response with configurable parameters."""
        try:
            response = self.client.chat.completions.create(
                model=self.deployment_name,
                messages=self.conversation_history,
                max_tokens=max_tokens or self.max_tokens,
                temperature=temperature or self.temperature
            )

            ai_response = response.choices[0].message.content

            if ai_response:
                self.conversation_history.append({
                    "role": "assistant", 
                    "content": ai_response
                })
                self.logger.info("Response generated successfully")
                return ai_response

            self.logger.warning("Empty response received")
            return None

        except Exception as e:
            self.logger.error(f"Response generation error: {e}")
            return None

    def reset_conversation(self) -&gt; None:
        """Reset conversation history."""
        self.conversation_history = []
        self.logger.info("Conversation reset")

def main():
    chat = AzureOpenAIChat()
    chat.start_conversation(
        "You are a technical assistant specializing in cloud computing"
    )

    try:
        while True:
            user_input = input("You: ")
            if user_input.lower() in ['exit', 'quit']:
                break

            chat.add_user_message(user_input)
            response = chat.generate_response()

            if response:
                print("AI:", response)

    except KeyboardInterrupt:
        print("\nConversation terminated.")
    finally:
        chat.reset_conversation()

if __name__ == " __main__":
    main()
</code></pre>
<h3 id="heading-step-5-run-your-application">Step 5: Run Your Application</h3>
<ol>
<li><p>Save the above code as <code>azure_chat.py</code>.</p>
</li>
<li><p>Run the script:</p>
</li>
</ol>
<pre><code class="lang-plaintext">python azure_chat.py
</code></pre>
<ol>
<li>Interact with the AI in the terminal. Type <code>exit</code> to terminate the session.</li>
</ol>
<p>Your <strong>chat application</strong> is now <strong>ready</strong> to be integrated into your project or deployed to production! 🎉</p>
<h3 id="heading-key-implementation-features">Key Implementation Features</h3>
<p><strong>Flexible Configuration</strong></p>
<ol>
<li><p>Dynamic model selection</p>
</li>
<li><p>Configurable response parameters</p>
</li>
<li><p>Secure credential management</p>
</li>
</ol>
<p><strong>Conversation Management</strong></p>
<ol>
<li><p>Maintain conversation context</p>
</li>
<li><p>Easy message appending</p>
</li>
<li><p>Simple conversation reset</p>
</li>
</ol>
<p><strong>Error Handling</strong></p>
<ol>
<li><p>Comprehensive exception management</p>
</li>
<li><p>Robust logging for debugging</p>
</li>
<li><p>Graceful error recovery</p>
</li>
</ol>
<hr />
<h3 id="heading-best-practices">Best Practices</h3>
<ol>
<li><p>Use <strong>environment variables</strong> for sensitive information</p>
</li>
<li><p>Implement <strong>comprehensive error logging</strong></p>
</li>
<li><p>Configure <strong>appropriate token limits</strong></p>
</li>
<li><p>Manage <strong>conversation history efficiently</strong></p>
</li>
<li><p>Leverage <strong>Azure’s advanced security features</strong></p>
</li>
</ol>
<p><strong><em>Recommended</em></strong> <code>.env</code> Configuration</p>
<hr />
<pre><code class="lang-plaintext">AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_API_KEY=your_secure_api_key
</code></pre>
<h3 id="heading-limitations-and-considerations">Limitations and Considerations</h3>
<p>While Azure OpenAI Service offers remarkable capabilities, it’s crucial to understand its limitations:</p>
<ol>
<li><p>Token-based pricing can become expensive for high-volume applications</p>
</li>
<li><p>Some models have <strong>context length restrictions</strong></p>
</li>
<li><p>Occasional <strong>API latency</strong> might impact real-time applications</p>
</li>
<li><p><strong>Continuous model updates</strong> require adaptation</p>
</li>
</ol>
<hr />
<hr />
<h2 id="heading-frequently-asked-questions">Frequently Asked Questions</h2>
<h3 id="heading-q-how-do-i-choose-the-right-model">Q: How do I choose the right model?</h3>
<p>To choose the right model, consider using GPT-3.5-Turbo for cost-effective, general tasks. For more complex reasoning or high-accuracy requirements, opt for GPT-4. If your project requires multimodal capabilities, GPT-4o is the most advanced option.</p>
<h3 id="heading-q-what-are-the-main-differences-between-models">Q: What are the main differences between models?</h3>
<p>The main differences between models lie in the complexity of reasoning, contextual understanding, computational resources required, and cost per token.</p>
<h3 id="heading-q-how-can-i-integrate-azure-openai-into-my-project">Q: How can I integrate Azure OpenAI into my project?</h3>
<p>To integrate Azure OpenAI into your project, start by creating an Azure OpenAI resource in your subscription. Deploy the model you want to use, then call the APIs via REST or SDKs, and begin building your application.</p>
<h3 id="heading-q-is-there-a-cost-associated-with-using-azure-openai">Q: Is there a cost associated with using Azure OpenAI?</h3>
<p>Yes, Azure OpenAI is a paid service. Pricing depends on the model you use and the number of tokens processed. For more details, please refer to <a target="_blank" href="https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/">Azure’s pricing page</a>.</p>
<h3 id="heading-q-what-security-features-does-azure-openai-offer">Q: What security features does Azure OpenAI offer?</h3>
<p>Azure OpenAI provides robust security features, including virtual network support for secure communication, managed identity via Microsoft Entra ID, content filtering to ensure safe interactions, and compliance with industry standards like GDPR and HIPAA.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Azure OpenAI Service represents a pivotal moment in democratizing advanced AI capabilities. By combining OpenAI’s cutting-edge models with Microsoft’s enterprise infrastructure, developers and organizations can unlock unprecedented possibilities in natural language processing, generation, and multimodal AI applications.</p>
<p>As AI continues to evolve, Azure OpenAI Service stands at the forefront, offering a robust, secure, and flexible platform for innovation.</p>
<h2 id="heading-next-steps">Next Steps</h2>
<ol>
<li><p><a target="_blank" href="https://portal.azure.com/">Create an Azure account</a></p>
</li>
<li><p><a target="_blank" href="https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/overview">Enable OpenAI service</a></p>
</li>
<li><p>Experiment with different models</p>
</li>
<li><p>Start integrating AI capabilities into your projects #Check Out These as well</p>
</li>
</ol>
<ul>
<li><p><a target="_blank" href="https://pratikpathak.com/app-service-6-months-in-just-5-minutes/">What I Learned About App Service: 6 Months in Just 5 Minutes</a></p>
</li>
<li><p><a target="_blank" href="https://pratikpathak.com/azure-openai-zero-to-hero/">Azure OpenAI: Zero to Hero – A Complete Integration Guide</a></p>
</li>
<li><p><a target="_blank" href="https://pratikpathak.com/coordinator-speaker-at-tech24vision/">Coordinator/Speaker at Tech24Vision</a></p>
</li>
<li><p><a target="_blank" href="https://pratikpathak.com/azure-ai-services-building-tomorrows-intelligence/">Azure AI Services: Building Tomorrow’s Intelligence, Today 🤖</a></p>
</li>
<li><p><a target="_blank" href="https://pratikpathak.com/lets-learn-git-and-github-workshop-at-gat/">Let’s Learn Git and GitHub Workshop at GAT</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Azure AI Services: Building Tomorrow’s Intelligence, Today 🤖]]></title><description><![CDATA[Have you ever run into any of the following types of questions in the process of developing an application?

How can I get my application to understand customer messages?

Can I include automatic detection of offending content in user uploads?

How c...]]></description><link>https://hashnode.pratikpathak.com/azure-ai-services-building-tomorrows-intelligence-today</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/azure-ai-services-building-tomorrows-intelligence-today</guid><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Sat, 23 Nov 2024 15:26:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1732644852290/a9c05ec4-e93b-4d60-8b4f-c83b2a06c904.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p>Have you ever run into any of the following types of questions in the process of developing an application?</p>
<ul>
<li><p>How can I get my application to understand customer messages?</p>
</li>
<li><p>Can I include automatic detection of offending content in user uploads?</p>
</li>
<li><p>How can I include voice commands without writing everything from scratch?</p>
</li>
</ul>
<p>And then you find out:</p>
<ul>
<li><p>For building AI features, one needs a deep understanding of machine learning</p>
</li>
<li><p>Huge data sets would be required in order to train custom models</p>
</li>
<li><p>The majority of AI solutions are complex and hard to maintain</p>
</li>
<li><p>Basic AI features may take months to implement</p>
</li>
</ul>
<h2 id="heading-introducing-azure-ai-services-your-instant-ai-toolkit">Introducing Azure AI Services: Your Instant AI Toolkit ⚡</h2>
<p>Just imagine having your AI Swiss Army knife in the form of Azure AI Services. Forget those months spent learning algorithms for machine learning or training models; you have pre-built capabilities in the simple API calls.</p>
<h2 id="heading-what-are-azure-ai-services">What are Azure AI services?</h2>
<p>Azure AI services is a collection of cloud-based artificial intelligence tools and technologies developed by Microsoft. Developers as well as organizations can easily and quickly build intelligent, market-ready and responsible applications through these services by offering out-of-the-box as well as customizable APIs and models.</p>
<p>Some of the major Azure AI services include:</p>
<ul>
<li><p><strong>Azure OpenAI Service</strong> : Enable a wide variety of natural language processing tasks.</p>
</li>
<li><p><strong>Azure AI Search</strong> : Brings AI-powered cloud search to mobile and web applications.</p>
</li>
<li><p><strong>Speech</strong> : Speech-to-text, text-to-speech, translation, and speaker recognition.</p>
</li>
<li><p><strong>Content Safety</strong> : Uses computer vision for automatic detection of unwanted or inappropriate content.</p>
</li>
<li><p><strong>Document Intelligence</strong> : Turn documents into data-driven intelligent solutions.</p>
</li>
<li><p><strong>Vision</strong> : Analyze content in images and video.</p>
</li>
<li><p><strong>Face</strong> : Detect and identify people and their emotions in images.</p>
</li>
<li><p><strong>Custom Vision</strong> : Develops the application of image recognition with solutions tailor-made for business needs.</p>
</li>
<li><p><strong>Immersive Reader</strong> : Enhance reading and understanding of text.</p>
</li>
<li><p><strong>Language</strong> : Power the industry’s leading natural understanding capabilities.</p>
</li>
<li><p><strong>Translator</strong> : Leverage AI-powered translation technology for more than 100 languages.</p>
</li>
<li><p><strong>Video Indexer</strong> : Extracts actionable insights from videos.</p>
</li>
</ul>
<p>These Azure AI services cover the whole end-to-end usage case scope, including natural language processing and computer vision for speech recognition and language translation. They could be available through REST APIs and client library SDKs to be integrated into applications.</p>
<h3 id="heading-azure-openai-service">Azure OpenAI Service</h3>
<p>Azure OpenAI Service provides access to the powerful language models of OpenAI, including GPT-4, GPT-3.5, and many others through REST API. It allows developers to easily add capabilities of advanced natural language processing to a wide range of applications that might be necessary for generating content, summarizing, and translation among others.</p>
<h4 id="heading-key-features-of-azure-openai-service">Key Features of Azure OpenAI Service</h4>
<ul>
<li><p>State-of-the-art language models, including GPT-4, GPT-3.5, and many more.</p>
</li>
<li><p>Tailor models to a specific use case with fine-tuning services</p>
</li>
<li><p>Enterprise-ready security, virtual network support, private link, and managed identity</p>
</li>
<li><p>Responsible AI principles and content filtering for abuse and unintended harm</p>
</li>
<li><p>All Azure services, including integration with Azure AI Studio, to explore and fine-tune models</p>
</li>
</ul>
<p>Azure OpenAI Service has a free tier and paid versions, allowing organizations of all sizes to leverage the advanced language AI capabilities. Pricing is based on usage, with a pay-as-you-go model that scales dynamically based on the organization’s requirements.</p>
<h3 id="heading-azure-ai-search">Azure AI Search</h3>
<p>Azure AI Search is an entirely enterprise-ready system for search and retrieval with a full solution set of advanced search technologies such as vector search, full-text search, and hybrid search. It is here to power high-performance search applications at any scale, therefore ideally suited for traditional as well as generative AI scenarios.</p>
<h4 id="heading-core-features-of-azure-ai-search">Core Features of Azure AI Search</h4>
<ul>
<li><p>Powerful search engine for vector, text, and hybrid search over a custom search index.</p>
</li>
<li><p>Robust indexing capabilities that comprise integrated data chunking, vectorization, and applied AI to extract and transform the content.</p>
</li>
<li><p>Support for advanced query syntax with features that include vector queries, text search, fuzzy search, auto-complete, and many more.</p>
</li>
<li><p>Semantic ranking, scoring of profiles, and query control parameters to tune query performance and relevance.</p>
</li>
<li><p>Seamless interoperability with other Azure services, including Azure OpenAI, Azure Machine Learning, and Azure data sources.</p>
</li>
</ul>
<p>Pricing for Azure AI Search is based upon a pricing model that goes by search unit capacity but also by the number of queries; organizations can dynamically scale the service up or down, depending on requirements.</p>
<h3 id="heading-azure-speech-service">Azure Speech Service</h3>
<p>Azure Speech Service is an all-encompassing set of speech-enabled capabilities that developers can easily use in their applications. This includes:</p>
<h4 id="heading-key-features-of-azure-speech-service">Key Features of Azure Speech Service</h4>
<ul>
<li><p>Real-time captioning, call center automation, and voice-based interactions via speech-to-text transcription</p>
</li>
<li><p>Converting text to speech with a wide range of natural-sounding and customizable neural voices</p>
</li>
<li><p>Speech translation to enable multilingual experiences and accessibility</p>
</li>
<li><p>Supporting more than 100 languages and dialects, which makes it feasible for use across the globe</p>
</li>
<li><p>Tiered pricing model with free as well as pay-as-you-go plans to suit different needs in usage</p>
</li>
</ul>
<p>Azure Speech Service offers a tiered pricing model with free and pay-as-you-go plans to suit different usage needs.</p>
<h3 id="heading-azure-ai-content-safety">Azure AI Content Safety</h3>
<p>Azure AI Content Safety is an extremely robust service that enables organizations to identify and moderate harmful user-generated or AI-generated content on their applications and services. Its key features are as follows:</p>
<h4 id="heading-core-features-of-azure-ai-content-safety">Core Features of Azure AI Content Safety</h4>
<ul>
<li><p>Text and image analysis to detect sexual content, violence, hate speech, and self-harm</p>
</li>
<li><p>Prompt Shields that detect attempts by AI-generated text to manipulate users</p>
</li>
<li><p>Groundedness Detection-ensures AI’s response is grounded to the provided source materials</p>
</li>
<li><p>Content moderation workflows and sensitivity settings can be customized</p>
</li>
<li><p>Intuitive Content Safety Studio to play around with in terms of moderation capabilities</p>
</li>
<li><p>Flexible pricing, so we have both a free and paid tier to fit organizations of all sizes</p>
</li>
</ul>
<p>Azure AI Content Safety offers both a free tier and paid plans to accommodate organizations of all sizes. Pricing is based on the volume of content processed through the service.</p>
<h3 id="heading-azure-ai-document-intelligence">Azure AI Document Intelligence</h3>
<p>Azure AI Document Intelligence is a cloud service that enables users to build and deploy intelligent document processing. It allows organizations to unlock new insights from the vast amounts of data locked away in various forms and documents.</p>
<h4 id="heading-key-features-of-azure-ai-document-intelligence">Key Features of Azure AI Document Intelligence</h4>
<ol>
<li><p><strong>General Extraction Models</strong> : Enriches text extraction from forms and documents, returning structured business-ready content. Provides text recognition, layout extraction, and data structuring capabilities.</p>
</li>
<li><p><strong>Pre-built Models</strong> : Pre-trained models ready to go for most document types, like bank statements, invoices, tax forms, and contracts. Enable businesses to add intelligent document processing to applications and workflows in days, not months or years, without having to develop a custom model.</p>
</li>
<li><p><strong>Custom Models</strong> : More options for document field extraction, custom classification, and composed models for complicated scenarios.</p>
</li>
<li><p><strong>Add-on Capabilities</strong> : Optional features such as high-resolution OCR, formula extraction, font analysis, or barcode recognition. Introduces support for searchable PDF output which enables advanced querying and information retrieval.</p>
</li>
</ol>
<p>Pricing for Azure AI Document Intelligence is by the number of documents processed. There’s both a free tier and paid tiers, so that organizations can prototype and add the service without requiring too much upfront investment and scale when their document processing needs increase.</p>
<h3 id="heading-azure-ai-vision">Azure AI Vision</h3>
<p>Azure AI Vision gives access to complex algorithms of computer vision for any image analysis and processing purposes in several intelligent applications.</p>
<h4 id="heading-core-features-of-azure-ai-vision">Core Features of Azure AI Vision</h4>
<ol>
<li><p><strong>Optical Character Recognition (OCR)</strong>: Extracts text from any image-recorded picture, document, receipts, posters, or whiteboards whether printed or handwritten. Text can be extracted in several languages using the models based on deep learning.</p>
</li>
<li><p><strong>Image Analysis</strong> : Detects and recognizes objects, faces, adult content, and automatically creates text captions for images. Provides a complete vision AI capability for asset management as well as for content understanding.</p>
</li>
<li><p><strong>Face Detection</strong> : Detects, identifies, and analyzes human faces within an image. Allows scenarios such as identification, touchless access control, and face blurring for privacy.</p>
</li>
<li><p><strong>Video Analysis</strong> : Includes capabilities such as Spatial Analysis to automatically detect and follow who is in and where they are in a video stream. Provides Video Retrieval as a capability to enable video indexes to be indexed and searchable.</p>
</li>
</ol>
<p>Images for Azure AI Vision must be of JPEG, PNG, GIF, or BMP format and less than 4 MB in size with dimensions greater than 50 x 50 pixels.</p>
<p>Pricing is by API calls and is both free as well as paid. This means that any organization can go exploring and start integrating the service without a huge initial outlay.</p>
<h3 id="heading-azure-face-service">Azure Face Service</h3>
<p>Azure Face Service contains AI algorithms to identify, detect, and analyze images for a human face. It offers support for a range of functionalities including facial recognition, liveness detection, and face analysis.</p>
<h4 id="heading-key-features-of-azure-face-service">Key Features of Azure Face Service</h4>
<ul>
<li><p>Detection and analysis of face, including attributes such as head pose, age, emotion, facial hair, and glasses</p>
</li>
<li><p>Verification of face to establish identity (“one-to-one” matching)</p>
</li>
<li><p>Face identification (“one-to-many” matching) for comparing a face to a collection of known faces</p>
</li>
<li><p>Liveness detection prevents spoofing attacks using printed photos, recorded videos, or 3D masks</p>
</li>
<li><p>Flexible integration via client SDKs, REST APIs, and the Azure Vision Studio</p>
</li>
</ul>
<p>Pricing for Azure Face Service is provided based on volume of API transactions and accommodates free and paid tiers so organizations could try and deploy facial recognition capabilities within their applications without ever doing any major upfront investment.</p>
<h3 id="heading-azure-custom-vision">Azure Custom Vision</h3>
<p>The service is developing and deploying a custom image classification and object detection model. It lets you define your own labels and train models to detect them in images.</p>
<h4 id="heading-core-features-of-azure-custom-vision">Core Features of Azure Custom Vision</h4>
<ul>
<li><p>Custom image classification: The service applies user-defined labels to entire images</p>
</li>
<li><p>Custom object detection- the service detects and describes the location of objects in an image</p>
</li>
<li><p>Image remnants of a number of different types: JPEG, PNG, GIF, and BMP.</p>
</li>
<li><p>Ease of training and optimization-for example, can choose versions of algorithms suitable for the domain</p>
</li>
<li><p>Develop through client SDKs, REST APIs, and the Custom Vision web portal</p>
</li>
</ul>
<p>Pricing for Azure Custom Vision is transaction-based, so one can have both free and paid editions of it. The free version enables organizations to experiment and include custom image recognition capabilities in their applications without a large upfront cost.</p>
<h3 id="heading-azure-ai-language">Azure AI Language</h3>
<p>Azure AI Language is the text understanding and analysis in the cloud-based service, using a suite of Natural Language Processing features. It incorporates the various services of existing Azure AI services: Text Analytics, QnA Maker, Language Understanding (LUIS), and more.</p>
<h4 id="heading-key-features-of-azure-ai-language">Key Features of Azure AI Language</h4>
<ol>
<li><p><strong>NER</strong> : This deals with the tagging of entities in the text into predefined categories, such as people, events, places, and so on.</p>
</li>
<li><p><strong>PII and PHI detection</strong> : It detects PII and PHI in text that obliterates the sensitive information.</p>
</li>
<li><p><strong>Sentiment Analysis and Opinion Mining</strong> : It detects the existence of positive or negative sentiments and association of aspects to text.</p>
</li>
<li><p><strong>Language Detection</strong> : The language in which a document is written is detected and the code for its language returned.</p>
</li>
<li><p><strong>Summarization</strong> : This provides summaries of both documents and conversations based on the most relevant information.</p>
</li>
</ol>
<p>The good thing about Azure AI Language is that its pricing model is free as well as paid services. This flexible approach helps organizations start small and then scale up the usage of their language-processing capacity based on demand.</p>
<h3 id="heading-azure-ai-translator">Azure AI Translator</h3>
<p>Azure AI Translator is a neural machine translation service, running on a cloud platform, which enables the construction of intelligent multilingual solutions for the realization of real-time text translation and of asynchronous batch documents, in addition to the building of your own customized models for translation for domain-specific language and terminology.</p>
<h4 id="heading-core-features-of-azure-ai-translator">Core Features of Azure AI Translator</h4>
<p><strong>Text Translation</strong> : Translate text in real-time among supported source and target languages. Dynamic Dictionary support, and learning how to block translations with Translator API.</p>
<p><strong>Document Translation</strong> :</p>
<ul>
<li><p><strong>Asynchronous Batch Translation</strong> : Translate complex files in batches, preserving the original documents’ structure and format. To perform asynchronous batch translation, you need to have an Azure Blob storage account.</p>
</li>
<li><p><strong>Synchronous Single File Translation</strong> : Translate separate document files, optionally with a glossary file, in the source file format. DOES NOT REQUIRE AN AZURE BLOB STORAGE ACCOUNT.</p>
</li>
</ul>
<p><strong>Custom Translator</strong> : Build custom translation models to handle domain-specific language, terminology, and style. Create custom dictionaries in phrases or sentence-based for specialty translations.</p>
<p>Both tiers, free and paid, come with pricing based on the number of characters translated. The flexible pricing model allows businesses to get started, give the service a try, and scale their translation needs as necessary.</p>
<h3 id="heading-azure-ai-video-indexer">Azure AI Video Indexer</h3>
<p>Azure AI Video Indexer is a cloud application using high-class AI models to extract deep insights from video and audio content. Azure AI Video Indexer is one of the members of the family of Azure AI services built on top of several other Azure AI services like Face, Translator, Vision, and Speech.</p>
<h4 id="heading-key-features-of-azure-ai-video-indexer">Key Features of Azure AI Video Indexer</h4>
<ol>
<li><p><strong>Video &amp; Audio Analysis</strong> : Analyzes video and audio content over running more than 30 AI models that are designed to generate a very broad view of the available insights. The ones include; Face detection and celebrity identification, OCR and visual content moderation, Scene and shot detection, keyframe extraction, and slate detection, Audio transcription, language detection, and speaker enumeration.</p>
</li>
<li><p><strong>Deep Search</strong> : Using the essence of these extractions, Deep Search ability will be thrown upon searching across one’s video library; in other words, where somebody was speaking specific words or when two people were featured together within the same clip.</p>
</li>
<li><p><strong>Content Creation</strong> : Using timestamp extraction, keyframes and metadata, users can mean much more to have a meaningful trailer, highlight reel, and any video-based content in particular.</p>
</li>
<li><p><strong>Accessibility</strong> : Transcription and translation of video content in various languages makes it accessible to those who are disabled or belong from a different region.</p>
</li>
<li><p><strong>Monetization</strong> : With an increase in signals of relevant keywords, entities, and sentiments, the value of video itself increases, which may be used for targeted advertisements.</p>
</li>
<li><p><strong>Content Moderation</strong> : Various models of textual as well as image content moderation have been used for detecting and flagging inappropriate content.</p>
</li>
</ol>
<p>The price for Azure AI Video Indexer is pretty simple: video processed minutes with free and paid-for tiers available to an organization’s need.</p>
<h3 id="heading-azure-ai-immersive-reader">Azure AI Immersive Reader</h3>
<p>Immersive Reader is an inclusively designed part of Azure AI services, which applies rigorously researched methods to bolster the reading comprehension of new readers, language learners, and people with learning differences like dyslexia. Developers can uniformly integrate accessibility features into web applications using the Immersive Reader client library.</p>
<h4 id="heading-core-features-of-azure-ai-immersive-reader">Core Features of Azure AI Immersive Reader</h4>
<ol>
<li><p>It separates text to enhance general readability and concentration.</p>
</li>
<li><p>It shows images of the most common words: The Immersive reader will show images of those words that are most often used to have better understanding.</p>
</li>
<li><p>Underlines nouns, verbs, adjectives, and many more: The Immersive Reader underlines the nouns, verbs, pronouns and many more in such a way that grammar will become easy to understand.</p>
</li>
<li><p>Read text aloud: It provides some of the fundamental capabilities to read the text aloud and hence supports good comprehension.</p>
</li>
<li><p><strong>Translate Content in Real-time</strong> : The Immersive Reader translates text into a number of languages in real time so that language learners can understand the content.</p>
</li>
<li><p><strong>Split Words into Syllables</strong> : The Immersive Reader splits words into syllables so that it eases the task of reading and sounding out words when unfamiliar with them.</p>
</li>
</ol>
<p>Azure AI Immersive Reader has a pricing model based on the character processed. It offers free and paid alternatives and those are based on different needs various organizations and businesses will need regarding the usage cases.</p>
<h2 id="heading-faq">FAQ</h2>
<h3 id="heading-1-what-is-the-difference-between-azure-ai-services-and-other-cloud-based-ai-platforms">1. What is the difference between Azure AI Services and other cloud-based AI platforms?</h3>
<p>Azure AI Services are a comprehensive suite of cloud-based AI tools and technologies developed by Microsoft. Compared to other cloud platforms, Azure AI Services offer a wide range of pre-built and customizable AI models, seamless integration with the broader Azure ecosystem, and a focus on responsible AI principles, such as ethical considerations and data privacy.</p>
<h3 id="heading-2-how-do-i-choose-the-right-azure-ai-service-for-my-specific-use-case">2. How do I choose the right Azure AI Service for my specific use case?</h3>
<p>When choosing the right Azure AI Service, it’s important to assess your specific requirements and use case. Consider the type of AI functionality you need (e.g., natural language processing, computer vision, speech recognition), the scale and complexity of your application, and any unique industry or domain-specific needs. The Azure AI documentation and consultation with Microsoft experts can help you identify the optimal service(s) for your project.</p>
<h3 id="heading-3-can-i-customize-the-pre-built-models-and-services-provided-by-azure-ai">3. Can I customize the pre-built models and services provided by Azure AI?</h3>
<p>Yes, Azure AI Services offer a range of customization capabilities. For example, you can fine-tune the language models in Azure OpenAI Service or build custom computer vision models using Azure Custom Vision. The level of customization depends on the specific service, but Azure AI provides the tools and flexibility to tailor the AI capabilities to your unique business requirements.</p>
<p><strong>Ready to transform your applications with AI? Explore Azure AI Services and unlock the potential of intelligent technologies today!</strong></p>
]]></content:encoded></item><item><title><![CDATA[25+ Python Bokeh Example. Learn python Bokeh]]></title><description><![CDATA[Representing your data in Python is one of the crucial steps, usually whenever I deal with data I just simply use dp.head() (as we do in pandas) and that's it, but it has many disadvantages. Later I found out about the python bokeh which can create i...]]></description><link>https://hashnode.pratikpathak.com/25-python-bokeh-example-learn-python-bokeh</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/25-python-bokeh-example-learn-python-bokeh</guid><category><![CDATA[python bokeh]]></category><category><![CDATA[python graph]]></category><category><![CDATA[Python]]></category><category><![CDATA[Data Science]]></category><category><![CDATA[data]]></category><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Sun, 14 Apr 2024 06:16:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1713075208002/9d649a62-3719-45a5-a1b6-e32a07364693.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p>Representing your data in Python is one of the crucial steps, usually whenever I deal with data I just simply use <code>dp.head()</code> (as we do in pandas) and that's it, but it has many disadvantages. Later I found out about the python bokeh which can create interactive graphs. Here I will show you a list of 25+ Python Bokeh examples to learn Python Bokeh.</p>
<p>Python Bokeh is one of the best Python packages for data visualization. Today we are going to see some Python Bokeh Examples. I have also provided the Python Bokeh project source code GitHub. Learn this easy visualization tool and add it to your Python stack.</p>
<h2 id="heading-what-is-python-bokeh">What is Python Bokeh?</h2>
<p>Python <a target="_blank" href="https://bokeh.org/">Bokeh</a> is a data visualization tool or we can also say Python Bokeh is used to plot various types of graphs. There are various other graph plotting libraries like matplotlib but Python Bokeh graphs are dynamic in nature means you can interact with the generated graph. See the below examples…</p>
<h2 id="heading-installation">Installation 💻:</h2>
<p>Python Bokeh can be easily installed using PIP. You can install the Python Bokeh easily by running the command:</p>
<pre><code class="lang-javascript">pip install bokeh
</code></pre>
<p>Now everything is ready let’s go through the examples 🏃‍♂️…</p>
<h2 id="heading-1-lineplot">1. LinePlot</h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
x = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>]
y = [<span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">3</span>]
p = figure(title=<span class="hljs-string">"{LinePlot Python Bokeh Example"</span>)
p.line(x, y, line_width=<span class="hljs-number">2</span>)
output_notebook()
show(p)
</code></pre>
<p><a target="_blank" href="https://colab.research.google.com/drive/1hQD7qMu5rbhV8JQ6gZ61drGiTQfUOyTE?usp=sharing">Live Preview</a> | <a target="_blank" href="https://github.com/zpratikpathak/25-Python-Bokeh-Example">Source Code</a> | <a target="_blank" href="https://github.com/zpratikpathak/25-Python-Bokeh-Example">🌿 Contribute</a></p>
<h2 id="heading-2-scatter-plot">2. <strong>Scatter Plot</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
x = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>]
y = [<span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">3</span>]
p = figure(title=<span class="hljs-string">"Scatter Plot Python Bokeh Example by PratikPathak.com"</span>)
p.circle(x, y, size=<span class="hljs-number">10</span>, color=<span class="hljs-string">"navy"</span>, alpha=<span class="hljs-number">0.5</span>)
output_notebook()
show(p)
</code></pre>
<h2 id="heading-3-bar-chart">3. <strong>Bar Chart</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
categories = [<span class="hljs-string">"A"</span>, <span class="hljs-string">"B"</span>, <span class="hljs-string">"C"</span>, <span class="hljs-string">"D"</span>, <span class="hljs-string">"E"</span>]
values = [<span class="hljs-number">10</span>, <span class="hljs-number">15</span>, <span class="hljs-number">8</span>, <span class="hljs-number">12</span>, <span class="hljs-number">6</span>]
p = figure(x_range=categories, title=<span class="hljs-string">"Bar Chart Python Bokeh Example by PratikPathak.com"</span>)
p.vbar(x=categories, top=values, width=<span class="hljs-number">0.9</span>)
output_notebook()
show(p)
</code></pre>
<h2 id="heading-4-histogram">4. <strong>Histogram</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
data = np.random.normal(<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1000</span>)
p = figure(title=<span class="hljs-string">"Histogram Python Bokeh Example by PratikPathak.com"</span>)
p.hist(data, bins=<span class="hljs-number">30</span>, color=<span class="hljs-string">"navy"</span>, alpha=<span class="hljs-number">0.5</span>)
output_notebook()
show(p)
</code></pre>
<h2 id="heading-5-pie-chart">5. <strong>Pie Chart</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
labels = [<span class="hljs-string">"A"</span>, <span class="hljs-string">"B"</span>, <span class="hljs-string">"C"</span>, <span class="hljs-string">"D"</span>]
values = [<span class="hljs-number">10</span>, <span class="hljs-number">15</span>, <span class="hljs-number">8</span>, <span class="hljs-number">12</span>]
p = figure(title=<span class="hljs-string">"Pie Chart Python Bokeh Example by PratikPathak.com"</span>)
p.wedge(x=<span class="hljs-number">0</span>, y=<span class="hljs-number">0</span>, radius=<span class="hljs-number">0.4</span>, start_angle=<span class="hljs-number">0.6</span>, end_angle=<span class="hljs-number">2.6</span>, color=[<span class="hljs-string">"red"</span>, <span class="hljs-string">"green"</span>, <span class="hljs-string">"blue"</span>, <span class="hljs-string">"yellow"</span>], legend_label=labels)
output_notebook()
show(p)
</code></pre>
<p><a target="_blank" href="https://colab.research.google.com/drive/1hQD7qMu5rbhV8JQ6gZ61drGiTQfUOyTE?usp=sharing">Live Preview</a> | <a target="_blank" href="https://github.com/zpratikpathak/25-Python-Bokeh-Example">Source Code</a> | <a target="_blank" href="https://github.com/zpratikpathak/25-Python-Bokeh-Example">🌿 Contribute</a></p>
<h2 id="heading-6-time-series-plot">6. <strong>Time Series Plot</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
<span class="hljs-keyword">from</span> datetime <span class="hljs-keyword">import</span> datetime, timedelta
start = datetime(<span class="hljs-number">2023</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>)
end = start + timedelta(days=<span class="hljs-number">30</span>)
x = [start + timedelta(days=i) <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> range((end-start).days)]
y = [<span class="hljs-number">10</span>, <span class="hljs-number">15</span>, <span class="hljs-number">8</span>, <span class="hljs-number">12</span>, <span class="hljs-number">6</span>, <span class="hljs-number">18</span>, <span class="hljs-number">9</span>, <span class="hljs-number">14</span>, <span class="hljs-number">7</span>, <span class="hljs-number">11</span>, <span class="hljs-number">5</span>, <span class="hljs-number">16</span>, <span class="hljs-number">8</span>, <span class="hljs-number">13</span>, <span class="hljs-number">6</span>]
p = figure(x_axis_type=<span class="hljs-string">"datetime"</span>, title=<span class="hljs-string">"Time Series Plot Python Bokeh Example by PratikPathak.com"</span>)
p.line(x, y, line_width=<span class="hljs-number">2</span>)
output_notebook()
show(p)
</code></pre>
<h2 id="heading-7-linked-brushing">7. <strong>Linked Brushing</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
<span class="hljs-keyword">from</span> bokeh.models <span class="hljs-keyword">import</span> ColumnDataSource
x1 = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>]
y1 = [<span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">3</span>]
x2 = [<span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>]
y2 = [<span class="hljs-number">2</span>, <span class="hljs-number">4</span>, <span class="hljs-number">6</span>, <span class="hljs-number">8</span>, <span class="hljs-number">4</span>]
source = ColumnDataSource(data=dict(x1=x1, y1=y1, x2=x2, y2=y2))
p1 = figure(title=<span class="hljs-string">"Scatter Plot 1"</span>)
p1.circle(<span class="hljs-string">'x1'</span>, <span class="hljs-string">'y1'</span>, source=source)
p2 = figure(title=<span class="hljs-string">"Scatter Plot 2 Python Bokeh Example by PratikPathak.com"</span>)
p2.circle(<span class="hljs-string">'x2'</span>, <span class="hljs-string">'y2'</span>, source=source)
output_notebook()
show(p1, p2)
</code></pre>
<h2 id="heading-8-hover-tooltips">8. <strong>Hover Tooltips</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
<span class="hljs-keyword">from</span> bokeh.models <span class="hljs-keyword">import</span> HoverTool
x = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>]
y = [<span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">3</span>]
p = figure(title=<span class="hljs-string">"Hover Tooltips Python Bokeh Example by PratikPathak.com"</span>)
p.circle(x, y, size=<span class="hljs-number">15</span>, fill_color=<span class="hljs-string">"navy"</span>, line_color=<span class="hljs-string">"white"</span>, alpha=<span class="hljs-number">0.5</span>)
hover = HoverTool(tooltips=[(<span class="hljs-string">"(x,y)"</span>, <span class="hljs-string">"(@x, @y)"</span>)])
p.add_tools(hover)
output_notebook()
show(p)
</code></pre>
<h2 id="heading-9-annotations">9. <strong>Annotations</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
<span class="hljs-keyword">from</span> bokeh.models <span class="hljs-keyword">import</span> Arrow, VectorRenderer, Label
x = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>]
y = [<span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">3</span>]
p = figure(title=<span class="hljs-string">"Annotations Python Bokeh Example by PratikPathak.com"</span>)
p.circle(x, y, size=<span class="hljs-number">15</span>, fill_color=<span class="hljs-string">"navy"</span>, line_color=<span class="hljs-string">"white"</span>, alpha=<span class="hljs-number">0.5</span>)
arrow = Arrow(x_start=<span class="hljs-number">2</span>, y_start=<span class="hljs-number">4</span>, x_end=<span class="hljs-number">3</span>, y_end=<span class="hljs-number">5</span>, line_width=<span class="hljs-number">2</span>, line_color=<span class="hljs-string">"red"</span>)
label = Label(x=<span class="hljs-number">3</span>, y=<span class="hljs-number">6</span>, text=<span class="hljs-string">"This is a label"</span>, render_mode=<span class="hljs-string">'css'</span>, border_line_color=<span class="hljs-string">'black'</span>, border_line_alpha=<span class="hljs-number">1.0</span>, background_fill_color=<span class="hljs-string">'white'</span>, background_fill_alpha=<span class="hljs-number">0.5</span>)
p.add_layout(arrow)
p.add_layout(label)
output_notebook()
show(p)
</code></pre>
<h2 id="heading-10-custom-glyphs">10. <strong>Custom Glyphs</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
<span class="hljs-keyword">from</span> bokeh.models.glyphs <span class="hljs-keyword">import</span> Asterisk
x = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>]
y = [<span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">3</span>]
p = figure(title=<span class="hljs-string">"Custom Glyphs Python Bokeh Example by PratikPathak.com"</span>)
p.add_glyph(x, y, Asterisk(size=<span class="hljs-number">20</span>, line_color=<span class="hljs-string">"red"</span>, fill_color=<span class="hljs-string">"yellow"</span>))
output_notebook()
show(p)
</code></pre>
<p><a target="_blank" href="https://colab.research.google.com/drive/1hQD7qMu5rbhV8JQ6gZ61drGiTQfUOyTE?usp=sharing">Live Preview</a> | <a target="_blank" href="https://github.com/zpratikpathak/25-Python-Bokeh-Example">Source Code</a> | <a target="_blank" href="https://github.com/zpratikpathak/25-Python-Bokeh-Example">🌿 Contribute</a></p>
<h2 id="heading-11-gridlines-and-axes">11. <strong>Gridlines and Axes</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
x = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>]
y = [<span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">3</span>]
p = figure(title=<span class="hljs-string">"Gridlines and Axes Python Bokeh Example by PratikPathak.com"</span>, x_range=(<span class="hljs-number">0</span>, <span class="hljs-number">6</span>), y_range=(<span class="hljs-number">0</span>, <span class="hljs-number">8</span>))
p.grid.grid_line_color = <span class="hljs-string">"grey"</span>
p.grid.grid_line_dash = [<span class="hljs-number">6</span>, <span class="hljs-number">4</span>]
p.xaxis.axis_label = <span class="hljs-string">"X-axis"</span>
p.yaxis.axis_label = <span class="hljs-string">"Y-axis"</span>
p.line(x, y, line_width=<span class="hljs-number">2</span>)
output_notebook()
show(p)
</code></pre>
<h2 id="heading-12-legend">12. <strong>Legend</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
x1 = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>]
y1 = [<span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">3</span>]
x2 = [<span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>]
y2 = [<span class="hljs-number">2</span>, <span class="hljs-number">4</span>, <span class="hljs-number">6</span>, <span class="hljs-number">8</span>, <span class="hljs-number">4</span>]
p = figure(title=<span class="hljs-string">"Legend Python Bokeh Example by PratikPathak.com"</span>)
p.line(x1, y1, line_width=<span class="hljs-number">2</span>, color=<span class="hljs-string">"red"</span>, legend_label=<span class="hljs-string">"Line 1"</span>)
p.line(x2, y2, line_width=<span class="hljs-number">2</span>, color=<span class="hljs-string">"blue"</span>, legend_label=<span class="hljs-string">"Line 2"</span>)
p.legend.location = <span class="hljs-string">"top_left"</span>
output_notebook()
show(p)
</code></pre>
<h2 id="heading-13-categorical-plots">13. <strong>Categorical Plots</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
fruits = [<span class="hljs-string">"Apples"</span>, <span class="hljs-string">"Pears"</span>, <span class="hljs-string">"Nectarines"</span>, <span class="hljs-string">"Plums"</span>, <span class="hljs-string">"Grapes"</span>, <span class="hljs-string">"Strawberries"</span>]
counts = [<span class="hljs-number">5</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">2</span>, <span class="hljs-number">4</span>, <span class="hljs-number">6</span>]
p = figure(x_range=fruits, title=<span class="hljs-string">"Categorical Plots Python Bokeh Example by PratikPathak.com"</span>)
p.vbar(x=fruits, top=counts, width=<span class="hljs-number">0.9</span>)
p.xaxis.axis_label = <span class="hljs-string">"Fruit"</span>
p.yaxis.axis_label = <span class="hljs-string">"Count"</span>
p.xaxis.axis_label_text_font_size = <span class="hljs-string">"12pt"</span>
p.yaxis.axis_label_text_font_size = <span class="hljs-string">"12pt"</span>
output_notebook()
show(p)
</code></pre>
<h2 id="heading-14-subplots">14. <strong>Subplots</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
<span class="hljs-keyword">from</span> bokeh.layouts <span class="hljs-keyword">import</span> gridplot
x1 = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>]
y1 = [<span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">3</span>]
x2 = [<span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>]
y2 = [<span class="hljs-number">2</span>, <span class="hljs-number">4</span>, <span class="hljs-number">6</span>, <span class="hljs-number">8</span>, <span class="hljs-number">4</span>]
p1 = figure(title=<span class="hljs-string">"Scatter Plot 1 Python Bokeh Example by PratikPathak.com"</span>)
p1.circle(x1, y1, size=<span class="hljs-number">10</span>, color=<span class="hljs-string">"navy"</span>, alpha=<span class="hljs-number">0.5</span>)
p2 = figure(title=<span class="hljs-string">"Scatter Plot 2 Python Bokeh Example by PratikPathak.com"</span>)
p2.circle(x2, y2, size=<span class="hljs-number">10</span>, color=<span class="hljs-string">"red"</span>, alpha=<span class="hljs-number">0.5</span>)
grid = gridplot([[p1, p2]], plot_width=<span class="hljs-number">400</span>, plot_height=<span class="hljs-number">400</span>)
output_notebook()
show(grid)
</code></pre>
<h2 id="heading-15-interactive-plots">15. <strong>Interactive Plots</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
<span class="hljs-keyword">from</span> bokeh.models <span class="hljs-keyword">import</span> ColumnDataSource, HoverTool, BoxSelectTool
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
x = np.random.random(<span class="hljs-number">1000</span>)
y = np.random.random(<span class="hljs-number">1000</span>)
source = ColumnDataSource(data=dict(x=x, y=y))
p = figure(title=<span class="hljs-string">"Interactive Plots Python Bokeh Example by PratikPathak.com"</span>, tools=<span class="hljs-string">"hover,box_select"</span>)
p.circle(<span class="hljs-string">'x'</span>, <span class="hljs-string">'y'</span>, source=source, size=<span class="hljs-number">3</span>, color=<span class="hljs-string">"navy"</span>, alpha=<span class="hljs-number">0.5</span>)
hover = HoverTool(tooltips=[(<span class="hljs-string">"(x,y)"</span>, <span class="hljs-string">"(@x, @y)"</span>)])
p.add_tools(hover)
output_notebook()
show(p)
</code></pre>
<p><a target="_blank" href="https://colab.research.google.com/drive/1hQD7qMu5rbhV8JQ6gZ61drGiTQfUOyTE?usp=sharing">Live Preview</a> | <a target="_blank" href="https://github.com/zpratikpathak/25-Python-Bokeh-Example">Source Code</a> | <a target="_blank" href="https://github.com/zpratikpathak/25-Python-Bokeh-Example">🌿 Contribute</a></p>
<h2 id="heading-16-linked-panning-and-zooming">16. <strong>Linked Panning and Zooming</strong></h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">from</span> bokeh.plotting <span class="hljs-keyword">import</span> figure, show, output_notebook
<span class="hljs-keyword">from</span> bokeh.models <span class="hljs-keyword">import</span> Range1d
x1 = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>]
y1 = [<span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">3</span>]
x2 = [<span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>]
y2 = [<span class="hljs-number">2</span>, <span class="hljs-number">4</span>, <span class="hljs-number">6</span>, <span class="hljs-number">8</span>, <span class="hljs-number">4</span>]
p1 = figure(title=<span class="hljs-string">"Scatter Plot 1 Python Bokeh Example by PratikPathak.com"</span>, x_range=Range1d(<span class="hljs-number">0</span>, <span class="hljs-number">6</span>), y_range=Range1d(<span class="hljs-number">0</span>, <span class="hljs-number">8</span>))
p1.circle(x1, y1, size=<span class="hljs-number">10</span>, color=<span class="hljs-string">"navy"</span>, alpha=<span class="hljs-number">0.5</span>)
p2 = figure(title=<span class="hljs-string">"Scatter Plot 2 Python Bokeh Example by PratikPathak.com"</span>, x_range=p1.x_range, y_range=p1.y_range)
p2.circle(x2, y2, size=<span class="hljs-number">10</span>, color=<span class="hljs-string">"red"</span>, alpha=<span class="hljs-number">0.5</span>)
output_notebook()
show(p1, p2)
</code></pre>
<p>More Important examples are here at <a target="_blank" href="https://pratikpathak.com/25-python-bokeh-example-learn-bokeh-from-examples/">25+ Python Bokeh Example</a></p>
<h2 id="heading-how-to-contribute">How to Contribute?</h2>
<p>Feel free to open a PR request on our GitHub repo.</p>
<p>Steps to contribute:</p>
<ol>
<li><p>Fork the repo</p>
</li>
<li><p>Make changes in the Forked repo and save</p>
</li>
<li><p>Open a Pull Request</p>
</li>
<li><p>That’s it 😄!</p>
</li>
</ol>
<p><a target="_blank" href="https://github.com/zpratikpathak/25-Python-Bokeh-Example">🌿 Contribute</a></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>In this article, I have shared you 25+ Python Bokeh examples which can help you to learn python bokeh. Feel free to contribute to our github repo and keep it updated.</p>
]]></content:encoded></item><item><title><![CDATA[Top 25+ Javascript Projects for Beginners with Source Code Github [2024 Latest Project]]]></title><description><![CDATA[Hey Everyone today I have curated a list of 25+ javascript projects for beginners with source code. All these Projects are updated and available on my GitHub.
You can check out my GitHub for a more curated list, projects, and much more. If you want t...]]></description><link>https://hashnode.pratikpathak.com/top-25-javascript-projects-for-beginners-with-source-code-github-2024-latest-project</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/top-25-javascript-projects-for-beginners-with-source-code-github-2024-latest-project</guid><category><![CDATA[Js project]]></category><category><![CDATA[top javascript projects]]></category><category><![CDATA[Pratik Pathak]]></category><category><![CDATA[Js project with source code]]></category><category><![CDATA[Js beginner projects]]></category><category><![CDATA[Javascript Projects]]></category><category><![CDATA[HTML5]]></category><category><![CDATA[CSS]]></category><category><![CDATA[js]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Sat, 17 Feb 2024 16:12:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173552519/77402fec-3ca6-4064-a7d0-6c7f16745832.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey Everyone today I have curated a list of 25+ javascript projects for beginners with source code. All these Projects are updated and available on my GitHub.</p>
<p>You can check out my GitHub for a more curated list, projects, and much more. If you want to contribute feel free to open a Pull Request.</p>
<p>Without any further a do let’s start 🏃‍♂️</p>
<p>The 25+ Javascript Projects for beginners with source code are –</p>
<h2 id="heading-1-ios-calculator-app">1. iOS Calculator App</h2>
<p>This is the replica of the original iOS calculator. It is built using HTML, CSS, and Javascript. This project contains the basic functionality of a calculator like Addition, Multiplication, Subtraction, and Division.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/01-iOS-Calculator/">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p>Technologies Used: JavaScript, HTML, CSS</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173521609/75fa58a5-a659-44de-9529-9bc57d0fbe9e.png" alt="iOS calculator" /></p>
<p>iOS Calculator JavaScript</p>
<h2 id="heading-2-travel-india">2. Travel India</h2>
<p>Travel India is a Project which focuses on India’s top 4 most visited tourist places. This project has a very beautiful UI controlled by Javascript. The Navigation is done by using Javascript. It also has a very beautiful Navbar.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/02-Travel-India">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173523493/645ae8d7-cbc3-4acd-8864-c4fcca200448.png" alt="Travel India Project" /></p>
<p>Travel India</p>
<h2 id="heading-3-age-prediction-tfjs">3. Age Prediction Tfjs</h2>
<p>Age prediction app uses the machine learning model of opencv and tensorflow JS to predict the Age of a person using face recognition. It is solely built by using an open-source model of TFjs.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/03-age-prediction-tfjs">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173525065/a1711515-2df4-473c-a984-0735949bac5f.jpeg" alt="Age Prediction Tfjs" /></p>
<p>Age Prediction Tfjs</p>
<h2 id="heading-4-connect-me">4. Connect ME</h2>
<p>This is the clone of <a target="_blank" href="https://linktr.ee/">LinkTr.ee</a>, those who don’t want to use LinkTr.ee can use this static application to share links with the audience. It is built using HTML, CSS, JS, and a little bit of node.js.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/04-connect-me">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173526297/1f60a9ee-9919-49d0-a7f4-c0933af2fdd6.png" alt="image 2" /></p>
<h2 id="heading-5-weather-app">5. Weather App</h2>
<p>This Project tells you the weather of a city. You just need to type the name of the city and click on fetch and it will the weather of the city. For the weather, it utilizes <a target="_blank" href="https://home.openweathermap.org/api_keys">OpenWeatherMap</a> API.</p>
<p>Check out the full code on GitHub.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/05-Weather-App">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p>Technologies Used: Javascript, HTML, CSS, OpenWeatherMap API</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173527178/f56d74d9-f1f5-4ba4-b7ba-29dd62e6e0cb.png" alt="Weather App using JS" /></p>
<p>Weather App using JS</p>
<p>Want to add your Javascript Project? Feel free to contribute, open a Pull Request <a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Contribute</a></p>
<p><a target="_blank" href="https://pratikpathak.com/docker-run-command-cheatsheet/">Docker Run Command example the ultimate cheatsheet</a></p>
<h2 id="heading-6-digital-clock">6. Digital Clock</h2>
<p>This is a digital clock that shows the time along with the Date. It uses your system time to fetch the current time and displays it.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/06-Digital-Clock">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p>Technologies Used: Javascript, HTML, CSS</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173528108/39da5fc2-1dc0-4a88-82b0-f57f2ae558d4.png" alt="Digital Clock javascript" /></p>
<p>Digital Clock javascript</p>
<h2 id="heading-7-flashlight-effect">7. FlashLight Effect</h2>
<p>It is a simple application for mouse tracking. There is a dark web page with some text in it and wherever the mouse goes it illuminates its surrounding area. Beautifully built using Vanilla JS.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/07-FlashLight-Effect">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173529387/7b525466-1580-4cb3-af91-35bdc543f632.png" alt="FlashLight Effect Javascript" /></p>
<p>FlashLight Effect Javascript</p>
<h2 id="heading-8-puzzle-game">8. Puzzle Game</h2>
<p>A Puzzle Game is a project that contains misplaced pieces of an image, You have to rearrange the missing pieces so that they become the same as the right side image.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/08-Puzzle-Game">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p>Technologies Used: Javascript, HTML, CSS</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173530900/76cad81a-c18e-4504-8848-9cdf2f48e365.png" alt="Puzzle Game Javascript" /></p>
<p>Puzzle Game Javascript</p>
<h2 id="heading-9-qr-code">9. QR Code</h2>
<p>A simple application to make QR code as well as it can read it, with a beautiful UI. Works on a local server. Created by Using QrCode.js package.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/09-Qr-Code">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p>Technologies Used: QrCode.js, Javascript, HTML, CSS</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173532085/34092622-057e-48a2-adc3-9c92f354f9be.png" alt="QR Code Javascript" /></p>
<p>QR Code Javascript</p>
<h2 id="heading-10-rich-text-editor">10. Rich Text Editor</h2>
<p>Have you ever used Microsoft Word? and wondered how you can make one? A rich text editor is a Word-like editor with contains a ribbon that has all the functionality like Bold, Italic, Text Formatting, etc.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/10-Rich-Text-Editor">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173533114/b4a165f7-5c52-4203-bf0b-6d7340ad2a0f.png" alt="Rich Text Editor Javascript" /></p>
<p>Rich Text Editor Javascript</p>
<p>Want to add your Javascript Project? Feel free to contribute, open a Pull Request <a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Contribute</a></p>
<h2 id="heading-11-background-color-switcher">11. Background Color Switcher</h2>
<p>The Background of the application will change based on the user’s color selection. The user has two clicks on his desired color and the whole background color will change.</p>
<p>[Live Preview](https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/11-Background Color Switcher) <a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p>Technologies Used: Javascript, HTML, CSS, DOM Manipulation</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173534158/406b80bb-cef6-459d-8dcf-3e96b0274aa4.png" alt="Background Color Switcher Javascript" /></p>
<p>Background Color Switcher Javascript</p>
<h2 id="heading-12-image-slider">12. Image Slider</h2>
<p>An Image Carousel made by using Javascript. It’s a simple application that shows all the images when the user clicks on the next button.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/12-Image-Slider">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173535801/ceb6365a-b352-4586-a5e0-a1891a24879e.png" alt="Image Slider Javascript" /></p>
<p>Image Slider Javascript</p>
<h2 id="heading-13-analogue-clock">13. Analogue Clock</h2>
<p>An analog clock that uses JavaScript and the Canvas Web API</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/13-Analogue-Clock">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173537271/2791382c-cbcd-4946-ab8b-2d6c77a7fd6c.png" alt="Analogue Clock Javascript" /></p>
<p>Analogue Clock Javascript</p>
<h2 id="heading-14-brick-breaker">14. Brick Breaker</h2>
<p>A brick breaker game. Made by using canvas API.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/14-Brick-Breaker">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173538078/4ba51bbe-98aa-49e8-a168-c5c9c0f216cb.png" alt="image 12" /></p>
<p>Brick Breaker Javascript</p>
<h2 id="heading-15-balloon-pop">15. Balloon Pop</h2>
<p>Balloon Pop game. Move your mouse over the balloon to pop it. Pop all the balloons to finish the game.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/15-Balloon-Pop">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173539226/0d40d0d2-581f-48ae-a058-1d622d8f84ed.png" alt="Brick Breaker Javascript" /></p>
<p>Brick Breaker Javascript</p>
<p>Want to add your Javascript Project? Feel free to contribute, open a Pull Request <a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Contribute</a></p>
<h2 id="heading-16-interactive-quiz">16. Interactive Quiz</h2>
<p>A simple web-based quiz about baby animal names. The HTML file sets up the structure of the quiz, including a container for the quiz, a heading, a section for the question, a list for multiple-choice answers, a message area, a result area, and a button to proceed to the next question.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/16-Interactive-Quiz">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173540494/ab118f97-47d1-4aca-a8c7-a7b8be1d9d4f.png" alt="Quiz APP Javascript" /></p>
<p>Quiz APP Javascript</p>
<h2 id="heading-17-math-addition">17. Math Addition</h2>
<p>A simple web-based arithmetic game, specifically designed for addition operations. The HTML file sets up the structure of the game, which includes a canvas area containing two numbers and an addition sign. The user is expected to input their guess for the sum of the two numbers in an input field. A button is provided to check the user’s answer.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/17-Math-Addition">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173541378/728e45c2-8719-4b3a-9340-36c1784ef8ba.png" alt="Math Addition Javascript" /></p>
<p>Math Addition Javascript</p>
<h2 id="heading-18-guess-the-number">18. Guess The Number</h2>
<p>This project is a number guessing game where the user attempts to guess a random number between 1 and 100 within 10 tries. The game’s interface, styled with CSS and powered by JavaScript, provides feedback on previous guesses and the number of remaining attempts.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/18-Guess-The-Number">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173542531/bfb12f88-484c-4ce8-bb18-f027769e8dcc.png" alt="Guess The Number Javascript" /></p>
<p>Guess The Number Javascript</p>
<h2 id="heading-19-rss-news-feed">19. RSS News Feed</h2>
<p>This project is a simple RSS News Feed reader. The HTML file sets up the structure of the application, which includes a heading with an RSS icon and a title that will display the name of the selected news source (defaulted to “PratikPathak.com”). There’s also a date section and a main content area where the news feed will be displayed in a list format.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/19-RSS-News-Feed">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173543801/ab164b8a-550e-439b-b81e-b21d20e5d6e4.png" alt="RSS News Feed Javascript" /></p>
<p>RSS News Feed Javascript</p>
<h2 id="heading-20-session-storage-to-do-list">20. Session Storage To-Do List</h2>
<p>This project is a simple Todo List application. The HTML file sets up the structure of the application, which includes a heading, an input field for entering tasks, and a button for adding tasks. There’s also a dedicated area where the tasks will be displayed.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/20-SessionStorage-TodoList">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173544863/55a1f0d5-522f-4606-a132-4871c9d9cce5.png" alt="Session Storage To-Do List Javascript" /></p>
<p>Session Storage To-Do List Javascript</p>
<p>Want to add your Javascript Project? Feel free to contribute, open a Pull Request <a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Contribute</a></p>
<h2 id="heading-21-whack-a-mole">21. Whack a Mole</h2>
<p>This project is a web-based game called “Whack-a-Mole”. The HTML structure includes a score display, a start button, and a game area with six “holes”, each containing a “mole”. The game’s visual styling is linked via a CSS file named “styles.css”, and the functionality is provided by a JavaScript file named “script.js”. The user is expected to “whack” the moles by clicking on them as they randomly appear from the holes.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/21-Whack-a-Mole">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173546180/f9ec0dfb-1b0c-4099-a9af-227592f56d47.png" alt="image 19" /></p>
<p>Whack a Mole Javascript</p>
<h2 id="heading-22-word-counter">22. Word Counter</h2>
<p>This project is a simple web-based Word Length Calculator. The HTML file sets up the structure of the application, which includes a heading, an input field for entering a word, a display area for the output, and a button to trigger the calculation.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/22-Word-Count">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173547241/5cb92da6-a954-468c-85f2-51dbd75810ac.png" alt="Word Counter Javascript" /></p>
<p>Word Counter Javascript</p>
<h2 id="heading-23-weight-conversion">23. Weight Conversion</h2>
<p>This project is a simple web-based Weight Conversion Tool. The HTML file sets up the structure of the application, which includes a form with a heading, an input field for entering a weight in pounds, and a display area for the converted weight in kilograms.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/23-Weight-Conversion">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173548251/85631ab9-ab64-4d0e-b318-8072dad6a4e6.png" alt="Weight Conversion Javascript" /></p>
<p>Weight Conversion Javascript</p>
<h2 id="heading-24-expense-calculator">24. Expense Calculator</h2>
<p>This project is a Budget App, a web-based application that allows users to manage their budget and expenses. The HTML structure includes sections for entering a budget, displaying the current budget, expenses, and balance, and entering expenses.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/24-Expense-Calculator">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173549460/d983f24d-0b79-448e-a79a-e4700ae2598c.png" alt="Expense Calculator Javascript" /></p>
<p>Expense Calculator Javascript</p>
<h2 id="heading-25-random-quote">25. Random Quote</h2>
<p>This project is a simple web-based “Quote of the Day” application. The HTML file sets up the structure of the application, which includes a heading, a paragraph instructing the user to press a button to receive a random quote, a button that triggers the quote generation, and two paragraphs where the quote and its author will be displayed.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/25-Random-Quote">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://pratikpathak.com/wp-content/uploads/2024/02/image-23-1024x427.png" alt="Random Quote javascript
" /></p>
<p>Random Quote javascript</p>
<h2 id="heading-26-toss-a-coin">26. Toss a Coin</h2>
<p>This project is a simple web-based Coin Toss game. The HTML file sets up the structure of the game, which includes a title, a brief description, an image of a coin, and a button to toss the coin.</p>
<p><a target="_blank" href="https://zpratikpathak.github.io/25-Javascript-Projects-for-beginner/26-Toss-a-coin">Live Preview</a><a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Source Code</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/imageupload/v1708173550965/481d356b-1a00-4219-8bba-2a8d1bf95ec0.png" alt="Toss a Coin Javascript" /></p>
<p>Toss a Coin Javascript</p>
<p>Want to add your Javascript Project? Feel free to contribute, open a Pull Request <a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">Contribute</a></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>This is the list of Updated 25+ Javascript Projects for beginners. Each and every project contains atleast three files <code>index.html</code>, <code>style.css</code> and <code>script.js</code>. If you want to add your project, feel free to open a Pull Request on <a target="_blank" href="https://github.com/zpratikpathak/25-Javascript-Projects-for-beginner">GitHub</a>.</p>
]]></content:encoded></item><item><title><![CDATA[_.each and forEach in JS]]></title><description><![CDATA[_.each()
'_.each()' is used to traverse/iterate through each element in a list.
Install Underscore package for using _.each
npm install underscore

Importing in nodejs Package
// npm install underscore
const _= require('underscore')

Syntax
_.each(li...]]></description><link>https://hashnode.pratikpathak.com/each-and-foreach-in-js</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/each-and-foreach-in-js</guid><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Tue, 04 May 2021 14:12:42 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-each">_.each()</h2>
<p>'_.each()' is used to traverse/iterate through each element in a list.</p>
<h2 id="heading-install-underscore-package-for-using-each">Install Underscore package for using <code>_.each</code></h2>
<pre><code class="lang-javascript">npm install underscore
</code></pre>
<h2 id="heading-importing-in-nodejs-package">Importing in nodejs Package</h2>
<pre><code class="lang-javascript"><span class="hljs-comment">// npm install underscore</span>
<span class="hljs-keyword">const</span> _= <span class="hljs-built_in">require</span>(<span class="hljs-string">'underscore'</span>)
</code></pre>
<h3 id="heading-syntax">Syntax</h3>
<pre><code class="lang-javascript">_.each(listname, callbackFunc(){
<span class="hljs-comment">// Callback Program</span>
})
</code></pre>
<p>Example:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> suspects = [<span class="hljs-string">'Miss Scarlet'</span>, <span class="hljs-string">'Colonel Mustard'</span>, <span class="hljs-string">'Mr. White'</span>]; 

<span class="hljs-keyword">var</span> suspectsList = [];

_.each(suspects, <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">name</span>) </span>{
suspectsList.push(name); 
});
</code></pre>
<p>Here _.each will select individual items from suspects one by one and pass it to function with <code>name</code> as a parameter. Eg. <code>name</code> variable will contain each element of suspects object.</p>
<p>Note: use Each for traversing/iterating through the list. It's a lot easier compared to the traditional loops method.</p>
<h2 id="heading-each-foreach-defined">_.each() / forEach DEFINED</h2>
<pre><code class="lang-javascript">_.each(
    [<span class="hljs-string">'observatory'</span>,<span class="hljs-string">'ballroom'</span>, <span class="hljs-string">'library'</span>],
    <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">value, index, list</span>)</span>{ ... }
);
[<span class="hljs-string">'observatory'</span>,<span class="hljs-string">'ballroom'</span>,<span class="hljs-string">'library'</span>]
.forEach(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">value, index, list</span>)</span>{...});
</code></pre>
<ul>
<li><p>Iterates over a list of elements, passing the values to a function.</p>
</li>
<li><p>Each invocation of iterator, the function, is called with three arguments: (element, index, list). If the list is a JavaScript object, the iterator's arguments will be (value, key, list).</p>
</li>
</ul>
<p><code>_</code> of <code>_.each()</code> is a library</p>
<p>Example:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> rooms = [<span class="hljs-string">'observatory'</span>,<span class="hljs-string">'ballroom'</span>, <span class="hljs-string">'library'</span>];
<span class="hljs-keyword">var</span> logger = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">val</span>)</span>{
  <span class="hljs-built_in">console</span>.log(val);
};

_.each(rooms, logger);
</code></pre>
<p><strong>Note</strong>: Each function does not return anything</p>
<p>Slide: https://slides.com/bgando/f2f-final-day-1#/4/1</p>
<p>Github Example: https://github.com/zpratikpathak/Functional-JS/blob/main/foreach%26_each.js</p>
]]></content:encoded></item><item><title><![CDATA[Destructuring and traversing of javascript objects]]></title><description><![CDATA[Destructuring
Destructuring is used to destructure existing objects into individual objects/data.
Eg.
// ES6 method
var obj = {
    "name":"Rusty",
    "room":"kitchen",
    "weapon": "candlestick"
}

let {name,weapon}=obj
console.log(name,weapon)
Tr...]]></description><link>https://hashnode.pratikpathak.com/destructuring-and-traversing-of-javascript-objects</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/destructuring-and-traversing-of-javascript-objects</guid><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Mon, 03 May 2021 15:24:46 GMT</pubDate><content:encoded><![CDATA[<h1 id="destructuring">Destructuring</h1>
<p>Destructuring is used to destructure existing objects into individual objects/data.
Eg.</p>
<pre><code>// ES6 <span class="hljs-keyword">method</span>
var obj = {
    "name":"Rusty",
    "room":"kitchen",
    "weapon": "candlestick"
}

let {<span class="hljs-type">name</span>,weapon}=obj
console.log(<span class="hljs-type">name</span>,weapon)
</code></pre><h1 id="traversing-a-nested-objects">Traversing a nested Objects</h1>
<p>Consider the following Object:</p>
<pre><code>const game = {
    "suspects": [
        {
            <span class="hljs-type">name</span>: "Rusty",
            color: "orange"
        },{
            <span class="hljs-type">name</span>: "Scarlet",
            color: "Red"
        }
    ]

}
</code></pre><p>Function to iterate:</p>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">traverse</span>(<span class="hljs-params">obj</span>) </span>{
    <span class="hljs-keyword">for</span> ( <span class="hljs-keyword">let</span> key <span class="hljs-keyword">in</span> obj ){
        <span class="hljs-built_in">console</span>.log(key) <span class="hljs-comment">//to print only key</span>
        <span class="hljs-built_in">console</span>.log(obj[key]) <span class="hljs-comment">// to print data of that key</span>
    }
}
traverse(game)
</code></pre><p>Output: </p>
<pre><code>suspects
[
  { <span class="hljs-type">name</span>: <span class="hljs-string">'Rusty'</span>, color: <span class="hljs-string">'orange'</span> },
  { <span class="hljs-type">name</span>: <span class="hljs-string">'Scarlet'</span>, color: <span class="hljs-string">'Red'</span> }
]
</code></pre><h2 id="iterating-each-element-in-the-object">Iterating Each element in the object:</h2>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">gameLoop</span>(<span class="hljs-params">obj</span>)</span>{
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i=<span class="hljs-number">0</span>; i&lt;obj.suspects.length; i++) {
        <span class="hljs-keyword">for</span> (key <span class="hljs-keyword">in</span> obj.suspects[i]) { <span class="hljs-comment">// for traversing array object</span>
            <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`<span class="hljs-subst">${key}</span> <span class="hljs-subst">${obj.suspects[i][key]}</span>`</span>) <span class="hljs-comment">// printing value of array object</span>
        }
        <span class="hljs-built_in">console</span>.log()
    }
}
gameLoop(game)
</code></pre><p>Output:</p>
<pre><code><span class="hljs-type">name</span> Rusty
color orange

<span class="hljs-type">name</span> Scarlet
color Red
</code></pre><h1 id="fun-task">Fun Task:</h1>
<p>How to extract colors from the <code>game</code> object using destructuring?</p>
<pre><code><span class="hljs-comment">// Destructuring Orange and Red color from objects game</span>
<span class="hljs-keyword">const</span> [color1, color2] = [game.suspects[<span class="hljs-number">0</span>].color, game.suspects[<span class="hljs-number">1</span>].color]
console.<span class="hljs-built_in">log</span>(color1,color2)
</code></pre><p><strong>Alternate Way</strong>:</p>
<pre><code><span class="hljs-keyword">var</span> [{<span class="hljs-attr">color</span>: firstcolor}, {<span class="hljs-attr">color</span>:secondcolor}] = game.suspects
<span class="hljs-built_in">console</span>.log(firstcolor,secondcolor)
</code></pre><h3 id="slides">Slides:</h3>
<p>https://slides.com/bgando/f2f-final-day-1</p>
<p>https://slides.com/bgando/f2f-final-day-2PP</p>
]]></content:encoded></item><item><title><![CDATA[Node.js as API development : 1]]></title><description><![CDATA[I'm Starting with Node.js as a backend API development. Since my personal blog went down and also I don't have money to renew it I'm moving with hash node. There is no particular reason for choosing hashnode for my blog but I like the subdomain provi...]]></description><link>https://hashnode.pratikpathak.com/nodejs-as-api</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/nodejs-as-api</guid><category><![CDATA[Node.js]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[js]]></category><category><![CDATA[npm]]></category><category><![CDATA[HTML5]]></category><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Fri, 16 Apr 2021 14:07:39 GMT</pubDate><content:encoded><![CDATA[<p>I'm Starting with Node.js as a backend API development. Since my personal blog went down and also I don't have money to renew it I'm moving with hash node. There is no particular reason for choosing hashnode for my blog but I like the subdomain provided by the hashcode. Let's hope I don't have to pay here for hosting my blogs and also no third-party ads should get placed on my blogs. I'm going to use it as my note's notebook</p>
<p>Basics of Node.js + Slide are in this  <a target="_blank" href="https://github.com/frontendmasters/intro-node-js">repo</a>  </p>
<h2 id="what-is-nodejs">What is NodeJs?</h2>
<p>Node.js is an environment for running JavaScript outside the browser.
Node.js can be used for build tools, desktop apps, mobile apps, databases, and more.</p>
<h2 id="browser-javascript-vs-nodejs">Browser Javascript VS Node.js</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1618555996055/pjv5uoGZ1.png" alt="image.png" /></p>
<h2 id="some-imp-globals">Some Imp Globals</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1618556556305/aDPaNTmeY.png" alt="image.png" /></p>
<h2 id="modules">Modules:</h2>
<p>How to create/import a module (Encapsulated Code):</p>
<pre><code><span class="hljs-keyword">var</span> module1 = (<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"><span class="hljs-built_in">exports</span>, <span class="hljs-built_in">require</span>, <span class="hljs-built_in">module</span>, __filename, __dirname</span>)</span>{
  <span class="hljs-comment">// your node js code in a file</span>
})

<span class="hljs-keyword">var</span> module2 = (<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"><span class="hljs-built_in">exports</span>, <span class="hljs-built_in">require</span>, <span class="hljs-built_in">module</span>, __filename, __dirname</span>)</span>{
  <span class="hljs-comment">// your node js code in another file</span>
})
</code></pre><h2 id="creating-modules">Creating Modules</h2>
<p>All your Nodejs code are modules.
As the author, you decide how and what to expose from your modules to other modules.
You do this with the module global object provided to you by the Nodejs runtime</p>
<p>Example for exporting a node module (i.e. code.js):</p>
<pre><code>const add=<span class="hljs-function"><span class="hljs-params">(num1,num2)</span> =&gt;</span> {}
const notPublic = <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {}

<span class="hljs-built_in">module</span>.<span class="hljs-built_in">exports</span> = { add, thing() {}, value:<span class="hljs-number">1</span>} <span class="hljs-comment">#Named export</span>
</code></pre><p>Here, <code>module.exports</code> is used to export the <code>add</code>, <code>thing</code>, and a <code>value</code> file but <code>notPublic</code> has not been exported since it's not written in in <code>module.exports</code>.
There is one more way to export the module which is <code>exports</code> global, it's not much reliable and you cannot explicitly export anything so please refrain from using it.</p>
<p>if you want to export one thing you can do it like</p>
<pre><code><span class="hljs-attr">module.exports</span> = add <span class="hljs-comment">#Default Exports</span>
</code></pre><p>we can access this using <code>.</code> operation like <code>.add</code>, <code>.value</code>, etc</p>
<p><strong>There should be only one "module.exports"</strong>. If you write more than one <code>module.exports</code> it will overwrite the existing one.
If you, later on, find that you need to export a few more modules and you have already written <code>module.exports</code> then use this method:</p>
<pre><code><span class="hljs-built_in">module</span>.<span class="hljs-built_in">exports</span>.more = <span class="hljs-comment">#Names of module,objects,etc</span>
</code></pre><h1 id="importing-modules">Importing Modules</h1>
<p>The Nodejs runtime injects another global, require.
This function takes a relative path to the module that you want to consume and synchronously loads it by returning whatever the target module exported.</p>
<p>Modules can be imported using the <strong>require()</strong> module.
for example:</p>
<pre><code><span class="hljs-keyword">const</span> <span class="hljs-keyword">val</span> = require(<span class="hljs-string">'./code'</span>)
</code></pre><p>Note: we have to write a relative path</p>
<p>There are two types of modules, the first one is created by us or let's say stored in the '.js' file, and the second one is inbuilt modules of node eg. 'fs'. We have to write relative path with "." in the first case</p>
<p>Follow this link to continue reading:</p>
]]></content:encoded></item><item><title><![CDATA[FS (File System Module) in Node.js]]></title><description><![CDATA[First import 'fs' (file system) module using:
const fs = require('fs')
###Read a file
Syntax:
const file = fs.readFileSync("Relative_Directory_Path/file.js",{encoding: 'utf-8'}) 
//just write the encoding part even if you don't know what does it mean...]]></description><link>https://hashnode.pratikpathak.com/fs-file-system-module-in-nodejs</link><guid isPermaLink="true">https://hashnode.pratikpathak.com/fs-file-system-module-in-nodejs</guid><category><![CDATA[js]]></category><category><![CDATA[Node.js]]></category><category><![CDATA[APIs]]></category><category><![CDATA[files]]></category><dc:creator><![CDATA[Pratik Pathak]]></dc:creator><pubDate>Fri, 16 Apr 2021 14:00:03 GMT</pubDate><content:encoded><![CDATA[<p>First import 'fs' (file system) module using:</p>
<pre><code><span class="hljs-keyword">const</span> fs = <span class="hljs-keyword">require</span>(<span class="hljs-string">'fs'</span>)
</code></pre><p>###Read a file
Syntax:</p>
<pre><code><span class="hljs-keyword">const</span> file = fs.readFileSync(<span class="hljs-string">"Relative_Directory_Path/file.js"</span>,{encoding: <span class="hljs-string">'utf-8'</span>}) 
<span class="hljs-comment">//just write the encoding part even if you don't know what does it mean</span>
</code></pre><p>Test 1:</p>
<pre><code><span class="hljs-keyword">const</span> fs = <span class="hljs-keyword">require</span>(<span class="hljs-string">'fs'</span>)
<span class="hljs-keyword">const</span> file = fs.readFileSync(<span class="hljs-string">"./lib.js"</span>) <span class="hljs-comment">#Reading without specifying encoding</span>
console.log(file)
</code></pre><p>Output:</p>
<pre><code><span class="hljs-string">PS</span> <span class="hljs-string">F:\Projects\NodeJs\Test&gt;</span> <span class="hljs-string">node</span> <span class="hljs-string">playground.js</span>
<span class="hljs-string">&lt;Buffer</span> <span class="hljs-string">6d</span> <span class="hljs-string">6f</span> <span class="hljs-number">64</span> <span class="hljs-number">75</span> <span class="hljs-string">6c</span> <span class="hljs-number">65</span> <span class="hljs-string">2e</span> <span class="hljs-number">65</span> <span class="hljs-number">78</span> <span class="hljs-number">70</span> <span class="hljs-string">6f</span> <span class="hljs-number">72</span> <span class="hljs-number">74</span> <span class="hljs-number">73</span> <span class="hljs-number">20</span> <span class="hljs-string">3d</span> <span class="hljs-number">20</span> <span class="hljs-number">28</span> <span class="hljs-number">29</span> <span class="hljs-number">20</span> <span class="hljs-string">3d</span> <span class="hljs-string">3e</span> <span class="hljs-number">20</span> <span class="hljs-string">7b</span> <span class="hljs-string">0d</span> <span class="hljs-string">0a</span> <span class="hljs-number">20</span> <span class="hljs-number">20</span> <span class="hljs-number">20</span> <span class="hljs-number">20</span> <span class="hljs-number">76</span> <span class="hljs-number">61</span> <span class="hljs-string">6c</span> <span class="hljs-number">75</span> <span class="hljs-number">65</span> <span class="hljs-string">3a</span> <span class="hljs-number">31</span> <span class="hljs-string">2c</span> <span class="hljs-string">0d</span> <span class="hljs-string">0a</span> <span class="hljs-number">20</span> <span class="hljs-number">20</span> <span class="hljs-number">20</span> <span class="hljs-number">20</span> <span class="hljs-number">75</span> <span class="hljs-number">73</span> <span class="hljs-number">65</span> <span class="hljs-number">72</span> <span class="hljs-number">49</span> <span class="hljs-number">64</span> <span class="hljs-string">...</span> <span class="hljs-number">68</span> <span class="hljs-string">more</span> <span class="hljs-string">bytes&gt;</span>
</code></pre><p>Test 2:</p>
<pre><code>const fs = require(<span class="hljs-string">'fs'</span>)
const file = fs.readFileSync("./lib.js",{<span class="hljs-keyword">encoding</span>: <span class="hljs-string">'utf-8'</span>}) #reading <span class="hljs-keyword">with</span> <span class="hljs-keyword">encoding</span> <span class="hljs-keyword">method</span>
console.log(file)
</code></pre><p>Output:</p>
<pre><code>PS F:\Projects\NodeJs\Test&gt; node playground.js
<span class="hljs-built_in">module</span>.<span class="hljs-built_in">exports</span> = <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {
    value:<span class="hljs-number">1</span>,
    userIds: [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>],
    action() {
        <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'action'</span>)
    }
}
</code></pre><p>In Test1 we read the file successfully but the result which we got was encoded while in Test2 we mentioned the encoding method due to which we are able to read file content as a String.</p>
<h3 id="how-to-write-in-a-file">How to write in a file</h3>
<p>First import 'fs' (file system) module using:</p>
<pre><code><span class="hljs-keyword">const</span> fs = <span class="hljs-keyword">require</span>(<span class="hljs-string">'fs'</span>)
</code></pre><p>Syntax:</p>
<pre><code><span class="hljs-selector-tag">fs</span><span class="hljs-selector-class">.writeFileSync</span>(<span class="hljs-string">'Relative_Directory_Path/file.js'</span>,<span class="hljs-string">'Conentent you want to write in the file.js'</span>)
</code></pre><p>For Example:</p>
<pre><code><span class="hljs-selector-tag">fs</span><span class="hljs-selector-class">.writeFileSync</span>(<span class="hljs-string">'./lib.js'</span>,<span class="hljs-string">'var me="hello"'</span>)
</code></pre><p>Output: <code>lib.js</code></p>
<pre><code><span class="hljs-keyword">var</span> me=<span class="hljs-string">"hello"</span>
</code></pre>]]></content:encoded></item></channel></rss>