<?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: Oluwatobiloba Akinbobola</title>
    <description>The latest articles on Forem by Oluwatobiloba Akinbobola (@unique-tea).</description>
    <link>https://forem.com/unique-tea</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%2F2280199%2F47906ad0-f55b-48e1-98d4-11dcaddef9ed.jpg</url>
      <title>Forem: Oluwatobiloba Akinbobola</title>
      <link>https://forem.com/unique-tea</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/unique-tea"/>
    <language>en</language>
    <item>
      <title>Getting Started with Cloud Marketplace</title>
      <dc:creator>Oluwatobiloba Akinbobola</dc:creator>
      <pubDate>Fri, 14 Mar 2025 10:07:15 +0000</pubDate>
      <link>https://forem.com/unique-tea/getting-started-with-cloud-marketplace-269b</link>
      <guid>https://forem.com/unique-tea/getting-started-with-cloud-marketplace-269b</guid>
      <description>&lt;h2&gt;
  
  
  INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;In this article, you use Google Cloud Marketplace to quickly and easily deploy a LAMP stack on a Compute Engine instance. The Bitnami LAMP Stack provides a complete web development environment for Linux that can be launched in one click.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Cloud Marketplace to deploy a LAMP stack&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the Google Cloud Console, on the &lt;strong&gt;Navigation menu&lt;/strong&gt;, click &lt;strong&gt;Marketplace&lt;/strong&gt;.
&lt;img src="https://media2.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%2Fslopylcv6x9tmzi94tj6.png" alt="Marketplace" width="800" height="604"&gt;
&lt;/li&gt;
&lt;li&gt;In the search bar, type &lt;code&gt;LAMP&lt;/code&gt; and then press &lt;strong&gt;ENTER&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the search results, click &lt;strong&gt;Bitnami package for LAMP&lt;/strong&gt;.
&lt;img src="https://media2.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%2Fhwxlnwcf959fml28lwe1.png" alt="Bitnami package" width="800" height="604"&gt;
&lt;em&gt;If you choose another LAMP stack, such as the Google Click to Deploy offering, the lab instructions will not work as expected.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;On the LAMP page, click &lt;strong&gt;GET STARTED&lt;/strong&gt;.
&lt;img src="https://media2.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%2Fm4f1kuswr8mjhy5ij1es.png" alt="GET STARTED" width="800" height="604"&gt;
&lt;/li&gt;
&lt;li&gt;On the Agreements page, check the box for &lt;strong&gt;Terms and agreements&lt;/strong&gt;, and click &lt;strong&gt;AGREE&lt;/strong&gt;.
&lt;img src="https://media2.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%2Fhux1shk2c8eg3819t7mx.png" alt="AGREE" width="800" height="604"&gt;
&lt;/li&gt;
&lt;li&gt;On the &lt;strong&gt;Successfully agreed to terms&lt;/strong&gt; pop up, click &lt;strong&gt;DEPLOY&lt;/strong&gt;.
&lt;img src="https://media2.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%2Fex1qepomdpkd4tstoctv.png" alt="DEPLOY" width="800" height="604"&gt;
&lt;em&gt;If prompted, click on Enable for the Compute Engine API and the Infrastructure Manager API.&lt;/em&gt;
&lt;img src="https://media2.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%2Ffq04p0p7xe2lalkzhw6k.png" alt="Enable" width="800" height="604"&gt;
&lt;/li&gt;
&lt;li&gt;For &lt;strong&gt;Zone&lt;/strong&gt;, select the deployment zone to &lt;code&gt;ZONE&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;For &lt;strong&gt;Machine Type&lt;/strong&gt;, select &lt;strong&gt;E2&lt;/strong&gt; as the &lt;strong&gt;Series&lt;/strong&gt; and &lt;strong&gt;e2-medium&lt;/strong&gt; as the &lt;strong&gt;Machine Type&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Leave the remaining settings as their defaults.
&lt;img src="https://media2.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%2F0vz6e5r7ndj5gvie19j3.png" alt="Machine Type" width="800" height="604"&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Deploy&lt;/strong&gt;.
&lt;img src="https://media2.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%2Ftxnfc99612jurjpclyn8.png" alt="Deploy" width="800" height="604"&gt;
&lt;em&gt;If a Welcome to Deployment Manager message appears, click Close to dismiss it.&lt;/em&gt;
&lt;img src="https://media2.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%2Fyu743hsp32maz3n4zmyg.png" alt="Welcome to Deployment" width="800" height="604"&gt;
&lt;strong&gt;Note&lt;/strong&gt;: Warnings may appear as the deployment is happening. You can disregard these for this lab.
The status of the deployment appears in the console window: &lt;strong&gt;lampstack-1 is being deployed&lt;/strong&gt;. When the deployment of the infrastructure is complete, the status changes to &lt;strong&gt;lampstack-1 has been deployed&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>googlecloud</category>
      <category>marketplace</category>
    </item>
    <item>
      <title>Azure Exercise</title>
      <dc:creator>Oluwatobiloba Akinbobola</dc:creator>
      <pubDate>Sat, 22 Feb 2025 21:14:16 +0000</pubDate>
      <link>https://forem.com/unique-tea/azure-exercise-2gjo</link>
      <guid>https://forem.com/unique-tea/azure-exercise-2gjo</guid>
      <description>&lt;p&gt;Try your hand at this Azure lab exercise and verify your output right here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 1:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Create a virtual network with the following details:&lt;/strong&gt;&lt;br&gt;
Address Space: 10.0.0.0/16&lt;br&gt;
Subnets:&lt;br&gt;
Subnet 1: 10.0.1.0/24 (Front-end)&lt;br&gt;
Subnet 2: 10.0.2.0/24 (Back-end)&lt;br&gt;
Name the virtual network "VNet-Assessment" and assign appropriate names for subnets.&lt;/p&gt;

&lt;h2&gt;
  
  
  Presentation 01
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fw4zbvli2oykqa1fvffvx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fw4zbvli2oykqa1fvffvx.png" alt="Create a virtual network" width="800" height="342"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Flrnzot16mo6g9h4xnves.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Flrnzot16mo6g9h4xnves.jpg" alt="VNet-Assessment" width="800" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 2:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Create and associate a Network Security Group (NSG) to the back-end subnet with the following rules:&lt;/strong&gt;&lt;br&gt;
Allow inbound SSH traffic on port 22 from any source&lt;br&gt;
Deny all inbound HTTP traffic on port 80&lt;br&gt;
Allow all outbound traffic&lt;br&gt;
&lt;strong&gt;Assessment Criteria:&lt;/strong&gt;&lt;br&gt;
NSG configuration and correct association to the subnet&lt;br&gt;
Proper definition of a security rule&lt;/p&gt;

&lt;h2&gt;
  
  
  Presentation 02
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fnsybycnblazxwog4z2xa.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fnsybycnblazxwog4z2xa.jpg" alt="Task:2" width="800" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 3:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Peering Two Virtual Networks&lt;/strong&gt;&lt;br&gt;
Create another virtual network called "VNet-Secondary" with the following address space: 10.1.0.0/16.&lt;br&gt;
Peer "VNet-Assessment" and "VNet-Secondary" ensure they can communicate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Presentation 03
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fovkpdhpg8bac8hx3qt48.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fovkpdhpg8bac8hx3qt48.jpg" alt="VNet-Secondary" width="800" height="234"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 4:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Deploying a Virtual Machine in a VNet&lt;/strong&gt;&lt;br&gt;
Deploy a Virtual Machine (VM) in the front-end subnet of "VNet-Assessment" using a Linux image. Ensure the VM has a private IP and is accessible only within the virtual network.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Assessment Criteria:&lt;/strong&gt;&lt;br&gt;
Correct deployment of VM in the right subnet&lt;br&gt;
Proper network settings ensure private IP usage&lt;/p&gt;

&lt;h2&gt;
  
  
  Presentation 04
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fex4zx2dpp3mmny0x1vyd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fex4zx2dpp3mmny0x1vyd.jpg" alt="VM" width="800" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>challenge</category>
      <category>azure</category>
    </item>
    <item>
      <title>Push a Docker Image to Docker Hub</title>
      <dc:creator>Oluwatobiloba Akinbobola</dc:creator>
      <pubDate>Mon, 17 Feb 2025 15:04:22 +0000</pubDate>
      <link>https://forem.com/unique-tea/push-a-docker-image-to-docker-hub-20np</link>
      <guid>https://forem.com/unique-tea/push-a-docker-image-to-docker-hub-20np</guid>
      <description>&lt;h2&gt;
  
  
  INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;Pushing a Docker image to Docker Hub is a straightforward process that allows you to share and deploy your containerized applications. Follow these steps:&lt;/p&gt;

&lt;p&gt;1.&lt;strong&gt;Log in to Docker Hub:&lt;/strong&gt;&lt;br&gt;
Use the command docker login and enter your Docker Hub credentials when prompted.&lt;br&gt;
&lt;a href="https://media2.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%2F5jyr1r671uiflv8co0cm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F5jyr1r671uiflv8co0cm.png" alt="Log in" width="800" height="177"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.&lt;strong&gt;Tag Your Image:&lt;/strong&gt;&lt;br&gt;
Tag your local image with your Docker Hub username and repository name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker tag &amp;lt;local-image-name&amp;gt; &amp;lt;docker-hub-username&amp;gt;/&amp;lt;repository-name&amp;gt;:&amp;lt;tag&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fvwtlimzgjky32uikhmpn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fvwtlimzgjky32uikhmpn.png" alt="Create repository" width="800" height="382"&gt;&lt;/a&gt;&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker tag fastfood brookeycutie/profusion:v1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.&lt;strong&gt;Push the Image:&lt;/strong&gt;&lt;br&gt;
Push the tagged image to Docker Hub using the docker push command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker push &amp;lt;docker-hub-username&amp;gt;/&amp;lt;repository-name&amp;gt;:&amp;lt;tag&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fjthxurfa8i8bt4gx7gi3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fjthxurfa8i8bt4gx7gi3.png" alt="Image description" width="800" height="382"&gt;&lt;/a&gt;&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker push brookeycutie/profusion:v1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fonnywndpdc4lin65qzqk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fonnywndpdc4lin65qzqk.png" alt="Image description" width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4.&lt;strong&gt;Verify on Docker Hub:&lt;/strong&gt;&lt;br&gt;
Log in to your Docker Hub account and check the repository to confirm the image has been uploaded.&lt;br&gt;
&lt;a href="https://media2.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%2F1597kgfqohaycoruatna.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F1597kgfqohaycoruatna.png" alt="Verify on Docker Hub" width="800" height="535"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By following these steps, you can easily share your Docker images with others or deploy them across different environments.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>devops</category>
      <category>cloudcomputing</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Master Docker in Minutes: Your Ultimate Hands-On Guide to Containerization</title>
      <dc:creator>Oluwatobiloba Akinbobola</dc:creator>
      <pubDate>Mon, 17 Feb 2025 13:23:31 +0000</pubDate>
      <link>https://forem.com/unique-tea/master-docker-in-minutes-your-ultimate-hands-on-guide-to-containerization-23g</link>
      <guid>https://forem.com/unique-tea/master-docker-in-minutes-your-ultimate-hands-on-guide-to-containerization-23g</guid>
      <description>&lt;h2&gt;
  
  
  INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;Containerization has transformed software development, deployment, and management. Docker, a leading containerization platform, stands out for its simplicity and efficiency. This hands-on lab will guide you through the basics of Docker, empowering you to leverage containerized applications with confidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lab 1: Installing Docker
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install Docker:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Download Docker Desktop from the &lt;a href="https://docs.docker.com/desktop/install/windows-install/" rel="noopener noreferrer"&gt;official website&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Follow the installation instructions for your operating system.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verify Installation:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Open a terminal or command prompt and run:
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker --version
docker-compose --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This confirms Docker is installed and ready to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lab 2: Running Your First Container
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Get the Sample Application&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clone the sample application repository:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/docker/welcome-to-docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fdv7sahblegehixj21zln.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fdv7sahblegehixj21zln.png" alt="Image description" width="800" height="298"&gt;&lt;/a&gt;&lt;br&gt;
Alternatively, download the repository manually.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Explore the Dockerfile&lt;/strong&gt;&lt;br&gt;
A Dockerfile defines the contents of a container. Open the Dockerfile in your project folder to understand its structure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Build Your First Image&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Build the Docker image:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t welcome-to-docker .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fvme31o40mn6tr0n913do.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fvme31o40mn6tr0n913do.png" alt="welcome-to-docker" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
The &lt;code&gt;-t&lt;/code&gt; flag tags the image with a name (welcome-to-docker).&lt;br&gt;
The &lt;code&gt;.&lt;/code&gt; specifies the location of the Dockerfile.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Run Your Container&lt;/strong&gt;&lt;br&gt;
1.&lt;strong&gt;Use Docker Desktop to run the container:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Fjeg8h55suag1q4751117.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fjeg8h55suag1q4751117.png" alt="Docker Desktop" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the &lt;strong&gt;Images&lt;/strong&gt; tab, select your image, and click &lt;strong&gt;Run&lt;/strong&gt;.
&lt;img src="https://media2.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%2F9idy9f64m91yiejeixel.png" alt="Host Port-8080" width="800" height="426"&gt;
2.Set the &lt;code&gt;Host Port&lt;/code&gt; to &lt;code&gt;8080&lt;/code&gt;.
&lt;img src="https://media2.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%2Fzoum8lp8uwdxkxyfysvb.png" alt="Host Port 8080" width="800" height="453"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 5: View the Frontend&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Access the running container via Docker Desktop or navigate to &lt;a href="http://localhost:8080" rel="noopener noreferrer"&gt; https://docs.docker.com/get-started/introduction/&lt;/a&gt; in your browser.&lt;br&gt;
&lt;a href="https://media2.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%2F4v93oa065jsgk4wl94s0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F4v93oa065jsgk4wl94s0.png" alt="Log" width="800" height="453"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Fccsovc5ghothq1em5gnq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fccsovc5ghothq1em5gnq.png" alt="Image Containers" width="800" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Stop Your Container&lt;/strong&gt;&lt;br&gt;
Stop the container in Docker Desktop by selecting the &lt;strong&gt;Stop&lt;/strong&gt; icon in the &lt;strong&gt;Containers&lt;/strong&gt; tab.&lt;br&gt;
&lt;a href="https://media2.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%2Fqeb160jhbhci7cvkamw1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fqeb160jhbhci7cvkamw1.png" alt="Stop" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;br&gt;
This article walked you through building and running your first Docker container. You also learned how to use Docker Desktop to manage containers and images. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;&lt;br&gt;
For more advanced use cases, explore images on &lt;a href="https://hub.docker.com/" rel="noopener noreferrer"&gt;Docker Hub&lt;/a&gt; and refer to the official Docker documentation.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>vscode</category>
      <category>containers</category>
      <category>devops</category>
    </item>
    <item>
      <title>Automate Email Alerts with Azure Logic Apps for New OneDrive Files</title>
      <dc:creator>Oluwatobiloba Akinbobola</dc:creator>
      <pubDate>Sat, 15 Feb 2025 18:37:11 +0000</pubDate>
      <link>https://forem.com/unique-tea/automate-email-alerts-with-azure-logic-apps-for-new-onedrive-files-39ij</link>
      <guid>https://forem.com/unique-tea/automate-email-alerts-with-azure-logic-apps-for-new-onedrive-files-39ij</guid>
      <description>&lt;h2&gt;
  
  
  INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;Azure Logic Apps is a powerful cloud service that enables you to automate workflows and integrate services without writing extensive code. In this guide, we will create a Logic App that monitors a specific OneDrive folder and sends an email whenever a new file is added.&lt;/p&gt;

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

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

