<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Paris Polyzos&#039; blog</title>
	<atom:link href="https://ppolyzos.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://ppolyzos.com</link>
	<description>a developer&#039;s notebook</description>
	<lastBuildDate>Tue, 12 Dec 2023 19:18:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://ppolyzos.com/wp-content/uploads/2022/12/cropped-favicon.png</url>
	<title>Paris Polyzos&#039; blog</title>
	<link>https://ppolyzos.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Sorting data in MySQL that include null values</title>
		<link>https://ppolyzos.com/2023/02/02/sorting-data-in-mysql-that-include-null-values/</link>
					<comments>https://ppolyzos.com/2023/02/02/sorting-data-in-mysql-that-include-null-values/#respond</comments>
		
		<dc:creator><![CDATA[Paris Polyzos]]></dc:creator>
		<pubDate>Thu, 02 Feb 2023 10:10:11 +0000</pubDate>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[mysql]]></category>
		<guid isPermaLink="false">https://ppolyzos.com/?p=4508</guid>

					<description><![CDATA[Sorting values in a MySQL database is a very common task when you have to deal with data. However, when it comes to sorting data...]]></description>
										<content:encoded><![CDATA[<p>Sorting values in a MySQL database is a very common task when you have to deal with data. However, when it comes to sorting data that include <em><strong>null</strong></em> values, there are some important considerations to keep in mind.</p>
<p>Depending on the specific needs of your project, you may want <em><strong>null </strong></em>values to be sorted either <strong>at the beginning</strong> or <strong>at the end</strong> of the results. In this article, we&#8217;ll explore how to sort values in a MySQL database with <em>null </em>values so that <em><strong>null</strong></em> values go <strong>first</strong> or <strong>last</strong>.</p>
<h2><strong>Sample Data</strong></h2>
<p>To better showcase the results of this example, we can use the following script to generate some sample data:</p>
<pre><code class="language-sql">CREATE TABLE users (
id INT PRIMARY KEY,
name VARCHAR(50),
age INT
);

INSERT INTO users (id, name, age) VALUES
(1, 'John', NULL),
(2, 'Jane', 25),
(3, 'Bob', 40),
(4, 'Alice', 30),
(5, 'Sarah', NULL),
(6, 'David', 35),
(7, 'Emma', 22),
(8, 'Tom', NULL),
(9, 'Grace', 28),
(10, 'Michael', 45);
</code></pre>
<p>This script creates a table called <em>users</em> with three columns: <em>&#8216;id&#8217;</em>, <em>&#8216;name&#8217;</em>, and <em>&#8216;age&#8217;</em>. We&#8217;re inserting ten rows of data, including some <strong>null</strong> values in the <em><strong>&#8220;age&#8221;</strong></em> column.</p>
<h2>Sorting null values first</h2>
<p>To sort null values <em>first</em>, we can use the <em><strong>IS NULL</strong></em> operator in combination with the <em><strong>ASC</strong></em> keyword to sort the null values in ascending order:</p>
<pre><code class="language-sql">SELECT * FROM users ORDER BY age IS NULL ASC, age ASC;
</code></pre>
<p>This will produce the following result:</p>
<pre><code class="language-sql">+----+---------+------+
| id |  name   | age  |
+----+---------+------+
|  1 | John    | NULL |
|  5 | Sarah   | NULL |
|  8 | Tom     | NULL |
|  7 | Emma    |   22 |
|  2 | Jane    |   25 |
|  9 | Grace   |   28 |
|  4 | Alice   |   30 |
|  6 | David   |   35 |
|  3 | Bob     |   40 |
| 10 | Michael |   45 |
+----+---------+------+
</code></pre>
<p>As you can see, the <em>null</em> values in the <em>&#8216;age&#8217;</em> column appear <em><strong>first</strong></em> in the results, followed by the non-null values sorted in ascending order.</p>
<h2>Sorting null values last</h2>
<p>Now, in order to sort null values <em>last</em>, we can use the <em><strong>IS NULL</strong></em> operator in combination with the <em><strong>DESC</strong></em> keyword to sort the null values in descending order:</p>
<pre><code class="language-sql">SELECT * FROM users ORDER BY age IS NULL DESC, age ASC;
</code></pre>
<p>This will produce the following result:</p>
<pre><code class="language-sql">+----+---------+------+
| id |  name   | age  |
+----+---------+------+
|  7 | Emma    |   22 |
|  2 | Jane    |   25 |
|  9 | Grace   |   28 |
|  4 | Alice   |   30 |
|  6 | David   |   35 |
|  3 | Bob     |   40 |
| 10 | Michael |   45 |
|  1 | John    | NULL |
|  5 | Sarah   | NULL |
|  8 | Tom     | NULL |
+----+---------+------+
</code></pre>
<p>As you can see, the <em>non-null </em>values in the <em>&#8216;age&#8217; </em>column appear <strong><em>first</em></strong> in the results, sorted in ascending order, followed by the <em>non-null</em> values.</p>
<p>To do so, we use the same <em>SELECT</em> statement as before, but we modify the <em>ORDER BY</em> clause and we break it in the following parts:</p>
<ul>
<li>the first part of the ORDER BY clause uses the <em>IS NULL</em> operator to identify any <em>null</em> values in the &#8216;<em>age&#8217;</em> column, then we order this expression in descending order, so that all <em>null</em> values appear last in the results,</li>
<li>the second part of the ORDER BY clause sorts the remaining <em>non-null</em> values in ascending order.</li>
</ul>
<h2>Conclusion</h2>
<p>Sorting values in a MySQL database with <em>null</em> values requires special consideration to ensure that <em>null</em> values are sorted correctly. By using the <em>IS NULL</em> operator in combination with the <em>ASC</em> or <em>DESC</em> keyword, we can sort null values first or last depending on our specific needs.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ppolyzos.com/2023/02/02/sorting-data-in-mysql-that-include-null-values/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Get the size of tables in a MySQL / PostgreSQL / SQL Server database</title>
		<link>https://ppolyzos.com/2022/12/18/get-the-size-of-tables-in-a-mysql-postgresql-sql-server-database/</link>
					<comments>https://ppolyzos.com/2022/12/18/get-the-size-of-tables-in-a-mysql-postgresql-sql-server-database/#respond</comments>
		
		<dc:creator><![CDATA[Paris Polyzos]]></dc:creator>
		<pubDate>Sun, 18 Dec 2022 15:39:58 +0000</pubDate>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[sql server]]></category>
		<guid isPermaLink="false">https://ppolyzos.com/?p=4524</guid>

					<description><![CDATA[When working with a database, it&#8217;s important to keep track of the size of tables, so that we can identify which tables are taking up...]]></description>
										<content:encoded><![CDATA[<p>When working with a database, it&#8217;s important to keep track of the size of tables, so that we can identify which tables are taking up the most space and optimize them accordingly.</p>
<p>In this tutorial, we&#8217;ll show you how to connect, get the size of tables in gigabytes and order them from larger to the smaller in three common database servers, <em>MySQL</em>, <em>PostgreSQL</em> and <em>SQL Server</em>.</p>
<h2>MySQL</h2>
<h3>Step 1. Connect to the database</h3>
<p>In order to connect to MySQL server using the command-line tools, you need to run the following command:</p>
<pre><code class="language-bash">mysql -u username -p password -h hostname database_name</code></pre>
<p>Replace <em>username</em>, <em>password</em>, <em>hostname</em>, and <em>database_name</em> with the appropriate values for your MySQL database.</p>
<h3>Step 2. Get the Table Sizes</h3>
<p>Once you&#8217;re connected to the database, you can use the following SQL query to get the size of each table:</p>
<pre><code class="language-sql">SELECT *
FROM (SELECT TABLE_SCHEMA                                                AS TABLE_SCHEMA,
             TABLE_NAME                                                  AS TABLE_NAME,
             ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024 / 1024, 3) AS `Size (GB)`
      FROM INFORMATION_SCHEMA.TABLES
      WHERE TABLE_SCHEMA NOT IN ('INFORMATION_SCHEMA')) T
ORDER BY T.`Size (GB)` DESC;</code></pre>
<p>Output Results:</p>
<pre><code class="language-sql">+---------------+----------------------+------------+
| Table_Schema  | Table_Name           | Size (GB)  |
+---------------+----------------------+------------+
| eshop         | orders               | 10.43      |
| eshop         | customers            | 4.12       |
| eshop         | products             | 2.86       |
| eshop         | order_items          | 1.98       |
| music_app     | categories           | 0.24       |
| music_app     | reviews              | 0.05       |
+---------------+----------------------+------------+</code></pre>
<p>Command-Line tools:</p>
<ul>
<li>MySQL Community Server: <a href="https://dev.mysql.com/downloads/mysql/">https://dev.mysql.com/downloads/mysql/</a></li>
<li>MySQL Shell: <a href="https://dev.mysql.com/downloads/shell/">https://dev.mysql.com/downloads/shell/</a></li>
</ul>
<hr />
<h2>PostgreSQL</h2>
<h3>Step 1. Connect to the database</h3>
<p>In order to connect to MySQL server using the command-line tools, you need to run the following command:</p>
<pre><code class="language-bash">psql -h hostname -d database_name -U username -W</code></pre>
<p>Replace <em>hostname</em>, <em>database_name</em>, and <em>username</em> with the appropriate values for your <em>PostgreSQL</em> database. You will be prompted to enter your password after running this command.</p>
<h3>Step 2. Get the Table Sizes</h3>
<p>Once you&#8217;re connected to the database, you can use the following SQL query to get the size of each table:</p>
<pre><code class="language-sql">SELECT table_name AS `Table`,
ROUND(((data_length + index_length) / 1024 / 1024 / 1024), 2) `Size (GB)`
FROM information_schema.TABLES
WHERE table_schema = "database_name"
ORDER BY `Size (GB)` DESC;</code></pre>
<p>Output Results:</p>
<pre><code class="language-sql">+----------------------+------------+
| Table                | Size       |
+----------------------+------------+
| orders               | 10 GB      |
| customers            | 4 GB       |
| products             | 2.8 GB     |
| order_items          | 2 GB       |
| categories           | 240 MB     |
| reviews              | 50 MB      |
+----------------------+------------+</code></pre>
<p>Command-Line tools:</p>
<ul>
<li>PostgreSQL: <a href="https://www.postgresql.org/download/">https://www.postgresql.org/download/</a></li>
<li>pgAdmin: <a href="https://www.pgadmin.org/download/">https://www.pgadmin.org/download/</a></li>
</ul>
<hr />
<h2>SQL Server</h2>
<h3>Step 1. Connect to the database</h3>
<p>In order to connect to SQL Server, you can use <em><a href="https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility">sqlcmd</a></em> command-line tool and run the following command:</p>
<pre><code class="language-bash">sqlcmd -S servername -U username -P password -d database_name</code></pre>
<p>Replace <em>servername</em>, <em>username</em>, <em>password</em>, and <em>database_name</em> with the appropriate values for your SQL Server database.</p>
<h3>Step 2. Get the Table Sizes</h3>
<p>Once you&#8217;re connected to the database, you can use the following SQL query to get the size of each table:</p>
<pre><code class="language-sql">SELECT 
    t.NAME AS TableName,
    s.Name AS SchemaName,
    p.rows AS RowCounts,
    SUM(a.total_pages) * 8 / 1024 / 1024 AS TotalSizeGB
FROM 
    sys.tables t
INNER JOIN 
    sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN 
    sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN 
    sys.allocation_units a ON p.partition_id = a.container_id
LEFT OUTER JOIN 
    sys.schemas s ON t.schema_id = s.schema_id
WHERE 
    t.NAME NOT LIKE 'dt%' 
    AND t.is_ms_shipped = 0
    AND i.OBJECT_ID &gt; 255 
GROUP BY 
    t.Name, s.Name, p.Rows
ORDER BY 
    TotalSizeGB DESC;
</code></pre>
<p>Output Results:</p>
<pre><code class="language-sql">+--------------------+---------------+-------------+--------------+
| TableName          | SchemaName    | RowCounts   | TotalSizeGB  |
+--------------------+---------------+-------------+--------------+
| orders             | dbo           | 10,000,000  | 10.43        |
| customers          | dbo           | 5,000,000   | 4.12         |
| products           | dbo           | 2,500,000   | 2.86         |
| order_items        | dbo           | 1,000,000   | 1.98         |
| categories         | dbo           | 250,000     | 0.24         |
| reviews            | dbo           | 50,000      | 0.05         |
+--------------------+---------------+-------------+--------------+
</code></pre>
<p><em>Command-Line tools:</em></p>
<ul>
<li><em>SQL Server Management Studio<br />
</em><a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms" target="_new" rel="noopener">https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms</a></li>
<li><em>sqlcmd:</em> <a href="https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility" target="_new" rel="noopener">https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility</a></li>
</ul>
<p><em><strong>Note<br />
</strong></em><div class="epcl-shortcode epcl-box information"><i class="epcl-icon fa fa-eye"></i>In case we want to display the results differently we can take into account the following calculations:<br />
&#8211; Size in Gigabytes: 1024 / 1024 / 1024<br />
&#8211; Size in Megabytes: 1024 / 1024<br />
&#8211; Size in Kilobytes: 1024</p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://ppolyzos.com/2022/12/18/get-the-size-of-tables-in-a-mysql-postgresql-sql-server-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to set nested app settings in Windows and Linux Azure App Service</title>
		<link>https://ppolyzos.com/2021/07/29/how-to-set-nested-app-settings-in-windows-and-linux-azure-app-service/</link>
					<comments>https://ppolyzos.com/2021/07/29/how-to-set-nested-app-settings-in-windows-and-linux-azure-app-service/#respond</comments>
		
		<dc:creator><![CDATA[Paris Polyzos]]></dc:creator>
		<pubDate>Thu, 29 Jul 2021 12:47:33 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[app service]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[windows]]></category>
		<guid isPermaLink="false">https://ppolyzos.com/?p=2198</guid>

					<description><![CDATA[Let&#8217;s assume there is a .net web api application and that the developer wants to use a different value of a nested property than the...]]></description>
										<content:encoded><![CDATA[<p>Let&#8217;s assume there is a .net web api application and that the developer wants to use a different value of a nested property than the one in application settings.</p>
<p>To override this property value in the Azure App Service, special attention needs to be given to how the key will be declared under the <code>Configuration</code> section for the nested application setting, as there is a small difference between the Windows and the Linux App Service.</p>
<p>In the <strong>Windows</strong> App Service Configuration, the <code>:</code> is used; on the other hand, in the <strong>Linux</strong> App Service Configuration, instead of the <code>:</code> (colon) the <code>__</code>(double underscore) has to be used for the nested application setting key.</p>
<p>So, in order to access the <code>Default</code> log level from a configuration file such as the following:</p>
<pre><code class="language-bash">{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "AllowedHosts": "*"
}
</code>
</pre>
<p>the following can be used:</p>
<ul>
<li><code>Logging:LogLevel:Default</code>for apps hosted on the Azure App Service on <strong>Windows</strong></li>
<li><code>Logging__LogLevel__Default</code>for apps hosted on the Azure App Service on <strong>Linux</strong></li>
</ul>
<p>and then, in the code, that app settings value can be accessed as usual using <code>_configuration.GetValue&lt;string&gt;("Logging:LogLevel:Default");</code></p>
<h1>How to test it</h1>
<p>The following example presents a very simple web api application that consists of a single <code>SettingsController</code> and a <code>GET</code> method that returns the <code>Default</code> log level from the application settings file:</p>
<p><a href="https://ppolyzos.com/wp-content/uploads/2021/07/sample_web_api_controller_access_nested_property_value.png" data-rel="lightbox-gallery-X2GnuEMs" data-rl_title="" data-rl_caption="" title=""><img fetchpriority="high" decoding="async" class="alignnone wp-image-2199 size-large" src="https://ppolyzos.com/wp-content/uploads/2021/07/sample_web_api_controller_access_nested_property_value-1024x459.png" alt="" width="1024" height="459" data-wp-pid="2199" data-pin-nopin="nopin" /></a></p>
<p>To update the nested configuration property in the <code>Configuration</code> section on each Azure App Service, it&#8217;s important to remember that on Linux <code>:</code>must be changed to <code>__</code>(double underscore), as shown in the following picture:</p>
<p><a href="https://ppolyzos.com/wp-content/uploads/2021/07/nested_env_properties_linux_windows_app_service_plan.png" data-rel="lightbox-gallery-X2GnuEMs" data-rl_title="" data-rl_caption="" title=""><img decoding="async" class="alignnone size-large wp-image-2203" src="https://ppolyzos.com/wp-content/uploads/2021/07/nested_env_properties_linux_windows_app_service_plan-1024x444.png" alt="" width="1024" height="444" data-wp-pid="2203" data-pin-nopin="nopin" /></a></p>
<p>After doing so, when the setting value is fetched from each web api, the appropriate result will appear based on the relevant settings:</p>
<ul>
<li>`GET https://linux-sample-api.azurewebsites.net/api/settings` -&gt; &#8220;Debug&#8221;</li>
<li>`GET https://windows-sample-api.azurewebsites.net/api/settings` -&gt; &#8220;Debug&#8221;</li>
</ul>
<p>instead of <code>Information</code> which is declared in the <code>appsettings.json</code> file.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ppolyzos.com/2021/07/29/how-to-set-nested-app-settings-in-windows-and-linux-azure-app-service/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Create an azure web app with app insights and a storage container using Terraform</title>
		<link>https://ppolyzos.com/2021/07/15/create-an-azure-web-app-with-app-insights-and-a-storage-container-using-terraform/</link>
					<comments>https://ppolyzos.com/2021/07/15/create-an-azure-web-app-with-app-insights-and-a-storage-container-using-terraform/#respond</comments>
		
		<dc:creator><![CDATA[Paris Polyzos]]></dc:creator>
		<pubDate>Thu, 15 Jul 2021 22:59:43 +0000</pubDate>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[iac]]></category>
		<category><![CDATA[infrastructure-as-code]]></category>
		<category><![CDATA[terraform]]></category>
		<guid isPermaLink="false">https://ppolyzos.com/?p=2182</guid>

					<description><![CDATA[Recently I started playing around with Terraform and I got very excited with how easy and fast it is to provision new resources, especially when...]]></description>
										<content:encoded><![CDATA[<p>Recently I started playing around with <a href="https://registry.terraform.io/" target="_blank" rel="noopener">Terraform</a> and I got very excited with how easy and fast it is to provision new resources, especially when someone wants to try out things. Using a file that contains a few lines of code and a few simple commands, new resources can be created; then, when the resources are not needed anymore, they can be easily deleted.</p>
<p>So, let&#8217;s get started with the basics.</p>
<h1>What is Infrastructure as Code (IaC)?</h1>
<p>Infrastructure as Code (IaC) is the managing and provisioning of infrastructure through code instead of manual processes. This approach offers a lot of benefits, as new infrastructure can be provisioned faster and with better consistency, since those files are the single source of truth. Furthermore, there is full traceability of the changes each code file imposes.</p>
<p>There are several tools to use in order to implement infrastructure as code for Azure solutions, such as <a href="https://docs.microsoft.com//azure/azure-resource-manager/templates/?WT.mc_id=DX-MVP-5003606">Azure Resource Manager</a> (ARM) templates or <a href="https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/overview?WT.mc_id=DX-MVP-5003606">Bicep</a>. However, <a href="https://www.terraform.io/intro/index.html">Terraform</a> has started appealing to me more and more, given that it provides the same way of working for multiple environments and it is really easy to get started with.</p>
<h1>So, what is Terraform?</h1>
<p><a href="https://www.terraform.io/intro/index.html">Terraform</a> is an open-source infrastructure as code software tool that allows you to build, change and version infrastructure safely and efficiently.</p>
<p>It generates an <em>execution plan</em>, describing what it will do and asks for approval before making any infrastructure changes. This allows the review of changes before Terraform creates, updates or destroys infrastructure. Another important benefit of using Terraform is that it supports multi-cloud scenarios, so a developer can use the same tool to manage resources of different cloud providers.</p>
<p>To start working with Terraform, I strongly suggest you have a look at the <a href="https://learn.hashicorp.com/tutorials/terraform/infrastructure-as-code?in=terraform/azure-get-started">Get Started</a> guide, available on their website, which provides a quick overview of the basics regarding installation, main commands and state to keep track of metadata.</p>
<h1>Let&#8217;s get started with an example</h1>
<p>Using the configuration file below, the following resources can be provisioned on Azure:</p>
<ol>
<li>an Azure app service plan;</li>
<li> a storage account and a blob container;</li>
<li>Application Insights; and</li>
<li>an Azure app service that is using .NET framework 5.0, a startup command, a few settings, and that is connected with the Application Insights and the storage account created above.</li>
</ol>
[gist id=&#8221;2ad20374060bb32da92dba45a4a99f46&#8243;]
<h2>How to run the file to provision the resources</h2>
<p>In order to provision the resources described in the <code>.tf</code> file please follow these steps:</p>
<h3>Step 1. Download the file</h3>
<p>Download the file and store it in a folder. Let&#8217;s assume that the folder is under this path: <code>D:\Workspace\IaC\</code>.</p>
<h3>Step 2. Login to Azure and select the subscription to use</h3>
<p>In case you are not logged into an Azure account, please use the <a href="https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?WT.mc_id=DX-MVP-5003606">Azure CLI</a> and terminal to login and set the desired subscription as default, using the following commands:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic"># follow instructions to login to portal
$ az login 

# list all available subscriptions
$ az account list -o table 

# change default subscription
$ az account set --subscription "&lt;subscription&gt;"</pre>
<h3>Step 3. Initialize and run the script</h3>
<p>While you are at the directory where the <code>.tf</code> file is stored, the <a href="https://www.terraform.io/docs/cli/commands/init.html">init command</a>  <code>terraform init</code> needs to be run first to <strong>initialize</strong> the working directory containing the Terraform configuration files:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">D:\Workspace\IaC&gt;terraform init

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/random...
- Finding hashicorp/azurerm versions matching "2.46.0"...
- Installing hashicorp/azurerm v2.46.0...
- Installed hashicorp/azurerm v2.46.0 (signed by HashiCorp)
- Installing hashicorp/random v3.1.0...
- Installed hashicorp/random v3.1.0 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

D:\Workspace\IaC&gt;</pre>
<p>Then, the <a href="https://www.terraform.io/docs/cli/commands/plan.html">plan command</a>  <code>terraform plan</code> to <strong>create</strong> an execution plan:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">D:\Workspace\IaC&gt;terraform plan

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with
the following symbols:
  + create

Terraform will perform the following actions:

  # azurerm_app_service.webapp will be created
...

Plan: 7 to add, 0 to change, 0 to destroy.</pre>
<p>And, finally, the <a href="https://www.terraform.io/docs/cli/commands/apply.html">apply command</a> <code>terraform apply</code> to <strong>execute</strong> the actions proposed in the Terraform plan:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">D:\Workspace\IaC&gt;terraform apply

# or if you want to use custom values
D:\Workspace\IaC&gt;terraform apply -var="name=&lt;your_name&gt;" -var="region=northeurope"</pre>
<p>After a few seconds, you will be asked if you want to continue executing the plan described in the previous step.</p>
<p>Once you answer <code>yes</code> to the prompt command, all the resources will start being created in the Azure account you have previously logged in.</p>
<p><a href="https://ppolyzos.com/wp-content/uploads/2021/07/terraform-provision-resources-azure-web-app.png" data-rel="lightbox-gallery-nIZmgD5f" data-rl_title="" data-rl_caption="" title=""><img decoding="async" class="alignnone wp-image-2184 size-full" src="https://ppolyzos.com/wp-content/uploads/2021/07/terraform-provision-resources-azure-web-app.png" alt="" width="1079" height="635" data-wp-pid="2184" data-pin-nopin="nopin" /></a></p>
<h3>Step 4. Clean Up</h3>
<p>To delete all the resources that have been created and go back to previous state, just run the <a href="https://www.terraform.io/docs/cli/commands/destroy.html">destroy command</a> <code>terraform destroy</code> and, in a few minutes, all previous changes will be cleared. After that you can start all over again.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">D:\Workspace\IaC&gt;terraform destroy
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://ppolyzos.com/2021/07/15/create-an-azure-web-app-with-app-insights-and-a-storage-container-using-terraform/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Write stateful workflows in a serverless compute environment with Azure Durable Functions</title>
		<link>https://ppolyzos.com/2020/11/14/write-stateful-workflows-in-a-serverless-compute-environment-with-azure-durable-functions/</link>
					<comments>https://ppolyzos.com/2020/11/14/write-stateful-workflows-in-a-serverless-compute-environment-with-azure-durable-functions/#respond</comments>
		
		<dc:creator><![CDATA[Paris Polyzos]]></dc:creator>
		<pubDate>Sat, 14 Nov 2020 07:08:27 +0000</pubDate>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure durable functions]]></category>
		<category><![CDATA[azure functions]]></category>
		<category><![CDATA[microsoft student learn ambassadors]]></category>
		<category><![CDATA[student learn ambassadors]]></category>
		<guid isPermaLink="false">https://ppolyzos.com/?p=2169</guid>

					<description><![CDATA[During the summer I was fortunate enough to take part in Summer in Greece Festival, a five-day event by Microsoft Learn Student Ambassadors in which...]]></description>
										<content:encoded><![CDATA[<p>During the summer I was fortunate enough to take part in <a href="http://summeringreece.studentambassadors.gr/" target="_blank" rel="noopener noreferrer">Summer in Greece Festival</a>, a five-day event by <a href="https://www.facebook.com/MicrosoftLearnStudentAmbassadorsGreece/" target="_blank" rel="noopener noreferrer">Microsoft Learn Student Ambassadors</a> in which MVPs, MCTs, and Microsoft Employees will present and deep dive to Microsoft technologies.</p>
<p>My talk was about a <a href="https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview?WT.mc_id=DX-MVP-5003606" target="_blank" rel="noopener noreferrer">Durable Functions</a>, an extension of <a href="https://docs.microsoft.com/en-us/azure/azure-functions/?WT.mc_id=DX-MVP-5003606" target="_blank" rel="noopener noreferrer">Azure Functions</a> that lets you write stateful functions in a serverless compute environment.</p>
<p><iframe loading="lazy" width="853" height="505" src="https://www.youtube.com/embed/im6chIaKico" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="allowfullscreen"><span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start">﻿</span></iframe></p>
<h2>Source Code</h2>
<p>You can view clone and run the code for the demo from the following link, <a href="https://github.com/ppolyzos/demo-mlsa-functions" target="_blank" rel="noopener noreferrer">https://github.com/ppolyzos/demo-mlsa-functions</a>.</p>
<h2>Slides</h2>
<p><iframe loading="lazy" width="960" height="569" src="https://docs.google.com/presentation/d/e/2PACX-1vQ1oDFgJJ-hZx-H-gKZBOfV8J4UA8J8Cc2hy-9y2R5DZ9_JA8PxlQ4BpWcBov_5O1t4x7Q1_0-BgJBL/embed?start=false&amp;loop=false&amp;delayms=3000" frameborder="0" allowfullscreen="allowfullscreen" mozallowfullscreen="mozallowfullscreen" webkitallowfullscreen="webkitallowfullscreen"></iframe></p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ppolyzos.com/2020/11/14/write-stateful-workflows-in-a-serverless-compute-environment-with-azure-durable-functions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Swap places between tilde (~) and section sign (§) key in your macbook keyboard</title>
		<link>https://ppolyzos.com/2020/10/09/swap-places-between-tilde-and-section-sign-%c2%a7-key-in-your-macbook-keyboard/</link>
					<comments>https://ppolyzos.com/2020/10/09/swap-places-between-tilde-and-section-sign-%c2%a7-key-in-your-macbook-keyboard/#comments</comments>
		
		<dc:creator><![CDATA[Paris Polyzos]]></dc:creator>
		<pubDate>Fri, 09 Oct 2020 09:54:48 +0000</pubDate>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[plus-minus-sign]]></category>
		<category><![CDATA[section-sign]]></category>
		<category><![CDATA[tilde]]></category>
		<guid isPermaLink="false">https://ppolyzos.com/?p=2150</guid>

					<description><![CDATA[In Greece we are using the US keyboard layout and that means that the tilde key (~) is placed next to number 1 at the...]]></description>
										<content:encoded><![CDATA[<p>In Greece we are using the US keyboard layout and that means that the tilde key (~) is placed next to number 1 at the top left corner of the key, like the following picture:</p>
<p><img decoding="async" class="aligncenter" src="https://cdn.shopify.com/s/files/1/0810/3669/files/us-english-mac-keyboard-layout-keyshorts_1024x1024.png?79" alt="US English Mac keyboard layout" width="75%" /></p>
<p>About a year ago we moved to Luxembourg and my old Macbook died, so I had to replace it with a new one that unfortunately has the German layout:</p>
<p><img decoding="async" class="aligncenter" src="https://cdn.shopify.com/s/files/1/0810/3669/files/german-mac-keyboard-layout-keyshorts_b0c47719-3cd8-4e00-835c-a87876e7bdc1_1024x1024.png?v=1553694832" alt="German Mac keyboard layout" width="75%" /></p>
<p>The problem is that even if you set the keyboard layout to US in MacOS when you hit the key next to 1, this symbol starts appearing <code>§</code>. I don&#8217;t have anything with the symbol but in my day to day it&#8217;s totally useless and I started missing my beloved symbol (<code>~</code>) which is so often used in coding.</p>
<p>Long story short, I had to find a way to swap places, through software, between the key, right next to left <code>Shift</code> key, and the one right next to 1. To do so, I experimented with different apps, scripts, etc. but what worked at the end is the following.</p>
<h2>Swap tilde <code>~</code> key with <code>§</code></h2>
<p>Open your favourite terminal Terminal, iTerm, etc.. and run the following script:</p>
<pre class="lang:default decode:true">hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000064},{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}'
</pre>
<p>Now if you press the key next to 1 it will show up as <strong>`</strong> and the key next to shift as <strong>§</strong>. This solution works <strong>until next restart</strong>.</p>
<p>If you want to make it permanent you need to run the following scripts:</p>
<p><strong>Step 1. Store the following script in your home directory</strong></p>
<pre class="lang:default decode:true">cat &lt;&lt; 'EOF' &gt; ~/.tilde-switch &amp;&amp; chmod +x ~/.tilde-switch
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000064},{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}'
EOF</pre>
<p>You can check your script at <code>~/.tilde-switch</code> file your home directory.</p>
<p><strong>Step 2. Create a task to run the file from step 1 on every startup</strong></p>
<p>Run the following command, it will require admin privileges:</p>
<pre class="lang:default decode:true">sudo /usr/bin/env bash -c "cat &gt; /Library/LaunchAgents/org.custom.tilde-switch.plist" &lt;&lt; EOF
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
  &lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;org.custom.tilde-switch&lt;/string&gt;
    &lt;key&gt;Program&lt;/key&gt;
    &lt;string&gt;${HOME}/.tilde-switch&lt;/string&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;KeepAlive&lt;/key&gt;
    &lt;false/&gt;
  &lt;/dict&gt;
&lt;/plist&gt;
EOF</pre>
<p><strong>Step 3. Activate the task from step 2</strong></p>
<p>Run the following command:</p>
<pre class="lang:default decode:true">sudo launchctl load -w -- /Library/LaunchAgents/org.custom.tilde-switch.plist
</pre>
<h3>Undo the key swap</h3>
<p>If you want to go back to the previous key setup, before the swap, you can do the following:</p>
<p><strong>Undo the only switching script</strong></p>
<pre class="lang:default decode:true">hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000035},{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000064}]}'
</pre>
<p><strong>Undo all three steps</strong></p>
<pre class="lang:default decode:true">sudo launchctl unload -w -- /Library/LaunchAgents/org.custom.tilde-switch.plist; sudo rm -f -- /Library/LaunchAgents/org.custom.tilde-switch.plist ~/.tilde-switch</pre>
<p>&nbsp;</p>
<h2>Quick Update for MacOS 14.2+</h2>
<p>After the update to MacOS 14.2, it seems that the above commands do not work and the only way I found that this works is by using <a href="https://karabiner-elements.pqrs.org/">Karabiner-Elements</a> and just adding the following entry in <em>Simple Modification</em> &#8211; <em>For all devices</em> &#8211; `non_us_backslash` -&gt; `grave_accent_and_titlde`.</p>
<p><a href="https://karabiner-elements.pqrs.org/"><img loading="lazy" decoding="async" class="aligncenter wp-image-4545 size-large" src="https://ppolyzos.com/wp-content/uploads/2020/10/karabiner-elements_swap_non_us_backslash-to-grave_accent-1024x659.png" alt="" width="706" height="454" srcset="https://ppolyzos.com/wp-content/uploads/2020/10/karabiner-elements_swap_non_us_backslash-to-grave_accent-1024x659.png 1024w, https://ppolyzos.com/wp-content/uploads/2020/10/karabiner-elements_swap_non_us_backslash-to-grave_accent-300x193.png 300w, https://ppolyzos.com/wp-content/uploads/2020/10/karabiner-elements_swap_non_us_backslash-to-grave_accent-1536x989.png 1536w, https://ppolyzos.com/wp-content/uploads/2020/10/karabiner-elements_swap_non_us_backslash-to-grave_accent-2048x1318.png 2048w" sizes="auto, (max-width: 706px) 100vw, 706px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://ppolyzos.com/2020/10/09/swap-places-between-tilde-and-section-sign-%c2%a7-key-in-your-macbook-keyboard/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Easily delete all files in an Azure Storage container</title>
		<link>https://ppolyzos.com/2020/07/30/easily-delete-all-files-in-an-azure-storage-container/</link>
					<comments>https://ppolyzos.com/2020/07/30/easily-delete-all-files-in-an-azure-storage-container/#comments</comments>
		
		<dc:creator><![CDATA[Paris Polyzos]]></dc:creator>
		<pubDate>Thu, 30 Jul 2020 16:05:49 +0000</pubDate>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure storage]]></category>
		<category><![CDATA[snippets]]></category>
		<guid isPermaLink="false">https://ppolyzos.com/?p=2140</guid>

					<description><![CDATA[One thing I tend to forget is how powerful azure cli is and how many things can be done way faster through this tool. So,...]]></description>
										<content:encoded><![CDATA[<p>One thing I tend to forget is how powerful azure cli is and how many things can be done way faster through this tool. So, for example, if you want to delete all files in an Azure Storage Account at once, a fast and easy way to do just that is by using the <a href="https://docs.microsoft.com/en-us/cli/azure/storage/blob?view=azure-cli-latest#az-storage-blob-delete-batch" target="_blank" rel="noopener noreferrer">delete-batch</a> command from <a href="https://docs.microsoft.com/en-us/cli/azure/?view=azure-cli-latest" target="_blank" rel="noopener noreferrer">Azure CLI</a>.</p>
<p>Run the following command:</p>
<pre class="lang:default decode:true">az storage blob delete-batch --account-key &lt;storage_account_key&gt; --account-name &lt;storage_account_name&gt; --source &lt;container_name&gt;</pre>
<p>where:</p>
<ul>
<li><code>&lt;storage_account_key&gt;</code> is the Primary or Secondary key of your storage account and must be used in conjunction with storage account name,</li>
<li><code>&lt;storage_account_name&gt;</code> is the name of your storage name and</li>
<li><code>&lt;container_name&gt;</code> is the container name you want to delete files from.</li>
</ul>
<p>and in a few seconds all your files will be deleted from the specified azure storage container.</p>
<p><strong>Errors</strong></p>
<p>If you get an error in regards to <code>Blob Snapshots</code> like this one, <code>This operation is not permitted because the blob has snapshots. ErrorCode: SnapshotsPresent</code>, add the <code>--delete-snapshots</code> with <code>inlcude</code> or <code>only</code> parameter:</p>
<pre class="lang:default decode:true">az storage blob delete-batch --account-key &lt;storage_account_key&gt; --account-name &lt;storage_account_name&gt; --source &lt;container_name&gt; --delete-snapshots include</pre>
<h3>Retrieve Storage Account Id</h3>
<p>If you want to retrieve Storage Account key, there are two options. One from the portal and the other one from command line using the following command:</p>
<pre class="lang:default decode:true">az storage account keys list --subscription &lt;subscription_id&gt; -n &lt;storage_account_name&gt; --query [].{ID:value} --output table</pre>
<p>where:</p>
<ul>
<li><code>&lt;subscription_id&gt;</code> is the subscription id that your storage account is using,</li>
<li><code>&lt;storage_account_name&gt;</code> is the name of your storage account,</li>
<li><code>--query</code> is used to fetch only the data you need from the results and</li>
<li><code>--output table</code> is to display results in a table format</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://ppolyzos.com/2020/07/30/easily-delete-all-files-in-an-azure-storage-container/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>[Greek Audio] AzureHeads 24# Meetup: Automatic updates using Azure Functions CosmosDB and SignalR</title>
		<link>https://ppolyzos.com/2020/07/03/greek-audio-azureheads-24-meetup-automatic-updates-using-azure-functions-cosmosdb-and-signalr/</link>
					<comments>https://ppolyzos.com/2020/07/03/greek-audio-azureheads-24-meetup-automatic-updates-using-azure-functions-cosmosdb-and-signalr/#respond</comments>
		
		<dc:creator><![CDATA[Paris Polyzos]]></dc:creator>
		<pubDate>Fri, 03 Jul 2020 16:44:36 +0000</pubDate>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[azure cosmos db]]></category>
		<category><![CDATA[azure functions]]></category>
		<category><![CDATA[azure signalr]]></category>
		<guid isPermaLink="false">https://ppolyzos.com/?p=2106</guid>

					<description><![CDATA[During the 24th AzureHeads meetup, I delivered a presentation about three azure services, Azure Functions, CosmosDB and Signalr; I talked about websockets and the benefits...]]></description>
										<content:encoded><![CDATA[<p>During the 24th AzureHeads meetup, I delivered a presentation about three azure services, <a href="https://azure.microsoft.com/en-us/services/functions/" target="_blank" rel="noopener noreferrer">Azure Functions</a>, <a href="https://docs.microsoft.com/en-us/azure/cosmos-db/introduction" target="_blank" rel="noopener noreferrer">CosmosDB</a> and <a href="https://azure.microsoft.com/en-us/services/signalr-service/" target="_blank" rel="noopener noreferrer">Signalr</a>; I talked about websockets and the benefits compared to long polling and then, I built a stocks demo application using Azure Functions for the logic, Azure CosmosDB for the data persistence and then I showcase how is it is to add real-time updates to the end-user web app using an Azure CosmosDB feature called <a href="https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed" target="_blank" rel="noopener noreferrer">Change Feed</a> and <a href="https://azure.microsoft.com/en-us/services/signalr-service/" target="_blank" rel="noopener noreferrer">Azure SignalR</a> service.</p>
<p>The audio is in Greek, so if you are brave enough with the language, enjoy <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><iframe loading="lazy" width="853" height="505" src="https://www.youtube.com/embed/3_B8dN9Pk70" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="allowfullscreen"><span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start">﻿</span></iframe></p>
<h2>Source Code</h2>
<p>You can view clone and run the code for the demo from the following link, <a href="https://github.com/ppolyzos/azureheads-stocks-demo" target="_blank" rel="noopener noreferrer">https://github.com/ppolyzos/azureheads-stocks-demo</a></p>
<h2>Slides</h2>
<p><iframe loading="lazy" src="https://docs.google.com/presentation/d/e/2PACX-1vQYk2uQqV_UNSXw00FEVv-b0x60ITIiO73JsUA-nDbpN4WFn_Quzct_vzPvn2v64Wv2T_s_0Y75Ka-G/embed?start=false&#038;loop=false&#038;delayms=3000" frameborder="0" width="960" height="569" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe></p>
]]></content:encoded>
					
					<wfw:commentRss>https://ppolyzos.com/2020/07/03/greek-audio-azureheads-24-meetup-automatic-updates-using-azure-functions-cosmosdb-and-signalr/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Rename your Azure &#8220;Default Directory&#8221; to something comprehensible</title>
		<link>https://ppolyzos.com/2020/06/11/rename-your-azure-default-directory-name-to-something-comprehensible/</link>
					<comments>https://ppolyzos.com/2020/06/11/rename-your-azure-default-directory-name-to-something-comprehensible/#respond</comments>
		
		<dc:creator><![CDATA[Paris Polyzos]]></dc:creator>
		<pubDate>Thu, 11 Jun 2020 11:25:36 +0000</pubDate>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[rename directory]]></category>
		<guid isPermaLink="false">https://ppolyzos.com/?p=2086</guid>

					<description><![CDATA[In the Azure portal, if your account contributes to other Azure subscriptions, you are allowed to switch from one to another using a drop-down menu...]]></description>
										<content:encoded><![CDATA[<p>In the Azure portal, if your account contributes to other Azure subscriptions, you are allowed to switch from one to another using a drop-down menu at the top left corner.</p>
<p><a href="https://ppolyzos.com/wp-content/uploads/2020/06/azure-rename-directory-step1.jpg" data-rel="lightbox-gallery-5lp00XAp" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="alignnone wp-image-2088 size-medium" src="https://ppolyzos.com/wp-content/uploads/2020/06/azure-rename-directory-step1-134x300.jpg" alt="" width="134" height="300" data-wp-pid="2088" /></a></p>
<p>The problem is that, by default, the name used in the Azure Active Directory is <strong>“Default Directory”</strong> which seems a little confusing, especially if you have access to multiple directories and subscriptions.</p>
<p>So, how do you change the name to something more comprehensible?</p>
<p>Follow these steps and you&#8217;ll be ready in no time:</p>
<p>1. Select the <strong>Azure Active Directory</strong> service from Azure Portal:</p>
<p><a href="https://ppolyzos.com/wp-content/uploads/2020/06/azure-rename-directory-select-service.jpg" data-rel="lightbox-gallery-5lp00XAp" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2087" src="https://ppolyzos.com/wp-content/uploads/2020/06/azure-rename-directory-select-service.jpg" alt="" width="595" height="339" data-wp-pid="2087" /></a></p>
<p>&nbsp;</p>
<p>2. At the <strong>left sidebar</strong>, under the <strong>Manage</strong> section, choose <strong>Properties</strong>. Then in <strong>Directory Properties</strong> choose a new name:</p>
<p><a href="https://ppolyzos.com/wp-content/uploads/2020/06/azure-rename-directory-step2.jpg" data-rel="lightbox-gallery-5lp00XAp" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="alignnone size-large wp-image-2089" src="https://ppolyzos.com/wp-content/uploads/2020/06/azure-rename-directory-step2-1024x935.jpg" alt="" width="1024" height="935" data-wp-pid="2089" /></a></p>
<p>3. Refresh the portal and you are all set <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><a href="https://ppolyzos.com/wp-content/uploads/2020/06/azure-rename-directory-step3.jpg" data-rel="lightbox-gallery-5lp00XAp" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="alignnone wp-image-2090 size-medium" src="https://ppolyzos.com/wp-content/uploads/2020/06/azure-rename-directory-step3-137x300.jpg" alt="" width="137" height="300" data-wp-pid="2090" /></a></p>
<h1>Video</h1>
<p><iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/BLp0Q3dC2WE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="allowfullscreen"></iframe></p>
]]></content:encoded>
					
					<wfw:commentRss>https://ppolyzos.com/2020/06/11/rename-your-azure-default-directory-name-to-something-comprehensible/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Understanding CRON Expressions</title>
		<link>https://ppolyzos.com/2020/05/09/understanding-cron-expressions/</link>
					<comments>https://ppolyzos.com/2020/05/09/understanding-cron-expressions/#respond</comments>
		
		<dc:creator><![CDATA[Paris Polyzos]]></dc:creator>
		<pubDate>Sat, 09 May 2020 11:04:34 +0000</pubDate>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[notes]]></category>
		<guid isPermaLink="false">https://ppolyzos.com/?p=2078</guid>

					<description><![CDATA[A CRON expression is a string consisting of six or seven subexpressions (fields), separated by white space, that describe individual details of the schedule. A...]]></description>
										<content:encoded><![CDATA[<p>A CRON expression is a string consisting of six or seven subexpressions (fields), separated by white space, that describe individual details of the schedule.</p>
<p>A very useful tool that enables users to schedule tasks to run periodically at a specified date/time in the future, thus allowing the automation of a lot of tasks and processes that otherwise would require human intervention or another type of coordination.</p>
<h2> Basics</h2>
<p>The order of the six fields in Azure is:<br />
`{second} {minute} {hour} {day} {month} {day of the week} { year (optional)}`.</p>
<p><strong>Examples</strong></p>
<p>A CRON expression that can be used as a trigger that executes every three minutes looks like: <code>0 */3 * * * *</code>.</p>
<p>Or a CRON expression that executes &#8220;at <span class="">minute 5</span> <span class="">past every hour from 4 through 7</span> <span class="">in February and March&#8221;, looks like: `5 4-7 * 2,3 *` (<a href="https://crontab.guru/#5_4-7_*_2,3_*">details</a>).</span></p>
<table class="table">
<thead>
<tr>
<th>Special character</th>
<th>Meaning</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td>*</td>
<td>Selects every value in a field</td>
<td>An asterisk &#8220;*&#8221; in the day of the week field means <em>every</em> day.</td>
</tr>
<tr>
<td>,</td>
<td>Separates items in a list</td>
<td>A comma &#8220;1,3&#8221; in the day of the week field means just Mondays (day 1) and Wednesdays (day 3).</td>
</tr>
<tr>
<td>&#8211;</td>
<td>Specifies a range</td>
<td>A hyphen &#8220;10-12&#8221; in the hour field means a range that includes the hours 10, 11, and 12.</td>
</tr>
<tr>
<td>/</td>
<td>Specifies an increment</td>
<td>A slash &#8220;*/10&#8221; in the minutes field means an increment of every 10 minutes.</td>
</tr>
</tbody>
</table>
<h2>Tools</h2>
<h3><a href="https://crontab.guru/">CRONTab Guru</a></h3>
<p>In my opinion, the best tool out there to write and validate your cron schedule expressions:</p>
<p><a href="https://ppolyzos.com/wp-content/uploads/2020/05/crontab-guru.jpg" target="_blank" rel="https://crontab.guru/ noopener noreferrer" data-rel="lightbox-gallery-ndckEPKM" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="alignnone wp-image-2081 size-large" src="https://ppolyzos.com/wp-content/uploads/2020/05/crontab-guru-1024x990.jpg" alt="" width="1024" height="990" data-wp-pid="2081" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ppolyzos.com/2020/05/09/understanding-cron-expressions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
