Wednesday, April 12, 2017

How to download Azure VHD locally

If you want to download your Azure VM or the storage locally, then you can follow a few techniques.

One is you can use PowerShell to initiate the DB copy command or else you can use Azure Storage Explorer tool. First we will start with the PowerShell.

First go into Storage account and copy the VHD location

SVROI (unmanaged) 
R X Discard 
NAME 
SVROI 
STORAGE ACCOUNT TYPE 
Standard CRS 
* Size (Gi8) O 
ESTIMATED PERFORMANCE O 
IOPS limit 
Throughput limit (M3/s) 
OPERATING SYSTEM 
Windows 
SOURCE IMAGE 
MicrosoftWindowsServer / WindowsServer / 2016-Datacenter / latest 
* Host caching O 
Read/write 
VFD URI 
https://svrdisks655.bIob.core.windows.net/vhds/SVR0120170329155733.vhd

Login to your azure account through PowerShell. For that first you can use below mentioned command and give the credentials.

PS C:\Windows\system32> Login-AzureRmAccount

Enter password 
Ent« ttæ —d

Once you pass the correct credentials you will be able to see the below details. That means you are successfully logged in.

PS Logi n—AzureRmAccount 
Environment 
Accou nt 
Tenant Id 
Subscr i pt i onld 
Subscr i pt i onName 
CurrentStor ageAccount 
. Azur«loud 
: henal 
: Visual Studio Enterprise 
- MPN

But if you have more subscription under one account you can list down them by typing 

PS C:\Windows\system32> Get-AzureRmSubscription 

You will get the subscription details and the account state like below,

SubscriptionName : 
Visual Studio Enterprise 
Subscr i pti onld 
Tenantld 
: Enabled 
State 
- MPN

If you want to select the desired subscription, use below command 

PS C:\Windows\system32> Select-AzureRmSubscription -SubscriptionId <Subscription ID>

Next you need to shut down the VM and for that you can run below command. In my case “SVR01” is the VM.

PS C:\Windows\system32> Stop-AzureRmVM -ResourceGroupName SVR -Name SVR01PS C : Stop—AzuremnW 
Virtual machine stopping operation 
—ResourceGroupNæne SVR 
-Name SVROI 
This cmdlet will Stop the specified virtual machine. DO you want to continue?

 

Once the server shutdown, you will see the summary as below

PS C: Stop—AzureRmVN 
Operati onld : 
. Succeeded 
Statu s 
Start Ti me 
: 06/04/2017 20:46:15 
EndTime 
: 06/04/2017 20:48:56 
Er ror 
—Resour ceGroupName SVR 
-Name SVROI

Now you can initiate the VHD Copy command by pasting the VHD URL which you have copied earlier.

PS C:\Windows\system32> Save-AzureRmVhd -ResourceGroupName SVR -SourceUri https://svrdssss655.blob.core.windows.net/vhds/SVR0120170329155733.vhd -LocalFilePath D:\AzureVHD\SVR01.vhd 

Once this completed you will be able to see your VHD in given location 

Sh View 
Datemodfied 
1 17L 一

Now you can attach that into your Hyper-V console or mapped as a hard drive into your local environment.

Tuesday, April 11, 2017

Microsoft Azure Storage Explorer

 

Azure Storage Explorer is an app which support for Azure storage data on Windows , Linux and MacOS.

This is a very handy tool which will help you to do more stuff with the Azure storage, I have used this to do more things with the Azure Virtual machine VHD/ Storage expansion, VHD export locally and manage the blobs.

Key features in the Storage explorer are mentioned below,

  • Support macOS, Linux, and Windows versions
  • Sign in to view your Storage Accounts grouped by subscription:
    • Use your Org Account, Microsoft Account, 2FA, etc
    • Configure and manage proxy settings
    • Remove accounts by signing out
    • Sign in to Azure China, Azure Germany, and Azure US Government accounts.
  • Connect to Storage Accounts using:
    • Account name and Key
    • Custom endpoints (including Azure China)
    • SAS URI for Storage Accounts
  • ARM and Classic Storage support
  • Generate SAS keys for blobs, blob containers, queues, tables, or file shares
  • Connect to blob containers, queues, tables, or file shares with Shared Access Signatures (SAS) key
  • Blobs
    • View blobs and navigate through directories
    • Upload, download, delete, and copy blobs and folders
    • Create, manage, and promote blob snapshots.
    • Open and view the contents text and picture blobs
    • View and edit blob properties and metadata
    • Search for blobs by prefix
    • Create and break leases for blobs and blob containers
    • Drag ‘n drop files to upload
    • Rename blobs and folders
    • Empty "virtual" folders can now be created in blob containers
    • You can modify the Blob and file properties
  • Tables
    • View and query entities with ODATA or use query builder to create complex queries
    • Add, edit, delete entities
    • Import and export table contents in CSV format (including exporting query results)
    • Customize column order
    • Ability to save queries
  • Queues
    • Peek most recent 32 messages
    • Add, dequeue, view messages
    • Clear queue
    • We made it possible for you to decide whether you want to encode/decode your queue messages
  • File Shares
    • View files and navigate through directories
    • Upload, download, delete, and copy files and directories
    • View file properties
    • Rename files and directories
  • There are more features available and those you can find on the Storage Explorer main  page.

    Here I’m going to show few steps that you can follow to start working with the Azure Explorer

    First, you need to download the  Storage Explorer client tool. That you can find by going into storageexplorer.com  location.

    Once you launch the Storage Explorer, First you will get the below window asking about the method that you want to use to connect to your Azure account

    Microsoft Azure Storage Explorer 
Edit View Help 
Microsoft Azure 
Quick Access 
(Local and 
Storage Account 
roper-tie 
What don't you like or feel is missin 
Release Notes: 0.8.9 
Connect to Azure Storage 
How do you want to connect to your Storage Account or service? 
@ Add an Azure Account 
Azure environment: 
Azure 
C) use a shared access signature (SAS) URI or connection string 
C) use a storage account name and key 
Next 
Sign inn. 
Cancel

    Click Sign In and then give the Azure portal credentials. After the verification, It will open the storage under Storage Explorer window.

    image

    Now you will be able to manage your Azure storage and the blobs, etc by using this Storage Explorer connector.

    image

     

    Hope this tool will help you to save your time to do more troubleshooting,