<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Antoine</title>
    <description>The latest articles on DEV Community by Antoine (@antoinega).</description>
    <link>https://dev.to/antoinega</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F243687%2Fc8e49f6d-a208-4a7e-a33b-ba73b2fe782b.jpeg</url>
      <title>DEV Community: Antoine</title>
      <link>https://dev.to/antoinega</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/antoinega"/>
    <language>en</language>
    <item>
      <title>Code Optimizations using AI and Azure Profiler</title>
      <dc:creator>Antoine</dc:creator>
      <pubDate>Tue, 12 Nov 2024 22:41:05 +0000</pubDate>
      <link>https://dev.to/antoinega/code-optimizations-using-ai-and-azure-profiler-1mg2</link>
      <guid>https://dev.to/antoinega/code-optimizations-using-ai-and-azure-profiler-1mg2</guid>
      <description>&lt;p&gt;For now, without any additional cost, you can use Code Optimizations leveraging AI trained &lt;strong&gt;not&lt;/strong&gt; on your code!&lt;/p&gt;

&lt;h2&gt;
  
  
  Enabling the Code Profiler
&lt;/h2&gt;

&lt;p&gt;For more see &lt;a href="https://learn.microsoft.com/en-us/azure/azure-monitor/insights/code-optimizations" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; about Code Optimizations, this &lt;a href="https://learn.microsoft.com/en-us/azure/azure-monitor/profiler/profiler-overview" rel="noopener noreferrer"&gt;section&lt;/a&gt; about Profiler.&lt;/p&gt;

&lt;p&gt;Prerequisites :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enable the Application Insights Profiler.

&lt;ul&gt;
&lt;li&gt;Verify your application:&lt;/li&gt;
&lt;li&gt;Is .NET.&lt;/li&gt;
&lt;li&gt;Uses Application Insights.&lt;/li&gt;
&lt;li&gt;Is collecting profiles.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Code Optimizations with VS Code
&lt;/h2&gt;

&lt;p&gt;VS Code has extensions to solve Code Optimizations generated by Profiler.&lt;br&gt;
You can see &lt;a href="https://learn.microsoft.com/en-us/azure/azure-monitor/insights/code-optimizations-vscode-extension" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Scan secret using trufflehog</title>
      <dc:creator>Antoine</dc:creator>
      <pubDate>Tue, 12 Nov 2024 22:10:34 +0000</pubDate>
      <link>https://dev.to/antoinega/scan-secret-using-trufflehog-36po</link>
      <guid>https://dev.to/antoinega/scan-secret-using-trufflehog-36po</guid>
      <description>&lt;h2&gt;
  
  
  Secret scanning using trufflehog
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/trufflesecurity/trufflehog" rel="noopener noreferrer"&gt;Trufflehog&lt;/a&gt; is a tool that can scan multiple sources (filesystem, git, have a pre commit hook, Postman), integrate in CI / Docker environment, etc... .&lt;/p&gt;

&lt;h3&gt;
  
  
  Easy start :
&lt;/h3&gt;

&lt;p&gt;In the directory, with a docker daemon started&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;docker&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;run&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--rm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-it&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-v&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;${PWD}&lt;/span&gt;&lt;span class="s2"&gt;:/pwd"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;trufflesecurity/trufflehog&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;filesystem&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;/pwd&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you will have a report with unverified result (probable issue), and confirmed issue.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Tools found from TechRadar</title>
      <dc:creator>Antoine</dc:creator>
      <pubDate>Sun, 27 Oct 2024 15:30:49 +0000</pubDate>
      <link>https://dev.to/antoinega/tools-found-from-techradar-2ho6</link>
      <guid>https://dev.to/antoinega/tools-found-from-techradar-2ho6</guid>
      <description>&lt;p&gt;The tech radar can be found &lt;a href="https://www.thoughtworks.com/radar" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  CAP
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/dotnetcore/CAP" rel="noopener noreferrer"&gt;CAP&lt;/a&gt; is a .NET library that implements the Outbox pattern. When working with distributed messaging systems like RabbitMQ or Kafka, we frequently face the challenge of ensuring that database updates and event publications are performed atomically. CAP addresses this challenge by recording the intent to publish the event in the same database transaction that caused the event. We find CAP to be quite useful as it supports several databases and messaging platforms while guaranteeing at-least-once delivery.&lt;/p&gt;

