<?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: Marcos Junior</title>
    <description>The latest articles on DEV Community by Marcos Junior (@markjunz).</description>
    <link>https://dev.to/markjunz</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%2F350291%2Fcc2d667b-0c52-4cd7-9278-53e5ac6e5824.jpg</url>
      <title>DEV Community: Marcos Junior</title>
      <link>https://dev.to/markjunz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/markjunz"/>
    <language>en</language>
    <item>
      <title>Enhancing Linux Security: Secure Boot and TPM-Based Disk Encryption on Manjaro Linux</title>
      <dc:creator>Marcos Junior</dc:creator>
      <pubDate>Sun, 30 Mar 2025 19:04:51 +0000</pubDate>
      <link>https://dev.to/markjunz/enhancing-linux-security-secure-boot-and-tpm-based-disk-encryption-on-manjaro-linux-597e</link>
      <guid>https://dev.to/markjunz/enhancing-linux-security-secure-boot-and-tpm-based-disk-encryption-on-manjaro-linux-597e</guid>
      <description>&lt;p&gt;Manjaro is a powerful and flexible Linux distribution, but by default, it does not enable Secure Boot or TPM-based disk encryption. These security features can significantly enhance system protection, ensuring that only trusted code runs during boot and that sensitive data remains encrypted.&lt;/p&gt;

&lt;p&gt;In this guide, I'll walk through the process of setting up Secure Boot and TPM-based disk encryption on Manjaro, using tools such as &lt;code&gt;sbctl&lt;/code&gt; and &lt;code&gt;systemd-cryptenroll&lt;/code&gt;. Additionally, I'll explore some tweaks of my preference that might be useful.&lt;/p&gt;

&lt;p&gt;The motivation for enabling this is the need of a secure and yet convenient disk encryption so I can move around with a portable computer without easy access to my data in case I lost it. &lt;/p&gt;

&lt;h2&gt;
  
  
  Why Secure Boot and TPM?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Secure Boot helps prevent unauthorized operating systems or bootloaders from running on your machine, adding an additional layer of security.&lt;/li&gt;
&lt;li&gt;TPM-based disk encryption enhances data protection by leveraging the Trusted Platform Module (TPM) to unlock encrypted volumes automatically when the correct hardware is detected.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before proceeding, ensure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A system with Secure Boot and TPM 2.0 enabled in the BIOS/UEFI settings. Make sure Secure Boot is in "Setup" mode. &lt;/li&gt;
&lt;li&gt;Manjaro Linux installed with a default LUKS1 encrypted partition, but with a bigger EFI partition in case you want to include &lt;code&gt;nvidia&lt;/code&gt; or other extra drivers. &lt;/li&gt;
&lt;li&gt;Basic familiarity with terminal commands and administrative privileges&lt;/li&gt;
&lt;li&gt;A backup of your important data, mistakes could lead to data loss. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I believe this tutorial might be valid for other Arch Based distributions that use the same tools, let me know if I am wrong. &lt;/p&gt;

&lt;p&gt;Let's get started!&lt;/p&gt;

&lt;p&gt;First, let's tweak with &lt;code&gt;initramfs&lt;/code&gt; by changing some parameters in &lt;code&gt;/etc/mkinitcpio.conf&lt;/code&gt;. This file is the one we need to change to include extra drivers and make sure the image is secure. &lt;/p&gt;

&lt;p&gt;The first change, since we are going to put the &lt;code&gt;initramfs&lt;/code&gt; in the unencrypted EFI, is to remove &lt;code&gt;/crypto_keyfile.bin&lt;/code&gt; from the &lt;code&gt;FILES&lt;/code&gt; section of the &lt;code&gt;mkinitcpio.conf&lt;/code&gt;, or comment out the entire entry. &lt;/p&gt;

&lt;p&gt;For the TPM, run &lt;code&gt;sudo systemd-cryptenroll --tpm2-device=list&lt;/code&gt; to check your TPM driver. Mine is &lt;code&gt;tpm_tis&lt;/code&gt;.  &lt;/p&gt;

