Posts

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 ver...

File Upload in Selenium with C#

Image
The file upload is a simple process for transferring a file from a local computer to a website. This blog will demonstrate how to upload files to a website using Selenium and C#. In this section, I'll go over two methods for uploading files to a website. Method 1: The SendKeys() method is used in the first method. This SendKeys() method will assist in automatically entering text into the editable element. In this method, I'll pass the file location to be uploaded as a parameter to the SendKeys() method. The following code snippet shows how to upload a file in Selenium. The first three steps show how to launch a Chrome browser. Navigate to the URL in the fourth step. Then some waiting time was added. Finally, the file upload element was discovered, and the physical path of the image to upload was passed through the SendKeys method. private   void   UploadButton_Click ( object   sender ,  EventArgs   e ) {      // Download the same vers...