&lt;ul&gt;
&lt;li&gt;An &lt;strong&gt;Azure subscription&lt;/strong&gt; (you can sign up for a free trial if needed).&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;OneDrive account&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;email account&lt;/strong&gt; (such as Outlook, Gmail, or Office 365 Mail) to send notifications.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Steps to Create the Logic App
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Create an Azure Logic App&lt;/strong&gt;&lt;br&gt;
1.&lt;strong&gt;Sign in to Azure Portal&lt;/strong&gt;: Go to Azure Portal and log in.&lt;br&gt;
2.&lt;strong&gt;Create a new Logic App&lt;/strong&gt;:&lt;br&gt;
&lt;a href="https://media2.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%2Ftkfp5nv9dlbufa3fn2c2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ftkfp5nv9dlbufa3fn2c2.png" alt="Logic Apps" width="800" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the Azure Portal, search for “Logic Apps” and select it.
&lt;img src="https://media2.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%2Foxlkqqzo6ubsa62tq8tb.png" alt="Logic Apps select" width="800" height="427"&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create&lt;/strong&gt; and provide the following details:
&lt;img src="https://media2.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%2Fa5q4ujtyhwadqgjgmzku.png" alt="Create" width="800" height="424"&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Review + Create&lt;/strong&gt; and then &lt;strong&gt;Create&lt;/strong&gt;.
&lt;img src="https://media2.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%2Fg96mnz61fij050x144kw.png" alt="Review + Create" width="800" height="527"&gt;
&lt;img src="https://media2.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%2Fflwx6d1m1g4ux6pfpikp.png" alt="create description" width="535" height="637"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Configure the Trigger&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Open the Logic App Designer&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;In the &lt;strong&gt;Azure Portal&lt;/strong&gt;, navigate to your newly created Logic App.
&lt;img src="https://media2.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%2Fmdrge79awrfna13qivt4.png" alt="Logic App" width="800" height="365"&gt;
&lt;/li&gt;
&lt;li&gt;Click Logic App Designer &amp;gt; Blank Logic App.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add a OneDrive Trigger&lt;/strong&gt;:
&lt;img src="https://media2.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%2Fckq4khe7d0v8ega8yskz.png" alt="OneDrive Trigger" width="800" height="372"&gt;

&lt;ul&gt;
&lt;li&gt;Click on "&lt;strong&gt;When a file is created&lt;/strong&gt;" (OneDrive trigger).
&lt;img src="https://media2.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%2Figl4rl3t7lnrqbrai3wo.png" alt="When a file is created" width="800" height="372"&gt;
&lt;/li&gt;
&lt;li&gt;Sign in with your OneDrive account to grant permissions.
&lt;img src="https://media2.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%2Fu0qpcxdevig72j5sg5rq.png" alt="file is created" width="800" height="263"&gt;
&lt;/li&gt;
&lt;li&gt;Configure the trigger settings:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Folder&lt;/strong&gt;: Select the OneDrive folder to monitor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interval&lt;/strong&gt;: Choose how often Azure checks for new files (e.g., every 1 minute).
&lt;img src="https://media2.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%2Fmnyrcroqq8natusxj89m.png" alt="Configure trigger" width="800" height="364"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Add an Email Action&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;+ New Step&lt;/strong&gt; and search for "Send an email".&lt;/li&gt;
&lt;li&gt;Select an email provider (Outlook, Gmail, or Office 365 Outlook).
&lt;img src="https://media2.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%2F78n938tzvisd1yo0e9jv.png" alt="email provider" width="800" height="327"&gt;
&lt;/li&gt;
&lt;li&gt;Sign in and grant necessary permissions.
&lt;img src="https://media2.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%2Fah3xv1w242cxk2v5s5ce.png" alt="Sign in email" width="800" height="258"&gt;
&lt;/li&gt;
&lt;li&gt;Configure the email action:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;To&lt;/strong&gt;: Enter the recipient’s email address.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subject&lt;/strong&gt;: Example - “New File Added: @{triggerOutputs()?['body/name']}”&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Body&lt;/strong&gt;: Example - "A new file named @{triggerOutputs()?['body/name']} has been added to OneDrive."
&lt;img src="https://media2.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%2Fcecq0gcx6z388bvkz1l6.png" alt="Mail trigger" width="800" height="363"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Save and Enable the Logic App&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Run Trigger&lt;/strong&gt; to test the setup.&lt;/li&gt;
&lt;li&gt;Upload a new file to the specified OneDrive folder.&lt;/li&gt;
&lt;li&gt;Check your email to confirm the notification.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  CONCLUSION
&lt;/h2&gt;

&lt;p&gt;By following these steps, you have successfully created an Azure Logic App that sends an email when a new file is added to a OneDrive folder. This automation can be useful for monitoring file uploads, document management, and real-time notifications.&lt;/p&gt;

</description>
      <category>logicapps</category>
      <category>azure</category>
      <category>cloudcomputing</category>
      <category>devops</category>
    </item>
    <item>
      <title>Building an Event-Driven Azure Function with Node.js and Event Grid</title>
      <dc:creator>Oluwatobiloba Akinbobola</dc:creator>
      <pubDate>Fri, 07 Feb 2025 00:17:44 +0000</pubDate>
      <link>https://forem.com/unique-tea/building-an-event-driven-azure-function-with-nodejs-and-event-grid-3kni</link>
      <guid>https://forem.com/unique-tea/building-an-event-driven-azure-function-with-nodejs-and-event-grid-3kni</guid>
      <description>&lt;h2&gt;
  
  
  INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;Azure Functions, combined with Azure Event Grid, provide a powerful serverless solution for building event-driven applications. This guide will create an Azure Function in JavaScript (Node.js) that listens to Event Grid events and logs the event data. This is a great starting point for integrating event-driven architectures into your Azure solutions.&lt;/p&gt;

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

