in Education by
I need to upload files to azure blob container every day from local system. I use azcopy with sas for doing it. But what i encountered is that SAS for container keep changing on every refresh. So is there any better way i can upload files using python or azcopy. Or is there any way to get the SAS toke from the azure without login and pass that SAS token to azcopy command? as of now i use this command from azcopy .\azcopy "Sourcefilepath" "Destblobpath?SAS_Token" --recurcive=true Each day i should login to azure get the SAS token and pass for the above command. i tried .\azcopy login and i get login successful, but i cant send files with .\azcopy "Sourcepath" "Destpath" Don't know where i'm doing wrong. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
If you're using python, I would suggest using the azure python sdk to do your uploading. You can see more from this example here... https://github.com/Azure-Samples/storage-blobs-python-quickstart/blob/master/example.py It can be as quick as this (from the quick start docs : https://docs.microsoft.com/en-us/python/api/overview/azure/storage?view=azure-python) to interface with your azure blob storage account. Just put in some logic to loop through a directory recursively and upload each file. First make sure to pip install the required packages, and then grab your account name (blob storage name) and your access key from the portal...plug them in and you're good to go. pip install azure-storage-blob azure-mgmt-storage Then write some python code here... from azure.storage.blob import BlockBlobService, PublicAccess blob_service = BlockBlobService('[your account name]','[your access key]') blob_service.create_container( 'mycontainername', public_access=PublicAccess.Blob ) blob_service.create_blob_from_bytes( 'mycontainername', 'myblobname', b'hello from my python file' ) print(blob_service.make_blob_url('mycontainername', 'myblobname')) This should get you going in the right direction pretty quickly.

Related questions

0 votes
    I've try to do the following instruction of this document : LINK I used SAS authentication and added this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 22, 2022 in Education by JackTerrance
0 votes
    How can I delete the associated account with the virtual machines On the preview portal on deleting the storage account ... as well. Select the correct answer from above options...
asked Jan 20, 2022 in Education by JackTerrance
0 votes
    I have a data frame with two columns - filepath (wasbs file path for blobs), string and want to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    So the scenario is the following: I have multiple instances of a web service that writes a blob of data to ... other unknown issues? Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    I just want to know whether a blob exists in a particular container or not. Simple question right! I'll download ... it doesn't exist. Select the correct answer from above options...
asked Jan 20, 2022 in Education by JackTerrance
0 votes
    Which of the following are a worldwide content caching and delivery system for Windows Azure blob content? 1. CDN 2. CND 3. DNC 4. None of the options...
asked Sep 22, 2021 in Technology by JackTerrance
0 votes
    Which of the following are a worldwide content caching and delivery system for Windows Azure blob content? CDN CND DNC None of the options...
asked Aug 28, 2021 in Technology by JackTerrance
0 votes
    What do you mean by a BLOB and what are their types in Azure?...
asked Dec 27, 2020 in Technology by JackTerrance
0 votes
    I have an Azure table datastore and here's my model for one class: public class Product : ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 21, 2022 in Education by JackTerrance
0 votes
    When should I use SQL Azure and when should I use table Storage? I was thinking, use table storage for transaction ... do you think? Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    I'm trying to make a web-based .NET application from scratch. I'm considering using Microsoft Azure to host it ... advice for using it. Select the correct answer from above options...
asked Jan 20, 2022 in Education by JackTerrance
0 votes
    Azure Storage plays the same role in Azure that ______ plays in Amazon Web Services. 1. EC3 2. S3 3. EC2...
asked Sep 22, 2021 in Technology by JackTerrance
0 votes
    Your Azure storage account is always replicated to ensure durability and high availability. By default, which of the following replications schemes is used? ZRS GRS RA-GRS LRS...
asked Aug 28, 2021 in Technology by JackTerrance
0 votes
0 votes
    What is meant by table storage in Azure?...
asked Dec 28, 2020 in Technology by JackTerrance
...