&lt;p&gt;As a reminder, you can find more infos about the Outbox pattern in the following links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/architecture/microservices/architect-microservice-container-applications/asynchronous-message-based-communication#resiliently-publishing-to-the-event-bus" rel="noopener noreferrer"&gt;Microsoft learn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.kamilgrzybek.com/blog/posts/the-outbox-pattern" rel="noopener noreferrer"&gt;blog&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Mockoon
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://mockoon.com/" rel="noopener noreferrer"&gt;Mockoon&lt;/a&gt; is an open-source API mocking tool. It has an intuitive interface, customizable routes and dynamic responses as well as the ability to automate the creation of mock data sets. Mockoon is compatible with OpenAPI and lets you generate different scenarios that can be tested locally and integrated with a development pipeline. You can also create "partial mocks" by intercepting the requests and only faking the calls that are defined in Mockoon. The partial mocks help simulate specific API routes or endpoints and forward other requests to actual servers. While partial mocks can be useful in certain scenarios, there is a risk of overuse, which may lead to unnecessary complexity. Besides that, Mockoon remains a valuable tool for quickly setting up mock APIs as well as improving and automating development workflows.&lt;/p&gt;

&lt;h1&gt;
  
  
  DevBox
&lt;/h1&gt;

&lt;p&gt;Despite advances in development tooling, maintaining consistent local development environments remains a challenge for many teams. Onboarding new engineers often entails running commands or custom scripts that can fail unpredictably across different machines and result in inconsistencies. To solve this challenge, our teams have increasingly relied on &lt;a href="https://www.jetify.com/devbox/" rel="noopener noreferrer"&gt;Devbox&lt;/a&gt;. &lt;a href="https://www.jetify.com/devbox/" rel="noopener noreferrer"&gt;Devbox&lt;/a&gt; is a command-line tool that provides an approachable interface for creating reproducible, per-project local development environments, leveraging the Nix package manager without using virtual machines or containers. It has notably streamlined their onboarding workflow because once it has been configured for a codebase, it takes one CLI command (devbox shell) to reproduce the defined environment on a new device. Devbox supports shell hooks, custom scripts and devcontainer.json generation for integration with VSCode.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Azqr</title>
      <dc:creator>Antoine</dc:creator>
      <pubDate>Tue, 10 Sep 2024 08:59:16 +0000</pubDate>
      <link>https://dev.to/antoinega/azqr-4kh1</link>
      <guid>https://dev.to/antoinega/azqr-4kh1</guid>
      <description>&lt;h2&gt;
  
  
  What is it ?
&lt;/h2&gt;

&lt;p&gt;The latest iteration of the Azure Quick Review tool, &lt;a href="https://github.com/Azure/azqr" rel="noopener noreferrer"&gt;azqr&lt;/a&gt; 2.0.0 Preview, marks a significant advancement in cloud resource analysis. &lt;/p&gt;

&lt;p&gt;This version not only introduces a range of enhancements and performance improvements but also ensures full compatibility with the Azure Proactive Resiliency Library v2, a comprehensive catalog of resiliency recommendations for Azure workloads. &lt;/p&gt;

&lt;p&gt;With its robust command-line interface, Azqr 2.0.0 Preview offers users a detailed overview of their Azure resources, aiding in the identification and rectification of non-compliant configurations. &lt;/p&gt;

