I am using the following method from python SDK for azure-iot-hub.
sas_blob = generate_blob_sas(account_name= STORAGE_ACCOUNT_NAME, account_key = ACCOUNT_ACCESS_KEY, container_name= containername, protocol = "https", start = datetime.datetime.utcnow() - timedelta( minutes= 40) , expiry= datetime.datetime.utcnow() + timedelta(hours=24), permission=BlobSasPermissions(read=True), blob_name = local_file_name)
This API generates sometimes invalid sas URL resulting in error
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
And sometimes it generates the correct sas URL through which files can be downloaded successfully.
Am I missing something? not able to identify why is there an inconsistency