<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aiur</title>
    <description>The latest articles on DEV Community by Aiur (@aiurerb).</description>
    <link>https://dev.to/aiurerb</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%2F1140329%2F66793f5c-6635-4fe9-b7d9-4a8823906044.png</url>
      <title>DEV Community: Aiur</title>
      <link>https://dev.to/aiurerb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aiurerb"/>
    <language>en</language>
    <item>
      <title>Tutorial: Create a single database by Azure</title>
      <dc:creator>Aiur</dc:creator>
      <pubDate>Thu, 31 Aug 2023 19:13:36 +0000</pubDate>
      <link>https://dev.to/aiurerb/tutorial-create-a-single-database-by-azure-3j47</link>
      <guid>https://dev.to/aiurerb/tutorial-create-a-single-database-by-azure-3j47</guid>
      <description>&lt;p&gt;Today, I set up a database on Azure. Previously, I always worked with local databases like MySQL, MariaDB, and MS SQL. I used various clients, both CLI and GUI, such as MySQL Workbench. However, when designing for the cloud, there are many more options to consider.&lt;/p&gt;

&lt;p&gt;For the first time, I opted for the graphical interface of the Azure Portal.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Let's navigate to the &lt;strong&gt;Azure SQL&lt;/strong&gt; page. I don't have any databases yet, so I'll click &lt;strong&gt;Create New&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Now we need to choose the type of resource we want to create. I chose "&lt;strong&gt;SQL database&lt;/strong&gt; / &lt;strong&gt;Single database&lt;/strong&gt;." The other options, "&lt;strong&gt;SQL managed instance&lt;/strong&gt;," and "&lt;strong&gt;SQL virtual machines&lt;/strong&gt;" seem more advanced. I'll explore those later to understand their implications.&lt;/li&gt;
&lt;li&gt;Next, we're in the "&lt;strong&gt;Basics&lt;/strong&gt;" section. First, we select a subscription, which will be billed for the database.&lt;/li&gt;
&lt;li&gt;Then, we assign a &lt;strong&gt;resource group&lt;/strong&gt;—a folder where all the new resources will be placed. I created a new one.&lt;/li&gt;
&lt;li&gt;For the "&lt;strong&gt;Database name&lt;/strong&gt;" we should give our database a unique name. The server will need a unique name too, but I'll cover that later.&lt;/li&gt;
&lt;li&gt;Now we need to set up the &lt;strong&gt;server&lt;/strong&gt;. A SQL server can serve multiple databases. If we already have one, we can use it. We can also connect additional databases to the new server later. For the server, I chose an &lt;strong&gt;SQL authentication&lt;/strong&gt; method. I'm using SQL authentication—it's a simple username/password setup. It's important to remember these credentials and write them down somewhere secure.&lt;/li&gt;
&lt;li&gt;When asked if I want to use an &lt;strong&gt;SQL elastic pool&lt;/strong&gt;, I answered "No." This is related to self-managing database resources. I'll need to learn more about this.&lt;/li&gt;
&lt;li&gt;The "&lt;strong&gt;Workload environment&lt;/strong&gt;" encompasses backup and compute settings. I selected "&lt;strong&gt;Development&lt;/strong&gt;"—it's cost-effective but less secure.&lt;/li&gt;
&lt;li&gt;Next, we move to the "&lt;strong&gt;Networking&lt;/strong&gt;" section.&lt;/li&gt;
&lt;li&gt;Here, we choose the "&lt;strong&gt;Connectivity method&lt;/strong&gt;"—a "&lt;strong&gt;Public endpoint&lt;/strong&gt;."&lt;/li&gt;
&lt;li&gt;For the "&lt;strong&gt;Connection policy&lt;/strong&gt;," I switched "&lt;strong&gt;Add current client IP address&lt;/strong&gt;" to "Yes."&lt;/li&gt;
&lt;li&gt;I didn't make any changes in the "&lt;strong&gt;Security&lt;/strong&gt;" section, as I'm not familiar with the terms and technologies.&lt;/li&gt;
&lt;li&gt;In the "&lt;strong&gt;Additional settings&lt;/strong&gt;" section, you can create a sample database. I went ahead and did that.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, the database is configured. I clicked "&lt;strong&gt;Review + Create&lt;/strong&gt;" and then "&lt;strong&gt;Create&lt;/strong&gt;."&lt;br&gt;
Azure provisions an SQL Server and sets up the database.&lt;/p&gt;

&lt;p&gt;For access, I tried the &lt;strong&gt;Query Editor&lt;/strong&gt; in the Azure Portal and &lt;strong&gt;Azure Data Studio&lt;/strong&gt; on my local laptop.&lt;br&gt;
Everything worked as expected. The schema is readable, and all queries returned data.&lt;/p&gt;

