file_advanced_samples_2.py 988 B

12345678910111213141516171819202122232425262728
  1. def run_all_samples(self, connection_string):
  2. print('Azure Storage File Advanced samples - Starting.')
  3. try:
  4. # Create an instance of ShareServiceClient
  5. service = ShareServiceClient.from_connection_string(conn_str=connection_string)
  6. # List shares
  7. print('\n\n* List shares *\n')
  8. self.list_shares(service)
  9. # Set Cors
  10. print('\n\n* Set cors rules *\n')
  11. self.set_cors_rules(service)
  12. # Set Service Properties
  13. print('\n\n* Set service properties *\n')
  14. self.set_service_properties(service)
  15. # Share, directory and file properties and metadata
  16. print('\n\n* Metadata and properties *\n')
  17. self.metadata_and_properties(service)
  18. except Exception as e:
  19. print('Error occurred in the sample.', e)
  20. finally:
  21. print('\nAzure Storage File Advanced samples - Completed.\n')