How to get blob-URL after file upload in azure

0 votes
I'm trying to connect web and worker role. So i have a page where user can upload video files. Files are large so i can't use the query to send files. That's why i'm trying to upload them into the Blob Storage and then send the url by the query. But i don't know how to get this url.

Can anyone help me?
Sep 27, 2018 in Azure by cloudie_crank
• 1,610 points
15,231 views

1 answer to this question.

0 votes

Assuming you're uploading the blobs into blob storage using .Net storage client library by creating an instance of CloudBlockBlob, you can get the URL of the blob by reading Uriproperty of the blob.

static void BlobUrl()
{
    var account = new CloudStorageAccount(new StorageCredentials(accountName, accountKey), true);
    var cloudBlobClient = account.CreateCloudBlobClient();
    var container = cloudBlobClient.GetContainerReference("container-name");
    var blob = container.GetBlockBlobReference("image.png");
    blob.UploadFromFile("File Path ....");//Upload file....

    var blobUrl = blob.Uri.AbsoluteUri;
}

View example on Pastebin

Hope this helps!!

To know more about Azure, enroll today with our Azure certification course.

Thanks!!

answered Sep 27, 2018 by null_void
• 3,220 points

Related Questions In Azure

0 votes
1 answer

How to upload a file on to Azure Blob storage without writing a code?

You can find the below tools useful ...READ MORE

answered Apr 13, 2018 in Azure by club_seesharp
• 3,450 points
1,244 views
0 votes
1 answer

Azure Blob: How to open a file in browser without downloading it?

First, because I was using a byte[] the controller ...READ MORE

answered Jun 20, 2018 in Azure by club_seesharp
• 3,450 points
23,202 views
0 votes
1 answer

How to get the list of names of Azure blob files in a container?

We can get some additional info like Size, ...READ MORE

answered Jun 27, 2018 in Azure by club_seesharp
• 3,450 points
20,904 views
0 votes
1 answer

Want to upload a blob file with huge size to azure in as little time as possible.

Microsoft Azure Storage Explorer is one of the ...READ MORE

answered Mar 27, 2019 in Azure by Prerna
• 1,960 points
1,031 views
0 votes
1 answer

How can i upload to Azure Blob storage with Shared Access key?

For GetBlobReferenceFromServer to work, the blob must be present ...READ MORE

answered Jun 12, 2018 in Azure by club_seesharp
• 3,450 points
3,340 views
0 votes
1 answer

How to get instance views for all VMs in Azure?

Hi@akhtar, You can get instance views for all ...READ MORE

answered Nov 11, 2020 in Azure by MD
• 95,440 points
819 views
0 votes
1 answer

How to get available ips in the VNet in Azure?

Hi@akhtar, The available ips depend on the network ...READ MORE

answered Nov 12, 2020 in Azure by MD
• 95,440 points
2,852 views
0 votes
1 answer

How to create a deployment from a remote template file in Azure?

Hi@akhtar, You can create a deployment from a ...READ MORE

answered Nov 15, 2020 in Azure by MD
• 95,440 points
358 views
0 votes
1 answer

How to determine the number of messages in an Azure Services Bus Queue?

You will get error when you try ...READ MORE

answered Jun 12, 2018 in Azure by null_void
• 3,220 points
4,146 views
0 votes
1 answer

How can we rewrite an URL in Azure Webapp?

You need to create a web.config file ...READ MORE

answered Jun 14, 2018 in Azure by null_void
• 3,220 points
8,157 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP