Tapas Pal, Author at CodeGuru https://www.codeguru.com/author/tapas-pal/ Wed, 08 Jun 2022 02:32:31 +0000 en-US hourly 1 https://wordpress.org/?v=6.3.2 Create and Configure Azure Network Watcher https://www.codeguru.com/azure/create-configure-azure-network-watcher/ Tue, 07 Jun 2022 02:16:11 +0000 https://www.codeguru.com/?p=19281 An Azure network watcher is a feature in Azure that enables developers to monitor and troubleshoot applications in the Azure Virtual Network. Azure network watchers also provide tools to monitor, diagnose, view metrics, and enable (or disable) logs for resources in an Azure Virtual Network. It is designed to monitor and repair the network health […]

The post Create and Configure Azure Network Watcher appeared first on CodeGuru.

]]>
An Azure network watcher is a feature in Azure that enables developers to monitor and troubleshoot applications in the Azure Virtual Network. Azure network watchers also provide tools to monitor, diagnose, view metrics, and enable (or disable) logs for resources in an Azure Virtual Network. It is designed to monitor and repair the network health of IaaS (Infrastructure-as-a-Service) products, which include virtual machines, virtual networks, application gateways, load balancers, and other cloud computing resources.

In this Azure cloud development tutorial, we will create a network watcher and demonstrate its functionalities.

You can learn more about the Azure Virtual Network in ServerWatch’s guide: What is Azure VM?

How to Create Network Watcher in Azure

To begin, log in to the home page of Azure Portal and search for the phrase Azure Network Watcher.

Create an Azure network watcher

On the Network page, click Add to create a new network watcher.

Add New Network Watcher in Azure

A new network watcher will be created. Now, click on the watcher and select all of the regions you want the watcher to continuously monitor.

Azure Network Watcher options

Next, we need to deploy the network watcher and wait for the resource to be created.

Deploy an Azure Network Watcher

Once completed, go to the network watcher, as shown below:

Azure Network Watcher Deployed

View the Overview section of the network watcher, as depicted here:

Azure Network Watcher example

Use Azure Powershell to Work with Network Watchers

You can also use the Azure Powershell to work with an Azure network watcher. Once the virtual machine is created, you can use the below commands to operate the network watcher.

To enable network watcher, use the following command:

$networkWatcher = Get-AzNetworkWatcher -Name NetworkWatcher_easteurope -ResourceGroupName rgname

In the above example, you have to provide the network watcher name and resource group name.

To troubleshoot with IP Flow, developers can use the PowerShell command:

Test-AzNetworkWatcherIPFlow

The following code demonstrates how to create a network watcher from PowerShell:

$subscriptionId = ''
$networkWatcherName = ''
$resourceGroupName = ''
$apiversion = "2016-09-01"
$requestBody = @"
{
'location': 'West Central US'
}
"@
armclientput "https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Network/networkWatchers/${networkWatcherName}?api-version=${api-version}" $requestBody

To delete a network watcher from the PowerShell, use the following command:

Remove-AzNetworkWatcher -Name NetworkWatcher_westcentralus -ResourceGroupName NetworkWatcherRG

Final Thoughts on Creating an Azure Network Watcher

In this Azure cloud computing tutorial, we have shown you how to create an Azure network watcher. The goal of this article was to help developers understand the basic details of Azure network watchers and how to configure them.

Read more Azure cloud computing development tutorials.

The post Create and Configure Azure Network Watcher appeared first on CodeGuru.

]]>
Configuring Security Rules In Azure Firewall https://www.codeguru.com/azure/security-rules-azure/ Sat, 07 May 2022 17:22:15 +0000 https://www.codeguru.com/?p=19222 Azure Firewall is a Microsoft-managed network virtual appliance (NVA) that provides the best of breed threat protection for cloud workloads running in Azure. It is a cloud-native and intelligent network firewall security service that allows developers and network administrators to centrally create, enforce, and monitor network security policies in virtual networks. In this cloud development […]

The post Configuring Security Rules In Azure Firewall appeared first on CodeGuru.

]]>
Azure Firewall is a Microsoft-managed network virtual appliance (NVA) that provides the best of breed threat protection for cloud workloads running in Azure. It is a cloud-native and intelligent network firewall security service that allows developers and network administrators to centrally create, enforce, and monitor network security policies in virtual networks. In this cloud development tutorial, we will demonstrate how to configure Azure to achieve high security and protection across a network.

Read: How to Create an Azure File Sync Service

How to Configure Azure Firewall

To begin learning how to configure Azure Firewall, we have to first create a virtual network. To do so, login to Azure Portal and search for the phrase Virtual Networks.

Create a Virtual Network in Azure Firewall

Click Create Virtual Network, select your Subscription and Resource Group. If you do not have one, go ahead and create a new Resource Group.

