<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ahmed Hassen on Medium]]></title>
        <description><![CDATA[Stories by Ahmed Hassen on Medium]]></description>
        <link>https://medium.com/@Ahhassen?source=rss-b8866051ae59------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*cwIu4EqxCfIv4SsOey912A.png</url>
            <title>Stories by Ahmed Hassen on Medium</title>
            <link>https://medium.com/@Ahhassen?source=rss-b8866051ae59------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:57:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Ahhassen/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ChatGPT will revolutionize software engineering, here is how!]]></title>
            <link>https://medium.com/@Ahhassen/chatgpt-will-revolutionize-software-engineering-here-is-how-74cba094ea28?source=rss-b8866051ae59------2</link>
            <guid isPermaLink="false">https://medium.com/p/74cba094ea28</guid>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[cloud-services]]></category>
            <dc:creator><![CDATA[Ahmed Hassen]]></dc:creator>
            <pubDate>Sun, 25 Dec 2022 17:46:22 GMT</pubDate>
            <atom:updated>2022-12-25T17:46:22.467Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>5 ways in which ChatGPT can be extremely handy handling software engineering challenges</blockquote><h3>Introduction</h3><p>Are you tired of sifting through documentation and scouring the internet for solutions to your programming challenges? ChatGPT may be the answer you’ve been looking for in years. In this article, we will explore how ChatGPT, a natural language processing tool, has the potential to revolutionize software engineering by presenting five use cases where it can help you in your work as a developer. These include improving an existing codebase, understanding an error stack trace, assisting with system design, writing boilerplate code, and even replacing StackOverflow as a go-to resource for finding solutions. Get ready to learn about the exciting potential of ChatGPT and how it can improve your efficiency and effectiveness as a developer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/0*ZkpkWRR-_pjBot66" /></figure><h3>What is ChatGPT?</h3><p>ChatGPT is a natural language processing (NLP) tool developed by OpenAI. It is designed to be able to understand and respond to user inputs in real-time. ChatGPT can understand and process complex questions and commands and provide relevant and accurate responses. It is also able to learn and adapt over time, making it an increasingly useful tool for software development and other tasks.</p><p>It was developed and built as follows:</p><ul><li>ChatGPT is built on top of the transformer GPT-3 model, which is an effective model for processing sequential data, such as text or audio.</li><li>By adding layers and capabilities to the GPT-3 model, ChatGPT is useful for tasks such as answering questions, providing suggestions and advice, and even completing tasks on its own.</li><li>ChatGPT is also able to learn and adapt over time. As it processes more and more user input, it can improve its understanding of language and become more accurate and helpful in its responses.</li></ul><p>ChatGPT is trained using a combination of supervised learning and reinforcement learning. The agent is the language model and the environment is the chatbot application. The reward is based on the quality of the responses generated by the language model.</p><p>The language model is given a conversation and asked to generate a response. Based on a human evaluation, the agent receives a reward with which it will updates its internal parameters and so on!</p><h3>Use cases</h3><p>Let’s go deep in showing how ChatGPT will revolutionize software engineering in all its areas. By presenting some use cases Ihave come across, we will highlight the benefits of this powerful tool</p><h4>Improve existing codebase</h4><p>First, ChatGPT can help improve your existing codebase by providing suggestions for refactoring and optimizing code. Let’s take a simple function which contains multiple errors and inconsistencies</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*Uz5JF1wA0wlrmF-xtI9ckA.png" /></figure><p>This code contains the following formatting errors:</p><ul><li>The ChildFunction function does not have a docstring, which is a string at the beginning of the function that describes what the function does. This is considered a best practice in Python.</li><li>The ChildFunction function does not follow the PEP8 style guide, which recommends using lowercase letters and separating words with underscores. The function name is written in uppercase letters, which is not allowed in Python.</li><li>The ChildFunction function does not handle the case where TXT is None. If TXT is None, the function will raise an AttributeError when it tries to call the replace method on it.</li><li>The ChildFunction function only removes spaces from the input text, but it does not handle other types of whitespace, such as tabs or newlines. This means that the function will not accurately count the number of characters in the input text if it contains other types of whitespace.</li></ul><p>By launching the following request “Please refactor this python function” ChatGPT will identify the areas of the code that can be simplified or made it more efficient by removing unnecessary or redundant code, combining multiple lines of code into a single line, or replacing complex code with a more concise function or library</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*PIp-5DBTwIGAgaZp1XIr6A.png" /></figure><p>The refactored code includes:</p><ul><li>The function names are written in lowercase letters and separated with underscores.</li><li>The docstrings are written in proper Python syntax and use triple quotes.</li><li>The code is indented with 4 spaces, as recommended by the PEP8 style guide.</li></ul><h4>Understanding an error stack trace</h4><p>Understanding an error stack trace can be an ambiguous for multiple reasons from which we can mention:</p><ol><li>The error message may not be clear or specific enough to pinpoint the root cause of the problem.</li><li>The error may be caused by a problem in a library or dependency that is used by the code, rather than the code itself. In this case, it may be difficult to understand how the problem is related to the code being executed.</li><li>The error may be caused by a problem with the underlying system or environment in which the code is running. For example, the error may be related to an issue with the operating system or hardware.</li><li>The error may be caused by a problem that only occurs in certain conditions or under certain circumstances. This can make it difficult to replicate the error and figure out what is causing it.</li><li>The error may be caused by a combination of several different factors, making it difficult to identify the specific cause of the problem.</li></ol><p>For this, you need to examine the stack trace thoroughly and give attention to the slightest details to resolve the issue. While such task seems to be difficult, ChatGPT can make it simple for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*UQkcHqtTI603ncxb_TTGIw.png" /></figure><p>By providing the Traceback above to ChatGPT, we can get the following explanation “ This error can occur if the <strong>AWS CLI</strong> is not installed or properly configured on the machine where MLflow is being run. To resolve this issue, make sure that the AWS CLI is installed and configured with the appropriate <strong>access keys</strong> and <strong>permission</strong>s. You can find more information about installing and configuring the AWS CLI at the following link: <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html">https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html</a>.”</p><p>Troubleshooting an error can be as simple as that, Yes!!! you can have the explanation you looking for without worrying about reading the whole traceback lines and trying to understand each line</p><h4>Architectural system design</h4><p>Next, ChatGPT can aid in system design by offering suggestions for architecture and integration whether it is defined on premise or for any cloud provider. There are several things that need to be considered when designing a microservices architecture for software engineering:</p><ol><li>Communication between microservices: It is important to consider how services will communicate with each other, including the protocol and format of the data being exchanged also roles management and firewalls</li><li>Data management: In a microservices architecture, each service typically has its own database. This can make it challenging to manage data consistently across the system.</li><li>Deployment: Microservices architecture typically involves deploying each service independently, which can be challenging.</li><li>Monitoring and debugging: With many independent services, it can be difficult to monitor and debug the system.</li><li>Scalability: Microservices architecture allows for more granular scaling, but it can also make it more complex to scale the system.</li></ol><p>Here is an example of an architecture I have imagined and asked ChatGPT to help me defined on GCP.</p><p>“Give an architecture to adopt in GCP to be able to do the following :</p><p><strong>Data ingestion</strong>: On-premises databases are connected to the architecture through ETL pipelines. The data is extracted, transformed, and loaded into a datalake and a datawarehouse for storage.</p><p><strong>Data analysis</strong>: Data analysts have access to the data stored in the datalake and datawarehouse for analysis. They can use various tools and techniques to extract insights from the data.</p><p><strong>Machine learning</strong>: Some of the data stored in the datalake and datawarehouse is used to train machine learning models. These models are then deployed using Kubernetes to enable scalability and reliability.</p><p><strong>Tracking and monitoring</strong>: The architecture includes a customized implementation of MLflow to track and monitor the machine learning models deployed with Kubernetes. This helps ensure that the models are performing as expected and can be debugged if necessary.”</p><p>And here is the reponse i got from GPT for the architecture i requested</p><ol><li>Set up a GCP account and create a project. This will provide you with access to various GCP services and resources.</li><li>Set up a Cloud SQL or BigQuery database to store your on-premises data. You can then use Cloud Data Fusion or Cloud Composer to create ETL pipelines that extract, transform, and load the data from your on-premises databases into the GCP database.</li><li>Set up a Cloud Storage bucket or Cloud Bigtable to store the data in your datalake and datawarehouse. You can use Cloud Data Fusion or Cloud Composer to set up periodic data loads from the GCP database to the datalake and datawarehouse.</li><li>Set up Cloud Dataproc or Cloud AI Platform to enable data analysts to access the data in the datalake and datawarehouse and perform analysis using tools such as Apache Spark, Apache Hive, and Jupyter notebooks.</li><li>Set up Cloud AI Platform to train and deploy machine learning models using the data in the datalake and datawarehouse. Use Cloud Build or Cloud Source Repositories to store and version your model code and use Cloud Kubernetes Engine to deploy your models as containerized microservices.</li><li>Use Vertex AI to track and monitor your machine learning models. You also can set up an MLflow server on GCP, and use the MLflow Python client to log model training runs and deployments to the server. You can then use the MLflow UI to view the logged information and monitor the performance of your models.</li></ol><h4>Write boilerplate code</h4><p>It can also assist in writing boilerplate code by providing templates and examples to save time and effort. A boilerplate code is a piece of code that serves as a starting point for a new project. It can include templates and examples that can be used as a reference or as a foundation for building out the project.</p><p>Here is an example of a boilerplate code for a Flask web application generated by ChatGPT</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*bno5ZmjNQgUnwyzrDRTbAA.png" /></figure><p>This boilerplate code includes a Flask app object and a route that returns a message to the user when accessed. It also includes an if statement that runs the app when the script is executed.</p><p>These are just a few examples of the types of boilerplate code that can be useful when starting a new project. There are many more templates and examples available online, depending on the specific needs of your project.</p><h4>Replace StackOverflow</h4><p>Finally, ChatGPT has the potential to replace StackOverflow as a go-to resource for finding solutions to programming challenges. Its advanced natural language processing capabilities allow it to understand and respond to complex questions and provide accurate and relevant answers.</p><p>ChatGPT might be better than Stack Overflow is when you are looking for a more personalized and interactive solution to a coding problem. With ChatGPT, you can ask specific questions and receive detailed answers, rather than simply searching through a list of pre-existing questions and answers on Stack Overflow. ChatGPT is also able to provide guidance and suggestions based on your unique situation and needs, rather than simply providing a one-size-fits-all solution. This can be particularly useful if you are a beginner programmer and are looking for more guidance and support as you learn.</p><h3>Conclusion</h3><p>ChatGPT has the potential to revolutionize modern software engineering by providing developers with a powerful tool for improving their efficiency and effectiveness. With its advanced natural language processing capabilities and ability to understand and respond to complex questions and commands, ChatGPT can help developers in a wide range of tasks, including improving existing codebases, understanding error stack traces, assisting with system design, writing boilerplate code, and finding solutions to programming challenges.</p><p>By providing developers with a single, powerful tool that can handle a wide range of tasks, ChatGPT has the potential to streamline the software development process and make it more efficient and effective. As such, it has the potential to greatly impact the way software is developed and used in the modern world.</p><p>I’m glad to share my third blog for medium. The journey has just begun for me, and I feel so grateful to share my expertise on using ChatGPT. If you liked this article follow me on <a href="https://www.linkedin.com/in/ahmed-hassen/">Linkedin</a> and <a href="https://medium.com/@Ahhassen/how-to-ace-the-azure-dp-100-azure-data-scientist-associate-exam-230581b72812">Github</a> and don’t miss my recent blogs</p><ul><li><a href="https://medium.com/@Ahhassen/a-gentle-introduction-to-azure-security-best-practices-e0f1e598f47f">A Gentle Introduction to Azure Security Best Practices</a></li><li><a href="https://medium.com/@Ahhassen/how-to-ace-the-azure-dp-100-azure-data-scientist-associate-exam-230581b72812">How to Ace the Azure DP-100-Azure Data Scientist Associate Exam</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74cba094ea28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Gentle Introduction to Azure Security Best Practices]]></title>
            <link>https://medium.com/@Ahhassen/a-gentle-introduction-to-azure-security-best-practices-e0f1e598f47f?source=rss-b8866051ae59------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0f1e598f47f</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Ahmed Hassen]]></dc:creator>
            <pubDate>Fri, 14 Oct 2022 09:44:29 GMT</pubDate>
            <atom:updated>2022-10-14T09:44:29.779Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This Blog summarizes some of the main requirements related to security for Microsoft Azure Software Developers and especially Data Engineers</blockquote><h3>Introduction</h3><p>Security aspects remains one of the toughest subjects to handle inside an organization these days. As cloud technology is constantly emerging in the IT market, companies are leaning towards the security policies defined by their cloud providers to assist them on facing the upcoming challenges. From which we can mention, managing heavy workloads defined by the organization users such as services, applications and solutions as well as the attack risks and vulnerable deployments. Not forgetting, of course, the fact that we are lacking experienced cloud administrators which can implement the best security protocols.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sW9lUQnC2qK5uvBx.jpg" /></figure><p>As a Software engineer, leveraging the best cloud security practices is considered as a huge advantage and can offer many benefits to your workload deployments. Which is why I m sharing some of the best practices related to security I’ve came across while preparing for the Azure Data Engineer Certificate. As a Software Engineer working with Azure portal, you should deploy your workloads on multiple Azure Services that may include storage, databases, Network and many others. Linking all these together requires setting up security rules in order to secure your authentication</p><h3>Authentication Methods</h3><p>This blog will come in handy when it comes to define the best authentication method to access your Azure service in a secure way</p><h4>Azure Active Directory</h4><p>What is Azure Active directory? As described by the Microsoft, Azure AD is a cloud-based identity and access management service, it is highly scalable and distributed across the world through the Azure Cloud. It is a live directory or a database that stores user accounts and their passwords, computers, files shares, security groups, permissions and so much more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*Re0s94NrJMjyXf_i.jpg" /></figure><p>Down here I have noted a list of hints regarding the use of AAD:</p><ul><li>Azure AD does not support Azure Files (REST) or Azure Tables</li><li>Use Active Directory to authorize resource management operations such as configuration.</li><li>Managed identity for Azure resources is a feature of Azure Active Directory</li><li>Azure AD supports Multi-Factor Authentication</li><li>Azure AD authentication uses contained database users to authenticate identities at a database level</li><li>Finally, Active Directory is supported for data operations on blob and queue Storage</li></ul><h4>Shared Access Signature</h4><p>A shared access signature (SAS) provides secure delegated access to resources in your storage account. as a best practice, you shouldn’t share storage account keys with external third-party applications and untrusted client, but you can use SAS instead. SAS comes with three types: User delegation SAS, Service SAS and Account SAS</p><ul><li>For untrusted clients, use a shared access signature or SAS.</li><li>The SAS is a string that contains a security token that can be attached to a URI.</li><li>You use an SAS to delegate access to storage objects and specify constraints such as the permissions and the time range of access.</li><li>By default, storage accounts accept connections from clients on any network.</li><li>Does not support Azure Files (SMB) and does not support <strong>RBAC</strong></li></ul><h4>Shared Key (Storage account key)</h4><p>One other option to authorize a request against a private storage service can be done through a Shared key</p><ul><li>Supports <strong>Azure Blob</strong>, <strong>Azure Files (SMB)</strong>, <strong>Azure Files (REST)</strong>, <strong>Azure Queue</strong>, <strong>Azure Tables</strong></li><li>The RBAC is not supported</li></ul><h3>Azure Services</h3><p>In this section we are exploring Do’s and Don’ts for some of the main services that data engineers may work on to deploy their workloads. To guarantee a useful content, I have limited sections to only cover data related services like storage and data processing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*3wj0YtUMGcnS1IaTEO4N_A.png" /></figure><h4>Azure Data Lake Gen2</h4><p>ADLS Gen2 supports Azure RBAC (role-based access control) and Posix like access control lists (ACLs). The Azure Data Lake Storage Gen2 connector supports the following authentication types:</p><p>✑ Account key authentication</p><p>✑ Service principal authentication</p><p>✑ Managed identities for Azure resources authentication</p><ul><li>Managed identity authentication is required when your storage account is attached to a VNET</li><li>You can directly use this managed identity for Data Lake Storage Gen2 authentication like using your own service principal. It allows this designated factory to access and copy data to or from your Data Lake Storage Gen2</li><li>A shared access signature (SAS) provides secure delegated access to resources in your storage account. But ACLs is not supported</li><li>With a SAS, you have granular control over how a client can access your data.</li></ul><h4>Azure Data Factory</h4><p>When it comes to Azure Data Factory. We can use managed identities to authenticate. What are managed identities? Managed identities provide an automatically managed identity in Azure Active Directory for applications to use when connecting to resources that support Azure Active Directory (Azure AD) authentication. If you want to build an application using an Azure resource that can access another service without needing to manage credentials, then we can use Managed identities</p><ul><li>A data factory can be associated with a managed identity for Azure resources, which represents this specific data factory.</li><li>You can directly use this managed identity for Data Lake Storage Gen2 authentication like using your own service principal. It allows this designated factory to access and copy data to or from your Data Lake Storage Gen2</li></ul><h4>Azure Synapse Analytics</h4><p>Azure Synapse is <strong>a limitless analytics service </strong>that brings together enterprise data warehousing<strong> (dedicated SQL pools) </strong>and <strong>Big Data</strong> analytics.</p><p>Azure Synapse Analytics uses a combination of authentication requests with the conditional access option provided by Azure AD premium. This feature provides a policy-based mechanism for decisions like block access, MFA, compliant device or force a password change.</p><p>What is not obvious is that there are authentication processes that acts in the background which may occur when services are working together seamlessly:</p><ul><li>Azure Synapse Spark or SQL pool to access data in an Azure Data Lake</li><li>A user wants to view reports in Power BI dashboard that is being serviced by a dedicated SQL pool. Here, you have multiple levels of authentication taking place under the hood</li></ul><p>When it comes to authentication, consider the following guidance:</p><ul><li>Azure AD authentication uses contained database users to authenticate identities at the database level.</li><li>You can use the managed identity capabilities to authenticate to any service that supports Azure Active Directory authentication</li><li>The managed identity lifecycle is directly tied to the Azure Synapse workspace. If you delete the Azure Synapse workspace, the managed identity is also cleaned up</li><li>For user accounts that are not part of an Azure Active Directory, then using SQL authentication will be an alternative</li><li>If a user and an instance of Azure Synapse are part of the same Azure Active Directory, it is possible for the user to access Azure Synapse Analytics without an apparent login</li><li>For bulk loading of data through COPY statement into Synapse SQL through Azure Blob storage, supported authentication types are <strong>Shared Access Signature (SAS</strong>) and <strong>key/secret is storage account key</strong> while the file type is Parquet.</li><li>We can register the synapse workspace with system-managed identity if the storage account is provisioned with a VNET</li></ul><h4>Azure Databricks</h4><p>Users access Azure Databricks workspace with an Azure Active Directory account. The account must be added to the Databricks workspace before they can access it. The resource provider front end checks a user’s authorization against an Azure Active Directory tenant. Azure Databricks also uses SCIM to manage access controls to users.</p><p>Additionally, we can use Azure AD generated tokens to automate provisioning of Azure Databricks workspace in order to access the Databricks REST API, but we are limited to 600 tokens per workspace</p><p>The following features gives a better understanding of the security requirements while using Azure Databricks</p><ul><li>RBAC: Control access to clusters, jobs, data tables, APIs, and workspace resources such as notebooks, folders, jobs, and registered models.</li><li>VNET Injection: Deploy an Azure Databricks workspace in your own Virtual network comes with more benefits such as connecting to other Azure services like storage and private endpoints, use a custom DNS and take advantage of the user-defined routes.</li><li>Cluster connectivity: Enable secure cluster connectivity on the workspace, to allow only private IP addresses for the cluster nodes. Also known as “No Public IPs.”</li></ul><p>One important thing to mention, is the automatic authentication to Azure Data Lake Storage Gen1 and 2 from Azure Databricks by enabling the feature <strong>credentials passthrough</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iv09yf9HZjlzjzsZeqV5Fg.png" /></figure><p>Apart from Azure Key Vault — Backed secret scope, <strong>Databricks-backed secret scope</strong> can also be used to store secrets. It’s an encrypted database owned and managed by Azure Databricks. The secret scope name should be unique within a specific workspace.</p><h3>Conclusion</h3><p>That was a lot to take! Let’s be honest, Security is one of the heaviest tasks to handle. But if you did make it so far, you should be familiar now with the basic aspects of the security protocols and its requirements. Here some of the takeaways:</p><ul><li>An application that accesses a storage account when network rules are in effect still requires proper authorization for the request. Authorization is supported with <strong>Azure Active Directory (Azure AD)</strong> credentials for blobs and queues, with a valid <strong>account access key</strong>, or with an <strong>SAS token</strong>.</li><li>A shared access signature (SAS) is <strong>a URI that grants restricted access rights to Azure Storage resources</strong>. You can provide a shared access signature to clients who should not be trusted with your storage account key but to whom you wish to delegate access to certain storage account resources</li><li>Microsoft Defender for storage account can be enabled for Blob, File &amp; ADLS gen2 only when they are in GA.</li></ul><p>As you may noticed, I didn’t cover all the Azure services such as Azure ML or Azure Web Apps etc. I wanted to focus on the services mostly used by the data engineers.</p><p>I’m glad to share my second blog for medium. The journey has just begun for me, and I feel so grateful to share my expertise on the security subject. If you liked this article follow me on <a href="https://www.linkedin.com/in/ahmed-hassen/">Linkedin</a> and <a href="https://medium.com/@Ahhassen/how-to-ace-the-azure-dp-100-azure-data-scientist-associate-exam-230581b72812">Github</a> and don’t miss my fist blog on “How to Ace your DP-100 Certification”</p><p><a href="https://medium.com/@Ahhassen/how-to-ace-the-azure-dp-100-azure-data-scientist-associate-exam-230581b72812">How to Ace the Azure DP-100-Azure Data Scientist Associate Exam</a></p><p><strong><em>References</em></strong></p><p>Get the best from the following useful links for a better understanding of the security protocols defined by Microsoft Azure</p><p><a href="https://learn.microsoft.com/en-us/azure/security/fundamentals/best-practices-and-patterns">Azure Security Best Practices and Patters</a></p><p><a href="https://medium.com/@ryanemaqsoftware/azure-security-best-practices-f49fbef8e0eb">Azure Security Best Practices</a> by <a href="https://medium.com/u/51b7d62b18db">Ryan Ewert</a></p><p><a href="https://k21academy.com/microsoft-azure/azure-security-best-practices/">Top 10 Best Practices for Azure Security in 2022</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0f1e598f47f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Ace the Azure DP-100-Azure Data Scientist Associate Exam]]></title>
            <link>https://medium.com/@Ahhassen/how-to-ace-the-azure-dp-100-azure-data-scientist-associate-exam-230581b72812?source=rss-b8866051ae59------2</link>
            <guid isPermaLink="false">https://medium.com/p/230581b72812</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[microsoft]]></category>
            <dc:creator><![CDATA[Ahmed Hassen]]></dc:creator>
            <pubDate>Sun, 26 Jun 2022 22:33:44 GMT</pubDate>
            <atom:updated>2022-06-26T22:33:44.361Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Everything you need to know to get started with Microsoft Azure</blockquote><h3>Introduction</h3><p>Data Science and MLOps are the two most in-demand roles in the tech industry, with an annual average growth rate of 195% for both roles through 2023. If you are looking to get started with a career in data science or artificial intelligence, achieving certification in this area can help you stand out from other applicants.</p><p>This blog is intended to provide you with everything you need to know about taking the Microsoft certification exam DP-100 matching the recent updates for 2022. I will be providing the general tips and hints for the Exam in addition to my notes as a bonus for the readers. If you’re interested in starting your certification journey, continue reading!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*RLBj75kJzN59gmfCUfZuSQ.jpeg" /></figure><h3>My Journey with the Certification</h3><p>Instead of giving you a whole bunch of details on the exam content and its specifications (The usual information on other articles), I would rather walk you through the path I followed to nail the certification</p><h4>Free Azure Account</h4><p>One of the main keys to getting certified, is to get your hands dirty on the Azure Portal console. Start by creating a free account and get 200$ as free credits for you to be familiar with all the resources.</p><p>Note: you can create different accounts as long as you change your email, number and credit card. Otherwise, you should activate the option “pay-as-you-go” to continue using the azure portal</p><h4>Coursera Preparation Course</h4><p>This is one of the “win-win situations” that you may encounter. You will get a course to help you prepare for the certification, on one hand, and grant you a Voucher with 50% on the exam on the other hand. is like having the best from both worlds! Here is the <a href="https://www.coursera.org/learn/prepare-for-dp-100-design-a-data-science-solution-on-azure">link</a> for the course</p><h4>Certification Dumps</h4><p>Practicing some exam questions before taking the certification exam is a mandatory step to get yourself ready! Among the various resources out there, I will go first with</p><ul><li>W<strong><em>hizzlab</em></strong>, which I consider one of the best training platforms. If you want a user-friendly interface with a thorough explanation of all answers, this is your perfect spot! This dump comes with 4 timed practice tests and 140 questions taken directly from previous exams, which will help get familiar with the question types and help you manage your timing during the exam. take a step forward <a href="https://www.whizlabs.com/microsoft-azure-certification-dp-100/">here</a></li><li>The next one would be the <strong><em>Udemy platform</em></strong> which provides some useful resources to add to your Wishlist. But didn’t we get enough of the courses yet?! As a matter of fact, we did but since the Coursera preparation path lacks two of the main important features which are the Azure SDK and Azure CLI, and that’s why I would recommend an additional course for both. Mastering the use of the Azure portal interface and its tools is a great skill. That said, having the ability build solutions through Python SDK, Azure CLI commands is a whole different story, and you need to have that kind of expertise to get certified. This is the <a href="https://www.udemy.com/course/machine-learning-using-azureml/">course</a> I recommend</li><li>Last but not least is the famous <strong><em>Exam-Topic</em></strong> <a href="https://www.examtopics.com/exams/microsoft/dp-100/">platform</a>. This dump has been avoided by fellow Azure candidates due to the misleading answers and wrong explanations it contains. But using it Wisely can turn this pain point into an amazing advantage, but how?! Try to get into the discussion between members in each question, share your thoughts, receive feedback and filter the upvoted responses to get your final correct answer, it could be a good practice to build up your skills. That said, be aware of deprecated questions as some tests may not be up to date</li></ul><h3><strong>Exam content: All you need to know</strong></h3><p>The DP-100 certification exam tests your ability to create a data science solution that meets a specific business need. You can take the exam whether you’re a data scientist or analyst, but your solution will be judged on its fit for a given scenario. In this section, I will not go into the 5 questions types that you will face during the exam (which btw can be found in this awesome <a href="https://towardsdatascience.com/azure-dp-100-exam-guide-everything-you-need-to-know-9f6f84d863d3">story</a> by <a href="https://medium.com/u/3c3fa8c446bb">Seth Billiau</a>). Alternatively, I prefer to have a deep dive into the main concepts and their related questions.</p><h4>Manage Azure resources for ML</h4><p>This part tests your expertise in choosing the best Azure resources that best fit your data science solution. We will focus on three important parts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*YL6N0CcVls2M7oMh.jpg" /><figcaption>Azure resources-<a href="https://teleco.ca/teleco-advises-business-to-move-to-the-cloud-with-ms-azure/">credits</a></figcaption></figure><ol><li><strong><em>Managing compute for experiments</em></strong></li></ol><p>You should be able to determine the appropriate compute specifications for your workload. Here are some hints to help decide:</p><ul><li><em>Azure compute instance</em>: a single VM doesn’t go idle (scale to 0) or scale up, you can’t share it and needs to be deleted for charges. Can be used with AutoML but is not available in the designer</li><li><em>Compute clusters</em>: a Multi-node compute type that can scale up and down, you can share it for training and create t within your workspace region. Suitable for AutoML and training experiments</li><li><em>Azure Kubernetes Services</em>: an AKS cluster is used for high scale production deployments such as real-time inference. Available in the designer and can be used in dev/test mode for larger models</li><li><em>Azure Container Instance</em>: ACI is suitable for small models (&lt;1GB in size and &lt;48GB in RAM). Used for real-time inference in dev/test mode, scale in a serverless way and available in the designer</li><li><em>Azure Databricks</em>: This Instance can be used as a training resource for local runs and machine learning pipelines, but not as a remote target for other training.</li><li><em>Azure HDInsight</em>: capable of running pipelines but not suitable for AutoML and not supported in the designer. can be used as an attached compute for training and not for inference</li></ul><p><strong><em>2. Implement Security and Access control</em></strong></p><p>creating custom roles and being familiar with built-in roles is a must-know skill. Follow this guidance:</p><ul><li>You can assign roles in four different ways, Azure portal, PowerShell, CLI commands and Rest API</li><li><em>RBAC</em>: a tool to manage and control the scope granted to identity over a specific resource</li><li><em>Managed identity</em>: an authentication method to access an Azure resource. System-assigned identity links you directly to a single resource whereas user assigned identity gives you access to multiple resources</li><li><em>Service Principal</em>: an automated process for accessing ML Workspace with no credentials needed. Useful to connect to other resources such as the Datalake Storage or the Azure SQL</li><li><em>Owner built-in-role</em>: Grants full access to all resources, including assigning roles in Azure RBAC</li><li><em>Contributor role</em>: same as owner with no role assignments in RBAC, no assignments in Azure Blueprints and can’t share image galleries</li><li><em>Reader role</em>: View all resources, but not allowed to make any changes</li><li><em>User administrator</em>: manage user access resources and assign roles</li></ul><p>3. <strong><em>Set up Azure Databricks workspace</em></strong></p><ul><li>Azure Databricks supports <strong>Python, Scala, R, Java, and SQL</strong>, as well as data science frameworks and libraries including TensorFlow, PyTorch, and scikit-learn</li><li>You can link your Databricks cluster to Azure ML workspace</li><li>logs and models artifacts are stored in both Azure ML and Azure Databricks Workspace once linked</li></ul><h4>Run experiments and train models</h4><p>For this part we will discover what is AutoML, create optimal models, tune its hyperparameters and how to troubleshoot your failing experiments like an expert</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/0*oSPAv5sxEVN_kJyR.png" /><figcaption>AutoML in Azure-<a href="https://docs.microsoft.com/en-us/azure/machine-learning/tutorial-auto-train-models">credits</a></figcaption></figure><ol><li><strong><em>Use Automated Machine Learning</em></strong></li></ol><ul><li>Feature engineering: when enabled, all the pre-processing transformations are done automatically via the ML Studio</li><li>Control your AutoML experiments costs by setting exit criterions such as training job time and metric score Threshhold</li><li>To use a custom featurization, we need to create an <strong><em>AutoMLConfig</em></strong> object and then customize the transformations with commands like <strong><em>add_transformers_params</em></strong> or <strong><em>drop_columns</em></strong> etc…</li><li>only the training data is mandatory, validation dataset can be instructed through the <strong><em>validation_size</em></strong><em>. Otherwise, Azure ML apply cross-validation using the training data</em></li></ul><p><strong>2. <em>Tune Hyperparameter with Azure ML</em></strong></p><p>Choosing the sampling method along with the early termination policy is an important feature in tuning hyperparameters:</p><ul><li><em>Grid Sampling</em>: applied only with discrete values and used to try every possible combination</li><li><em>Random Sampling</em>: Randomly select a value for each hyperparameter, which can be a mix of discrete and continuous values</li><li><em>Bayesian Sampling</em>: Supports discrete and continuous values, learns from previous runs, <strong>does not support early termination</strong> techniques and can’t use <strong>normal distribution</strong> but only Choice, Uniform and qUniform</li><li><em>Median stopping policy</em>: terminates the execution when the performance metric proves to be worse than the median of the running averages.</li><li><em>Bandit policy</em>: iterations are done when the primary performance metric underperforms the best of the runs. Not to use for Bayesian sampling</li></ul><p><strong>3. <em>Troubleshooting experiments</em></strong></p><ul><li><em>Use logs</em>: Use the <strong><em>get_details_with_logs()</em></strong> method of the run object to display the experiment run logs, otherwise use the AzureML Studio</li><li><em>Debug locally</em>: using a local web service makes it easier to troubleshoot and debug problems</li><li><em>HTTP status code 502</em>: Exception crashed in the run</li><li><em>HTTP status code 503</em>: in this case, you should decrease the utilization at which autoscaling creates new replicas (default value 70%)</li><li><em>HTTP status code 504</em>: Increase the Timeout and remove unnecessary call from the score.py script</li></ul><h4>Deploy and operationalize ML solutions</h4><p>In this part, we will focus on the pipeline aspect, what knowledge we need for the experiments and how to use Mlfow for tracking</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*T0xAxP3Pd8S3oAdu.png" /><figcaption>ML Operationalization-<a href="https://mobcoder.com/blog/mlops-methods-and-tools-of-devops-for-machine-learning/">credits</a></figcaption></figure><ol><li><strong><em>Deploy model as real time inference</em></strong></li></ol><p>After creating an experiment, it’s important to know how to publish it as real time inference. Follow this guidance to do so:</p><ul><li><em>Register the model</em>: can be done from a local path or referenced to a run. Previous models will not be overwritten but another version will be added</li><li><em>Inference config</em>: first we define the entry script (<strong><em>init() and run() functions), </em></strong>next we set the environment (specification file, pre-built Envs or by specifying packages) and finally combine both in <strong><em>InferenceConfig</em></strong></li><li><em>Deployment config</em>: start by choosing the compute, define the deployment configuration (whether it’s <strong><em>AksWebservice</em></strong> or <strong><em>AciWebservice</em></strong>) and then deploy you model to an endpoint through the Model class</li><li><em>ACI services</em>: Authentication is disabled by default for ACI deployed service, but can be set manually to <strong><em>key_based</em></strong> authentication</li><li><em>AKS services</em>: <strong><em>key-based</em></strong> authentication is set by default. Optionally you can choose an AKS to use <strong><em>token-based</em></strong> authentication</li></ul><p><strong><em>2. Pipelines and Experiments in Azure ML</em></strong></p><p>Here some general aspects how you should configure your pipelines and experiments in Azure:</p><ul><li>When running pipeline with multiple steps, you should include the <strong><em>PipelineData</em></strong> parameter to reference the output folder</li><li>Publishing a Pipeline: first call the publish method on a specific run, next assign an endpoint to it, after that initiate a published endpoint by making a HTTP request to its REST endpoint</li><li>In order to parametrize you pipeline, you should create <strong><em>PipelineParameter</em></strong> object for the pipeline before publishing it!</li><li>Use the ParallelRunStep class to perform parallel batch inferencing. All the results can be stored in the parallel_run_step.txt file</li><li>Schedule a pipeline: We publish the pipeline to get the ID, then create the Recurrence, finally we define the pipeline with the Schedule method</li><li>Trigger a pipeline whenever data changes: we must create a Schedule that monitors a specified path on a datastore</li></ul><p><strong><em>3. What MLflow is good for?!</em></strong></p><p>One of the things that will separate you from candidates, is your knowledge on Mlflow module, here are some hints for the tool:</p><ul><li>Logging: <strong><em>log_param</em></strong>, <strong><em>log_metric</em></strong>, <strong><em>log_image</em></strong> are logging methods to store important values inside MLflow</li><li>Logging a model should be followed by its package, for example if you trained a model with spark <strong><em>mlflow.spark.log_model(model,”model”)</em></strong></li><li>to set the MLflow logging target, you need to <strong><em>set_tracking_uri</em></strong> after getting it with the <strong><em>get_mlflow_tracking_uri</em></strong> method</li></ul><h4>Implement responsible ML models</h4><p>Here comes the last part. We will discuss some interesting aspects such as fairness, privacy and model explainers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*T6IQOejUp_QL0cRVY2IIug.jpeg" /><figcaption>Responsible ML-<a href="https://medium.com/@damir.divkovic/a-deeper-dive-tools-for-responsible-ai-from-microsoft-viewpoint-efb16ed1f772">credits</a></figcaption></figure><ol><li><strong><em>Model explainers and feature importance</em></strong></li></ol><p>Models explainers can be local or global depending on your needs. If you want to understand the importance of your features with regards to all the predictions goes with global, otherwise choose local for a specific prediction</p><ul><li><em>Mimic Explainer</em>: Works as both global and local explainers. Note that we should choose the same architecture as the trained model.</li><li><em>Tabular Explainer</em>: Same as Mimic, chooses the architecture of explainer by itself. The explainer acts as a wrapper around various algorithms</li><li><em>PFI Explainer</em>: Doesn’t support local feature importance explanation. It requires the actual labels which are the test features</li></ul><p><strong><em>2. Detect and Mitigate unfairness</em></strong></p><p>We have three techniques to mention to mitigate unfairness</p><ul><li><em>Exponentiated gradient</em>: Applies cost minimization approach to learn the tradeoff between predictions and fairness disparity</li><li><em>Gridsearch technique</em>: same as Exponentiated gradient but works efficiently with small number of constraints</li><li><em>Threshhold optimizer</em>: a post processing technique that applies a constraint to the classifier, transforming the prediction as appropriate</li></ul><p><strong><em>3. Data Drift in dataset</em></strong></p><p>Define a dataset monitor to detect Data-drift and trigger alerts if the rate of drift exceeds a specific threshold</p><ul><li><em>DataDriftDetector</em>: create this monitor from a dataset specifying the <strong><em>baseline_data</em></strong> and the <strong><em>target_data</em></strong></li><li><em>Backfill</em>: compare the baseline dataset to the target dataset, which backfills the monitor based on time laps</li><li><em>AlertConfiguration</em>: set an operator email address for notifications if the <strong><em>threshhold</em></strong> defined is exceeded</li></ul><h3>Conclusion</h3><p>Congratulation on making it so far! It is not an easy journey as you have noticed, but it does worth the effort, believe me! I can’t express enough the excitement and gratitude I had while sharing my expertise on the subject. If you want to dig even more on the exam content, I have prepared a document (DP-100) in my <a href="https://github.com/ahmedhassen7/Azure-DP100-Exam-preparation">GitHub</a> which goes deeper on each section. You can also get a list of study materials on Azure DP-100 in this amazing <a href="https://medium.com/deep-ai/study-guide-for-microsoft-azure-data-scientist-associate-certification-dp-100-c2e4611cb071">article </a>by <a href="https://medium.com/u/37b79f8d5d8">Shivam</a></p><p>The DP-100 exam is a 120-minute, with exam questions between 40–60, delivered either through a computer-based testing system (Pearson VUE) or on-site. Make sure to use your personal laptop, as you may need to disable firewall and proxy settings during the exam. Choose a quiet place and don’t let anyone enter your room. At the end of the exam, you will be given a score and a list of questions you got wrong. You will not be able to go back and change answers after you submit the exam. You must wait until the end of the exam to see your score.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=230581b72812" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>