&lt;p&gt;This synergy between Azqr and the Resiliency Library represents a forward leap in proactive resource management and compliance adherence within the Azure ecosystem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;Install using winget:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;winget&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;azqr&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To scan a specific resource group in a specific subscription run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;/azqr&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;scan&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-s&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;subscription_id&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-g&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;resource_group_name&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Documentation is available &lt;a href="https://azure.github.io/azqr/docs/usage/#running-the-scan" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Troubleshoot test in vscode</title>
      <dc:creator>Antoine</dc:creator>
      <pubDate>Sun, 25 Aug 2024 18:27:37 +0000</pubDate>
      <link>https://dev.to/antoinega/troubleshoot-test-in-vscode-oea</link>
      <guid>https://dev.to/antoinega/troubleshoot-test-in-vscode-oea</guid>
      <description>&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;p&gt;Testing in Visual Studio Code is a streamlined process that can enhance your development workflow. However, sometimes tests may not appear as expected. If this occurs, restarting OmniSharp can often resolve the issue (F1 + Command "Restart Omnisharp&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05kahn4mw07llqai6n8f.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05kahn4mw07llqai6n8f.jpg" alt="Image description" width="640" height="428"&gt;&lt;/a&gt;"). OmniSharp is an integral part of the C# extension for Visual Studio Code, providing a comprehensive development experience, including features such as intelligent code completion (IntelliSense), debugging, and more.&lt;/p&gt;

&lt;p&gt;Restarting OmniSharp&lt;br&gt;
If your tests are not showing up in Visual Studio Code, try restarting OmniSharp. Here's how:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the Command Palette with &lt;code&gt;Ctrl+Shift+P&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;OmniSharp: Restart OmniSharp&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Hit &lt;code&gt;Enter&lt;/code&gt;, and wait for OmniSharp to reload.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Command Line
&lt;/h2&gt;

&lt;p&gt;When specific tests need to be run, the command line can be a powerful ally. Utilizing the "dotnet test --filter" command allows for running selective tests that match a given expression. This is particularly useful in large projects where running every test is time-consuming.&lt;/p&gt;

&lt;p&gt;Using Command Line Filters&lt;br&gt;
To run a subset of tests, use the &lt;code&gt;dotnet test --filter&lt;/code&gt; command. For instance, if you want to run tests that contain the word "Login":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet test --filter "FullyQualifiedName~Login"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will run all tests with "Login" in their fully qualified name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Debug test
&lt;/h2&gt;

&lt;p&gt;For a deeper dive into test issues, setting the environment variable VSTEST_HOST_DEBUG=1 triggers a debug prompt before the test host starts, as detailed in the Visual Studio Test Platform &lt;a href="https://github.com/Microsoft/vstest-docs/blob/master/docs/diagnose.md#debug-test-platform-components" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;. This allows developers to attach a debugger to the test host process, providing insight into the test execution and facilitating a more thorough investigation of any underlying issues.&lt;/p&gt;

&lt;p&gt;Debugging Test Platform Components&lt;br&gt;
For debugging, set the &lt;code&gt;VSTEST_HOST_DEBUG=1&lt;/code&gt; environment variable. When you run your tests, a prompt will appear to attach a debugger. Here's how to set the variable in Windows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Command Prompt as an administrator.&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;set VSTEST_HOST_DEBUG=1&lt;/code&gt; and press &lt;code&gt;Enter&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Run your tests in the same Command Prompt session.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Incorporating these practices into your testing routine can significantly improve efficiency and ensure a robust codebase. Remember, a well-tested application is a cornerstone of software reliability and user trust.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Create Invite on Azure B2C with Graph API</title>
      <dc:creator>Antoine</dc:creator>
      <pubDate>Wed, 23 Mar 2022 14:58:55 +0000</pubDate>
      <link>https://dev.to/antoinega/create-invite-on-azure-b2c-with-graph-api-38l4</link>
      <guid>https://dev.to/antoinega/create-invite-on-azure-b2c-with-graph-api-38l4</guid>
      <description>&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@diana_pole" rel="noopener noreferrer"&gt;Diana Polekhina&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/invitation" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While reading &lt;a href="https://damienbod.com/2022/03/11/create-azure-b2c-users-with-microsoft-graph-and-asp-net-core/" rel="noopener noreferrer"&gt;this great post&lt;/a&gt; from Damien Bod, i had the idea to do the same for inviting users in Azure B2C.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure Permissions in Azure
&lt;/h2&gt;

&lt;p&gt;Following &lt;a href="https://docs.microsoft.com/en-us/graph/api/invitation-post?view=graph-rest-beta&amp;amp;tabs=csharp" rel="noopener noreferrer"&gt;the doc&lt;/a&gt;, we require the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;permission User.Invite.All (permission type : Application) and grant Admin Consent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmy0nwxmflchumq1bsgb3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmy0nwxmflchumq1bsgb3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Get from your application:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;your tenant ID&lt;/li&gt;
&lt;li&gt;your Application ID&lt;/li&gt;
&lt;li&gt;a Secret Value&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;Once you have configured the permission, you can use the following code (with you IDs / Secret):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;    &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;scopes&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s"&gt;"https://graph.microsoft.com/.default"&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;tenantId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;YOUR_TENANT_ID&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Values from app registration&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;clientId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;YOUR_APPLICATION_ID&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;clientSecret&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;YOUR_SECRET&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;TokenCredentialOptions&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;AuthorityHost&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;AzureAuthorityHosts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AzurePublicCloud&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   
    &lt;span class="p"&gt;};&lt;/span&gt;

    &lt;span class="c1"&gt;// https://docs.microsoft.com/dotnet/api/azure.identity.clientsecretcredential&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;clientSecretCredential&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ClientSecretCredential&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;tenantId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;clientId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;clientSecret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;_graphServiceClient&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;GraphServiceClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;clientSecretCredential&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scopes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;


    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;invitation&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Invitation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;InvitedUserEmailAddress&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;EMAIL&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;InviteRedirectUrl&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"&amp;lt;YOUR_APPLICATION_URL&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;SendInvitationMessage&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="n"&gt;_graphServiceClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Invitations&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;AddAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;invitation&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;using the following NuGet packages :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.nuget.org/packages/Microsoft.Identity.Web" rel="noopener noreferrer"&gt;Microsoft.Identity.Web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.nuget.org/packages/Microsoft.Graph" rel="noopener noreferrer"&gt;Microsoft.Graph&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hope this helps !&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Using Azure Function bindings based on Identity</title>
      <dc:creator>Antoine</dc:creator>
      <pubDate>Sun, 07 Nov 2021 13:02:21 +0000</pubDate>
      <link>https://dev.to/antoinega/using-azure-function-bindings-based-on-identity-5691</link>
      <guid>https://dev.to/antoinega/using-azure-function-bindings-based-on-identity-5691</guid>
      <description>&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@nadineshaabana"&gt;Nadine Shaabana&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/identity"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://azure.microsoft.com/en-us/updates/general-availability-azure-functions-extensions-for-blobs-queues-event-hubs-service-bus-and-event-grid/"&gt;General availability for blob / queue / service bus / event hub&lt;/a&gt; is now generally available.&lt;/p&gt;