Create a Resource Group in Azure Firewall

Next, add the name of your virtual network and select Region.

Virtual Network Basic Details in Azure Firewall

Click Next and then add or update your IP addresses:

Add IP Address to a Virtual Network in Azure Firewall

Read: Azure Storage Account Replication Types

Then, in the Security tab, select the following options, as depicted in the next image:

Azure Virtual Network Security Options

Click on the Review + Create tab, then click Create.

Create a Virtual Network in Azure Firewall

Wait for your deployment to complete. Once finished, click on Go to Resource.

Deploy a Virtual Network in Azure Firewall

Choose + Subnet Link to a Subnet in the newly created virtual network.

Virtual Network Subnets in Azure Firewall

Add all the details required for the subnet and save it. You will now have two subnets under the newly created virtual network.

Azure Firewall Subnet Options

Azure Firewall Subnet Created

Read: Configuring Load Balancer in Azure

How to Create a New Firewall in Azure Firewall

Next, we will need to create a new firewall. Search for the phrase Firewall in the Azure Portal and click Create.

Create a New Firewall in Azure Firewall

Add the name of the firewall, then select the Region, Resource Group, and Availability Zone.

Add Azure Firewall Details

After this, we will want to select Firewall Tier Standard and then Firewall Management: Use a Firewall Policy to Manage This Firewall or create a new firewall policy, as depicted below:

Azure Firewall Policies

Select the previously created virtual network and update the IP Address space.

Azure Firewall Address Space

Next, create a Public IP or select an existing one if unused.

Create an Azure Firewall Public IP Address

After adding all of the basic firewall details, the screen will look like the image below:

Azure Firewall Details and Options

Finally, click Review + Create. Review all of the provided details to make sure they are accurate and create the firewall.

Azure Firewall tutorial

Now we have successfully deployed the Azure Firewall within our firewall. Take note of the Firewall Private IP, Firewall SKU, and the Firewall Subnet.

Read more Microsoft Azure tutorials and cloud development guides.

The post Configuring Security Rules In Azure Firewall appeared first on CodeGuru.

]]>
Create a Dedicated SQL Pool in Azure https://www.codeguru.com/database/sql-pool-azure/ Fri, 06 May 2022 19:14:58 +0000 https://www.codeguru.com/?p=19201 An Azure Synapse Dedicated SQL Pool (previously known as Azure SQL Data Warehouse), is a massively parallel processing database. It is a Big Data solution that stores information in a relational table format with columnar storage. It also uses a Massive Parallel Processing (MPP) architecture to leverage up to 60 nodes to run queries. Once […]

The post Create a Dedicated SQL Pool in Azure appeared first on CodeGuru.

]]>
An Azure Synapse Dedicated SQL Pool (previously known as Azure SQL Data Warehouse), is a massively parallel processing database. It is a Big Data solution that stores information in a relational table format with columnar storage. It also uses a Massive Parallel Processing (MPP) architecture to leverage up to 60 nodes to run queries. Once you have your data in a Dedicated SQL Pool you can leverage this for historical analysis from a dashboard, use it as a dataset for Machine Learning, and any other data goals you might have for a massive dataset.

In this database development tutorial, we will explain the step-by-step process used to create a dedicated SQL Pool in Microsoft’s Azure Synapse Analytics.

How to Create a Dedicated SQL Pool

To start, we want to create a dedicated SQL Pool in Azure. Log into the Azure Portal with your free or paid subscription. Then click on Create a Resource.

Create a new Azure Resource

Next, in the Search Bar of Azure Portal, type Dedicated SQL Pool.

Azure Portal Search

Azure Dedicated SQL Pool

Choose Dedicated SQL Pool (Formerly SQL DW) and create a new Dedicated SQL Pool by clicking on the Create button.

Create a Dedicated SQL Pool

Next, we need to either create a new Resource Group or select an existing one.

How to Create a Dedicated Resource Group in Azure

Enter the name of the new Resource Group and click Ok.

Azure Resource Group Name

Now, fill in the basic details of the Dedicated SQL Pool.

Details of Dedicated SQL Pool in Azure

Read: How to Migrate On-premise SQL Database to Azure

How to Create a New SQL Server in Azure

At this point, a new SQL Server needs to be created If you do not have a server setup already. If you do, you can skip this part. To create the new SQL Server, click on Create New and enter the Server Name and Location. If you already have an SQL Server, you can enter that information here.

Create SQL Server in Azure

Next, for now, you can simply use SQL Authentication. Enter in your Server Admin Login details and a secure password. Once finish, click OK.

SQL Server Authentication in Azure

Now, after you have entered the SQL Pool details with your SQL Pool Name and set the server, you also need to choose your performance level – choose wisely, as per your project needs.

Dedicated Pool Performance in Azure

Select the Performance Level and you will be prompted with a new Configuration option.

