azure_storage_5.py 581 B

123456789101112131415
  1. def connection(self):
  2. if self._connection is None:
  3. connect_str = setting("AZURE_STORAGE_CONNECTION_STRING")
  4. # Create the BlobServiceClient object which will be used to create a container client
  5. blob_service_client = BlobServiceClient.from_connection_string(connect_str)
  6. # Create a unique name for the container
  7. container_name = "pac-files"
  8. # Create a blob client using the local file name as the name for the blob
  9. self._connection = blob_service_client
  10. return self._connection