&lt;p&gt;If you want to include &lt;code&gt;nvidia&lt;/code&gt; drivers, make sure you have &lt;code&gt;nvidia-dkms&lt;/code&gt; package installed and working. &lt;/p&gt;

&lt;p&gt;Then, in the &lt;code&gt;MODULES&lt;/code&gt; property, add the drivers you need:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MODULES=(crc32c-intel tpm_tis i915 nvidia nvidia_modeset nvidia_uvm nvidia_drm)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the &lt;code&gt;HOOKS&lt;/code&gt; parameter, change it to include &lt;code&gt;system&lt;/code&gt;, &lt;code&gt;sd-vconsole&lt;/code&gt;, and &lt;code&gt;sd-encrypt&lt;/code&gt;. This will be useful for TPM unlock to work. Mine looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HOOKS=(base systemd udev autodetect microcode kms modconf block keyboard keymap consolefont plymouth sd-vconsole sd-encrypt filesystems)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since boot loaders can be problematic with encryptions, and the EFI is perfectly capable of booting the kernel directly, I believe ditching the boot loader is the way to go. But before doing that, make sure your computer Secure Boot is in Setup mode, by running &lt;code&gt;sudo sbctl status&lt;/code&gt;. Install &lt;code&gt;sbctl&lt;/code&gt; if you don't have it yet/&lt;/p&gt;

&lt;p&gt;Let's now configure the Unified Kernel Image, which is a combination of the kernel and initramfs. It could get larger than the default 300mb EFI partition if you have multiple kernels and include the heavy &lt;code&gt;nvidia&lt;/code&gt; drivers. &lt;/p&gt;

&lt;p&gt;Open up &lt;code&gt;/etc/mkinitcpio.d/linuxXXX.preset&lt;/code&gt; in your favourite text editor. Uncomment the &lt;code&gt;default_uki&lt;/code&gt; and &lt;code&gt;fallback_uki&lt;/code&gt; parameters, and make sure both paths are correct. In Manjaro, EFI filesystem is mounted in &lt;code&gt;/boot/efi&lt;/code&gt;. It might be &lt;code&gt;/efi&lt;/code&gt; in other distributions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ALL_kver="/boot/vmlinuz-6.12-x86_64"

PRESETS=('default' 'fallback')

default_uki="/boot/efi/EFI/Linux/manjaro-6.12-x86_64.efi"
default_options="--splash /usr/share/systemd/bootctl/splash-manjaro.bmp"

fallback_uki="/boot/efi/EFI/Linux/manjaro-6.12-x86_64-fallback.efi"
fallback_options="-S autodetect"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make similar changes to other &lt;code&gt;.preset&lt;/code&gt; files if you have other kernels. &lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;sudo cat /proc/cmdline&lt;/code&gt; to check your current kernel command line, and then copy that into &lt;code&gt;/etc/kernel/cmdline&lt;/code&gt;. This will be used as the kernel command line in the signed UKI.&lt;/p&gt;

&lt;p&gt;Now let's create and enroll Secure Boot keys:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo sbctl create-keys
sudo sbctl enroll-keys --Microsoft
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run &lt;code&gt;sudo mkinitcpio -P&lt;/code&gt;. It should take a minute or two to generate a new UKI for your kernels in the EFI partition. If this command fails, try to understand if you have missed any steps. It should also have a "SIGN" step. If it is not signed, something is wrong. &lt;/p&gt;

&lt;p&gt;Time to check EFI boot entries. Run &lt;code&gt;efibootmgr&lt;/code&gt; to list current boot entries. You can delete unused entries now. In my case, I have removed Grub boot loader so it has only the kernels I use. To do that run &lt;code&gt;sudo efibootmgr -B -b 000N&lt;/code&gt; where N is the &lt;code&gt;Boot0000&lt;/code&gt; entry you want to remove. &lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;sudo findmnt /boot/efi&lt;/code&gt; to find the device name your EFI partition is, usually &lt;code&gt;/dev/sda1&lt;/code&gt; or &lt;code&gt;/dev/nvme0n1p1&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Add the kernel UKI to the boot loader:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo efibootmgr -c -d /dev/nvme0n1 -p 1 -L "Manjaro" -l "EFI/Linux/manjaro-6.12-x86_64.efi"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note the path is related to the EFI partition root, not your current root. In my setup here, my mounted EFI full path is &lt;code&gt;/boot/efi/EFI/Linux/manjaro-6.12-x86_64.efi&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;sudo sbctl verify&lt;/code&gt; to check if everything you need is properly signed. &lt;/p&gt;