Dedicated Pool Performance Level Options in Azure

In the Performance Level screen, you can scale your system per your performance and storage scalability needs. Once set, click on Apply.

Configure Performance Options in Azure for Dedicated Pools

Next, click on the Networking tab. Select the appropriate options and then click on the Additional Settings tab.

Dedicated Pool Networking Options

Make sure you choose the Sample under the Use Existing Data section, which will create a sample database named AdventureWorksDW.

Azure Dedicated Pools tutorial

Then, click on Review + Create. Finally, click on Create to initiate the deployment process.

Dedicated Pool Deployment in Azure

A notification will pop on the screen as the deployment is in progress; you can see the resources that will be created in real-time.

Azure Dedicated Pool example

During deployment, you can also click on the Operation Details to learn about the operation which contains data from Operation ID, Timestamp, Duration, and more.

Dedicated Pool Operation Details

 

Once the deployment is complete, you will be provided with a Go to Resource link.

Dedicated Pools in Azure

In the Resource Overview section, you can learn more about the Resource Sample Pool that was created. The server’s name, connection strings, and performance levels are all detailed here. Developers can also check out the metrics visualization of the DWU Usage that we just created.

Dedicated Pools in Azure details and overview

Read more database programming and database administration tutorials.

The post Create a Dedicated SQL Pool in Azure appeared first on CodeGuru.

]]>
How to Migrate On-premise SQL Database to Azure https://www.codeguru.com/azure/migrate-on-premise-sql-database-azure/ Thu, 05 May 2022 16:02:55 +0000 https://www.codeguru.com/?p=19186 Developers can use the Azure Database Migration Service to migrate databases from an on-premise SQL Server instance to Azure SQL Database. Microsoft enables these functions and cloud offerings with Azure SQL Database, which runs as a Platform-as-a-Service (PaaS). The Azure Database Migration Service can assess and evaluate on-premises database loads and migrate them into Azure […]

The post How to Migrate On-premise SQL Database to Azure appeared first on CodeGuru.

]]>
Developers can use the Azure Database Migration Service to migrate databases from an on-premise SQL Server instance to Azure SQL Database. Microsoft enables these functions and cloud offerings with Azure SQL Database, which runs as a Platform-as-a-Service (PaaS). The Azure Database Migration Service can assess and evaluate on-premises database loads and migrate them into Azure Cloud. In this database tutorial, I will demonstrate how database migration services can migrate on-prem SQL Server instances to Azure.

Read: Create an Azure File Sync Service

How to Create an Azure Database Migration Service

In this section, we will demonstrate how to create an Azure Database Migration Service instance. To start, open the Azure Portal and search the phrase Azure Database Migration Service.
Database Migration SQL Azure

 

On the Azure Database Migration Service screen, select Create. Choose one option from the Database Migration options and continue to use Azure Database Migration Service.

SQL Database Migration to Azure

Next, select the Subscription, create a new Resource Group (or choose an existing one), specify a Name for the instance of the Azure Database Migration Service, select the Location , and choose Azure as the Service Mode and Pricing Tier. Then, click Networking.

Azure Database Migration Service
In the Networking tab, choose an existing virtual network or create a new one.

Migration Service Setup for Azure

In the next screen, review the details of the Migration Service and hit Create.

Azure Migration Service example
Wait for the resource to be created. Once finished, click Go to Resource.

Deploy Migration Service in Azure
Select New Migration Project.

SQL Database Migration Service Creation
On the New Migration Project Screen, specify a name for the project, then select SQL Server Data Source, in the target server type. Next, choose Azure SQL Database and then, for type of activity, select Data Migration. Click Create and Run Activity.

New Azure database migration service project

Read: Azure Storage Account Replication Types

SQL Server to Azure Database Migration Wizard

Next, in the Source tab, enter the SQL Server Source Database details.

Azure Migration Project Source

In the Select Source Databases screen, check all the databases you want to be migrated to Azure.

Azure SQL Database Migration

Next, in the Target Database tab, enter the Server Name, Authentication Type, User ID, and Password.

Database Migration Target SQL to Azure

Select or enter the Target Database Name in the Map to Target Databases tab.

Mapping Database Target in Azure

Next, select the list of objects for migration.

Configure Migration Settings in Azure

Finally, in the Summary tab, verify all the details you have entered and selected. Click Start Migration to migrate data from your on-premise database to the cloud.

Database Migration tutorial

Final Thoughts on On-Premise SQL Database Cloud Migration

In this database administration tutorial, I have shown you how to migrate a database to an SQL managed instance using the Azure Database Migration Service. Hopefully this article will help database developers to better understand the basics of Azure database migration.

Read more Microsoft Azure tutorials and cloud development guides.

