Upload multiple pdf files to Azure Blob Storage through Streamlit

Hi, I am trying to upload pdf files to azure blob storage through st.file_uploader(). Following is the code I am using to achieve the same. I am facing an issue in writing the file buffer to a created blob. A container is getting created but remains empty in Azure storage.

uploaded_files = st.file_uploader(β€˜β€™,type= β€˜.pdf’,accept_multiple_files= True)
if uploaded_files :
container_name = str(uuid.uuid4())
container_client = blob_service_client.create_container(container_name)
for _ in uploaded_files:
try:
blob_client = blob_service_client.get_blob_client(container = container_name, blob = .name)
st.info(f"Upoading file to blob - {
.name}β€œ)
with open(.read(), β€œrb”) as doc:
blob_client.upload_blob(doc,overwrite = True)
doc.close()
except Exception as e:
st.warning(f"Failed to parse - {
.name}”)