&lt;p&gt;Upgrading depends on your Azure Function version, &lt;a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob#storage-extension-5x-and-higher"&gt;methods can vary&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-identity-based-connections-tutorial"&gt;This tutorial&lt;/a&gt; shows how to configure Azure Function to use identity, and &lt;a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-identity-based-connections-tutorial-2"&gt;this tutorial&lt;/a&gt; for an example on Service Bus connection.&lt;/p&gt;

&lt;p&gt;Hope this helps !&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Guide on Event Hubs with Azure Function</title>
      <dc:creator>Antoine</dc:creator>
      <pubDate>Sat, 16 Oct 2021 20:07:48 +0000</pubDate>
      <link>https://dev.to/antoinega/guide-on-event-hubs-with-azure-function-2o2</link>
      <guid>https://dev.to/antoinega/guide-on-event-hubs-with-azure-function-2o2</guid>
      <description>&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@jussararomao"&gt;Jussara Romão&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/ray"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/azure/architecture/serverless/event-hubs-functions/event-hubs-functions"&gt;Great guide&lt;/a&gt; created by Microsoft on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Concepts on Event Hubs

&lt;ul&gt;
&lt;li&gt;Events&lt;/li&gt;
&lt;li&gt;Partitions&lt;/li&gt;
&lt;li&gt;Consumer&lt;/li&gt;
&lt;li&gt;Azure Function Scaling &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Performance and scaling 

&lt;ul&gt;
&lt;li&gt;Hosting&lt;/li&gt;
&lt;li&gt;Trigger&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;How to make your system resilient

&lt;ul&gt;
&lt;li&gt;Streaming&lt;/li&gt;
&lt;li&gt;Idempotency&lt;/li&gt;
&lt;li&gt;Deduplication&lt;/li&gt;
&lt;li&gt;Error Handling&lt;/li&gt;
&lt;li&gt;Failures &amp;amp; Corrupt Data&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;How to secure your Azure function

&lt;ul&gt;
&lt;li&gt;Authentication / Identity&lt;/li&gt;
&lt;li&gt;Network&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Some words about metrics / logs and how to exploit them to understand what happens (with Application Insights)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hope this helps !&lt;/p&gt;

</description>
    </item>
    <item>
      <title>what's WSLg</title>
      <dc:creator>Antoine</dc:creator>
      <pubDate>Sat, 09 Oct 2021 09:47:55 +0000</pubDate>
      <link>https://dev.to/antoinega/what-new-in-wslg-3aka</link>
      <guid>https://dev.to/antoinega/what-new-in-wslg-3aka</guid>
      <description>&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@fakurian"&gt;Fakurian Design&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/sound-wave"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://arstechnica.com/gadgets/2021/10/the-best-part-of-windows-11-is-a-revamped-windows-subsystem-for-linux/"&gt;This blog post&lt;/a&gt; highlights the new features in WSLg coming with Windows 11.&lt;/p&gt;

&lt;p&gt;The big news is ... WSL now supports graphics and sound !&lt;/p&gt;

&lt;p&gt;&lt;a href="https://devblogs.microsoft.com/commandline/wslg-architecture/"&gt;This blog post&lt;/a&gt; explains how it works.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=b1YBx1L8op4"&gt;Scott Hanselman has made a video&lt;/a&gt; to present this.&lt;/p&gt;