The post How to Migrate On-premise SQL Database to Azure appeared first on CodeGuru.

]]>
Create An Azure File Sync Service https://www.codeguru.com/azure/azure-file-sync/ Sat, 23 Apr 2022 14:06:17 +0000 https://www.codeguru.com/?p=19160 The Azure File Sync Service allows for the synchronization of on-premise file servers with Azure file shares, supported by Azure storage accounts. It can be used to transition between on-premise and cloud backup solutions, as well as, disaster recovery. The process to use Azure File Sync consists of three steps: configure the service in Microsoft […]

The post Create An Azure File Sync Service appeared first on CodeGuru.

]]>
The Azure File Sync Service allows for the synchronization of on-premise file servers with Azure file shares, supported by Azure storage accounts. It can be used to transition between on-premise and cloud backup solutions, as well as, disaster recovery. The process to use Azure File Sync consists of three steps: configure the service in Microsoft Azure, install the agents, and configure the replication.

Read: How to Secure Azure Storage Accounts

How to Create an Azure Storage Account

To begin, open the Azure Portal, then click +Create a resource on the New menu.

Create Azure Resource

Next, click Storage and then choose Storage account – blob, file, table, queue.

Creating an Azure Resource

On the Create Storage Account page, select your Subscription and Resource group. Create a new resource group if you do not have an existing one.

Create Azure Storage Account

Enter the new Resource Group name and click Ok.

Creating Azure Storage Accounts

Next, in the Instance details, enter the Storage Account Name, select Region, Performance, and Redundancy options. After entering these details, click Review + Create.

Azure Storage Account Tutorials

Once all of the validation is passed, click the Create button.

Azure Storage Account details

Wait for the Resource Deployment to complete.

Azure Resource Deployment

After successfully creating the Azure Storage Account, open it. Click Files under the Service.

Azure File Service

Next, you need to create a file share. To do so, click the + File Share link.

Azure File Service Share Link

Enter the name for the File Share and select Tier. Then, to finish, click Create.

Azure New File Share

The File Share will now be created.

Azure File Share Created

Read: Setting Up Budgets and Configuring Alerts in Microsoft Azure

How to Create an Azure File Sync Service

To create an Azure File Sync Service, open the Azure Portal and search for Azure File Sync.

Azure Sync File

Click Azure File Sync. Once the screen appears, click the Create button to deploy the File Sync service.

Azure File Sync Service

In the Deploy Storage Sync screen, you need to enter the Name and select the Subscription, Resource Group, and Location. After selecting these, click Review + Create.

Create an Azure File Sync Service

Next, review all of the details you entered and choose Create.

Deploy Azure File Sync

Wait for the File Sync Deployment to complete.

Azure File Sync

After creating the File Sync Service, you need to create a Sync Group. To do so, open the LocalSync and then click + Sync Group.

Azure Sync Group

Next, on the Sync Group, enter the Sync Group Name and select a Storage Account by clicking Select Storage Account and choosing the Storage Account that you created earlier.

Sync Azure Storage Account

After selecting your Storage Account, you need to find the File Share Name. Select File Share and click the Create button.

Azure Storage Account tutorials

Next, you need to create a server endpoint for the Sync Group you created. Before creating a server endpoint, however, we need to set up our server. For that, we need to install and configure Storage Sync Agent Setup.

Finally, you need to add a server endpoint page. You can select your server on the Registered Server drop down menu and enter the path to sync the cloud.

Azure Storage Server Endpoint

Read more Microsoft Azure and cloud computing tutorials.

The post Create An Azure File Sync Service appeared first on CodeGuru.

]]>
Azure Storage Account Replication Types https://www.codeguru.com/azure/azure-storage-replication/ Fri, 01 Apr 2022 04:41:02 +0000 https://www.codeguru.com/?p=19111 Azure Storage allows developers to create and store copies of data across multiple locations to maintain data availability, integrity, and durability. This feature is known as storage replication. The cloud storage service provides redundancy to protect data against hardware failures and power or network outages. In this cloud computing tutorial, we will explain several redundancy […]

The post Azure Storage Account Replication Types appeared first on CodeGuru.

]]>
Azure Storage allows developers to create and store copies of data across multiple locations to maintain data availability, integrity, and durability. This feature is known as storage replication. The cloud storage service provides redundancy to protect data against hardware failures and power or network outages. In this cloud computing tutorial, we will explain several redundancy options developers can choose from. Developers can replicate data within one region, or you can replicate it into a geographically distant, secondary region.

Read: Setting Up Budgets and Configuring Alerts in Azure

What are the Types of Azure Storage Replication?

Replication options to be selected during the creation of an Azure Storage account can be seen in the image below. By default, Azure Storage replicates data three times within a primary region that is selected during creation. Azure also offers the following redundancy options you can configure for replication within the primary region:

Locally Redundant Storage (LRS)

Locally redundant storage (LRS) replicates your data synchronously to three disks within a data center in the primary region. This storage replication type offers a moderate level of availability at a lower cost.

