嗨,我是逻辑应用程序的新手。我有一个 python 代码,用于使用 Azure 逻辑应用发送带有附件的邮件。当我在获取 Blob 内容中提供静态文件路径时,邮件与附件一起正常工作。但是,当我尝试从 azure databricks 动态发送文件路径时,它不会在逻辑应用程序中的 get blob 内容中接收。我还尝试了一些使用初始化变量的示例,但它不起作用。
import requests
def send_email(_to, _subject, _body, file):
email_body = "{0} <br><br><br> <h6> Hi Hello World </h6>".format(_body)
task = { "body_data_1": email_body , "subject_name_1": _subject , "email_to_list_1": _to, "attach" : file }
logic_app_post_url = 'https://prod-27.centralindia.logic.azure.com:443/workflows/*****'
resp = requests.post(logic_app_post_url, json=task)
print(resp.status_code)
if resp.status_code == 202:
print('Email Sent!')
email_to = "abc@outlook.com"
email_subject = "Testing Logic App Send Mail with Dynamic File"
email_body = "Hi This is a test mail Dynamic"
file_path = "/super-store/output/orders/_SUCCESS"
send_email(email_to, email_subject, email_body, file_path)
逻辑应用设计
逻辑应用运行错误详细信息