hi and welcome in cloud in five minutes today I want to show you how easy it is
to move file in Azure would it be from a machine running Linux Windows or Mac
Also, if you prefer, I have a French version of this video. Just click here in the top-
right corner
in today's demo what I want to do is I will take a picture uploaded in a Azure
subscription in a blood storage then in a second time I will take this image and
copy it in another subscription I will do that with two different tools let's
get started okay so here we are in my open two machine I decided to go with
Linux today just to show how it work on a nice machine of course it will work on
Windows or Mac so my plan is today is to play with those images they are in my
own and I create a folder called demo so that's for it so I also have two
subscription so one on each browser so here that one is where I have a
container called image and here in the second
subscription I have a container called extra so the first example I want to
show you today will use AZ copy that's a tool I wrote a blog post not long time
ago about it I will put the link in the description and it was very easy easy
copy and useful at that time it was only possible to do it on Windows but since
recently it's now possible on Linux also and Mac because it's done using the.net
core library so I will put that link also in the description where it shows
how to install it so you need to install the net core and install also the tool
it's really easy to do so let's get started so first I will open my terminal
and then for today I created a file so I could show you the command having time
to explain it and then copy pasted in terminal so the first one is to upload a
local file to Azure using AZ copy so of course the command is AZ copy and then
we'll specify the source of the file so this is my path to my local drive on my
PC for to my picture and then I will specify the destination of the container
the full path so this is like with my subscription and the container images
and then the name if I would like to change the name that would be the time
to put a different me and then for today I use the key but
you could also use SAS token or different metal to get the key or D
storage account name it's really easy you just need to go in the azure portal
so lets me show you so from the azure portal you go in your blob storage and
then here where you see the access key you click on that and you will have like
your storage account name and your two keys so you could do the rotation if you
need to change them keep your key secret otherwise people will have access to
your files yeah will delete everything that you will see before this video got
published so back to our code so easy copy the source the destination and then
my security my key so let's try its to copy-paste that and the terminal perfect
so now if we go back and I do a refresh we'll see the images transferred so now
let's try to move it from this blob storage to the other subscription
without of course getting back honored to do that we'll need to specify to this
like a source and a destination so the source it will still be the URL the
complete URL and then the destination will also be deconflict URL again see
now it's extra it's a different name two different key of course for the source
and destination so that and I pasted it and it's done if I go in my second
subscription and i refresh the image is already there perfect so that worked
pretty cool basic app is awesome really easy simple it's very powerful it will
cut in pieces the the file you need to upload to optimize your upload time
really great tool but some time you don't want to install the net core or
another application so another solution that you could do is using the azure CLI
so it's possible to move file with Azure CLI so you just need to install it using
the node management package just like a really easy command to install so as
your CLI required a little bit more parameters but it's still simple so
we'll need to specify that we want to work with storage and blob because we're
not working with tables or queue we are working with the blob one and the action
for the first part at least it's upload then file is represent the local file so
I'm putting my path here then the account name and the azure container and
the name of my blog will be copy it would be nice if I could have like a URL
like in the AZ copy that's not possible those things need to be separated and of
course the key is the same account key so let's copy that go back in the
terminal will clear my screen okay so it's already done so if I go into i
refresh OC my second image is already it already present okay now let's do the
other one so go back here I'll scroll a little bit okay so I know look may see a
lot of parent or stay with me and we'll explain everything so now it's easy
storage blob as usual and then copy because we want to move files between
the uploading from on-premise and start why start because all the upload or the
moving part will be a sync it's really cool very practical and you
could also do batch but today I have only one so right now you need to
specify the source account name so this is easy like the source storage key the
source container the source blob pretty obvious right okay so now I can't name
an account key or for the destination so it doesn't specify
destination or source but keep in mind is destination and then destination
container and destination blog hope it's clear so let's go here and then paste it
and execute it and yeah it's already done
let's go in the browser I'm refreshing it cool and I don't know if you need
that new things but if you go in a specific blob you could now see it so if
I go and click it's it blob you will see the image and by the way those guys are
all the onion for the DevOps bootcamp coming this June so perfect that work
perfectly work by script by code it will work on any OS you're running if you
want a graphical tool you could also use these as your storage Explorer so having
here I already talked about it in a previous video one thing I want to
mention is that now it's possible to have it in all oh s so it's really cool
I look a little bit like an FTP application where you could you know
upload download move files see the set the security and all those things
reiha-sama will put the link also in the video beau-line just like this you could
upload files move them from a container together even if they are in a different
subscription I hope you like this video and I hope it was useful if you have any
questions reach me on the comment section or on any social media if you
like this video give it a thumbs up and to be sure to don't miss my future one
subscribe and click the bell icon thank you for watching see you next time
you