LRS replicates three times within a single data center in the primary region. The locally redundant storage provides 99.99% of the durability of your data. Using this type of strategy, data will be copied inside the same data center racks in different fault domains for the purpose of high availability. A write request to a storage account that is using LRS happens synchronously; the write operation returns successfully only after the data is written to all three replicas.

Zone-redundant Storage (ZRS)

ZRS synchronously replicates data in Azure availability zones in the primary region. This Azure storage replication type provides a higher level of resilience at a higher cost. Each Azure availability zone is an individual physical location with its own independent networking, power, and cooling resources. ZRS provides a minimum of 99.99% durability for objects during a given year.

Microsoft recommends using ZRS in the primary region for scenarios that require high availability. ZRS is also recommended for restricting the replication of data within a country or region to meet data governance requirements.

A write request to a storage account that is using ZRS happens synchronously. The write operation returns successfully only after the data is written to all replicas across the three availability zones.

Read: Azure Service Bus Publisher and Subscriber

Geo-Redundant Storage (GRS)

GRS provides additional redundancy for data storage, compared to LRS or ZRS replication types. In addition to the three copies of data stored in one region, there are three copies stored in a paired Azure regiTypes of Azure Storage replicationon. GRS provides all the features of LRS storage in the primary zone, and, additionally, provides a secondary LRS data storage in another region. Geo-redundant storage is assured by 99.99%.

In GRS, data is copied to a secondary region. Secondary regions are pre-assigned and cannot be configured or changed. Disadvantages of GRS include the fact that users can not read data from the secondary region using this replication strategy unless Microsoft Azure automatically performs a failover to the secondary region.

Read-Access Geo-Redundant (RA-GRS)

The RA-GRS replication strategy works similar to GRS but allows read-access to data stored in the secondary region. Developers can use multiple readable endpoints. This increases the SLA for read operations to 99.99%. Users can select the replication strategy during the creation of a storage account. Once the storage account has been created and the user sets the replica strategy, the user can switch to a different strategy, depending on the type of strategy initially configured.

Object Replication for Block Blob Storage

Object Replication for Block Blob Storage is a special replication method that is available only for Block Blob Storage accounts. The object replication method is asynchronous; you can use it to automatically move data to an archive tier.

Read more Azure Storage account tutorials, guides, and walkthroughs.

The post Azure Storage Account Replication Types appeared first on CodeGuru.

]]>
Continuous Integration Using Azure DevOps https://www.codeguru.com/azure/continuous-integration-azure-devops/ Wed, 23 Mar 2022 19:05:00 +0000 https://www.codeguru.com/?p=19097 Azure Pipelines are used for continuously building, testing, and deploying code and applications to any platform and cloud solution. Developers can create a cloud-hosted pipeline for Windows, Linux, and macOS. Further, they can automate build, and deploy processes using Azure DevOps (Azure Pipelines are much faster when compared to VSTS). In this programming tutorial, we […]

The post Continuous Integration Using Azure DevOps appeared first on CodeGuru.

]]>
Azure Pipelines are used for continuously building, testing, and deploying code and applications to any platform and cloud solution. Developers can create a cloud-hosted pipeline for Windows, Linux, and macOS. Further, they can automate build, and deploy processes using Azure DevOps (Azure Pipelines are much faster when compared to VSTS). In this programming tutorial, we will demonstrate Azure Pipelines creation and how to use them to implement continuous integration for a .NET Web Application.

Pipeline Using Azure DevOps

To start, login to your Azure DevOps account and choose Pipelines, Builds:

Azure Devops Continuous Integration

Azure DevOps Account Overview

For first time users, you can also select the New Pipeline button, as shown in the following figure:

Azure DevOps New Pipeline

Azure DevOps Pipeline

Click Create Pipeline to create your first Pipeline:

Creating an Azure DevOps Pipeline

Azure DevOps Create New Pipeline

Select your repository type, for which you want to set-up a build. For the following example, we have selected the Other Git Repository option:

Azure DevOps Code Repository

Azure DevOps Code Repository

To connect the Git Repository, add the URL and enter your Username and Password:

Azure DevOps Connect Git Repository

Azure DevOps Connect Git Repository

After you successfully login to Git, select the Branch as depicted here:

Azure DevOps template

Azure DevOps Code Branch Selection

Azure DevOps Pipeline has many pre-defined templates to choose from, based on the needs of the developer or project. In this example, we have selected the ASP.NET Template and clicked Apply:

Azure DevOps Template

Azure DevOps Pre Defined Template

The following template has five configuration steps: Tasks, Variables, Triggers, Option, and Retention. Configure each of these steps before moving on:

Azure DevOps Template Configuration

Azure DevOps Template Configuration