&lt;p&gt;Hope this helps !&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Prototyping using codeswing</title>
      <dc:creator>Antoine</dc:creator>
      <pubDate>Sun, 03 Oct 2021 19:28:54 +0000</pubDate>
      <link>https://dev.to/antoinega/prototyping-using-codeswing-5gnb</link>
      <guid>https://dev.to/antoinega/prototyping-using-codeswing-5gnb</guid>
      <description>&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@stationery_hoe" rel="noopener noreferrer"&gt;Kasturi Roy&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/sketch" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/lostintangent/codeswing" rel="noopener noreferrer"&gt;Codeswing&lt;/a&gt; is an awesome tool made to prototype easily from vscode using any frontend you want (you can already have Svelte, React, Vue or Html/CSS/Js), with an auto-refresh rendering preview.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fntng6uhjfywlcbtnbkbn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fntng6uhjfywlcbtnbkbn.png" alt="Codeswing Preview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you wnat to use it from anywhere, you can use the &lt;a href="https://github.dev/lostintangent/codeswing-playground" rel="noopener noreferrer"&gt;playground&lt;/a&gt;, using vscode in browser, and add codeswing extension.&lt;/p&gt;

&lt;p&gt;Hope this helps !&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to fix a partition issue in a bacpac backup</title>
      <dc:creator>Antoine</dc:creator>
      <pubDate>Thu, 16 Sep 2021 15:40:45 +0000</pubDate>
      <link>https://dev.to/antoinega/how-to-fix-a-partition-issue-in-a-bacpac-backup-5e4g</link>
      <guid>https://dev.to/antoinega/how-to-fix-a-partition-issue-in-a-bacpac-backup-5e4g</guid>
      <description>&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@emmages"&gt;Emmanuel Ikwuegbu&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/fix"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In order to fix it, we need to perform 6 steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;rename the .bacpac file to .zip extension&lt;/li&gt;
&lt;li&gt;extract model.xml and origin.xml&lt;/li&gt;
&lt;li&gt;open model.xml and change the entry
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;                &lt;span class="nt"&gt;&amp;lt;Entry&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;Element&lt;/span&gt; &lt;span class="na"&gt;Type=&lt;/span&gt;&lt;span class="s"&gt;"SqlPartitionValue"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;Property&lt;/span&gt; &lt;span class="na"&gt;Name=&lt;/span&gt;&lt;span class="s"&gt;"ExpressionScript"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;Value&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;![CDATA[NULL]]&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/Value&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;/Property&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;/Element&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/Entry&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;                &lt;span class="nt"&gt;&amp;lt;Entry&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;Element&lt;/span&gt; &lt;span class="na"&gt;Type=&lt;/span&gt;&lt;span class="s"&gt;"SqlPartitionValue"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;Property&lt;/span&gt; &lt;span class="na"&gt;Name=&lt;/span&gt;&lt;span class="s"&gt;"ExpressionScript"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;Value&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;![CDATA[CAST(NULL AS DATETIME2)]]&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/Value&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;/Property&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;/Element&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/Entry&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Save, and compute the new checksum using Powershell cmdlet &lt;a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-filehash?view=powershell-7.1"&gt;Get-FileHash&lt;/a&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Get-FileHash&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Algorithm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;256&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;model.xml&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;write the checksum in origin.xml to replace previous model.xml checksum&lt;/li&gt;
&lt;li&gt;Put back files model.xml and origin.xml in zip&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hope it helps !&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Reuse tfvars in Powershell</title>
      <dc:creator>Antoine</dc:creator>
      <pubDate>Sun, 12 Sep 2021 19:01:50 +0000</pubDate>
      <link>https://dev.to/antoinega/reuse-tfvars-in-powershell-1j8h</link>
      <guid>https://dev.to/antoinega/reuse-tfvars-in-powershell-1j8h</guid>
      <description>&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@thoughtcatalog"&gt;Thought Catalog&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/read"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To reuse data in Powershell set in tfvars, we just have to use the &lt;a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertfrom-stringdata?view=powershell-7.1"&gt;ConvertFrom-StringData&lt;/a&gt; cmdlet.&lt;/p&gt;

&lt;p&gt;In order to remove some character (such as { or } ), we can use -replace .&lt;/p&gt;

&lt;p&gt;That will give us&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Get-Content&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;\varfile.tfvars&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-replace&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-replace&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"{"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;$convert&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ConvertFrom-StringData&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hope this help !&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
