diff --git a/TDD.png b/TDD.png new file mode 100644 index 0000000..fd56281 Binary files /dev/null and b/TDD.png differ diff --git a/azure_blob_file_upload_test.py b/azure_blob_file_upload_test.py new file mode 100644 index 0000000..a2ddecd --- /dev/null +++ b/azure_blob_file_upload_test.py @@ -0,0 +1,31 @@ +import requests + +import dotenv + +import os + +dotenv.load_dotenv(".env") + +container_name = "alextestcontainer" + +file_name = "tdd.png" + +image_file = open("TDD.png", "rb") + +image_content = image_file.read() + +contents = image_content + +sas_token = os.getenv("SAS_TOKEN") + +url = f"https://todotfstateacc.blob.core.windows.net/{container_name}/{file_name}?{sas_token}" + +headers = { + "x-ms-blob-type": "BlockBlob" +} + +response = requests.request("PUT", url, data=contents, headers=headers) + +print(response.text) + +print(f"Response returned with status code {response.status_code}") \ No newline at end of file