&lt;p&gt;If it is, you can now restart, enable Secure Boot and lock changes to boot order, usb boot, and protect the firmware by setting up a password. &lt;/p&gt;

&lt;p&gt;Once you restart, the boot process will ask you for the password of your encrypted root partition. If you want to unlock it automatically with TPM, do the following steps. &lt;/p&gt;

&lt;p&gt;First, confirm you have a LUKS2 partition. Run &lt;code&gt;cryptsetup luksDump /dev/nvme0n1p2&lt;/code&gt; (or &lt;code&gt;/dev/sda2&lt;/code&gt;). Note the version number. If it is 2, you are ready to proceed. If it is 1, we need to convert it. The conversion is simple, but you need to boot into a live CD that has &lt;code&gt;cryptsetup&lt;/code&gt; because you can't convert if it is unlocked and mounted. &lt;/p&gt;

&lt;p&gt;To convert the partition, while on Live CD, run &lt;code&gt;sudo cryptsetup convert --type luks2 /dev/nvme0n1p2&lt;/code&gt;. Then restart back to your actual system. &lt;/p&gt;

&lt;p&gt;Enroll the LUKS2 into TPM: &lt;code&gt;sudo systemd-cryptenroll --tpm2-device=auto /dev/nvme0n1p2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Open &lt;code&gt;/etc/crypttab&lt;/code&gt; and make it look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;luks-xxx-xxx-xxx-xxx-xxx UUID=xxx-xxx-xxx-xxx-xxx none tpm2-device=auto,discard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy &lt;code&gt;/etc/crypttab&lt;/code&gt; to &lt;code&gt;/etc/crypttab.initramfs&lt;/code&gt;, making it the same as above.&lt;/p&gt;

&lt;p&gt;Recreate your UKI running &lt;code&gt;sudo mkinitcpio -P&lt;/code&gt;. If it is successful and signed, you can restart again and now your disk will be unlocked by your TPM chip. &lt;/p&gt;

&lt;p&gt;That's it, I hope this tutorial is simple for you to follow. I wish one day Linux distributions can provide easier and out-of-the-box tools so that the avarage user can have a more streamlined experience like other non-open OSes. &lt;/p&gt;

&lt;p&gt;Let me know in the comments how it went or if your have suggestions. &lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus
&lt;/h2&gt;

&lt;p&gt;One thing that bothers me a lot is the slowness of bluetooth keyboard and mouse connection when swtiching devices. This is actually a "feature" to save energy, but you can fix it by changing &lt;code&gt;/etc/Bluetooth/main.conf&lt;/code&gt; file property &lt;code&gt;FastCoonectable&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you have multiple monitors with different DPI, and also use SDDM as your login greeter, you will notice that it shows on the wrong DPI on one of the displays. To fix that I've enabled SDDM to run itself in Wayland. That's actually a X11 issue. To do that, make sure you have included &lt;code&gt;nvidia&lt;/code&gt; drivers if you have a NVidia GPU in your &lt;code&gt;initramfs&lt;/code&gt; regardless of using SecureBoot or TPM. This is required because the driver should be loaded before SDDM. To fix it create the &lt;code&gt;/etc/sddm.conf/10-wayland.conf&lt;/code&gt; driver with the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[General]
DisplayServer=wayland
GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell

[Wayland]
CompositorCommand=kwin_wayland --drm --no-lockscreen --no-global-shortcuts --locale1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>manjaro</category>
      <category>linux</category>
      <category>archlinux</category>
    </item>
    <item>
      <title>A new card for your Home Assistant dashboard</title>
      <dc:creator>Marcos Junior</dc:creator>
      <pubDate>Tue, 06 Jun 2023 13:58:27 +0000</pubDate>
      <link>https://dev.to/markjunz/a-new-card-for-your-home-assistant-dashboard-4nnb</link>
      <guid>https://dev.to/markjunz/a-new-card-for-your-home-assistant-dashboard-4nnb</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xugske-T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/waj4m42wprjxsxmvgpu9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xugske-T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/waj4m42wprjxsxmvgpu9.png" alt="A screenshot of Minimalistic Area Card" width="504" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've created a new card for your home assistant dashboard, that aims to be a minimalist version of the native area card. &lt;/p&gt;

&lt;p&gt;By minimalist, I mean it would be as simple as having a title, sensors, and toggle buttons. For style changes, this card can use the area image already defined, a camera image, or a solid color. &lt;/p&gt;

&lt;p&gt;It is not my goal to provide many ways of customizations, however you can also use other tools like &lt;code&gt;card-mod&lt;/code&gt; if you need to add custom style changes. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/junalmeida/homeassistant-minimalistic-area-card"&gt;Check out the documentation&lt;/a&gt; on how to setup it using HACS for Home Assistant. &lt;/p&gt;

&lt;p&gt;If this is useful for you, &lt;a href="https://github.com/sponsors/junalmeida"&gt;please consider donating&lt;/a&gt;, but only if you wanted to :) &lt;/p&gt;

</description>
      <category>homeassistant</category>
      <category>smarthome</category>
      <category>dashboard</category>
      <category>lovelace</category>
    </item>
    <item>
      <title>Using Autofac on Azure Functions</title>
      <dc:creator>Marcos Junior</dc:creator>
      <pubDate>Thu, 02 Apr 2020 22:04:37 +0000</pubDate>
      <link>https://dev.to/markjunz/using-autofac-on-azure-functions-4h78</link>
      <guid>https://dev.to/markjunz/using-autofac-on-azure-functions-4h78</guid>
      <description>&lt;p&gt;Reasons to use DI on a software project are numerous, and while one can argue that a micro-service should be so small that no IoC is needed, others may have their reasons to use it. &lt;/p&gt;

&lt;p&gt;Not here to judge which approach is the best, but if you decide that DI is a must on your azure function project, you may find that the native support for DI does not allow you to use a third-party container as easy as you can see on a regular asp-net project. There are some libraries out there, but most uses some different techniques (such as DI using attributes) not alike to the code style on asp-net projects.&lt;/p&gt;

&lt;p&gt;That is the reason I decided to write a library to fill this gap, and create an easy DI setup code as similar to asp-net as possible. That means you will be able to create classes with interfaces as parameters of a constructor, without the need of anything else but registering dependencies accordingly. &lt;/p&gt;

&lt;p&gt;Find below a basic function example, observe that classes and functions are not declared as static, and dependencies are passed to the constructor just like in a regular asp-net project.&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="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Function1&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Disposable&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;Function1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IService1&lt;/span&gt; &lt;span class="n"&gt;service1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ILogger&lt;/span&gt; &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// ...&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;FunctionName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;nameof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Function1&lt;/span&gt;&lt;span class="p"&gt;))]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt; &lt;span class="nf"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;QueueTrigger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"myqueue-items"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Connection&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"AzureWebJobsStorage"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;myQueueItem&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Delay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;_logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"C# Queue trigger function processed: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;myQueueItem&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="c1"&gt;// ...&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You will also find in the github project, a sample project that demonstrates the &lt;code&gt;IDisposable&lt;/code&gt; classes being disposed at the end of a function run.&lt;/p&gt;

&lt;p&gt;Head to the project's read-me and check out code examples. &lt;/p&gt;

