How I choose which services to use in Azure (Barry Luijbregts, Scott Hanselman) - Oh wow! Very interesting video, presenting a nice and structured way to pick our cloud services.
Copy, Download or Upload from-to any combination of Windows, Linux, OS X, or the cloud
Data is and will always be our primary concern. Whether shaped as text files, images, VM VHDs or any other ways, at some point in time, our data will need to be moved. I already wrote about it previously, and the content of this post is still valuable today, but I wanted to share new options and convert all ground (meaning Linux, Windows and OS X).
Scenarios
Here few scenarios why you would want to move data.
Your Microsoft Azure trial is ending, and you wish to keep all the data.
You are creating a new web application, and all those images need to be moved to the Azure subscription.
You have a Virtual Machine that you would like to move to the cloud or to a different subscription.
...
AZCopy
AzCopy is a fantastic command-line tool for copying data to and from Microsoft Azure Blob, File, and Table storage. At the moment, to write this post AzCopy is only available for Windows users. Another solution will be introduced later in this post for Mac and Linux users. Before AzCopy was only available on Windows. However, recently a second version built with .NET Core Framework is available. The commands are very similar but not exactly the same.
AzCopy on Windows
In his simplest expression, an AzCopy command looks like this:
If you earlier have installed an Azure SDK on your machine, you already have it. By default, AzCopy is installed to %ProgramFiles(x86)%\Microsoft SDKs\Azure\AzCopy (64-bit Windows) or %ProgramFiles%\Microsoft SDKs\Azure\AzCopy (32-bit Windows).
If you need only AzCopy for a server, you can download the latest version of AzCopy.
Let's see some frequent usage. First let's say you need do move all those images from your server to an Azure blob storage.
These examples were simple, but AzCopy is a very powerful tool. I invite you to type one of the following commands to discover more about using AzCopy:
For detailed command-line help for AzCopy: AzCopy /?
For command-line examples: AzCopy /?:Samples
AzCopy on Linux
Before you could install AzCopy you will need to install .Net Core. This is done very simply with few commands.
It is very similar to the original version, but parameters are using -- and - instead of the / and where a : was required, it's now a simple space.
Uploading to Azure
Here an example, to copy a single file GlobalDevopsBootcamp.jpg to an Azure Blob Storage. We pass the full local path to the file into --source, the destination is the full URI, and finally the destination blob storage key. Of course, you could also use SAS token if you prefer.
To copy the image to a second Azure subscription, we use the command the source is now an Azure Storage URI, and we pass the source and the destination keys:
Azure CLI is a set of cross-platform commands for the Azure Platform. It gives tools to manipulate all Azure components, but this post will focus on azure storage features.
There are two versions of the Azure Command-Line Interface (CLI) currently available:
Azure CLI 2.0: written in Python, conpatible only with the Resource Manager deployment model.
Azure CLI 1.0: written in Node.js, compatible with both the classic and Resource Manager deployment models.
Azure CLI 1.0 is deprecated and should only be used for support with the Azure Service Management (ASM) model with "classic" resources.
Installing Azure CLI
Let's start by installing Azure CLI. Of course, you can download an installer but since everything is evolving very fast with not getting it from Node Package Manager (npm). The install will be the same, you just need to specify the version if you absolutely need Azure CLI 1.0.
sudo npm install azure-cli -g
To keep the previous scenario, let's try to copy all images to a blob storage. Unfortunately, Azure CLI doesn't offer the same flexibility as AzCopy,and you must upload the file one by one. However, to upload all images from a folder, we can easily put the command in a loop.
for f in Documents/images/*.jpg
do
azure storage blob upload -a frankysnotes -k YoMjXMDe+694FGgOaN0oaRdOF6s1ktMgkB6pBx2vnAr8AOXm3HTF7tT0NQWvGrWnWj5m4X1U0HIPUIAA== $f blogimages
done
In the previous command -a was the account name, and -k was the Access key. This two information can easily be found in the Azure portal. From the portal (https://portal.azure.com), select the storage account. In the right band click-on Access keys.
To copy a file (ex: a VM disk aka VHD) from one storage to another one in a different subscription or region, it's really easy. This time we will use the command azure storage blob copy start and the -a and -k are related to our destination.
The nice thing about this command is that it's asynchronous. To see the status of your copy just execute the command azure storage blob copy show
azure storage blob copy show -a frankshare -k YoMjXMDe+694FGgOaN0oPaRdOF6s1ktMgkB6pBx2vnAr8AOXm3HTF7tT0NQVxsqhWvGrWnWj5m4X1U0HIPUIAA== imagesbackup 20151011_151451.MOV
Azure CLI 2.0 (Windows, Linux, OS X, Docker, Cloud Shell)
The Azure CLI 2.0 is Azure's new command-line optimized for managing and administering Azure resources that work against the Azure Resource Manager. Like the previous version, it will work perfectly on Windows, Linux, OS X, Docker but also from the Cloud Shell!
Cloud Shell is available right from the Azure Portal, without any plugging.
Uploading to Azure
The command if the same as the previous version except that now the command is named az. Here an example to upload a single file into an Azure Blob Storage.
Let's now copy the file to another Azure subscription. A think to be aware is that --account-name and --account-key are for the destination, even if it's not specified.
If you prefer, I also have a video version of that post.
One More Thing
Sometimes, we don't need to script things, and a graphic interface is much better. For this kind of situation, the must is the Azure Storage Explorer. It does a lot! Upload, download, and manage blobs, files, queues, tables, and Cosmos DB entities. And it works on Windows, macOS, and Linux!
It's just the beginning
This post was just an introduction to two very powerful tools. I strongly suggest to go read in the official documentation to learn more. Use the comment to share all your questions and suggestion.
Artificial Intelligence tunes Azure SQL Databases (Veljko Vasic) - Very interesting article that shares a real-life situation where a Microsft Partner used SQL Auto tuning capability of SQL Database in Azure to optimize all his databases.
A Comparison of Docker GUIs (Chris Ward) - This post surprises me by his very long list of graphical interfaces for Docker. I only knew the default one, but I'm now very tented to try other ones.
Building MEAN Apps with Cosmos DB - Part 1 (John Papa) - Pretty awesome series of little videos that explain step by step how to build the Mongo Express Angular Node (MEAN) application.
Monospaced Programming Fonts with Ligatures (Scott Hanselman) - Pretty cool hack. I mean I knew those characters existed, but I didn't know they had a name, and that we had display options.
Securing Web Applications - Simple Talk (Vishwas Parameshwarappa) - Security should be in our priority in this time of APIs and IoT.... Excellent post to get started with multiple security breaches and how to fix them.
Tuples In C# (Mahesh Chand) - Tuples are one feature introduced in .Net 4.0 that can simplify our life a lot. Learn how in this post.
Sneak peek: A new Azure Cloud Console (Brendan Burns Partner Architect) - Wow! This post presents a much more comfortable terminal interface for Azure. Really slick.
Getting Started with YAML in Node.js using js-yaml (Dave Johnson) - Interesting post, I've been using YAML for few years now. However, it's true that when I did some work with Node.js I switched to json... Next time then...
New book: Begin to Code with C# (Kim Spilker) - C# is a very popular and powerful language, I'm happy to see new books to bring more people aboard.
You might be a creative if … (docjamesw@gmail.com) - A post to read in the morning. It's like a little pill of energy.
You’re doing it wrong: Demos (Gil Zilberfeld) - Nice quick post that helps us to definitely pick a side when the question "Should we demo that?" popped.
Fixing Azure Portal Errors - Errors are inevitable, this post explains how to workaround most of them and when nothing works how let the support team knows.
But Why Do You Trust Your Data? (Buck Woody) - I consider this post as a really great teaser. After ready his post most chances are you will check the video it recommended... and next give a shot to Azure data Catalog.
Analyzing your Azure Search traffic (Berni Torres Garayar) - Great post that explains how to improve our services by listening to our client's search requests, leveraging the new Azure Search Analytics and PowerBi.
Miscellaneous
Give yourself permission to have work-life balance - In a connected world, it's easy not to slow down a moment and raise our head to look around us. Interesting post to read before you win the race to the burnout.
An application revolution powered by the cloud (Mark Russinovich) - This post is a great introduction to the air of micro-services. It explains the evolution from the monolithic architecture and introduces some container system.
Azure Active Directory Application (Vincent-Philippe Lauzon) - This post is a good intro to Azure Active Directory and how it could help us in our cloud applications.
Why Microsoft Azure? - Interesting post that explains major reasons why Microsoft is a lead in cloud computing.
Getting to Know #Azure Mobile App - Nice tutorial that leverage the recently GA Azure Mobile App to build AskAlex: an universal application that looks promising...;)
Exception Handling with Logic Apps (Jeff Hollan) - Great tutorial that shows how to solve a extremely frequent problem... the exception handling.
Using Logic Apps Webhook Triggers (Jeff Hollan) - Fantastic tutorial that shows how to create an HTTP trigger in today's interface/ designer.
Express - This is the perfect post to get started with node.js with Azure. This post starts with you step by step from a vanilla computer running OS X or Linux to your first App.
Exploring Azure DocumentDB in Visual Studio (Andrew Hoh) - This post reveals all the feature of this very powerful addition the already great cloud explorer, VisualStudio add-on.
Visual Studio Code: PowerShell Extension (Sergiy Baydachnyy) - Nice post of a series and cool introduction to a useful vscode extension... if you still don't have already installed it yet.
The Five Knows of Programming - Nice post to calm the student among us... And Remember us also that learning is fun!
A Simple Formula for Changing Our Behavior (Peter Bregman) - Interesting article that expresses a nice and simple solution to walk through difficult situations... at work or at home.
Lazy Loading Images on the Web - (Brian Rinaldi) - Very cool post that share (and explains) a lot of tools and frameworks to implement a lazy loading process.
Source Control Integration in Azure Automation (Beth Cooper) - Fantastic news. This post shares with us how to take advantage of this useful new feature and configure our source control.
VSCode Documentation moves to GitHub (Chris Dias) - I really think the documentation is a major piece of VSCode. Having it " to the is a fantastic thing.
How to write better and faster using templates - Interesting post that shares with us a way to speed-up our writing. Personally, found very productive the time to structure the post since use it to organize my thoughts. Like in "old time" when we were passing through the code to adjust the indentation.
Announcing Geospatial support in Azure DocumentDB! (Aravind Ramachandran) - Fantastic, this option was present in the wishlist of many people. And we can try it right now in the DocumentDB playground.