&lt;p&gt;Before starting, ensure you have the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An active Azure account.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; installed on your local machine.&lt;/li&gt;
&lt;li&gt;Visual Studio Code (VS Code) with the Azure Functions extension.&lt;/li&gt;
&lt;li&gt;Azure Functions Core Tools installed (follow the &lt;a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local" rel="noopener noreferrer"&gt;installation guide&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Create a Resource Group&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Log in to the &lt;a href="https://portal.azure.com" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Search for &lt;strong&gt;Resource groups&lt;/strong&gt; in the top search bar and select it.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;+ Create&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Fill in the required fields:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Subscription&lt;/strong&gt;: Select your subscription.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource group&lt;/strong&gt;: Enter a name like &lt;code&gt;EventGridLabRG&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Region&lt;/strong&gt;: Choose a region (e.g., &lt;code&gt;East US&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Review + Create&lt;/strong&gt;, then &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Create a Storage Account&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the Azure Portal, search for &lt;strong&gt;Storage accounts&lt;/strong&gt; and select it.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;+ Create&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Fill in the details:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Resource group&lt;/strong&gt;: Select &lt;code&gt;EventGridLabRG&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage account name&lt;/strong&gt;: Enter a globally unique name (e.g., &lt;code&gt;eventgridlabstorage&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Region&lt;/strong&gt;: Choose the same region (e.g., &lt;code&gt;East US&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: Standard.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Replication&lt;/strong&gt;: Locally-redundant storage (LRS).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Review + Create&lt;/strong&gt;, then &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Create an Azure Function App&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the Azure Portal, search for &lt;strong&gt;Function App&lt;/strong&gt; and select it.
&lt;img src="https://media2.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%2F94gzstpvb6gzfrcsb2r4.png" alt="Function App" width="800" height="321"&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;+ Create&lt;/strong&gt;.
&lt;img src="https://media2.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%2F35ur5ldvax51oiwgpi2t.png" alt="+ Create" width="800" height="426"&gt;
&lt;/li&gt;
&lt;li&gt;Fill in the basis details required
&lt;img src="https://media2.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%2Fnkue2qnp4l0runnd34s4.png" alt="basis details" width="800" height="436"&gt;
&lt;img src="https://media2.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%2Fzhwdusdpahkbn3zb8why.png" alt="monitoring" width="800" height="248"&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Next: Hosting&lt;/strong&gt;, then select the storage account created earlier (&lt;code&gt;eventgridlabstorage&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Review + Create&lt;/strong&gt;, then &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Create the Azure Function (Event Grid Trigger)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open VS Code and install the Azure Functions extension if not already installed.&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;F1&lt;/code&gt; or type &lt;code&gt;&amp;gt;&lt;/code&gt; in the search bar, then select &lt;strong&gt;Azure Functions: Create New Project&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select a working folder and choose &lt;strong&gt;JavaScript&lt;/strong&gt; as the runtime.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Event Grid Trigger&lt;/strong&gt; as the function template.&lt;/li&gt;
&lt;li&gt;Name the function (e.g., &lt;code&gt;EventGridTrigger&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Deploy the function to Azure using the command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func azure functionapp publish eventgridfunctionapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2F3sh04veya22d3g0yb89v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F3sh04veya22d3g0yb89v.png" alt="eventgridfunctionapp" width="800" height="568"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Step 5: Write the Function Code&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the Azure Portal, go to your Function App.&lt;/li&gt;
&lt;li&gt;Select the &lt;code&gt;EventGridTrigger&lt;/code&gt; function from the Functions list.&lt;/li&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Code + Test&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Replace the default &lt;code&gt;index.js&lt;/code&gt; code with the following:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = async function (context, eventGridEvent) {
    context.log("Event Grid Event received:");
    context.log(JSON.stringify(eventGridEvent, null, 2));

    // Extract and log details
    const { subject, eventType, data } = eventGridEvent;
    context.log(`Subject: ${subject}`);
    context.log(`Event Type: ${eventType}`);
    context.log(`Data: ${JSON.stringify(data)}`);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fxjv7v14kf5ad7akxsls6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fxjv7v14kf5ad7akxsls6.png" alt="EventGridTrigger01" width="800" height="418"&gt;&lt;/a&gt;&lt;br&gt;
5.Click &lt;strong&gt;Save&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2F1yfquo7t85avblayxdem.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F1yfquo7t85avblayxdem.png" alt="Save" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Create an Event Grid Topic&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the Azure Portal, search for &lt;strong&gt;Event Grid Topics&lt;/strong&gt; and select it.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;+ Create&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Fill the required basis&lt;/li&gt;
&lt;li&gt;Click Review + Create, then Create.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 7: Link the Event Grid Topic to the Function&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the Event Grid Topic (&lt;code&gt;eventgridlabtopic&lt;/code&gt;) in the Azure Portal.&lt;/li&gt;
&lt;li&gt;In the left-hand menu, select &lt;strong&gt;Event Subscriptions&lt;/strong&gt;, then click &lt;strong&gt;+ Event Subscription&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Fill the required basis.

&lt;ul&gt;
&lt;li&gt;Name: Enter a name (e.g., &lt;code&gt;EventGridFunctionSubscription&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event Schema&lt;/strong&gt;: Leave as default (Event Grid Schema).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Endpoint Type&lt;/strong&gt;: Select Azure Function.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Endpoint&lt;/strong&gt;: Select your Function App and the &lt;code&gt;EventGridTrigger&lt;/code&gt; function.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 8: Test the Function&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to your Function App in the Azure Portal.&lt;/li&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Code + Test&lt;/strong&gt; and click &lt;strong&gt;Test/Run&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enter sample JSON data:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "id": "test-event-id",
  "eventType": "TestEvent",
  "subject": "/example/test",
  "data": {
    "property1": "hello",
    "property2": "world"
  },
  "eventTime": "2025-01-25T12:00:00.000Z",
  "dataVersion": "1.0"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fkjfby7rpbikzx5y06ing.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fkjfby7rpbikzx5y06ing.png" alt="Test/Run" width="800" height="380"&gt;&lt;/a&gt;&lt;br&gt;
4.Click &lt;strong&gt;Run&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 9: Verify the Function Execution&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to your &lt;strong&gt;Function App&lt;/strong&gt; in the Azure Portal.&lt;/li&gt;
&lt;li&gt;Check the &lt;strong&gt;Invocation logs&lt;/strong&gt; to confirm the function processed the event and logged the data.
&lt;img src="https://media2.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%2F0b0woy6g2cidu54csuab.png" alt="Function App" width="800" height="539"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 10: Clean Up Resources&lt;/strong&gt;&lt;br&gt;
To avoid unnecessary charges, delete the resource group:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the Azure Portal, search for &lt;strong&gt;Resource groups&lt;/strong&gt; and select it.&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;EventGridLabRG&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Delete resource group&lt;/strong&gt;, confirm the name, and click &lt;strong&gt;Delete&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  CONCLUSION
&lt;/h2&gt;

&lt;p&gt;By following this guide, you have successfully created an Event Grid-triggered Azure Function using Node.js. This setup allows you to process and log Event Grid events, enabling seamless integration of event-driven solutions in Azure. This approach is scalable, cost-effective, and ideal for modern cloud applications.&lt;/p&gt;

</description>
      <category>node</category>
      <category>eventdriven</category>
      <category>azure</category>
      <category>cloudcomputing</category>
    </item>
    <item>
      <title>Analyzing billing information using BigQuery</title>
      <dc:creator>Oluwatobiloba Akinbobola</dc:creator>
      <pubDate>Fri, 31 Jan 2025 19:07:43 +0000</pubDate>
      <link>https://forem.com/unique-tea/analyzing-billing-information-using-bigquery-4llh</link>
      <guid>https://forem.com/unique-tea/analyzing-billing-information-using-bigquery-4llh</guid>
      <description>&lt;h2&gt;
  
  
  INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;Google BigQuery is a powerful tool for studying big datasets effectively. In this tutorial, we'll go over how to import billing data into BigQuery, analyze the dataset, and perform SQL queries to glean insightful information.&lt;/p&gt;

&lt;h2&gt;
  
  
  PROCEDURE
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Task 1: Import Data into BigQuery&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Sign in to BigQuery and Create a Dataset&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to the Cloud Console and select &lt;strong&gt;BigQuery&lt;/strong&gt; from the Navigation menu.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;View actions&lt;/strong&gt; icon next to your project ID (e.g., &lt;code&gt;qwiklabs-gcp&lt;/code&gt;) and select &lt;strong&gt;Create dataset&lt;/strong&gt;.
&lt;img src="https://media2.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%2F745xuimja4ycd10p6hjb.png" alt="Create dataset" width="800" height="634"&gt;
&lt;/li&gt;
&lt;li&gt;Specify the basic details
&lt;img src="https://media2.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%2Foupom9znp8s0w73on84r.png" alt="basic details" width="800" height="634"&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create Dataset&lt;/strong&gt;.
2.&lt;strong&gt;Create a Table and Import Data&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;View actions&lt;/strong&gt; icon next to &lt;code&gt;billing_dataset&lt;/code&gt; and select &lt;strong&gt;Create Table&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;For the &lt;strong&gt;source&lt;/strong&gt; and &lt;strong&gt;destination&lt;/strong&gt;, specify:
&lt;img src="https://media2.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%2Fokfuetx29l6crz63gt03.png" alt="source" width="800" height="634"&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create Table&lt;/strong&gt;. Once the job completes, the table will appear under the dataset in the left pane.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Task 2: Examine the Table&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on &lt;code&gt;sampleinfotable&lt;/code&gt; to view its schema. BigQuery automatically generates this schema based on the imported data, which includes strings, integers, timestamps, and floating values.
2.Navigate to the &lt;strong&gt;Details&lt;/strong&gt; tab to check the number of rows. In this case, the table contains &lt;strong&gt;415,602 rows&lt;/strong&gt;.
&lt;img src="https://media2.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%2F8v3rm1d2m6fbfaidoro7.png" alt="Details" width="800" height="634"&gt;
&lt;/li&gt;
&lt;li&gt;Use the Preview tab to explore a sample of the data.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Task 3: Compose a Simple Query&lt;/strong&gt;&lt;br&gt;
To analyze the data, construct a query to filter rows where the &lt;strong&gt;Cost&lt;/strong&gt; field is greater than 0:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM `billing_dataset.sampleinfotable`
WHERE Cost &amp;gt; 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the query to find that &lt;strong&gt;70765 rows&lt;/strong&gt; have a cost greater than 0.&lt;br&gt;
&lt;a href="https://media2.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%2Fbmbe950xead3y74x9chv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fbmbe950xead3y74x9chv.png" alt="Cost" width="800" height="634"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Task 4: Analyze the Billing Dataset with SQL&lt;/strong&gt;&lt;br&gt;
1.&lt;strong&gt;Retrieve All Billing Data&lt;/strong&gt;&lt;br&gt;
Run the following query to extract key billing details:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT
  billing_account_id,
  project.id,
  project.name,
  service.description,
  currency,
  currency_conversion_rate,
  cost,
  usage.amount,
  usage.pricing_unit
FROM
  `billing_dataset.sampleinfotable`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query returns &lt;strong&gt;415,602 rows&lt;/strong&gt; of billing data.&lt;br&gt;
&lt;a href="https://media2.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%2Fd08058wr5ftyvj1ebwit.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fd08058wr5ftyvj1ebwit.png" alt="billing_dataset" width="800" height="634"&gt;&lt;/a&gt;&lt;br&gt;
2.&lt;strong&gt;Find the Latest 100 Records with Charges&lt;/strong&gt;&lt;br&gt;
To identify the most recent charges, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT
  service.description,
  sku.description,
  location.country,
  cost,
  project.id,
  project.name,
  currency,
  currency_conversion_rate,
  usage.amount,
  usage.unit
FROM
  `billing_dataset.sampleinfotable`
WHERE
  Cost &amp;gt; 0
ORDER BY usage_end_time DESC
LIMIT 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fr86snchwrjpyl89du138.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fr86snchwrjpyl89du138.png" alt="LIMIT 100" width="800" height="634"&gt;&lt;/a&gt;&lt;br&gt;
3.To find all charges that were more than 10 dollars, for Compose New Query, paste the following in Query Editor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT
  service.description,
  sku.description,
  location.country,
  cost,
  project.id,
  project.name,
  currency,
  currency_conversion_rate,
  usage.amount,
  usage.unit
FROM
  `billing_dataset.sampleinfotable`
WHERE
  cost &amp;gt; 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fviau441a134av4z759l9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fviau441a134av4z759l9.png" alt="cost &amp;gt; 10" width="800" height="634"&gt;&lt;/a&gt;&lt;br&gt;
4.&lt;strong&gt;Determine the Product with the Most Billing Records&lt;/strong&gt;&lt;br&gt;
To find the product with the highest number of records, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT
  service.description,
  COUNT(*) AS billing_records
FROM
  `billing_dataset.sampleinfotable`
GROUP BY
  service.description
ORDER BY billing_records DESC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result shows that &lt;strong&gt;Compute Engine&lt;/strong&gt; has the most billing records (&lt;strong&gt;281,136&lt;/strong&gt;).&lt;br&gt;
&lt;a href="https://media2.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%2Fuftggh61tveex7n286s6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fuftggh61tveex7n286s6.png" alt="Compute Engine" width="800" height="634"&gt;&lt;/a&gt;&lt;br&gt;
5.&lt;strong&gt;To find the most frequently used product&lt;/strong&gt; costing more than 1 dollar, for New Query, paste the following in Query Editor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT
  service.description,
  COUNT(*) AS billing_records
FROM
  `billing_dataset.sampleinfotable`
WHERE
  cost &amp;gt; 1
GROUP BY
  service.description
ORDER BY
  billing_records DESC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The query reveals that &lt;strong&gt;Cloud SQL&lt;/strong&gt; has the most billing records (&lt;strong&gt;15&lt;/strong&gt;) costing over $1.&lt;br&gt;
6.&lt;strong&gt;Identify the Most Commonly Charged Unit of Measure&lt;/strong&gt;&lt;br&gt;
To determine the most frequently charged unit, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT
  usage.unit,
  COUNT(*) AS billing_records
FROM
  `billing_dataset.sampleinfotable`
WHERE cost &amp;gt; 0
GROUP BY
  usage.unit
ORDER BY
  billing_records DESC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result shows that &lt;strong&gt;Byte-seconds&lt;/strong&gt; is the most commonly charged unit.&lt;br&gt;
&lt;a href="https://media2.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%2F7bqva0tft97th1vl630l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F7bqva0tft97th1vl630l.png" alt="usage.unit" width="800" height="634"&gt;&lt;/a&gt;&lt;br&gt;
7.&lt;strong&gt;Find the Product with the Highest Aggregate Cost&lt;/strong&gt;&lt;br&gt;
To calculate the total cost per product, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT
  service.description,
  ROUND(SUM(cost),2) AS total_cost
FROM
  `billing_dataset.sampleinfotable`
GROUP BY
  service.description
ORDER BY
  total_cost DESC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query identifies the product with the highest total cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  CONCLUSION
&lt;/h2&gt;

&lt;p&gt;BigQuery may be used to import, analyze, and effectively extract insights from massive datasets. Whether you are looking through billing records or running intricate SQL queries, BigQuery gives you the resources you need to make informed decisions.&lt;/p&gt;

</description>
      <category>bigdata</category>
      <category>googlecloud</category>
      <category>cloudcomputing</category>
      <category>sql</category>
    </item>
    <item>
      <title>Implementing Cloud SQL</title>
      <dc:creator>Oluwatobiloba Akinbobola</dc:creator>
      <pubDate>Thu, 30 Jan 2025 17:02:29 +0000</pubDate>
      <link>https://forem.com/unique-tea/implementing-cloud-sql-3f8j</link>
      <guid>https://forem.com/unique-tea/implementing-cloud-sql-3f8j</guid>
      <description>&lt;h2&gt;
  
  
  INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;In this article, you set up a Cloud SQL server and discover how to use a proxy to connect an application to it over an external connection. You can also set up a connection using a private IP link, improving security and performance. Although we used WordPress as the example application in this lab, the knowledge and best practices may be applied to any application that requires SQL Server.&lt;/p&gt;

&lt;p&gt;By the end of this experiment, you will have two functional Wordpress frontend instances connected to their SQL instance backend using two distinct connection types, as illustrated in this diagram:&lt;/p&gt;

&lt;h2&gt;
  
  
  ARCHITECTURAL DIAGRAM
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fryi1je5yiclnvpuucc29.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fryi1je5yiclnvpuucc29.png" alt="ARCHITECTURAL" width="800" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  PROCEDURE
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Task 1. Create a Cloud SQL database&lt;/strong&gt;&lt;br&gt;
Configure a SQL server according to Google Cloud best practices and create a Private IP connection.&lt;br&gt;
1.On the &lt;strong&gt;Navigation menu&lt;/strong&gt;, click &lt;strong&gt;SQL&lt;/strong&gt;.&lt;br&gt;
2.Click &lt;strong&gt;Create instance&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2F278g7jm30hvuvlop76l6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F278g7jm30hvuvlop76l6.png" alt="Create instance" width="800" height="634"&gt;&lt;/a&gt;&lt;br&gt;
3.Click &lt;strong&gt;Choose MySQL&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2F2tpydqstdixhgsbqno3q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F2tpydqstdixhgsbqno3q.png" alt="Choose MySQL" width="800" height="634"&gt;&lt;/a&gt;&lt;br&gt;
4.Specify and leave the remaining settings as their defaults&lt;br&gt;
&lt;strong&gt;Note&lt;/strong&gt;: Note the root password; it will be used in a later step and referred to as [ROOT_PASSWORD].&lt;br&gt;
5.Expand &lt;strong&gt;Show configuration options&lt;/strong&gt;.&lt;br&gt;
6.Expand the &lt;strong&gt;Machine configuartion&lt;/strong&gt; section.&lt;br&gt;
7.Provision the right amount of vCPU and memory. To choose a &lt;strong&gt;Machine configuration&lt;/strong&gt;, click the dropdown menu, and then explore your options.&lt;br&gt;
8.For this lab, select &lt;strong&gt;Dedicated core&lt;/strong&gt; from the dropdown menu, and then select &lt;strong&gt;1 vCPU, 3.75 GB&lt;/strong&gt;.&lt;br&gt;
9.Next, expand the &lt;strong&gt;Storage&lt;/strong&gt; section and then choose &lt;strong&gt;Storage type&lt;/strong&gt; and &lt;strong&gt;Storage capacity&lt;/strong&gt;.&lt;br&gt;
10.&lt;strong&gt;Click&lt;/strong&gt; each of the capacity options to see how it affects the throughput. Reset the option to 10GB.&lt;br&gt;
11.Expand the &lt;strong&gt;Connections&lt;/strong&gt; section.&lt;br&gt;
12.Select &lt;strong&gt;Private IP&lt;/strong&gt;.&lt;br&gt;
13.In the &lt;strong&gt;Network&lt;/strong&gt; dropdown, select &lt;strong&gt;default&lt;/strong&gt;.&lt;br&gt;
14.Click the &lt;strong&gt;Set up Connection&lt;/strong&gt; button that appears.&lt;br&gt;
&lt;a href="https://media2.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%2Fzaov9v4bzn03ey8vpbxu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fzaov9v4bzn03ey8vpbxu.png" alt="Set up Connection" width="800" height="634"&gt;&lt;/a&gt;&lt;br&gt;
15.In the panel to the right, click &lt;strong&gt;Enable API&lt;/strong&gt;, click &lt;strong&gt;Use an automatically allocated IP range&lt;/strong&gt;, click &lt;strong&gt;Continue&lt;/strong&gt;, and then click &lt;strong&gt;Create Connection&lt;/strong&gt;.&lt;br&gt;
16.Click &lt;strong&gt;Create Instance&lt;/strong&gt; at the bottom of the page to create the database instance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Task 2. Configure a proxy on a virtual machine&lt;/strong&gt;&lt;br&gt;
1.On the &lt;strong&gt;Navigation menu&lt;/strong&gt; click &lt;strong&gt;Compute Engine&lt;/strong&gt;.&lt;br&gt;
2.Click &lt;strong&gt;SSH&lt;/strong&gt; next to &lt;strong&gt;wordpress-proxy&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2Fxbyekhaowp5kwl33cuai.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fxbyekhaowp5kwl33cuai.png" alt="wordpress-proxy ssh" width="800" height="634"&gt;&lt;/a&gt;&lt;br&gt;
3.Download the Cloud SQL Proxy and make it executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy &amp;amp;&amp;amp; chmod +x cloud_sql_proxy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to start the proxy, you need the connection name of the Cloud SQL instance. Keep your SSH window open and return to the Cloud Console.&lt;br&gt;
4.On the &lt;strong&gt;Navigation menu&lt;/strong&gt;, click &lt;strong&gt;SQL&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2F8abjerruh9nndiik0luy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F8abjerruh9nndiik0luy.png" alt="wordpress-db" width="800" height="241"&gt;&lt;/a&gt; &lt;br&gt;
5.Click on the &lt;strong&gt;wordpress-db&lt;/strong&gt; instance and wait for a green checkmark next to its name, which indicates that it is operational (this could take a couple of minutes).&lt;br&gt;
&lt;a href="https://media2.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%2Fawonx5kpwlkgv43uefb1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fawonx5kpwlkgv43uefb1.png" alt="wordpres" width="800" height="380"&gt;&lt;/a&gt;&lt;br&gt;
6.Note the &lt;strong&gt;connection name&lt;/strong&gt; it will be used later and referred to as [SQL_CONNECTION_NAME].&lt;br&gt;
7.In addition, for the application to work, you need to create a table. Click &lt;strong&gt;Databases&lt;/strong&gt;.&lt;br&gt;
8.Click &lt;strong&gt;Create database&lt;/strong&gt;, type &lt;strong&gt;wordpress&lt;/strong&gt;, which is the name the application expects, and then click &lt;strong&gt;Create&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2F8kb4r2qr85e6kb5e5e2g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F8kb4r2qr85e6kb5e5e2g.png" alt="Create database" width="800" height="634"&gt;&lt;/a&gt;&lt;br&gt;
9.Return to the SSH window and save the connection name in an environment variable, replacing [SQL_CONNECTION_NAME] with the unique name you copied in a previous step:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export SQL_CONNECTION=[SQL_CONNECTION_NAME]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;10.To verify that the environment variable is set, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo $SQL_CONNECTION
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The connection name should be printed out.&lt;br&gt;
11.To activate the proxy connection to your Cloud SQL database and send the process to the background, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./cloud_sql_proxy -instances=$SQL_CONNECTION=tcp:3306 &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The expected output is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Listening on 127.0.0.1:3306 for [SQL_CONNECTION_NAME]
Ready for new connections
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;12.Press ENTER.&lt;br&gt;
&lt;a href="https://media2.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%2Fc1vj5xydfrvxcjbaa6ea.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fc1vj5xydfrvxcjbaa6ea.png" alt="Configure a proxy" width="800" height="583"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Task 3. Connect an application to the Cloud SQL instance&lt;/strong&gt;&lt;br&gt;
Connect a sample application to the Cloud SQL instance.&lt;br&gt;
1.Configure the Wordpress application. To find the external IP address of your virtual machine, query its metadata:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -H "Metadata-Flavor: Google" http://169.254.169.254/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip &amp;amp;&amp;amp; echo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Go to the &lt;strong&gt;wordpress-proxy&lt;/strong&gt; external IP address in your browser and configure the Wordpress application.&lt;br&gt;
3.Click &lt;strong&gt;Let's Go&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2Fhtewjcduum3xvw7dd2jv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fhtewjcduum3xvw7dd2jv.png" alt="Let's Go" width="800" height="592"&gt;&lt;/a&gt;&lt;br&gt;
4.Specify and replacing [ROOT_PASSWORD] with the password you configured upon machine creation, and leave the remaining settings as their defaults&lt;br&gt;
&lt;a href="https://media2.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%2Fy9iuw5frjd91gzt154sa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fy9iuw5frjd91gzt154sa.png" alt="wordpress-proxy" width="800" height="634"&gt;&lt;/a&gt;&lt;br&gt;
5.Click &lt;strong&gt;Submit&lt;/strong&gt;.&lt;br&gt;
6.When a connection has been made, click &lt;strong&gt;Run the installation&lt;/strong&gt; to instantiate Wordpress and its database in your Cloud SQL. This might take a few moments to complete.&lt;br&gt;
&lt;a href="https://media2.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%2F2ffl7a23jomzd5ptryij.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F2ffl7a23jomzd5ptryij.png" alt="Run the installation" width="800" height="356"&gt;&lt;/a&gt;&lt;br&gt;
7.Populate your demo site's information with random information and click &lt;strong&gt;Install Wordpress&lt;/strong&gt;. You won't have to remember or use these details.&lt;br&gt;
&lt;a href="https://media2.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%2F0br4dvf41q8uylhp124t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F0br4dvf41q8uylhp124t.png" alt="Install Wordpress" width="800" height="704"&gt;&lt;/a&gt;&lt;br&gt;
8.When a 'Success!' window appears, remove the text after the IP address in your web browser's address bar and press ENTER.&lt;br&gt;
You'll be presented with a working Wordpress Blog!&lt;br&gt;
&lt;a href="https://media2.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%2Fuod0ikt18juwtj2lpo2p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fuod0ikt18juwtj2lpo2p.png" alt="Wordpress Blog" width="800" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Task 4. Connect to Cloud SQL via internal IP&lt;/strong&gt;&lt;br&gt;
1.In the Cloud Console, on the &lt;strong&gt;Navigation menu&lt;/strong&gt;, click &lt;strong&gt;SQL&lt;/strong&gt;.&lt;br&gt;
2.Click &lt;strong&gt;wordpress-db&lt;/strong&gt;.&lt;br&gt;
3.Note the Private IP address of the Cloud SQL server; it will be referred to as [SQL_PRIVATE_IP].&lt;br&gt;
&lt;a href="https://media2.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%2Fu67rfbqxnmmjxkxsqkv7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fu67rfbqxnmmjxkxsqkv7.png" alt="SQL_PRIVATE_IP" width="800" height="380"&gt;&lt;/a&gt;&lt;br&gt;
4.On the &lt;strong&gt;Navigation menu&lt;/strong&gt;, click &lt;strong&gt;Compute Engine&lt;/strong&gt;.&lt;br&gt;
5.Copy the external IP address of &lt;strong&gt;wordpress-private-ip&lt;/strong&gt;, paste it in a browser window, and press ENTER.&lt;br&gt;
&lt;a href="https://media2.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%2Fsujw0lcr50epv49v68mm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fsujw0lcr50epv49v68mm.png" alt="wordpress-private-ip" width="800" height="380"&gt;&lt;/a&gt;&lt;br&gt;
6.Click &lt;strong&gt;Let's Go&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2Fhmtjzrm7pzj2tvxw3wpr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fhmtjzrm7pzj2tvxw3wpr.png" alt="Let's Go" width="800" height="587"&gt;&lt;/a&gt;&lt;br&gt;
7.Specify and leave the remaining settings as their defaults&lt;br&gt;
&lt;a href="https://media2.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%2F2xt4dv5f8rhnwxbf4mz2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F2xt4dv5f8rhnwxbf4mz2.png" alt="Specify Default" width="800" height="679"&gt;&lt;/a&gt;&lt;br&gt;
8.Click &lt;strong&gt;Submit&lt;/strong&gt;.&lt;br&gt;
9.Click &lt;strong&gt;Run the installation&lt;/strong&gt;.&lt;br&gt;
An 'Already Installed!' window is displayed, which means that your application is connected to the Cloud SQL server over private IP.&lt;br&gt;
&lt;a href="https://media2.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%2Fbliozxvsir3012y1hqy7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fbliozxvsir3012y1hqy7.png" alt="Already Installed" width="800" height="349"&gt;&lt;/a&gt;&lt;br&gt;
10.In your web browser's address bar, remove the text after the IP address and press ENTER.&lt;br&gt;
You'll be presented with a working Wordpress Blog!&lt;br&gt;
&lt;a href="https://media2.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%2Ftt6qkobjrwwwm921xpdd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ftt6qkobjrwwwm921xpdd.png" alt="Wordpress Blog!" width="800" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  CONCLUSION
&lt;/h2&gt;

&lt;p&gt;We have successfully created a Cloud SQL database and configured it with a secure proxy and Private IP for better security and performance. Private IP works only if the application and Cloud SQL server share the same region and VPC. For different regions, VPCs, or projects, use a proxy for a secure external connection.&lt;/p&gt;

</description>
      <category>sql</category>
      <category>googlecloud</category>
      <category>cloudcomputing</category>
      <category>devops</category>
    </item>
    <item>
      <title>Mastering Azure SQL Database: A Practical Guide to SSMS Integration</title>
      <dc:creator>Oluwatobiloba Akinbobola</dc:creator>
      <pubDate>Wed, 29 Jan 2025 15:28:00 +0000</pubDate>
      <link>https://forem.com/unique-tea/mastering-azure-sql-database-a-practical-guide-to-ssms-integration-4na4</link>
      <guid>https://forem.com/unique-tea/mastering-azure-sql-database-a-practical-guide-to-ssms-integration-4na4</guid>
      <description>&lt;h2&gt;
  
  
  INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;A completely managed relational database service, Azure SQL Database enables smooth interaction with SQL Server Management Studio (SSMS). This tutorial explains setting up security settings, creating an Azure SQL database, and running SQL queries.&lt;/p&gt;

&lt;h2&gt;
  
  
  PROCEDURE
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Part 1: Creating an Azure SQL Database&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Sign in to Azure Portal&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt; and log in.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create a New SQL Database&lt;/strong&gt;
&lt;img src="https://media2.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%2F2yhv55plw87q5wwmey9j.png" alt="New SQL Database" width="800" height="367"&gt;

&lt;ul&gt;
&lt;li&gt;Click &lt;strong&gt;Create a resource&lt;/strong&gt; &amp;gt; Search for &lt;strong&gt;SQL Database&lt;/strong&gt; &amp;gt; Select &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configure Database Settings&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Choose a &lt;strong&gt;subscription&lt;/strong&gt; and &lt;strong&gt;resource group&lt;/strong&gt;.
&lt;img src="https://media2.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%2F4yd3i3eeggql7a2gxov7.png" alt="create01" width="800" height="382"&gt;
&lt;/li&gt;
&lt;li&gt;Provide a &lt;strong&gt;Database Name&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create new server&lt;/strong&gt;, set authentication to &lt;strong&gt;SQL auth only&lt;/strong&gt;, define an &lt;strong&gt;admin login&lt;/strong&gt; and &lt;strong&gt;password&lt;/strong&gt;, and select a &lt;strong&gt;region&lt;/strong&gt;.
&lt;img src="https://media2.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%2Folovbdl45ussjkvqygk2.png" alt="Create2" width="800" height="382"&gt;
&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Basic&lt;/strong&gt; pricing for this lab.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Review + create&lt;/strong&gt; &amp;gt; &lt;strong&gt;Create&lt;/strong&gt;.
&lt;img src="https://media2.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%2Fr0djq4msykjhxyq1jz44.png" alt="Review + create" width="800" height="382"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configure Firewall Rules&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to &lt;strong&gt;SQL Server&lt;/strong&gt; &amp;gt; &lt;strong&gt;Networking&lt;/strong&gt;.
&lt;img src="https://media2.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%2Fwag61zk3nkh0askyp8sn.png" alt="SQL Server" width="800" height="382"&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add Client IP&lt;/strong&gt; &amp;gt; &lt;strong&gt;Save&lt;/strong&gt;.
&lt;img src="https://media2.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%2F8zh034fwschrkfl7helo.png" alt="Add Client IP" width="800" height="372"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Part 2: Connecting to Azure SQL Database with SSMS&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Launch SSMS&lt;/strong&gt; on your computer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Connect to the Server&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Server type&lt;/strong&gt;: Database Engine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server name&lt;/strong&gt;: Copy from Azure Portal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication&lt;/strong&gt;: SQL Server Authentication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Login&lt;/strong&gt;: Use the admin username and password.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Connect&lt;/strong&gt;.
&lt;img src="https://media2.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%2Fqjdzhittfs6r2zhdi9vs.png" alt="ssms Connect" width="800" height="426"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expand Databases&lt;/strong&gt; in &lt;strong&gt;Object Explorer&lt;/strong&gt; to view.
&lt;img src="https://media2.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%2Fqrks7z7vi0snlju1y9ad.png" alt="Object Explorer" width="800" height="426"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Part 3: Running SQL Queries in SSMS&lt;/strong&gt;&lt;br&gt;
1.&lt;strong&gt;Create a Table&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE Employees (
    EmployeeID INT PRIMARY KEY,
    FirstName NVARCHAR(50),
    LastName NVARCHAR(50),
    Email NVARCHAR(100)
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Click &lt;strong&gt;Execute&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2Fj510m9roqhgohcx59y9w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fj510m9roqhgohcx59y9w.png" alt="CREATE TABLE" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
2.&lt;strong&gt;Insert Data&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSERT INTO Employees (EmployeeID, FirstName, LastName, Email)
VALUES (1, 'John', 'Doe', 'john.doe@example.com'),
       (2, 'Jane', 'Smith', 'jane.smith@example.com');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Click &lt;strong&gt;Execute&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2F9hxucuir8p7af99zn8jo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F9hxucuir8p7af99zn8jo.png" alt="Insert Data" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
3.&lt;strong&gt;Query the Data&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM Employees;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Click &lt;strong&gt;Execute&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2F4ur8zfzjv8pt2ex4pe4c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F4ur8zfzjv8pt2ex4pe4c.png" alt="SELECT ALL" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
4.&lt;strong&gt;Update and Delete Data&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UPDATE Employees SET Email = 'johndoe@newmail.com' WHERE EmployeeID = 1;
DELETE FROM Employees WHERE EmployeeID = 2;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Click &lt;strong&gt;Execute&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2Fn7p52rd9v27lf664xh4p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fn7p52rd9v27lf664xh4p.png" alt="UPDATE" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Part 4: Additional Features&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Query Performance Insight&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to your &lt;em&gt;database&lt;/em&gt; in the Azure Portal.
&lt;img src="https://media2.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%2Fyd039nmqrtbozx3toal2.png" alt="SQL database" width="800" height="350"&gt;
&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Intelligent Performance&lt;/strong&gt;, open &lt;strong&gt;Query Performance Insight&lt;/strong&gt; to monitor slow queries.
&lt;img src="https://media2.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%2Ffvop6lm6k8etm0qh6v7y.png" alt="Query Performance Insight" width="428" height="316"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enable Automatic Tuning&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Automatic tuning&lt;/strong&gt; &amp;gt; Enable options like &lt;strong&gt;Force Last Good Plan&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backup and Restore&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Azure SQL Database provides automatic backups.&lt;/li&gt;
&lt;li&gt;To restore, go to &lt;strong&gt;Backups&lt;/strong&gt; &amp;gt; &lt;strong&gt;Point-in-time restore&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Writing SQL Queries in Azure Portal&lt;/strong&gt;&lt;br&gt;
1.&lt;strong&gt;Open Query Editor&lt;/strong&gt; in Azure Portal under &lt;strong&gt;SQL Database&lt;/strong&gt; &amp;gt; &lt;strong&gt;Query Editor (preview)&lt;/strong&gt;.&lt;br&gt;
2.&lt;strong&gt;Log in using SQL Authentication&lt;/strong&gt;.&lt;br&gt;
3.&lt;strong&gt;Run Queries Directly in the Portal&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE Customers (
    CustomerID INT PRIMARY KEY,
    FirstName NVARCHAR(50),
    LastName NVARCHAR(50),
    PhoneNumber NVARCHAR(15)
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fonu2bwe74lmm1okmar91.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fonu2bwe74lmm1okmar91.png" alt="Run" width="800" height="484"&gt;&lt;/a&gt;&lt;br&gt;
Click &lt;strong&gt;Run&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2Fg52h1fssvsammdhmze8h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fg52h1fssvsammdhmze8h.png" alt="Run Table" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  CONCLUSION
&lt;/h2&gt;

&lt;p&gt;This guide covered creating and configuring an Azure SQL Database, connecting to SSMS, executing SQL queries, and exploring advanced features like performance insights and backups. These foundational skills are essential for managing databases in a cloud environment.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>sql</category>
      <category>cloudcomputing</category>
      <category>database</category>
    </item>
    <item>
      <title>Optimizing Cloud Storage Operations: Access, Encryption, and Data Management.</title>
      <dc:creator>Oluwatobiloba Akinbobola</dc:creator>
      <pubDate>Mon, 27 Jan 2025 02:22:57 +0000</pubDate>
      <link>https://forem.com/unique-tea/optimizing-cloud-storage-operations-access-encryption-and-data-management-4kop</link>
      <guid>https://forem.com/unique-tea/optimizing-cloud-storage-operations-access-encryption-and-data-management-4kop</guid>
      <description>&lt;h2&gt;
  
  
  INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;Cloud Storage is a core service in Google Cloud, offering a wide range of advanced features essential for modern cloud solutions. This article provides hands-on experience with key Cloud Storage functionalities, enabling you to leverage its capabilities effectively in your designs. Through both the Google Cloud Console and the &lt;code&gt;gsutil&lt;/code&gt; command-line tool, you will learn to create and manage buckets, configure access control lists for security, utilize custom encryption keys, implement version control, enable directory synchronization, and share buckets across projects using IAM. These skills are critical for optimizing storage management and ensuring secure, scalable, and collaborative cloud environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  PROCEDURE
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Task 1. Preparation
&lt;/h2&gt;

&lt;p&gt;&lt;a href="//console.cloud.google.com"&gt;Open Google Console&lt;/a&gt;.&lt;br&gt;
&lt;strong&gt;Create a Cloud Storage bucket&lt;/strong&gt;&lt;br&gt;
1.On the &lt;strong&gt;Navigation menu&lt;/strong&gt;, click &lt;strong&gt;Cloud Storage&lt;/strong&gt; &amp;gt; &lt;strong&gt;Buckets&lt;/strong&gt;.&lt;br&gt;
2.Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;br&gt;
3.Specify the following, and leave the remaining settings as their defaults:&lt;br&gt;
4.Make a note of the bucket name. It will be used later in this lab and referred to as [BUCKET_NAME_1].&lt;br&gt;
5.Click Create.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Download a sample file using CURL and make two copies&lt;/strong&gt;&lt;br&gt;
1.In the Cloud Console, click &lt;strong&gt;Activate Cloud Shell&lt;/strong&gt;.&lt;br&gt;
2.If prompted, click &lt;strong&gt;Continue&lt;/strong&gt;.&lt;br&gt;
3.Store [BUCKET_NAME_1] in an environment variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export BUCKET_NAME_1=&amp;lt;enter bucket name 1 here&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Verify it with echo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo $BUCKET_NAME_1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.Run the following command to download a sample file (this sample file is a publicly available Hadoop documentation HTML file):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl \
https://hadoop.apache.org/docs/current/\
hadoop-project-dist/hadoop-common/\
ClusterSetup.html &amp;gt; setup.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6.To make copies of the file, run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cp setup.html setup2.html
cp setup.html setup3.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Task 2. Access control lists (ACLs)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Copy the file to the bucket and configure the access control list&lt;/strong&gt;&lt;br&gt;
1.Run the following command to copy the first file to the bucket:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud storage cp setup.html gs://$BUCKET_NAME_1/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.To get the default access list that's been assigned to setup.html, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil acl get gs://$BUCKET_NAME_1/setup.html  &amp;gt; acl.txt
cat acl.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.To set the access list to private and verify the results, run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil acl set private gs://$BUCKET_NAME_1/setup.html
gsutil acl get gs://$BUCKET_NAME_1/setup.html  &amp;gt; acl2.txt
cat acl2.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.To update the access list to make the file publicly readable, run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil acl ch -u AllUsers:R gs://$BUCKET_NAME_1/setup.html
gsutil acl get gs://$BUCKET_NAME_1/setup.html  &amp;gt; acl3.txt
cat acl3.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2F64w7hmqx01q8napebrd1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F64w7hmqx01q8napebrd1.png" alt="publicly readable" width="800" height="634"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Examine the file in the Cloud Console&lt;/strong&gt;&lt;br&gt;
1.In the Cloud Console, on the &lt;strong&gt;Navigation menu&lt;/strong&gt;, click &lt;strong&gt;Cloud Storage&lt;/strong&gt; &amp;gt; &lt;strong&gt;Buckets&lt;/strong&gt;.&lt;br&gt;
2.Click [BUCKET_NAME_1].&lt;br&gt;
3.Verify that for file setup.html, &lt;strong&gt;Public access&lt;/strong&gt; has a &lt;strong&gt;Public link&lt;/strong&gt; available.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Delete the local file and copy back from Cloud Storage&lt;/strong&gt;&lt;br&gt;
1.Return to &lt;strong&gt;Cloud Shell&lt;/strong&gt;. If necessary, click &lt;strong&gt;Activate Cloud Shell&lt;/strong&gt;.&lt;br&gt;
2.Run the following command to delete the setup file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm setup.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.To verify that the file has been deleted, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.To copy the file from the bucket again, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud storage cp gs://$BUCKET_NAME_1/setup.html setup.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Task 3. Customer-supplied encryption keys (CSEK)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Generate a CSEK key&lt;/strong&gt;&lt;br&gt;
For the next step, you need an AES-256 base-64 key.&lt;br&gt;
1.Run the following command to create a key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -c 'import base64; import os; print(base64.encodebytes(os.urandom(32)))'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result (&lt;strong&gt;this is example output&lt;/strong&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;b'tmxElCaabWvJqR7uXEWQF39DhWTcDvChzuCmpHe6sb0=\n'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Copy the value of the generated key excluding &lt;code&gt;b'&lt;/code&gt; and &lt;code&gt;\n'&lt;/code&gt; from the command output. Key should be in form of &lt;code&gt;tmxElCaabWvJqR7uXEWQF39DhWTcDvChzuCmpHe6sb0=&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Modify the boto file&lt;/strong&gt;&lt;br&gt;
The encryption controls are contained in a gsutil configuration file named &lt;code&gt;.boto&lt;/code&gt;.&lt;br&gt;
1.To view and open the boto file, run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls -al

nano .boto
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If the &lt;code&gt;.boto&lt;/code&gt; file is empty, close the nano editor with &lt;strong&gt;Ctrl+X&lt;/strong&gt; and generate a new &lt;code&gt;.boto&lt;/code&gt; file using the &lt;code&gt;gsutil config -n&lt;/code&gt; command. Then, try opening the file again with the above commands.&lt;/p&gt;

&lt;p&gt;If the &lt;code&gt;.boto&lt;/code&gt; file is still empty, you might have to locate it using the &lt;code&gt;gsutil version -l&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;2.Locate the line with "&lt;code&gt;#encryption_key=&lt;/code&gt;"&lt;br&gt;
&lt;strong&gt;Note:&lt;/strong&gt; The bottom of the nano editor provides you with shortcuts to quickly navigate files. Use the &lt;strong&gt;Where Is&lt;/strong&gt; shortcut to quickly locate the line with the &lt;em&gt;#encryption_key=&lt;/em&gt;.&lt;br&gt;
3.Uncomment the line by removing the # character, and paste the key you generated earlier at the end.&lt;br&gt;
Example (&lt;strong&gt;this is an example&lt;/strong&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before:
# encryption_key=

After:
encryption_key=tmxElCaabWvJqR7uXEWQF39DhWTcDvChzuCmpHe6sb0=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Press &lt;strong&gt;Ctrl+O&lt;/strong&gt;, &lt;strong&gt;ENTER&lt;/strong&gt; to save the boto file, and then press &lt;strong&gt;Ctrl+X&lt;/strong&gt; to exit nano.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Upload the remaining setup files (encrypted) and verify in the Cloud Console&lt;/strong&gt;&lt;br&gt;
1.To upload the remaining setup.html files, run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil cp setup2.html gs://$BUCKET_NAME_1/
gsutil cp setup3.html gs://$BUCKET_NAME_1/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Return to the Cloud Console.&lt;br&gt;
3.Click [BUCKET_NAME_1]. Both setup2.html and setup3.html files show that they are customer-encrypted.&lt;br&gt;
&lt;a href="https://media2.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%2F7kqrcxdxgfupylgmmi5m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F7kqrcxdxgfupylgmmi5m.png" alt="setup2&amp;amp;3" width="800" height="634"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Delete local files, copy new files, and verify encryption&lt;/strong&gt;&lt;br&gt;
1.To delete your local files, run the following command in Cloud Shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm setup*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.To copy the files from the bucket again, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil cp gs://$BUCKET_NAME_1/setup* ./
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.To cat the encrypted files to see whether they made it back, run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat setup.html
cat setup2.html
cat setup3.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Task 4. Rotate CSEK keys
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Move the current CSEK encrypt key to decrypt key&lt;/strong&gt;&lt;br&gt;
1.Run the following command to open the &lt;code&gt;.boto&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano .boto
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Comment out the current encryption_key line by adding the # character to the beginning of the line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The bottom of the nano editor provides you with shortcuts to quickly navigate files. Use the &lt;strong&gt;Where Is&lt;/strong&gt; shortcut to quickly locate the line with the &lt;em&gt;encryption_key=&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;3.Uncomment decryption_key1 by removing the # character, and copy the current key from the encryption_key line to the decryption_key1 line.&lt;br&gt;
Result (&lt;strong&gt;this is example output&lt;/strong&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before:
encryption_key=2dFWQGnKhjOcz4h0CudPdVHLG2g+OoxP8FQOIKKTzsg=

# decryption_key1=

After:
# encryption_key=2dFWQGnKhjOcz4h0CudPdVHLG2g+OoxP8FQOIKKTzsg=

decryption_key1=2dFWQGnKhjOcz4h0CudPdVHLG2g+OoxP8FQOIKKTzsg=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Press &lt;strong&gt;Ctrl+O&lt;/strong&gt;, &lt;strong&gt;ENTER&lt;/strong&gt; to save the boto file, and then press &lt;strong&gt;Ctrl+X&lt;/strong&gt; to exit nano.&lt;br&gt;
&lt;strong&gt;Note:&lt;/strong&gt; In practice, you would delete the old CSEK key from the encryption_key line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Generate another CSEK key and add to the boto file&lt;/strong&gt;&lt;br&gt;
1.Run the following command to generate a new key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -c 'import base64; import os; print(base64.encodebytes(os.urandom(32)))'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Copy the value of the generated key excluding b' and \n' from the command output. Key should be in form of &lt;code&gt;tmxElCaabWvJqR7uXEWQF39DhWTcDvChzuCmpHe6sb0=&lt;/code&gt;.&lt;br&gt;
3.To open the boto file, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano .boto
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Uncomment encryption and paste the new key value for &lt;code&gt;encryption_key=&lt;/code&gt;.&lt;br&gt;
Result (&lt;strong&gt;this is example output&lt;/strong&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before:
# encryption_key=2dFWQGnKhjOcz4h0CudPdVHLG2g+OoxP8FQOIKKTzsg=

After:
encryption_key=HbFK4I8CaStcvKKIx6aNpdTse0kTsfZNUjFpM+YUEjY=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.Press &lt;strong&gt;Ctrl+O&lt;/strong&gt;, &lt;strong&gt;ENTER&lt;/strong&gt; to save the boto file, and then press &lt;strong&gt;Ctrl+X&lt;/strong&gt; to exit nano.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rewrite the key for file 1 and comment out the old decrypt key&lt;/strong&gt;&lt;br&gt;
1.Run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil rewrite -k gs://$BUCKET_NAME_1/setup2.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.To open the boto file, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano .boto
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Comment out the current decryption_key1 line by adding the # character back in.&lt;br&gt;
&lt;a href="https://media2.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%2Fz9s1zc1f8x53apb3b7cm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fz9s1zc1f8x53apb3b7cm.png" alt="example output" width="800" height="634"&gt;&lt;/a&gt;&lt;br&gt;
Result (&lt;strong&gt;this is example output&lt;/strong&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before:
decryption_key1=2dFWQGnKhjOcz4h0CudPdVHLG2g+OoxP8FQOIKKTzsg=

After:
# decryption_key1=2dFWQGnKhjOcz4h0CudPdVHLG2g+OoxP8FQOIKKTzsg=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Press &lt;strong&gt;Ctrl+O&lt;/strong&gt;, &lt;strong&gt;ENTER&lt;/strong&gt; to save the boto file, and then press &lt;strong&gt;Ctrl+X&lt;/strong&gt; to exit nano.&lt;br&gt;
&lt;strong&gt;Note:&lt;/strong&gt; In practice, you would delete the old CSEK key from the decryption_key1 line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Download setup 2 and setup3&lt;/strong&gt;&lt;br&gt;
1.To download setup2.html, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil cp gs://$BUCKET_NAME_1/setup2.html recover2.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.To download setup3.html, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil cp gs://$BUCKET_NAME_1/setup3.html recover3.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; What happened? setup3.html was not rewritten with the new key, so it can no longer be decrypted, and the copy will fail.&lt;br&gt;
You have successfully rotated the CSEK keys.&lt;/p&gt;
&lt;h2&gt;
  
  
  Task 5. Enable lifecycle management
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;View the current lifecycle policy for the bucket&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run the following command to view the current lifecycle policy:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil lifecycle get gs://$BUCKET_NAME_1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; There is no lifecycle configuration. You create one in the next steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a JSON lifecycle policy file&lt;/strong&gt;&lt;br&gt;
1.To create a file named life.json, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano life.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Paste the following value into the life.json file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "rule":
  [
    {
      "action": {"type": "Delete"},
      "condition": {"age": 31}
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; These instructions tell Cloud Storage to delete the object after 31 days.&lt;br&gt;
3.Press &lt;strong&gt;Ctrl+O&lt;/strong&gt;, &lt;strong&gt;ENTER&lt;/strong&gt; to save the file, and then press &lt;strong&gt;Ctrl+X&lt;/strong&gt; to exit nano.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set the policy and verify&lt;/strong&gt;&lt;br&gt;
1.To set the policy, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil lifecycle set life.json gs://$BUCKET_NAME_1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.To verify the policy, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil lifecycle get gs://$BUCKET_NAME_1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Task 6. Enable versioning
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;View the versioning status for the bucket and enable versioning&lt;/strong&gt;&lt;br&gt;
1.Run the following command to view the current versioning status for the bucket:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil versioning get gs://$BUCKET_NAME_1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The Suspended policy means that it is not enabled.&lt;br&gt;
2.To enable versioning, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil versioning set on gs://$BUCKET_NAME_1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.To verify that versioning was enabled, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil versioning get gs://$BUCKET_NAME_1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Create several versions of the sample file in the bucket&lt;/strong&gt;&lt;br&gt;
1.Check the size of the sample file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls -al setup.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Open the setup.html file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano setup.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Delete any 5 lines from setup.html to change the size of the file.&lt;br&gt;
4.Press &lt;strong&gt;Ctrl+O&lt;/strong&gt;, &lt;strong&gt;ENTER&lt;/strong&gt; to save the file, and then press &lt;strong&gt;Ctrl+X&lt;/strong&gt; to exit nano.&lt;br&gt;
5.Copy the file to the bucket with the -v versioning option:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud storage cp -v setup.html gs://$BUCKET_NAME_1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6.Open the setup.html file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano setup.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;7.Delete another 5 lines from setup.html to change the size of the file.&lt;br&gt;
8.Press &lt;strong&gt;Ctrl+O&lt;/strong&gt;, &lt;strong&gt;ENTER&lt;/strong&gt; to save the file, and then press &lt;strong&gt;Ctrl+X&lt;/strong&gt; to exit nano.&lt;br&gt;
9.Copy the file to the bucket with the -v versioning option:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud storage cp -v setup.html gs://$BUCKET_NAME_1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;List all versions of the file&lt;/strong&gt;&lt;br&gt;
1.To list all versions of the file, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud storage ls -a gs://$BUCKET_NAME_1/setup.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Highlight and copy the name of the oldest version of the file (the first listed), referred to as [VERSION_NAME] in the next step.&lt;br&gt;
&lt;strong&gt;Note:&lt;/strong&gt; Make sure to copy the full path of the file, starting with &lt;strong&gt;gs&lt;/strong&gt;://&lt;br&gt;
3.Store the version value in the environment variable [VERSION_NAME].&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export VERSION_NAME=&amp;lt;Enter VERSION name here&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Verify it with echo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo $VERSION_NAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result (&lt;strong&gt;this is example output&lt;/strong&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gs://BUCKET_NAME_1/setup.html#1584457872853517
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Download the oldest, original version of the file and verify recovery&lt;/strong&gt;&lt;br&gt;
1.Download the original version of the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud storage cp $VERSION_NAME recovered.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.To verify recovery, run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls -al setup.html

ls -al recovered.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Task 7. Synchronize a directory to a bucket
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Make a nested directory and sync with a bucket&lt;/strong&gt;&lt;br&gt;
1.Run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir firstlevel
mkdir ./firstlevel/secondlevel
cp setup.html firstlevel
cp setup.html firstlevel/secondlevel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.To sync the firstlevel directory on the VM with your bucket, run the following command:&lt;br&gt;
&lt;a href="https://media2.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%2F4s7ksuyav6lpya5c7g7y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F4s7ksuyav6lpya5c7g7y.png" alt="firstlevel" width="800" height="380"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsutil rsync -r ./firstlevel gs://$BUCKET_NAME_1/firstlevel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Examine the results&lt;/strong&gt;&lt;br&gt;
1.In the Cloud Console, on the &lt;strong&gt;Navigation menu&lt;/strong&gt;, click &lt;strong&gt;Cloud Storage&lt;/strong&gt; &amp;gt; &lt;strong&gt;Buckets&lt;/strong&gt;.&lt;br&gt;
2.Click [BUCKET_NAME_1]. Notice the subfolders in the bucket.&lt;br&gt;
3.Click on &lt;strong&gt;/firstlevel&lt;/strong&gt; and then on &lt;strong&gt;/secondlevel&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2Fcktrkhxvxh22l7ufkvax.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fcktrkhxvxh22l7ufkvax.png" alt="secondlevel" width="800" height="380"&gt;&lt;/a&gt;&lt;br&gt;
4.Compare what you see in the Cloud Console with the results of the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud storage ls -r gs://$BUCKET_NAME_1/firstlevel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2F6p1iapm2lhryor4awnv6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F6p1iapm2lhryor4awnv6.png" alt="compare result" width="800" height="634"&gt;&lt;/a&gt;&lt;br&gt;
5.Exit Cloud Shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;exit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Task 8. Cross-project sharing
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Switch to the second project&lt;/strong&gt;&lt;br&gt;
1.Open a new incognito tab.&lt;br&gt;
2.Navigate to &lt;a href="//console.cloud.google.com"&gt;console.cloud.google.com&lt;/a&gt; to open a Cloud Console.&lt;br&gt;
3.Click the project selector dropdown in the title bar.&lt;br&gt;
4.Click &lt;strong&gt;All&lt;/strong&gt;, and then click the second project provided for you in the Qwiklabs Connection Details dialog. Remember that the Project ID is a unique name across all Google Cloud projects. The second project ID will be referred to as [PROJECT_ID_2].&lt;br&gt;
&lt;strong&gt;Prepare the bucket&lt;/strong&gt;&lt;br&gt;
1.In the Cloud Console, on the &lt;strong&gt;Navigation menu&lt;/strong&gt;, click &lt;strong&gt;Cloud Storage&lt;/strong&gt; &amp;gt; &lt;strong&gt;Buckets&lt;/strong&gt;.&lt;br&gt;
2.Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;br&gt;
3.Specify and leave the remaining settings as their defaults&lt;br&gt;
4.Note the bucket name. It will be referred to as [BUCKET_NAME_2] in the following steps.&lt;br&gt;
5.Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;br&gt;
&lt;strong&gt;Upload a text file to the bucket&lt;/strong&gt;&lt;br&gt;
1.Upload a file to [BUCKET_NAME_2]. Any small example file or text file will do.&lt;br&gt;
2.Note the file name (referred to as [FILE_NAME]); you will use it later.&lt;br&gt;
&lt;strong&gt;Create an IAM Service Account&lt;/strong&gt;&lt;br&gt;
1.In the Cloud Console, on the &lt;strong&gt;Navigation menu&lt;/strong&gt;, click &lt;strong&gt;IAM &amp;amp; admin&lt;/strong&gt; &amp;gt; &lt;strong&gt;Service accounts&lt;/strong&gt;.&lt;br&gt;
2.Click &lt;strong&gt;Create service account&lt;/strong&gt;.&lt;br&gt;
3.On Service account details page, specify the &lt;strong&gt;Service account name&lt;/strong&gt; as &lt;code&gt;cross-project-storage&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2Fsbx4i51ur7f5j4uo7nex.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fsbx4i51ur7f5j4uo7nex.png" alt="cross-project-storage" width="800" height="760"&gt;&lt;/a&gt;&lt;br&gt;
4.Click &lt;strong&gt;Create and Continue&lt;/strong&gt;.&lt;br&gt;
5.On the Service account permissions page, specify the role as &lt;strong&gt;Cloud Storage&lt;/strong&gt; &amp;gt; &lt;strong&gt;Storage Object Viewer&lt;/strong&gt;.&lt;br&gt;
6.Click &lt;strong&gt;Continue&lt;/strong&gt; and then &lt;strong&gt;Done&lt;/strong&gt;.&lt;br&gt;
7.Click the &lt;strong&gt;cross-project-storage&lt;/strong&gt; service account to add the JSON key.&lt;br&gt;
&lt;a href="https://media2.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%2Fufraaiined2tgwfu89zr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fufraaiined2tgwfu89zr.png" alt="cross-project" width="800" height="760"&gt;&lt;/a&gt;&lt;br&gt;
8.In &lt;strong&gt;Keys&lt;/strong&gt; tab, click &lt;strong&gt;Add Key&lt;/strong&gt; dropdown and select &lt;strong&gt;Create new key&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2Fzjbso5hrl17bb9gyaedk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fzjbso5hrl17bb9gyaedk.png" alt="Keys" width="800" height="760"&gt;&lt;/a&gt;&lt;br&gt;
9.Select &lt;strong&gt;JSON&lt;/strong&gt; as the key type and click &lt;strong&gt;Create&lt;/strong&gt;. A JSON key file will be downloaded. You will need to find this key file and upload it in into the VM in a later step.&lt;br&gt;
&lt;a href="https://media2.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%2Ftf8hgob0k8rlme7kn4eq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ftf8hgob0k8rlme7kn4eq.png" alt="JSON" width="800" height="760"&gt;&lt;/a&gt;&lt;br&gt;
10.Click &lt;strong&gt;Close&lt;/strong&gt;.&lt;br&gt;
11.On your hard drive, rename the JSON key file to &lt;strong&gt;credentials.json&lt;/strong&gt;.&lt;br&gt;
12.In the upper pane, switch back to [PROJECT_ID_1].&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a VM&lt;/strong&gt;&lt;br&gt;
1.On the &lt;strong&gt;Navigation menu&lt;/strong&gt;, click &lt;strong&gt;Compute Engine&lt;/strong&gt; &amp;gt; &lt;strong&gt;VM instances&lt;/strong&gt;.&lt;br&gt;
2.Click &lt;strong&gt;Create Instance&lt;/strong&gt;.&lt;br&gt;
3,On the &lt;strong&gt;Machine configuration&lt;/strong&gt; page, specify and leave the remaining settings as their defaults&lt;br&gt;
&lt;a href="https://media2.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%2Fwde8ivze6tp6i47fkl3d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fwde8ivze6tp6i47fkl3d.png" alt="Machine configuration" width="800" height="380"&gt;&lt;/a&gt;&lt;br&gt;
4.Click &lt;strong&gt;OS and storage&lt;/strong&gt;.&lt;br&gt;
5.If the &lt;strong&gt;Image&lt;/strong&gt; shown is not &lt;strong&gt;Debian GNU/Linux 12 (bookworm)&lt;/strong&gt;, click &lt;strong&gt;Change&lt;/strong&gt; and select &lt;strong&gt;Debian GNU/Linux 12 (bookworm)&lt;/strong&gt;, and then click &lt;strong&gt;Select&lt;/strong&gt;.&lt;br&gt;
6.Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SSH to the VM&lt;/strong&gt;&lt;br&gt;
1.For &lt;strong&gt;crossproject&lt;/strong&gt;, click &lt;strong&gt;SSH&lt;/strong&gt; to launch a terminal and connect.&lt;br&gt;
&lt;a href="https://media2.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%2F5he9mckbtxboont5yp95.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F5he9mckbtxboont5yp95.png" alt="crossproject-SSH" width="800" height="760"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Note:&lt;/strong&gt; If the message appears like &lt;strong&gt;Connection via Cloud Identity-Aware Proxy Failed&lt;/strong&gt; then click &lt;strong&gt;Connect without Identity-Aware Proxy&lt;/strong&gt;.&lt;br&gt;
2.Store [BUCKET_NAME_2] in an environment variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export BUCKET_NAME_2=&amp;lt;enter bucket name 2 here&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Verify it with echo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo $BUCKET_NAME_2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Store [FILE_NAME] in an environment variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export FILE_NAME=&amp;lt;enter FILE_NAME here&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.Verify it with echo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo $FILE_NAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6.List the files in [PROJECT_ID_2]:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud storage ls gs://$BUCKET_NAME_2/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result (&lt;strong&gt;this is example output&lt;/strong&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AccessDeniedException: 403 404513585876-compute@developer.gserviceaccount.com does not have storage.objects.list access to the Google Cloud Storage bucket.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Authorize the VM&lt;/strong&gt;&lt;br&gt;
1.To upload credentials.json through the SSH VM terminal, click on the up arrow icon (upload icon) in the upper-right corner, and then click &lt;strong&gt;Upload file&lt;/strong&gt;.&lt;br&gt;
2.Select credentials.json and upload it.&lt;br&gt;
3.Click &lt;strong&gt;Close&lt;/strong&gt; in the File Transfer window.&lt;br&gt;
Verify that the JSON file has been uploaded to the VM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result (&lt;strong&gt;this is example output&lt;/strong&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;credentials.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.Enter the following command in the terminal to authorize the VM to use the Google Cloud API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud auth activate-service-account --key-file credentials.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Verify access&lt;/strong&gt;&lt;br&gt;
1.Retry this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud storage ls gs://$BUCKET_NAME_2/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Retry this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud storage cat gs://$BUCKET_NAME_2/$FILE_NAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Try to copy the credentials file to the bucket:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud storage cp credentials.json gs://$BUCKET_NAME_2/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result (&lt;strong&gt;this is example output&lt;/strong&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Copying file://credentials.json [Content-Type=application/json]...
AccessDeniedException: 403 cross-project-storage@qwiklabs-gcp-02-c638e3daa975.iam.gserviceaccount.com does not have storage.objects.create access to the Google Cloud Storage object.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Modify role&lt;/strong&gt;&lt;br&gt;
1.In the upper pane, switch back to [PROJECT_ID_2].&lt;br&gt;
2.In the Cloud Console, on the &lt;strong&gt;Navigation menu&lt;/strong&gt;, click &lt;strong&gt;IAM &amp;amp; admin&lt;/strong&gt; &amp;gt; &lt;strong&gt;IAM&lt;/strong&gt;.&lt;br&gt;
3.Click the pencil icon for the &lt;strong&gt;cross-project-storage&lt;/strong&gt; service account (You might have to scroll to the right to see this icon).&lt;br&gt;
4.Click on the &lt;strong&gt;Storage Object Viewer&lt;/strong&gt; role, and then click &lt;strong&gt;Cloud Storage&lt;/strong&gt; &amp;gt; &lt;strong&gt;Storage Object Admin&lt;/strong&gt;.&lt;br&gt;
5.Click &lt;strong&gt;Save&lt;/strong&gt;. If you don't click &lt;strong&gt;Save&lt;/strong&gt;, the change will not be made.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verify changed access&lt;/strong&gt;&lt;br&gt;
1.Return to the SSH terminal for &lt;strong&gt;crossproject&lt;/strong&gt;.&lt;br&gt;
2.Copy the credentials file to the bucket:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud storage cp credentials.json gs://$BUCKET_NAME_2/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result (&lt;strong&gt;this is example output&lt;/strong&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Copying file://credentials.json [Content-Type=application/json]...
- [1 files][  2.3 KiB/  2.3 KiB]
Operation completed over 1 objects/2.3 KiB.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  CONCLUSION
&lt;/h2&gt;

&lt;p&gt;You learned how to create and manage buckets and objects while investigating key Cloud Storage features in this lab. You discovered how to rotate encryption keys, use customer-supplied encryption keys (CSEK) for increased security, and set up access control lists (ACLs) to govern permissions, switching between private and public access as necessary. You also synchronized folders between a virtual machine and a bucket, enabled versioning to restore earlier versions of data, and put lifecycle management policies in place to automatically destroy items after 31 days. Lastly, you used IAM to conduct cross-project resource sharing, which allowed resources to be accessed easily across projects. You can create scalable, effective, and safe cloud storage solutions with these abilities.&lt;/p&gt;

</description>
      <category>googlecloud</category>
      <category>cloudcomputing</category>
      <category>beginners</category>
      <category>devops</category>
    </item>
    <item>
      <title>Getting Started with Azure Cosmos DB and Node.js: A Step-by-Step Guide</title>
      <dc:creator>Oluwatobiloba Akinbobola</dc:creator>
      <pubDate>Sun, 26 Jan 2025 16:57:14 +0000</pubDate>
      <link>https://forem.com/unique-tea/getting-started-with-azure-cosmos-db-and-nodejs-a-step-by-step-guide-i48</link>
      <guid>https://forem.com/unique-tea/getting-started-with-azure-cosmos-db-and-nodejs-a-step-by-step-guide-i48</guid>
      <description>&lt;h2&gt;
  
  
  INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;Microsoft Azure's fully managed NoSQL database solution, Azure Cosmos DB, gives you low latency, scalable, and highly available access to your data. We'll go over how to install the required tools, set up Azure Cosmos DB, and build a basic Node.js application to communicate with the database in this tutorial.&lt;/p&gt;

&lt;h2&gt;
  
  
  PROCEDURE
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Set Up Azure Cosmos DB&lt;/strong&gt;&lt;br&gt;
Before diving into coding, you must set up an Azure Cosmos DB account and create a database and container.&lt;br&gt;
1.&lt;strong&gt;Create an Azure Cosmos DB Account:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log in to the Azure Portal.&lt;/li&gt;
&lt;li&gt;Search for "Azure Cosmos DB" and click &lt;strong&gt;Create&lt;/strong&gt;.
&lt;img src="https://media2.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%2Fh0shfs6oy3g2mkh46k13.png" alt="Azure Cosmos DB" width="800" height="232"&gt;
&lt;/li&gt;
&lt;li&gt;Choose the &lt;strong&gt;Core (SQL)&lt;/strong&gt; API and fill in the required details, such as the resource group, account name, and region.
&lt;img src="https://media2.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%2F57zipge0kthr8q95m53p.png" alt="Core (SQL)" width="800" height="431"&gt;

&lt;ul&gt;
&lt;li&gt;Click &lt;strong&gt;Review + Create&lt;/strong&gt;, then &lt;strong&gt;Create&lt;/strong&gt; to provision your account.
&lt;img src="https://media2.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%2Fmxuodanemxnfvm6tzos0.png" alt="Review + Create" width="800" height="617"&gt;
&lt;img src="https://media2.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%2Fhnwri8bo8mwn81a7zeuv.png" alt="Create" width="800" height="633"&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;2.&lt;strong&gt;Create a Database and Container:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.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%2F5wx89k4kpc1wakdcmw1j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F5wx89k4kpc1wakdcmw1j.png" alt="Quick start" width="800" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Data Explorer&lt;/strong&gt; in the Azure Portal once the account is ready.&lt;/li&gt;
&lt;li&gt;Create a new database (e.g., &lt;code&gt;ToDoListDB&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Inside the database, create a new container (e.g., &lt;code&gt;Items&lt;/code&gt;) and set the partition key (e.g., &lt;code&gt;/id&lt;/code&gt;).
&lt;img src="https://media2.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%2F78mjkhf8eiuacl0jptlu.png" alt="partion key" width="800" height="341"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Install Required Software on Your Local Machine&lt;/strong&gt;&lt;br&gt;
To build and run the Node.js application, you’ll need to install the following tools:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install Node.js:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visit the &lt;a href="https://nodejs.org/" rel="noopener noreferrer"&gt;Node.js official website&lt;/a&gt; and download the latest LTS version.&lt;/li&gt;
&lt;li&gt;Install Node.js, which includes npm (Node Package Manager).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Set Up Your Project:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new directory for your project:
&lt;img src="https://media2.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%2Fus9tr4sk4aw8katqwbyn.png" alt="Node" width="800" height="439"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir cosmosTest &amp;amp;&amp;amp; cd cosmosTest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Initialize a new Node.js project:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Install the Azure Cosmos DB SDK:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @azure/cosmos
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Write a Simple Application to Connect to Cosmos DB&lt;/strong&gt;&lt;br&gt;
Now, let’s create a basic Node.js application to connect to your Cosmos DB instance.&lt;br&gt;
1.&lt;strong&gt;Create a New File:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open your project in VS Code and create a new file named &lt;code&gt;app.js&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.&lt;strong&gt;Write the Connection Code:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add the following code to &lt;code&gt;app.js&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const { CosmosClient } = require("@azure/cosmos");

const endpoint = "&amp;lt;your-cosmosdb-endpoint&amp;gt;";
const key = "&amp;lt;your-cosmosdb-key&amp;gt;";
const client = new CosmosClient({ endpoint, key });

const databaseId = "ToDoListDB";
const containerId = "Items";

async function run() {
    const database = client.database(databaseId);
    const container = database.container(containerId);

    // Test insertion
    const { resource: item } = await container.items.create({
        id: "1",
        description: "This is a test item",
        isCompleted: false,
    });
    console.log("Item created successfully: ", item.id);

    // Test retrieval
    const { resource: fetchedItem } = await container.item(item.id).read();
    console.log("Item fetched successfully: ", fetchedItem);
}

run().catch((error) =&amp;gt; {
    console.error("Error occurred:", error);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fx61jyxohfz83fl5sgl42.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fx61jyxohfz83fl5sgl42.png" alt="Nodejs" width="800" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Replace &lt;code&gt;&amp;lt;your-cosmosdb-endpoint&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;your-cosmosdb-key&amp;gt;&lt;/code&gt; with your actual Cosmos DB endpoint and key. These can be found in the &lt;strong&gt;Keys&lt;/strong&gt; section of your Cosmos DB account in the Azure Portal.
&lt;img src="https://media2.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%2Fpl7hh7slgm499m1o8alk.png" alt="code" width="800" height="706"&gt;
&lt;strong&gt;Step 4: Run and Test the Application&lt;/strong&gt;
With the code in place, it’s time to run and test your application.
1.&lt;strong&gt;Run the Application:&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;In the terminal, navigate to your project directory and run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node app.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.&lt;strong&gt;Check the Output:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If everything is set up correctly, you should see output similar to:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Item created successfully: 1
Item fetched successfully: { id: 'Wakefield.7', description: 'This is a test item', isCompleted: false }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.&lt;strong&gt;Verify in Azure Portal:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to your Azure Cosmos DB account in the Azure Portal.&lt;/li&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Data Explorer&lt;/strong&gt; &amp;gt; &lt;code&gt;ToDoListDB&lt;/code&gt; &amp;gt; &lt;code&gt;Items&lt;/code&gt;.
&lt;img src="https://media2.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%2F85tt0mppu8iela52xd3e.jpg" alt="Data Explorer" width="800" height="433"&gt;
&lt;/li&gt;
&lt;li&gt;You should see the document created by your script.
&lt;img src="https://media2.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%2F4ps82djab5hccjnmevny.png" alt="item" width="800" height="364"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CONCLUSION
&lt;/h2&gt;

&lt;p&gt;Well done! You have successfully installed the required tools, configured Azure Cosmos DB, and developed a basic Node.js application to communicate with your database.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>cosmosdb</category>
      <category>cloudcomputing</category>
      <category>devops</category>
    </item>
    <item>
      <title>Deploy a Web App using Azure CLI and ARM Template</title>
      <dc:creator>Oluwatobiloba Akinbobola</dc:creator>
      <pubDate>Mon, 20 Jan 2025 16:13:22 +0000</pubDate>
      <link>https://forem.com/unique-tea/deploy-a-web-app-using-azure-cli-and-arm-template-4a99</link>
      <guid>https://forem.com/unique-tea/deploy-a-web-app-using-azure-cli-and-arm-template-4a99</guid>
      <description>&lt;h2&gt;
  
  
  INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;Azure CLI and ARM (Azure Resource Manager) templates help make the process of deploying a web application on Azure more efficient. By defining your infrastructure as code using ARM templates, deployments become consistent and repeatable. This is a detailed tutorial on how to use an ARM template and the Azure CLI to launch a PHP web application.&lt;/p&gt;

&lt;h2&gt;
  
  
  PROCEDURE
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Create the ARM Template&lt;/strong&gt;&lt;br&gt;
1.Create a new folder e.g. web-app using this code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd web-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.The ARM template (&lt;code&gt;template.json&lt;/code&gt;) defines the resources needed for your web app, such as the App Service Plan and the Web App itself. Here’s the template:&lt;br&gt;
&lt;a href="https://media2.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%2Fckcz78j8vhqb50i1c9h2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fckcz78j8vhqb50i1c9h2.png" alt="template" width="800" height="708"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "resources": [
    {
      "type": "Microsoft.Web/serverfarms",
      "apiVersion": "2021-01-15",
      "name": "[parameters('appServicePlanName')]",
      "location": "[resourceGroup().location]",
      "sku": {
        "name": "F1",
        "tier": "Free",
        "size": "F1",
        "family": "F",
        "capacity": 1
      }
    },
    {
      "type": "Microsoft.Web/sites",
      "apiVersion": "2021-01-15",
      "name": "[parameters('webAppName')]",
      "location": "[resourceGroup().location]",
      "properties": {
        "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('appServicePlanName'))]",
        "siteConfig": {
          "appSettings": [
            {
              "name": "SCM_DO_BUILD_DURING_DEPLOYMENT",
              "value": "true"
            }
          ]
        }
      }
    }
  ],
  "parameters": {
    "appServicePlanName": {
      "type": "string"
    },
    "webAppName": {
      "type": "string"
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fw6bbmmst71gwmkt73nu4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fw6bbmmst71gwmkt73nu4.png" alt="Template Image" width="800" height="708"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Step 2: Define Parameters&lt;/strong&gt;&lt;br&gt;
The &lt;code&gt;parameters.json&lt;/code&gt; file provides values for the parameters defined in the ARM template:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "appServicePlanName": {
      "value": "myAppServicePlan"
    },
    "webAppName": {
      "value": "akinWebApp987"
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Create a Resource Group&lt;/strong&gt;&lt;br&gt;
Before deploying, create a resource group to hold your resources:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az group create --name web-rg --location eastus
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Create the App Service Plan (if it doesn’t exist)&lt;/strong&gt;&lt;br&gt;
If the App Service Plan does not exist, you can create it manually using the Azure CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az appservice plan create --name myAppServicePlan --resource-group web-rg --sku F1 --location eastus
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fscz9fpjfcyl9tm92zv1r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fscz9fpjfcyl9tm92zv1r.png" alt="web-rg" width="800" height="708"&gt;&lt;/a&gt;&lt;br&gt;
This creates a new App Service Plan named myAppServicePlan with the Free tier (F1).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Deploy the ARM Template&lt;/strong&gt;&lt;br&gt;
Use the Azure CLI to deploy the ARM template and parameters file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az deployment group create --resource-group web-rg --template-file template.json --parameters parameters.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fmlrh2noa1vo86qtgkbv1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fmlrh2noa1vo86qtgkbv1.png" alt="Deploy ARM Template" width="800" height="708"&gt;&lt;/a&gt;&lt;br&gt;
This command will:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create an App Service Plan (Free tier).&lt;br&gt;
&lt;a href="https://media2.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%2Fhode4w0kdvf9e239gx55.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fhode4w0kdvf9e239gx55.png" alt="Web App" width="800" height="760"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deploy a Web App linked to the App Service Plan.&lt;br&gt;
&lt;a href="https://media2.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%2Fm8v8sbypk8d65kprmf4z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fm8v8sbypk8d65kprmf4z.png" alt="Web App linked" width="800" height="760"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fa6e4ircfkm8db1yabs24.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fa6e4ircfkm8db1yabs24.png" alt="Microsoft Azure" width="800" height="830"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Step 6: Deploy Code from GitHub&lt;/strong&gt;&lt;br&gt;
To deploy your PHP application code from a &lt;a href="https://github.com/UniqueEmmanuel/fruitables" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;, use the following command:&lt;br&gt;
&lt;a href="https://media2.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%2Fs07igow0j8e8a33ezuu1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fs07igow0j8e8a33ezuu1.png" alt="Fork Github" width="800" height="760"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Fdaok6sqsjzuznovg37mo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fdaok6sqsjzuznovg37mo.png" alt="Github" width="800" height="566"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az webapp deployment source config --name akinWebApp987 --resource-group web-rg --repo-url https://github.com/yourtechie/fruitables --branch master --manual-integration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fg2sealug0nsq6qlk5sad.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fg2sealug0nsq6qlk5sad.png" alt="Deployed center" width="800" height="708"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fl34e3ntr30uzzmyojdjg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fl34e3ntr30uzzmyojdjg.png" alt="Deployed website" width="800" height="760"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fqmuc82f4q3d9h8f6idu4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fqmuc82f4q3d9h8f6idu4.png" alt="Deployed log" width="800" height="760"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This command connects your web app to the GitHub repository and deploys the code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Flzhuegtyc92st2eshqb6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Flzhuegtyc92st2eshqb6.png" alt="Web app link" width="800" height="895"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  CONCLUSION
&lt;/h2&gt;

&lt;p&gt;Create an ARM template, deploy Azure CLI, and connect the web app to GitHub for continuous deployment, ensuring a consistent, automated process for managing and scaling the web app on Azure.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>azure</category>
      <category>cloudcomputing</category>
      <category>arm</category>
    </item>
  </channel>
</rss>