Next, run the Pipeline using a trigger setting, or, we can schedule the build time. Developers can set the continuous integration during any new check-in process. You can also specify a scheduled day and time to autorun the build. You can see here when to build and branch filters where you can include or exclude a specific branch:

Azure DevOps Pipelines

Azure DevOps Run Pipeline

Step-by-step execution logs and all of the jobs and tasks can be viewed in real-time. Once all jobs are executed successfully, you can see the result on the Builds dashboard:

Azure DevOps Build Log

Azure DevOps Build Log

Developers can see the build history by clicking the History tab. If you want to see the progression, click on the build number from the grid and it will display all the progression.

You can see the build artifact’s published details, build Pipelines status and associated changes for the latest changes or latest build as well. Azure DevOps also supports Git Repository – you can add code as depicted below:

Azure DevOps Clone Repo

Azure DevOps Clone Repo

The post Continuous Integration Using Azure DevOps appeared first on CodeGuru.

]]>
Configuring Load Balancer In Microsoft Azure https://www.codeguru.com/azure/configure-load-balancer-azure/ Wed, 23 Mar 2022 03:04:12 +0000 https://www.codeguru.com/?p=19080 The Microsoft Azure load balancer allows developers and system administrators to distribute traffic to back-end virtual machines. Load Balancing provides a higher level of availability across virtual machines, helping to allocate resources, optimize app performance, and increase uptime. Programmers can use the Azure portal to create a basic load balancer and balance internal traffic among […]

The post Configuring Load Balancer In Microsoft Azure appeared first on CodeGuru.

]]>
The Microsoft Azure load balancer allows developers and system administrators to distribute traffic to back-end virtual machines. Load Balancing provides a higher level of availability across virtual machines, helping to allocate resources, optimize app performance, and increase uptime. Programmers can use the Azure portal to create a basic load balancer and balance internal traffic among their virtual machines. In this Azure tutorial, we will demonstrate how to configure a load balancer through the Microsoft Azure portal.

How to Configure a Load Balancer in Azure

This load balancing tutorial assumes that the reader knows how to create a virtual machine in Azure and that you also know how to install IIS.

To demonstrate load balancer functionality, we have created two virtual machines (VMs) and named them:

  • Virtual Machine 1: LBDemo1
  • Virtual Machine 2: LBDemo2

After creating the above Windows virtual machines, we installed IIS.

After you have replicated these two steps, open the virtual machine LBDemo1 and copy the Public IP address to verify the IIS web status. See below:

Configuring Load Balancers in Azure

LBDemo1 Created

To verify the IIS service is running in the LBDemo1 virtual machine, just paste the Public IP address in the web browser and hit Enter. The IIS server should be running successfully:

Azure IIS Server Setup

IIS Default Web Page

Next, open the virtual machine LBDemo2 and copy the Public IP address to verify the IIS web status:

Azure Load Balancer Examples

LBDemo2 VM Created

Again, to verify the IIS service is running in the LBDemo2 virtual machine, just paste the Public IP address in the web browser and hit Enter, as we did before. The IIS server should be running successfully.

Default IIS Web Server

IIS Default Web Page

Next, in the Azure portal, click on the + Create a Resource, and then type Load Balancer. On the Load Balancer page, click the Create button to start creating a new load balancer.

Create a load balancer in Azure

Create Load Balancer

Now it is time to name your load balancer and assign it an IP address name. Give it the name: DemoLB and the Public IP address name of LBIP. Then, click the Review+Create button.

Adding IP Address to a Load Balancer

Add Load Balancer Public IP

After successfully creating the load balancer, open the load balancer and check the Overview section. You will find a section titled Backend Pool, Note that Load Balancer Rule and Health Probe are not filled n. See below:

How to create a load balancer

Load Balancer Overview

Next, we will add the above-created virtual machines to the load balancer. To add the load balancer, click Backend Pools and then +Add.

Load Balancing Demo

Load Balancer Backend Pools

In the Backend Pool Name page, enter the Backend Pool Name and then select the virtual machine. Click Add to add both of the virtual machines we created in previous steps.

Add Backend Pools in Azure

Backend Pools

After adding both of the virtual machines in the Backend Pool you will get the following page:

Back-end pools example

Backend Pools Created

After this, we need to configure Health Probes.Click Health Probes:

Back-end Pools Health Probes

Health Probes

Then, click +Add to enter the Health Probes details:

Azure Health Probes

Create Health Probes

Enter a name for Health Probes, the Protocol, Port, and other pertinent details, as depicted below:

Adding Health Probe Details

Add Details for Health Probes

The following Health Probe should be successfully created:

Now, we need to create the Load Balancing Rules. Click Load Balancing Rules and then +Add.

In the Load Balancing Rules, map the Public IP address and Port Number of incoming traffic to the private IP address and port number of the virtual machine:

Load Balancer Rules