&lt;p&gt;Please feel free to contribute creating issues with feedback and pull requests. &lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/junalmeida"&gt;
        junalmeida
      &lt;/a&gt; / &lt;a href="https://github.com/junalmeida/autofac-azurefunctions"&gt;
        autofac-azurefunctions
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Autofac implementation of the dependency injection factory for non isolated Azure Functions.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Autofac.Extensions.DependencyInjection.AzureFunctions&lt;/h1&gt;
&lt;p&gt;Autofac is an &lt;a href="http://martinfowler.com/articles/injection.html" rel="nofollow"&gt;IoC container&lt;/a&gt; for Microsoft .NET. It manages the dependencies between classes so that &lt;strong&gt;applications stay easy to change as they grow&lt;/strong&gt; in size and complexity. This is achieved by treating regular .NET classes as &lt;em&gt;&lt;a href="https://autofac.readthedocs.io/en/latest/glossary.html" rel="nofollow"&gt;components&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;This library has been created to allow Azure Functions v3 users to use AutoFac library in a common way like it is done with regular web projects
Note that Azure Functions moving forward has now a NET 5 &lt;code&gt;dotnet-isolated&lt;/code&gt; mode which allows the use of Autofac directly without this library.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/junalmeida/autofac-azurefunctions/workflows/NuGet/badge.svg?branch=master"&gt;&lt;img src="https://github.com/junalmeida/autofac-azurefunctions/workflows/NuGet/badge.svg?branch=master" alt="NuGet"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please file issues and pull requests for this package in this repository rather than in the Autofac core repo.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.nuget.org/packages/Autofac.Extensions.DependencyInjection.AzureFunctions" rel="nofollow"&gt;NuGet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Contributing - You can report problems and feature requests creating issues and pull requests on this project.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Get Started in Azure Functions&lt;/h2&gt;
&lt;p&gt;This quick start shows how to use the &lt;code&gt;UseAutofacServiceProviderFactory&lt;/code&gt; integration to help automatically build the root service provider…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/junalmeida/autofac-azurefunctions"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



</description>
      <category>dotnet</category>
      <category>autofac</category>
      <category>azure</category>
      <category>azurefunctions</category>
    </item>
    <item>
      <title>Redirecting legacy .NET apps to a new Oracle DataAccess</title>
      <dc:creator>Marcos Junior</dc:creator>
      <pubDate>Thu, 26 Mar 2020 13:15:40 +0000</pubDate>
      <link>https://dev.to/markjunz/redirecting-legacy-net-apps-to-a-new-oracle-dataaccess-946</link>
      <guid>https://dev.to/markjunz/redirecting-legacy-net-apps-to-a-new-oracle-dataaccess-946</guid>
      <description>&lt;p&gt;&lt;em&gt;Published on October 13, 2018&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I wrote this guide to help you dealing with a development or production environment that needs to run multiple legacy .net applications that are highly coupled with an specific version of Oracle DataAccess. With this guide you don't have to change any line of code, reference, or configuration of each project.&lt;/p&gt;

&lt;p&gt;This guide will also help you to keep your system clean, running only one lighweight version of Oracle Client.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Please fell free to give feed back and suggest improvements.&lt;/p&gt;

</description>
      <category>oracle</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>Deploying a Cordova + Ionic application with VSTS</title>
      <dc:creator>Marcos Junior</dc:creator>
      <pubDate>Thu, 26 Mar 2020 13:12:34 +0000</pubDate>
      <link>https://dev.to/markjunz/deploying-a-cordova-ionic-application-with-vsts-4o99</link>
      <guid>https://dev.to/markjunz/deploying-a-cordova-ionic-application-with-vsts-4o99</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally posted on LinkedIn, on April 17, 2018.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I decided to write this article to present to you all the benefits we achieved with a 100% automated deploy, and, of course, to help you out showing the difficulties that arise when doing such task. Although it seems to be a simple task, and in theory it is, the reality is that you will face really difficult technical problems on building this kind of application on different machines and OSes. I will show you in this article what component and versions we have been using, and each task we configured for Android and iOS deployment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OqYT_thu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/mfctbd8ct3q2zzs856wg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OqYT_thu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/mfctbd8ct3q2zzs856wg.png" alt="Platform Logos" width="624" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The project used as inspiration to this article was started in June 2017. Since that date we have not updated structural components like cordova. Here is the list of components we are using:&lt;/p&gt;

