file_basic_samples_2.py 855 B

12345678910111213141516171819202122
  1. def run_all_samples(self, connection_string):
  2. print('Azure Storage File Basis samples - Starting.')
  3. #declare variables
  4. filename = 'filesample' + self.random_data.get_random_name(6)
  5. sharename = 'sharesample' + self.random_data.get_random_name(6)
  6. try:
  7. # Create an instance of ShareServiceClient
  8. service = ShareServiceClient.from_connection_string(conn_str=connection_string)
  9. print('\n\n* Basic file operations *\n')
  10. self.basic_file_operations(sharename, filename, service)
  11. except Exception as e:
  12. print('error:' + e)
  13. finally:
  14. # Delete all Azure Files created in this sample
  15. self.file_delete_samples(sharename, filename, service)
  16. print('\nAzure Storage File Basic samples - Completed.\n')