<?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 Kiarash Yasoubi on Medium]]></title>
        <description><![CDATA[Stories by Kiarash Yasoubi on Medium]]></description>
        <link>https://medium.com/@kiarashyasoubi?source=rss-e203cadd18ba------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*4XRApFOiRsMJAufC</url>
            <title>Stories by Kiarash Yasoubi on Medium</title>
            <link>https://medium.com/@kiarashyasoubi?source=rss-e203cadd18ba------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 16:13:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kiarashyasoubi/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[Azure Cost Management API: A Practical Guide for FinOps Automation]]></title>
            <link>https://medium.com/@kiarashyasoubi/azure-cost-management-api-a-practical-guide-for-finops-automation-19a8a400f2ef?source=rss-e203cadd18ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/19a8a400f2ef</guid>
            <category><![CDATA[finops]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[azure-cost-management]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Kiarash Yasoubi]]></dc:creator>
            <pubDate>Wed, 04 Feb 2026 15:17:08 GMT</pubDate>
            <atom:updated>2026-02-04T15:17:08.430Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zq89exHpiemKHpSw817bIQ.png" /></figure><h3>Why use the Cost Management API?</h3><p>Most Azure users start and end their FinOps journey in the <strong>Azure Portal</strong>. It’s a fantastic out-of-the-box solution that provides visual breakdowns, budget alerts, and advisor recommendations. However, as an organization matures, the “built-in” tools can become a silo.</p><p>The real power of the <strong>Cost Management API</strong> lies in <strong>flexibility and integration</strong>. If you are building a <strong>Multicloud FinOps Solution</strong>, you cannot rely on the Azure Portal alone. You need to pull Azure data into a central “Single Pane of Glass” (like a custom dashboard or a data lake) to compare it alongside AWS or GCP costs.</p><blockquote><strong><em>Note:</em></strong><em> The API isn’t just for looking at data; it’s for </em><strong><em>automating</em></strong><em> your response to that data.</em></blockquote><h3>Introduction</h3><p>Usually, for standard FinOps monitoring, the built-in Azure dashboards are enough. They provide immediate visibility into your spending.</p><p>However, we move to the API when we hit these “New-level” requirements:</p><ol><li><strong>Multicloud Consolidation:</strong> Merging Azure spend with other cloud providers for a holistic business view.</li><li><strong>Custom Analytics:</strong> Using Python or Power BI to perform complex trend analysis that the standard portal doesn’t support.</li><li><strong>Automated Governance:</strong> Triggering external workflows (like Jira tickets or Slack alerts) based on specific granular cost data.</li></ol><h3>Requirements: Setting the Stage</h3><p>To programmatically talk to Azure, you can’t just use your personal login. You need a formal handshake between your code and the Azure platform.</p><h3>1. Service Principal (SPN)</h3><p>Think of the SPN as a “User Account” for your script. You will need to register an application in <strong>Microsoft Entra ID</strong> (formerly Azure AD) to get your Client ID, Tenant ID, and Client Secret.</p><h3>2. The Right Role (RBAC)</h3><p>Having an SPN isn’t enough; it needs permission to “read” the billing data. You must assign one of the following roles at the appropriate scope:</p><ul><li><strong>Cost Management Reader:</strong> Perfect for simple data extraction.</li><li><strong>Cost Management Contributor:</strong> If your script needs to create exports or manage budgets.</li></ul><h3>3. The Tooling</h3><p>While you can use various languages, <strong>Python</strong> is the industry standard for FinOps due to its powerful data libraries (like pandas) and the robust azure-mgmt-costmanagement SDK.</p><h3>Methods: Scoping Your Data</h3><p>One of the most powerful features of the API is the ability to choose your <strong>Scope</strong>. You don’t always want “everything.”</p><p><strong>Scope LevelBest Use CaseManagement Group</strong>Enterprise-wide reporting. See costs across multiple subscriptions at once.<strong>Subscription ID</strong>Standard project-level tracking. Most common for specific business units.<strong>Resource Group</strong>Granular tracking. Great for “Chargeback” models where you bill a specific team for their specific app.</p><p>Understood. Let’s strip away the “consultant” talk and focus on the technical engineering and the “why” for your blog post. Here is the refined section for Medium, focusing on the architecture and the code.</p><h3>Defining the Scope: Management Group, Subscription, or Resource Group?</h3><p>One of the most important parts of using the Azure Cost Management API is defining the <strong>Scope</strong>. The scope tells Azure where to look for the data. If you don’t define this correctly, you’ll either get too much data to process or miss critical costs.</p><h3>Which Scope should you choose?</h3><ul><li><strong>Management Group:</strong> Use this for <strong>Enterprise-wide data</strong>. It’s the best choice when you need to aggregate costs across dozens of subscriptions for a high-level FinOps report.</li><li><strong>Subscription:</strong> This is the most common scope. It targets a specific environment (like Production or Dev) and provides a clean breakdown of all services within that account.</li><li><strong>Resource Group:</strong> Use this for <strong>Application-level tracking</strong>. If you want to know exactly how much your “Customer-API” project is costing compared to your “Internal-DB” project within the same subscription, this is your scope.</li></ul><h3>The Implementation: Python Code Snippet</h3><p>To get this running, you will need the azure-identity and azure-mgmt-costmanagement libraries. The code below is designed to be modular—you just swap out the SCOPE_ID string depending on your needs.</p><h3>1. Authentication and Setup</h3><p>First, make sure your Service Principal (SPN) has <strong>Cost Management Reader</strong> permissions at the level you are trying to query.</p><h3>2. The Python Script</h3><pre>import os<br>from azure.identity import DefaultAzureCredential<br>from azure.mgmt.costmanagement import CostManagementClient<br>from azure.mgmt.costmanagement.models import QueryDefinition, QueryDataset, QueryAggregation<br><br># --- CONFIGURATION ---<br># Management Group: &quot;/providers/Microsoft.Management/managementGroups/{mg-id}&quot;<br># Subscription:     &quot;/subscriptions/{sub-id}&quot;<br># Resource Group:   &quot;/subscriptions/{sub-id}/resourceGroups/{rg-name}&quot;<br><br>SCOPE_ID = &quot;/subscriptions/your-subscription-uuid-here&quot;<br><br>def fetch_azure_costs(scope):<br>    # Initialize the credential and client<br>    credential = DefaultAzureCredential()<br>    client = CostManagementClient(credential)<br><br>    # Define the data you want to pull (Pre-Tax Cost, Summed up)<br>    query_def = QueryDefinition(<br>        type=&quot;Usage&quot;,<br>        timeframe=&quot;MonthToDate&quot;,<br>        dataset=QueryDataset(<br>            aggregation={<br>                &quot;totalCost&quot;: QueryAggregation(name=&quot;PreTaxCost&quot;, function=&quot;Sum&quot;)<br>            },<br>            granularity=&quot;None&quot;<br>        )<br>    )<br><br>    # Execute the request<br>    try:<br>        usage = client.query.usage(scope, query_def)<br>        <br>        # Displaying the result<br>        for row in usage.rows:<br>            amount = row[0]<br>            currency = row[2]<br>            print(f&quot;Current Month Spend for {scope}: {amount} {currency}&quot;)<br>            <br>    except Exception as e:<br>        print(f&quot;Error fetching data: {e}&quot;)<br><br>if __name__ == &quot;__main__&quot;:<br>    fetch_azure_costs(SCOPE_ID)</pre><h3>Why this approach is flexible</h3><p>By using Python instead of the built-in Azure Export feature, you can:</p><ul><li><strong>Filter on the fly:</strong> Only pull data for specific tags.</li><li><strong>Format for Multicloud:</strong> Clean the Azure data so it matches your AWS or GCP data structures.</li><li><strong>Automate Reporting:</strong> Send these results directly to a database, a Slack channel, or a custom dashboard without manual intervention.</li></ul><h3><strong>Going Deeper: Grouping Data by Service</strong></h3><p>If you want to use this data for a Multicloud FinOps solution, you need to break down the costs. The API allows you to “Group By” specific dimensions like <strong>Resource Location</strong>, <strong>Service Name</strong>, or <strong>Resource Group Name</strong>.</p><h3>Updating the Query for Granularity</h3><p>By adding a grouping parameter to our QueryDataset, the API will return a list of costs per service rather than just one total number.</p><pre>from azure.mgmt.costmanagement.models import QueryGrouping<br><br>def fetch_costs_by_service(scope):<br>    client = CostManagementClient(DefaultAzureCredential())<br><br>    query_def = QueryDefinition(<br>        type=&quot;Usage&quot;,<br>        timeframe=&quot;MonthToDate&quot;,<br>        dataset=QueryDataset(<br>            aggregation={<br>                &quot;totalCost&quot;: QueryAggregation(name=&quot;PreTaxCost&quot;, function=&quot;Sum&quot;)<br>            },<br>            # This is the magic part: Grouping by Service Name<br>            grouping=[<br>                QueryGrouping(type=&quot;Dimension&quot;, name=&quot;ServiceName&quot;)<br>            ]<br>        )<br>    )<br><br>    result = client.query.usage(scope, query_def)<br>    <br>    print(f&quot;{&#39;Service&#39;:&lt;25} | {&#39;Cost&#39;:&lt;10}&quot;)<br>    print(&quot;-&quot; * 40)<br>    for row in result.rows:<br>        print(f&quot;{row[1]:&lt;25} | {row[0]:.2f} {row[2]}&quot;)</pre><h3>Best Practices for the Cost Management API</h3><p>Before you publish your automation, keep these three technical constraints in mind:</p><ol><li><strong>Data Latency:</strong> Azure billing data is not real-time. There is usually a <strong>8-to-24 hour delay</strong> between usage and when it appears in the API.</li><li><strong>Pagination:</strong> If you are querying at a Management Group level with thousands of resources, the API might paginate the results. Ensure your code can handle next_link tokens.</li><li><strong>Rate Limits:</strong> The Cost Management API has a limit of <strong>30 calls per minute</strong>. If you are building a dashboard for many users, implement a caching layer (like Redis) so you aren’t hitting the API on every page refresh.</li></ol><h3>Beyond Data Collection: Automation &amp; Anomaly Detection</h3><p>Gathering data is only the first step. To truly implement a FinOps culture, you need to move from <strong>reactive monitoring</strong> to <strong>proactive automation</strong>. Here are two high-impact ways to extend the code we’ve built:</p><h3>1. Automate with Azure Functions</h3><p>Instead of running this script manually on your laptop, host it in an <strong>Azure Function</strong>.</p><ul><li><strong>The Trigger:</strong> Use a <strong>Timer Trigger</strong> (CRON job) to run the script every morning at 8:00 AM.</li><li><strong>The Workflow:</strong> The function pulls the cost data, formats it, and pushes it to a central storage account or a Power BI streaming dataset or SQL Server Database.</li><li><strong>The Benefit:</strong> It’s serverless and low-cost. You only pay for the few seconds the script takes to run, making it a “zero-touch” solution for your team.</li></ul><h3>2. Implement Anomaly Detection</h3><p>The biggest risk in cloud environments is a “runaway bill” — a developer leaves a high-end GPU cluster running, or a script loops infinitely. You can enhance your Python code to detect these anomalies:</p><ul><li><strong>The Logic:</strong> Compare today’s MonthToDate cost against the average cost of the last 7 days.</li><li><strong>The Action:</strong> If the current spend is &gt;20% higher than the rolling average, have the script send an urgent alert via <strong>SendGrid</strong> or a <strong>Microsoft Teams Webhook</strong>.</li></ul><blockquote><strong><em>Pro Tip:</em></strong><em> Don’t just alert on total cost. Set up your anomaly detection to look at specific service tiers. A sudden spike in “Data Transfer” costs is often a sign of a configuration error or a security breach.</em></blockquote><h3>Final Thoughts</h3><p>The Azure Cost Management API is the foundation of a mature cloud strategy. By shifting your cost data into a programmatic environment like Python, you gain the flexibility to integrate with multicloud tools, automate your reporting, and build intelligent guardrails that protect your budget.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19a8a400f2ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to pass the exam Azure Data Engineer Associate DP-203]]></title>
            <link>https://medium.com/@kiarashyasoubi/how-to-pass-the-exam-azure-data-engineer-associate-dp-203-444d2636804b?source=rss-e203cadd18ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/444d2636804b</guid>
            <category><![CDATA[databricks]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[data-engineer]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[synapse]]></category>
            <dc:creator><![CDATA[Kiarash Yasoubi]]></dc:creator>
            <pubDate>Wed, 13 Jul 2022 22:36:51 GMT</pubDate>
            <atom:updated>2022-07-13T22:36:51.840Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*F_TVtCa_GNE61R-RgrhPwg.png" /></figure><h3><strong>Azure Data Engineer Associate — DP203</strong></h3><p>Azure Data Engineer Associate, is one of the favorite microsoft certificate among data engineers and developer. This certificate evaluates the understanding of user over processing, develop, storing and security in the Azure environment.</p><h3><strong>What are the requirement?</strong></h3><p>Although it is not required but it is highly recommended to pass the <strong>Azure Fundamental — AZ900</strong> and <strong>Azure Data Fundamental -DP900</strong> before <strong>DP203</strong> if you are not familiar with Azure Ecosystem. The good news is you don’t have to be an expert in programing language like Python or Scala to pass this exam. However, some high level knowledge may be required.</p><h3><strong>The main topics to cover</strong></h3><p><strong>Design and implement data storage (40–45%)</strong></p><p>Most of the question are related to storing the data. You need have a solid understanding of storing solutions like storage account, blob, container, datalake ….</p><p><strong>Design and develop data processing (25–30%)</strong></p><p>The other important of part of the exam could be using the data movement and processing tools like Azure Data Factory, Synapse , Azure Databricks, Spark …</p><p><strong>Design and implement data security (10–15%)</strong></p><p>Familiarity with security concepts like row level security or policies</p><p><strong>Monitor and optimize data storage and data processing (10–15%)</strong></p><p>This part is mainly concentered on monitoring and troubleshooting</p><p>*Beware that topics are regularly updating. Therefore, it is better to check the Microsoft official website</p><h3><strong>Recommendation to study</strong></h3><p><strong>Microsoft learning path:</strong> is the best place to start. You should finish all the modules. By finishing the learning path you will have a good understanding over related topics for the exam</p><p><strong>Hands on experience: </strong>Without playing with azure services, it will not possible to pass this exam. Try to deploy some resources and create some pipelines. You can also use Azure Free 30 days credits if you don’t have access to azure for free.</p><p>Here are some tasks/projects can help you understand Azure Data Engineer tools better if you are a beginner:</p><p>Deployment of resource: Deploy Storage account, SQL Database Synapse, Datafactory ..</p><p>Create an access tokens and configure the firewall</p><p>Data Factory : create a pipeline that read data from storage account and inject it to sql database (connectors, linked services, dataset)</p><p>Synapse (Serverless, Spark Pool, Dedicated server): create pipelines, use synapse notebook to run some transformation code, load data from storage account using different methods ( external tables, spark …)</p><p>Azure Databricks (mounting, load and development, Monitoring)</p><h3><strong>Exam structure</strong></h3><p>Number of questions are vary between 42 to 60. exams divided in 3 parts, after finishing each part you cannot go back! Be careful. In addition, usually there will be some use case, which you are going to encounter the scenario and based on that you have to answer some questions.</p><p>The passing score is above 60% and you will receive the result immediately after finishing the exam. And the certificate will be valid for 1 year. Eveyr year you have to pass an easement to renew the certificate ( don’t worry it is not as hard as the exam!)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=444d2636804b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Witcher Netflix — Social Media Analytics: web scraping, natural language processing with…]]></title>
            <link>https://medium.com/data-analytics-centre/the-witcher-netflix-social-media-analytics-web-scraping-natural-language-processing-with-34b942d9faf6?source=rss-e203cadd18ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/34b942d9faf6</guid>
            <category><![CDATA[social-media-analytics]]></category>
            <category><![CDATA[the-witcher]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Kiarash Yasoubi]]></dc:creator>
            <pubDate>Thu, 09 Jul 2020 21:27:33 GMT</pubDate>
            <atom:updated>2020-08-23T18:27:37.098Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Witcher Netflix — Social Media Analytics: web scraping, natural language processing with Python</h3><p>Social media is one the main source of accessing to difference data these days. Many organizations invest in social media analytics tools and techniques in order to monitor and predict events as well as people behaviors. However, Social media is one the main source of accessing to difference data these days. Many organizations invest in social media analytics tools and techniques in order to monitor and predict events as well as people behaviors. However, usually we people talk about social media they think about twitter, Facebook and Instagram, however, there are other social media for other fields or industries too. IMDB is one of the biggest database of films, television programs and video games that offers vast information and enable users to share their opinion about programs and rank them. Therefore, in this article we aimed to collect IMDB user’s reviews about the series the Witcher that believed to be the next Game of Thrones. Instead of looking for other social Medias, we are going to collect our data directly from IMDB website using a single web scraping by Python and then analyze the comments. Our goal is to use Python to explorer users’ comment and get insight about what they are think about the Witcher.</p><p>Here is the framework we are going to implement with Python:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*hj8Df73OgNejPqpw3mDv_w.png" /></figure><p><strong>1.</strong> <strong>Data collection:</strong></p><p>We load the required libraries (you may need to install some of them)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hO7b3WUjZFs16wZk_grfjA.png" /></figure><p>Then we enter the URL(s) of reviews and use the BeautifulSoup library to download and parse the html tags.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pVTWFDQUnobzTiwY9DrYPQ.png" /></figure><p>In this step, we should find the exact address of html tags we are looking for. BeautifulSoup function’s find_all could be useful here. We know that comment are stored in class name “review-container”, so apply the function and extract comments from html code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*25ZXPeO5ty48HL5oHEtIdA.png" /></figure><p><strong>2.</strong> <strong>Data Manipulation</strong></p><p>Now we have a messy and semi structured data, which is not ready for processing. We need to first transform it to tabular data set and then do some cleaning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*5zL7Z3Og0dwCWSVZzmiGkw.png" /></figure><p>As you may noticed, Reviews are messy and ranking column need to be cleaned</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*uoUs3418ijijWJtHf1FdXQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*9Nl7eFtksGBVUI_Un0PMvg.png" /></figure><p>Now ranking column cleared so let us see what is happening here</p><p><strong>3.Visualization</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*yjCcBeliZzNsXCM7Reop5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*8cGLXcd3S8FTuTXlwml5hg.png" /></figure><p>4. <strong>Natural Language Processing</strong></p><p>For this part, we need to make corpus and tokenize the comments</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*ACq7s_EiooDy3THCkwQFLA.png" /></figure><p>Now we can visualized the most frequent words used by users</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*9ffXYl94mAvBjiDTMU6iHg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vmbcs2nIuheMUWVfJ62S5Q.png" /></figure><p>Then we apply sentiment analysis</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*1VUUMlVBtsBJlGNcbb0Vzw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*VD_VXXDm4KBsEqsTeO4L_A.png" /><figcaption>We noticed that most people had positive comment</figcaption></figure><p>Now visualize most frequent positive and negative words</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*lICVs_6wpPpzI1HHtR8vRw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*8efOqEcRYkR19ZfmtdzEsw.png" /><figcaption>Positive reviews</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*Je5LmgqOvsimbdITAuyNIw.png" /><figcaption>Negative reviews</figcaption></figure><p><strong>Conclusion:</strong></p><p>In this article tried to show how to combine web scraping with natural language processing in order to get insight about how user thing about the series.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34b942d9faf6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-analytics-centre/the-witcher-netflix-social-media-analytics-web-scraping-natural-language-processing-with-34b942d9faf6">The Witcher Netflix — Social Media Analytics: web scraping, natural language processing with…</a> was originally published in <a href="https://medium.com/data-analytics-centre">Data Analytics Centre</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>