&lt;p&gt;Apache Cordova &lt;strong&gt;6.5.0&lt;/strong&gt;; Ionic &lt;strong&gt;3.12.0&lt;/strong&gt;; NodeJS &lt;strong&gt;6.11.4&lt;/strong&gt;; AngularJS &lt;strong&gt;4.1&lt;/strong&gt;; HockeyApp &lt;strong&gt;2.2.4&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's go straight to the point: the flow used in VSTS to build, test and deploy to both staging and production environments. As you know, the idea of VSTS regarding CI/CD separates the process of a deploy (CD) from the build itself (CI) into so called BUILD and RELEASE.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LYmAPRAg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/ccelk112d42wtm9whupf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LYmAPRAg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/ccelk112d42wtm9whupf.png" width="555" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The build process is configured as the image shows. Here, the idea is to &lt;em&gt;tokenize&lt;/em&gt; all the necessary xml and json files so that these tokens can be replaced later by real values during the release (CD) process. These tokens includes the android and ios package name, ids to necessary services, apis, and apple certificates and profiles.&lt;/p&gt;

&lt;p&gt;Please note that I decided to archive the files before the npm step. This is due to size. As you know, npm downloads tons of files and a significant part of them are simply not used. The rest of this process aims to guarantee that ionic builds successfully. If you have any kind of js tests like jasmine, you can add a task to execute such tests.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8EvTsfXw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/vea0lmprcb9knogx15ug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8EvTsfXw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/vea0lmprcb9knogx15ug.png" alt="Build Output" width="477" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The down side on the build process: we suffered a lot at this part when trying to update cordova and ionic versions. It is a real pain because latest cordova version changed the whole android project structures, and I have incompatibilities with current structure, plugins and so on. The latest nodejs version also lead to some problems with npm. I need to invest more time (and patience) in order to update cordova, ionic and nodejs versions.&lt;/p&gt;

&lt;p&gt;The build process runs after each pull request to master or develop branches. It can be triggered after any push to any branch, but my account have some limits, so I ended up in configuring only these. Every successful build of develop triggers a release to our staging environment, and build of master triggers a release to the production environment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Bizogw89--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/6q41f6gh38o0499xuruf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Bizogw89--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/6q41f6gh38o0499xuruf.png" alt="Build Success" width="568" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let's inspect the release parts. The first task is a simple extraction from the artifact of a previous build. Then, all the tokens are replaced with variables configured in the release definition. These variables can be secured so sensitive data like passwords stays only on the servers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6NIMjWfC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/9laanocldh0fvdp7fzr0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6NIMjWfC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/9laanocldh0fvdp7fzr0.png" alt="Release" width="589" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ionic Build Android is the key task that will generate for us the real APK. This APK will be created using values from the previous tokens task, so, when releasing a staging environment, there will be an APK for staging, and when releasing production, APK for production. After that, the APK is uploaded to the former HockeyApp service, now AppCenter. HockeyApp is the distribution method we chose for both Android and iOS enterprise and staging versions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wza3Kizf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/956qpcgjzmuz9jh65x7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wza3Kizf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/956qpcgjzmuz9jh65x7e.png" alt="Release Config" width="352" height="341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The iOS task is almost identical to the Android one, but we faced a very difficult problem with that. The latest version of cordova and cordova-ios packages simply did not build successfully due to problems accessing the provisioning profile. After wasting days looking for a solution, we found out that this problem was already fixed in the alpha version of the cordova-ios package. So, I put on the build process a curl command to download the fix to the problematic file (&lt;code&gt;platforms/ios/cordova/lib/build.js&lt;/code&gt;) and then everything worked.&lt;/p&gt;

&lt;p&gt;So, that's my odyssey on automating all my workflow with this project. The best part of it is that once I achieved the staging and production environments correctly, I got everything automated. A pull request and a code review leads to an artifact pushed to users phones.&lt;/p&gt;

&lt;p&gt;I hope that the information I tried to spread here can be useful in some manner to you. Fell free to ask any questions about this process, if you think that you need more details on any step or opinions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XahzOI88--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/7yy7d0mvyh1e08htom4o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XahzOI88--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/7yy7d0mvyh1e08htom4o.png" alt="Release Success" width="391" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cordova</category>
      <category>ionic</category>
      <category>ios</category>
      <category>android</category>
    </item>
  </channel>
</rss>
