<?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>Forem: Daniel Handloser</title>
    <description>The latest articles on Forem by Daniel Handloser (@pickhub).</description>
    <link>https://forem.com/pickhub</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%2F694314%2F14fa958e-249c-463f-8982-bd77aa6b31cf.jpeg</url>
      <title>Forem: Daniel Handloser</title>
      <link>https://forem.com/pickhub</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/pickhub"/>
    <language>en</language>
    <item>
      <title>Enable multifactor authentication for your tenant on Azure</title>
      <dc:creator>Daniel Handloser</dc:creator>
      <pubDate>Mon, 26 Aug 2024 09:31:03 +0000</pubDate>
      <link>https://forem.com/pickhub/enable-multifactor-authentication-for-your-tenant-on-azure-o02</link>
      <guid>https://forem.com/pickhub/enable-multifactor-authentication-for-your-tenant-on-azure-o02</guid>
      <description>&lt;p&gt;As many others, I've recently gotten the email saying "Action required: Enable multi-factor authentication for your tenant by 15 October 2024". &lt;/p&gt;

&lt;p&gt;Since the docs are very exhaustive and cover the various ways of authentication, especially for large organizations, I wanted to give a quick guide on how to set up multi-factor authentication (MFA) or more specifically 2-factor authentication (2FA) on Azure for default personal accounts.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Login to &lt;a href="//portal.azure.com"&gt;portal.azure.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Search for "authentication methods" and click "Microsoft Entra authentication methods"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&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%2Fjatmzrnaqyrk7bj2miwv.png" 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%2Fjatmzrnaqyrk7bj2miwv.png" alt="Finding the auth " width="800" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Enable one of the MFA methods, e.g. "Email OTP"

&lt;ul&gt;
&lt;li&gt;Toggle "Enable"&lt;/li&gt;
&lt;li&gt;Select "Include" and "All users"&lt;/li&gt;
&lt;li&gt;Press "Save"
&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%2Fktoejrcapkevzi7gy3a9.png" alt="Enabling 2FA via email" width="610" height="1018"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's it, you will now be required to submit a one time password (OTP) when logging in.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>microsoft</category>
    </item>
    <item>
      <title>Automating PR comments with Github CLI</title>
      <dc:creator>Daniel Handloser</dc:creator>
      <pubDate>Fri, 27 Aug 2021 09:39:43 +0000</pubDate>
      <link>https://forem.com/pickhub/automating-pr-comments-with-github-cli-1l6</link>
      <guid>https://forem.com/pickhub/automating-pr-comments-with-github-cli-1l6</guid>
      <description>&lt;p&gt;As an engineer, my day-to-day involves reviewing pull requests (PRs). Oftentimes these are small changes and I would review around 30 PRs per week.&lt;/p&gt;

&lt;p&gt;For me to approve a request, I need to trigger different checks by commenting on the PR. If you're going through the same struggle every day, here is how to automate this process with &lt;em&gt;Github CLI&lt;/em&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Installation
&lt;/h1&gt;

&lt;p&gt;On macOS: make sure you have 'brew' installed and run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install gh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Bash script
&lt;/h1&gt;

&lt;p&gt;We're going to write a small bash script that fetches all open PRs and creates a comment.&lt;/p&gt;

&lt;p&gt;On your console &lt;code&gt;cd&lt;/code&gt; to the directory of the repository that the pull requests are in. &lt;code&gt;gh pr list&lt;/code&gt; will allow us to find all open PRs. &lt;/p&gt;

&lt;p&gt;Depending on your needs you can find different flags in the &lt;a href="https://cli.github.com/manual/gh_pr_list"&gt;documentation&lt;/a&gt;. For my work I usually look at all PRs with a certain title, the query is &lt;code&gt;gh pr list -S "&amp;lt;YOUR SEARCH&amp;gt;"&lt;/code&gt;. To make a comment, we need the PRs ID, which is called &lt;em&gt;number&lt;/em&gt; in &lt;em&gt;Github&lt;/em&gt;. We can extract that by telling &lt;code&gt;gh&lt;/code&gt; to output a &lt;em&gt;JSON&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;With the command-line &lt;em&gt;JSON&lt;/em&gt; processor &lt;em&gt;jq&lt;/em&gt; we're getting the &lt;code&gt;number&lt;/code&gt; of the PR:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr list -S "&amp;lt;YOUR SEARCH&amp;gt;" --json "number" --jq '.[].number'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looping over the results we can add a comment to every PR in our list. This is the final snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for prNumber in $(gh pr list -S "&amp;lt;YOUR SEARCH&amp;gt;" --json "number" --jq '.[].number'); do
    echo "Triggering PR no. $prNumber\n"
    gh pr comment $prNumber --body "&amp;lt;YOUR MESSAGE&amp;gt;"
done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we're done. This will leave a comment on all the PRs from your search query. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://www.pexels.com/photo/elderly-woman-reading-book-in-room-5231267/"&gt;Photo by Anna Shvets from Pexels&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>bash</category>
    </item>
  </channel>
</rss>