Add Load Balancer Rules

Finally, we can verify if our load balancer is configured. If so, it should be visible in our Backend Pool and Public IP address. Copy the Public IP address and enter into a web browser. The default IIS page from the LBDemo1 virtual machine should respond.

If we shut down the LBDemo virtual machine and refresh the web browser, the default IIS page from the LBDemo2 virtual machine server will respond.

The post Configuring Load Balancer In Microsoft Azure appeared first on CodeGuru.

]]>
How to Secure Azure Storage Accounts https://www.codeguru.com/azure/secure-azure-storage-accounts/ Thu, 17 Mar 2022 17:04:07 +0000 https://www.codeguru.com/?p=19061 Azure Storage provides multilayered security to protect data. It gives developers an abundance of security options to ensure their cloud data is secure. Azure services like blob storage, file shares, table storage, and data lake stores all expand upon the offerings of Azure Storage and the security demands required. In this Azure storage tutorial, we […]

The post How to Secure Azure Storage Accounts appeared first on CodeGuru.

]]>
Azure Storage provides multilayered security to protect data. It gives developers an abundance of security options to ensure their cloud data is secure. Azure services like blob storage, file shares, table storage, and data lake stores all expand upon the offerings of Azure Storage and the security demands required. In this Azure storage tutorial, we will explain how to use access keys and other cloud security options to secure Azure Storage accounts.

Azure Storage accounts give a few significant security benefits to protect data in the cloud, including:

  • Protects the information in storage
  • Protects information being sent to storage
  • Supports cross-domain program access

Read: Introduction to Azure DevOps

What are Azure Storage Account Keys?

Azure Storage accounts can approve authorized apps like Active Directory to control access to the data in blobs and queues. This verification approach is recommended. Another approach could be a shared key or shared secret for different storage models. This authentication alternative is one of the easiest to use and it supports blobs, files, queues, and tables.

We will demonstrate this security method here. To begin, open the Azure Management Portal and go to Azure Storage Account, then click on Access Keys, as depicted in the following image:

Azure Access Keys Tutorial

Access Azure Storage Access Keys

In Azure Storage Accounts there are two keys that are created by Azure for storage accounts: primary and secondary. These two keys are 512-bit storage access keys that are used for authenticating access to Azure storage accounts. They give access to everything in the account. Developers can find these storage account keys in the Azure Portal view of the storage account from Settings > Access Keys. See below:

Examples of Azure Access Keys

Azure Storage Keys

Read: How to Access Azure Storage Account File Shares from .NET

Types of Azure Storage Access Control

Before going further, let’s briefly discuss a few types of access control methods Azure employees for storage accounts.

Role Based Access Control

To access data in a storage account, the customer makes a request over HTTP or HTTPS. Azure Active Directory and role-based access control (RBAC) are supported by Azure Storage for resource management and data operations.

Cross-origin Resource Sharing (CORS)

Cross-origin resource sharing (CORS) supports cross-domain access for Azure Storage. CORS uses HTTP headers allowing web applications at one domain to access information from a server of different domains.

Azure Encryption

Data in a new storage account is encrypted with Microsoft-managed keys by default. You can continue to rely on Microsoft-managed keys for the encryption of your data, or you can manage encryption with your own keys, which is known as customer-managed keys:

Azure Encryption

Azure Storage Encryption

Setting up Shared Access Signatures in Azure Storage

Let’s continue. Navigate to your Azure Management Portal and go to Azure Storage Account, then click on Shared Access Signature.

Access keys provide complete access to the entire storage account. Using Shared Access Signature (SAS), programmers can restrict access to individual storage services. Developers just need to select the required services that they would like to restrict access to using SAS. You can choose multiple services to restrict.

Azure storage share access

Azure Storage Share Access Signature

If you want to allow access by permissions, you can provide permissions based on the following, under the Allowed Permissions section:

The Allowed Permissions section allows developers to provide different permissions to different levels of access. You can have one developer work on all the items that have Read Operations and another to work on Update Operations.

Coders can also control storage access by specifying Start Date/Time and End Date/Time, as shown here:

Azure storage account permissions

Control Access based on Date and Time

You can further configure these Start and End Date/times based on time zone.

Azure storage access tutorial

If you want to control access by protocol (like HTTP/HTTPS), you can disable basic HTTP requests by checking the HTTPS only radio button:

azure storage access tutorials

Allowed Protocols

Finally, you can control Access by IP Address too:

Azure storage access by IP

Allowed IP Addresses

Once you configure all of the required settings and determine access levels, click on the Generate SAS button, which is available at the bottom of the page, to generate the SAS token:

Generating SAS Tokens in Azure

Read more Microsoft Azure tutorials and guides.