&lt;p&gt;[&lt;a href="https://learn.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?view=azuresql&amp;amp;tabs=azure-portal"&gt;Tutotrial&lt;/a&gt;]&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Daily Tutorial: Deploy with CLI</title>
      <dc:creator>Aiur</dc:creator>
      <pubDate>Thu, 31 Aug 2023 10:17:16 +0000</pubDate>
      <link>https://dev.to/aiurerb/daily-tutorial-deploy-with-cli-4531</link>
      <guid>https://dev.to/aiurerb/daily-tutorial-deploy-with-cli-4531</guid>
      <description>&lt;p&gt;To gain a better understanding of deployment processes, I'm revisiting the procedures from yesterday. My goal is to redeploy a web application on Azure, and today, I've chosen to exclusively utilize the command-line interface (CLI).&lt;/p&gt;

&lt;p&gt;To achieve this, I installed the Azure CLI. Since I'm using Windows, the process was straightforward due to the MSI file. Subsequently, I logged into Azure:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This command opens a browser-based login page. After logging in, my data is presented in the console in JSON format.&lt;/p&gt;

&lt;p&gt;Following that, I navigated to my project folder and published my web application:&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 up --sku F1 --name &amp;lt;app-name&amp;gt; --os-type &amp;lt;os&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is akin to the "Publish" button in Visual Studio. Initially, I forgot the "up" command, but afterward, everything went smoothly. The value for "--name" must be unique, as it represents a domain in azurewebsites.net. "F1" denotes the free pricing tier, and "--os-type" should be either "linux" or "windows."&lt;/p&gt;

&lt;p&gt;It took a while, but eventually, the following message appeared:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The application can be accessed at http://azuretestapp310823.azurewebsites.net.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The new app can now be inspected in the Azure Portal.&lt;/p&gt;

&lt;p&gt;My next step was to introduce changes. I modified the app's code and entered 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;az webapp up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This also went well. All the changes were adopted. Thus, I concluded that performing deployment through the CLI isn't all that complex.&lt;/p&gt;

&lt;p&gt;[&lt;a href="https://learn.microsoft.com/en-us/azure/app-service/quickstart-dotnetcore?tabs=net70&amp;amp;pivots=development-environment-cli"&gt;Tutorial&lt;/a&gt;]&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Daily Tutorials</title>
      <dc:creator>Aiur</dc:creator>
      <pubDate>Wed, 30 Aug 2023 20:32:19 +0000</pubDate>
      <link>https://dev.to/aiurerb/daily-tutorials-49go</link>
      <guid>https://dev.to/aiurerb/daily-tutorials-49go</guid>
      <description>&lt;p&gt;I would like to keep a diary to ensure that my exercises are not in vain.&lt;/p&gt;

&lt;p&gt;Currently, I am learning ASP.NET, and today I made significant progress by understanding how to host my apps on the internet. So far, I've been experimenting with local applications on my laptop, but I had no idea how to publish them on the internet.&lt;/p&gt;

&lt;p&gt;After exploring Azure, I decided to try out this platform. Therefore, I created an account and received a €200 voucher. This should be sufficient for my experiments.&lt;/p&gt;

&lt;p&gt;The first tutorial covered deploying an ASP.NET application without databases using Visual Studio. It turned out to be surprisingly simple. Through the project's context menu in the explorer, I selected the "Publish" option and then signed in to Azure using a wizard. And just like that, the website was online. I didn't have to perform any complex manipulations in the Azure-CLI or Azure Portal.&lt;br&gt;
[&lt;a href="https://learn.microsoft.com/en-us/azure/app-service/quickstart-dotnetcore?tabs=net70&amp;amp;pivots=development-environment-vs"&gt;Tutorial Link&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;In the next tutorial, I learned about deploying an ASP.NET application with a SQL database connection. This required more steps.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;First, we prepared a Resource Group and a database. A special wizard in Azure (Web App + Database in the Marketplace) helped us set up all the necessary resources.&lt;/li&gt;
&lt;li&gt;Next, the new App Service provided us with a ConnectionString to access the database.&lt;/li&gt;
&lt;li&gt;Then, I deployed an application from GitHub. This was an entirely new approach for me. Azure's Deployment Center connected to the GitHub repository and tracked all changes. In this process, we had to use the new ConnectionString and continue the migration. I also learned that with GitHub, you can edit content using the browser-based Visual Studio Code. So, I edited the &lt;em&gt;appsettings.json&lt;/em&gt; file and a workflow &lt;em&gt;YAML&lt;/em&gt; file, and all changes were instantly reflected in Azure.&lt;/li&gt;
&lt;li&gt;We now had a functional web application, but the database lacked structure, no schema. I resolved this by SSH into the Azure Portal, starting a terminal, and performing a migration.
[&lt;a href="https://learn.microsoft.com/en-us/azure/app-service/tutorial-dotnetcore-sqldb-app"&gt;Tutorial Link&lt;/a&gt;]&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At the end, my application was up and running, and the data was successfully stored in the database.&lt;/p&gt;

&lt;p&gt;I believe that if I have a simple app, I can configure the ConnectionString on the local host. Instead of migrations, one could also utilize a script for the database. Nevertheless, I'm glad I delved into this complex process, including YAML and Git. While it might be challenging at the beginning, once you grasp the mechanics, everything works smoothly and becomes an invaluable skill.&lt;/p&gt;

&lt;p&gt;Tomorrow, I will attempt to repeat everything using Azure CLI.&lt;/p&gt;

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