Posts

String Interpolation in C#

Image
Programmers can incorporate expressions into string literals using the C# functionality known as string interpolation. Complex string messages with variables and expressions are made easier to generate as a result. The '$' character is used in C# string interpolation to indicate interpolated expressions within a string literal. We will examine string interpolation in C# and present examples in this blog article. Basic syntax String interpolation is used by prefixing a string literal with the '$' character and then including one or more expressions inside curly braces. Here's an illustration: string name = " John "; int age = 30 ; Console .WriteLine($" My name is {name} and I am {age} years old. "); In this example, we have a string literal with two expressions enclosed by curly brackets. At runtime, the expressions are evaluated and the resulting values are placed into the string. Output: My name is John and

Comparing Azure Functions and Azure Logic Apps

Image
In this blog post, we'll explore the difference between Azure Functions and Logic Apps. Azure Functions and Logic Apps both are two popular cloud computing services. Azure Functions and Logic Apps both services are serverless so you don’t want to worry about the infrastructure. But there are many differences between them. Azure Functions Azure Functions is a serverless compute service that helps to run code on-demand without worrying about the infrastructure. You can just write the code and upload it to Azure Functions. Then it will run the code whenever an event occurs, such as an HTTP request or a message in a queue. Azure Functions is designed to be lightweight and flexible. It supports multiple programming languages so you can write code in any language you are familiar with. Example C#, Java, JavaScript, Python, and PowerShell. You can also trigger your functions in a different way like HTTP requests, timers, and messages in a queue. Azure Functions is an excellent

An Overview of Azure Functions

Image
A new cloud computing concept called serverless computing has gained a lot of popularity recently. It is a methodology that enables programmers to create and deploy apps without stressing over the infrastructure. Because of this the developers no need to worry about managing servers, storage, and other infrastructure components so they can concentrate on writing code and creating apps. Azure Functions is one of the most widely used serverless computing platforms. Microsoft Azure provides Azure Functions, a cloud-based service. Using this service the developers can create and operate applications without worrying about the infrastructure. With the support of Azure Functions, developers may run brief segments of code, or "functions," in response to various events, such as HTTP requests, modifications to database data, or updates to message queues. Azure Functions supports the following programming languages C#, Java, JavaScript (Node.js), PowerShell, Python and TypeScrip

Upload and Download Azure Blob Storage using AZCopy

Image
AZCopy is a command-line utility for uploading and downloading Azure Blob Storage files. At the time of writing, the most recent version of AZCopy is V10. So, you can get the AZCopy executable file from the link below. https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10 If the link does not work, look for the most recent version of AZCopy and download the executable file. Download the file and save it in a location that is convenient for you on your computer. In this blog, I'll show you how to use an SAS token to upload and download files from Azure Blob Storage. Get SAS token First, let's look at how to obtain an SAS token. Go to the Azure Storage Account to which you want to upload or download files. On the right side, under Security + networking, choose Shared access signature. Locate the Allowed resource types and choose the preferred resource type. I'm going with all three options (Service, Container, Object) Enter the

Azure Blob Storage With ASP.NET Core

Image
This blog will show you how to create a container and files in Azure Blob Storage. You must first install the Azure.Storage.Blobs package. Install-Package Azure.Storage.Blobs Create a container in Azure Blob Storage Let's start by learning how to create a container in Azure Blob Storage. A connection string is required for this. Go to Azure Blob Storage -> Access keys for that. There are two key values there. Choose the first option. The connection string will be concealed. When you click the show button on the right side, the connection string will be revealed. You can now copy the connection string. A code snippet for creating a container in Azure Storage is provided below. The connection string has been set up here. The instance of BlobContainerClient has been created. Using the BlobContainerClient instance, determine whether the container name exists or not, and if not, create a new container with the given name. The container name must adhere to the followi

Import an Azure DevOps Repository from a Different Azure DevOps Repository

Image
This blog will walk you through the process of importing an Azure DevOps Repository from another Azure Repository. Let's take it one step at a time. Step 1: To begin, navigate to the source project, select Repos, and then Files. Step 2: Click the Clone button on the right hand side of the top. Step 3: When you click the Clone button, the 'Clone Repository' popup appears. Then, click the 'Generate Git Credentials' button. Step 4: The username and password will then be displayed. We'll need three things for this step: a command line, a username, and a password. Step 5: Select Repos and then files to import the repository for a new project. And then click the Import button. If you want to add repository to an existing project, use Import Repositoty. Step 6: The 'Import a Git repository' popup will appear. In that box, enter the Clone URL and check the 'Requires Authentication' checkbox. It will display textboxes where you can e

File Download at Custom Path in Selenium with C#

Image
This blog will show you how to download files from websites and save them to a folder. When you use selenium to download a file from a website, the file is saved in the default download folder. Chrome options must be used to save a downloaded file to the desired location. Let's see how we can do that. The code snippet below will download and save a file from a website. ChromeOptions() has been initialized here. In AddUserProfilePreference, download.default directory, enter the path of the directory where you want to save the downloaded file. using   OpenQA . Selenium ; using   OpenQA . Selenium . Chrome ; using   System ; using   System . Threading ; using   System . Windows . Forms ; using   WebDriverManager ; using   WebDriverManager . DriverConfigs . Impl ; using   WebDriverManager . Helpers ; private   void   DownloadButton_Click ( object   sender ,  EventArgs   e ) {      // Download the same version of chromedriver      var   chromeDriverPath   =   new   DriverManager