The post How to Secure Azure Storage Accounts appeared first on CodeGuru.

]]>
Create Infrastructure as Code in Azure Bicep https://www.codeguru.com/azure/infrastructure-azure-bicep/ Sun, 27 Feb 2022 14:00:19 +0000 https://www.codeguru.com/?p=19005 Azure Bicep is a new declarative language that is classified as a domain-specific language (DSL) for deploying Azure resources. Everything a developer can do with an Azure Resource Manager (ARM) template can also be performed with Bicep. In fact, it is closely linked to ARM templates. Bicep makes it easier to define how your Azure […]

The post Create Infrastructure as Code in Azure Bicep appeared first on CodeGuru.

]]>
Azure Bicep is a new declarative language that is classified as a domain-specific language (DSL) for deploying Azure resources. Everything a developer can do with an Azure Resource Manager (ARM) template can also be performed with Bicep. In fact, it is closely linked to ARM templates. Bicep makes it easier to define how your Azure resources should be configured and deployed. In this Azure development tutorial, we will demonstrate how Azure resources can be deployed using Bicep.

Read: Azure Service Bus Publisher and Subscriber

What are the Benefits of Azure Bicep?

Azure Bicep was created to improve the syntax of ARM templates. Typically, the syntax of ARM templates is cumbersome compared to other solutions. Bicep syntax, meanwhile, can more easily be compared with the ARM JSON syntax. Developers can create complex template deployments by creating smaller module Bicep files. Most importantly, Bicep will automatically detect resource dependencies, taking some of the load off of programmers.

Azure Bicep Tutorial

How to Use Azure Bicep

How to Create Azure Bicep Files

Developers can use Microsoft-provided Visual Studio Code extensions for the Bicep language to enhance the functionality that Bicep brings to the table. These extensions, specifically, provide language support and resource autocompletion to assist with creating and validating Bicep files, reducing coding errors, and making the writing of code more efficient.

To add a Bicep extension, in Visual Studio Code, select Extensions, search for Bicep, and install the extension. See the image below for more:

Azure Bicep Tutorial

Take a look at the following template Bicep code. Notice the compact code structure; it is maybe half the size of the typical ARM template. Bicep is smart enough to figure out if resources are dependent on each other. Additionally, Bicep knows it first needs to deploy appServicePlan and automatically adds the dependsOn part when it gets converted from Bicep to an ARM template. Here is the code:

param name string = 'sample-bicep-webapplication'
param location string = resourceGroup().location
param sample string = 'Sample'
param sampleCode string = 'G1'
resource webApp 'Microsoft.Web/sites@2022-01-01' = {
  name: name
  location: location
  properties: {
    name: name
    siteConfig: {
      metadata: [
        {
          name: 'TECHNOLOGY_STACK'
          value: 'dotnetcore'
        }
      ]
    }
    serverFarmId: appServicePlan.id
  }
}
resource appServicePlan 'Microsoft.Web/serverfarms@2022-01-01'  = {
  name: name
  location: location
  properties: {
    name: name
  }
  sample: {
    Tier: sample
    Name: sampleCode
  }
}

The following code snippet is used by Bicep for deployment of your resources array, with the link to the template and a link to the parameters file if available.

"resources": [
  {
    "type": "Microsoft.Resources/deployments",
    "apiVersion": "2022-01-01",
    "name": "linkedTemplate",
    "properties": {
      "mode": "Incremental",
      "templateLink": {
        "uri": "https://mystorageaccount.blob.core.windows.net/AzureTemplates/newStorageAccount.json",
        "contentVersion": "1.0.0.0"
      },
      "parametersLink": {
        "uri": "https://mystorageaccount.blob.core.windows.net/AzureTemplates/newStorageAccount.parameters.json",
        "contentVersion": "1.0.0.0"
      }
    }
  }
]

Bicep v0.3 has been integrated with the Azure Command-Line-Interface (CLI). Besides building a Bicep file, there is also a command needed to deploy your file to a resource group or subscription. The commands to do this are in the AZ Deployment group.

Read: Setting Up Budgets and Configuring Alerts in Microsoft Azure

How to Convert ARM Templates to Azure Bicep

Azure Bicep can be easily used to convert an ARM template to Bicep code. The command for this is az bicep decompile. It takes a JSON file as input and attempts to make it into Bicep.

To decompile ARM template JSON files to Bicep, use Azure CLI:

az bicep decompile --file AzureARM.json

Developers can export the template for a resource group and then pass it directly to the decompile command. Refer to the following example:

az group export --name "my_resource_group_name" > AzureARM.json
az bicep decompile --file AzureARM.json

Conclusion to Creating Infrastructure As Code Using Azure Bicep

This programming tutorial explained how to create Azure Bicep deployment templates. Be sure to check back often for more tutorials using Azure Bicep.

Read more cloud computing and Azure programming tutorials.

The post Create Infrastructure as Code in Azure Bicep appeared first on CodeGuru.

]]>