Sean Yu

IoT Specialty/Microsoft MVP/MCT

All Posts


Custom Vision 对混凝土骨料进行分类

本文介绍一个案例,使用custom vision 对混凝土骨料进行分类:         Azure Custom Vision(自定义视觉)是一种图像识别服务,可用于构建、部署和改进你自己的图像标识符。 图像标识符根据图像的视觉特征将标签(表示类或对象)应用于图像 。 自定义视觉服务使用机器学习算法分析图像。 你作为开发人员提交多组图像, 然后在提交时自行标记图像,此算法会针对该数据进行训练并计算其自己的准确度, 训练算法以后,即可在图像识别应用中测试它、重新训练它并最终使用它对新图像进行分类。 也可导出模型本身,方便脱机使用。 可以将自定义视觉功能分为两种功能: 图像分类 可将一个或多个标签应用到图像。  对象检测 与之类似,但还在图像中返回坐标,坐标中可以找到应用的标签。     图文步骤: 创建Custom Vision:     资源创建完成进入主界面:     创建项 …

Video Custom Vision

Monitor Azure Functions send email when Error,监控Azure Function当出错时发送报警

本文介绍: 当Azure Functions执行失败时发送报警。   视频介绍: 图文介绍: 1.准备一个可以执行出错的Azure Functions并部署: (这部分内容讲过很多次了,可参照本博客中其他的文章,本文不再赘述)。 本例子中使用了默认的http 触发的 python Functions,修改functions中的代码,当http触发传递的参数不包含“name”时,执行1/0操作,故而报错异常。 代码如下: import logging import azure.functions as func def main(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') name = …

Azure Monitor Azure Functions Python

Azure Function Python 从其他文件import 方法失败的解决办法

使用Python Azure Functions时新建了.py文件并执行了import 操作,运行时提示如下错误: Result: Failure[2021-01-25T05:16:11.553Z] Exception: ModuleNotFoundError: No module named 'helper'. Troubleshooting Guide: https://aka.ms/functions-modulenotfound Stack:   File "/usr/local/Cellar/azure-functions-core-tools@3/3.0.3233/workers/python/3.8/OSX/X64/azure_functions_worker/dispatcher.py",     解决方案: 在__init__.py文件中增加: import sys …

Azure Azure Functions Python

Export Azure Functions Invocation Traces log,导出运行日志

本文介绍: Azure Functions 执行过程中产生的日志默认记录在了Application Insights里。这也是我们创建Functions时会自动创建一个Application Insights的原因,如下图Functions 自带一个Application Insights:   Azure Functions代码中的log相关的内容都可以在Functions 的Monitor页面查询到,注意查询结果可能出现5分钟延时。 如果我们想导出这些日志,可以点击Query in Application Insights页面,在application insights页面里导出数据:     切换到Application Insights Logs查询页面,即可导出数据:

Azure Application Insights Azure Functions Log

Azure Functions Error Value cannot be null. (Parameter 'provider')

在初次调试Azure Functions时,可能会遇到如下错误: Value cannot be null. (Parameter 'provider') 或者 connect Econnrefused 127.0.0.1:9091       此问题初步判断为网络异常导致了文件下载失败,可以开启更多调试日志查看是否为文件下载失败导致的,可以打开更多日志查看是否是文件下载故障: 步骤: 在VS Code中修改.vscode\launch.json和tasks.json文件中的启动命令 在launch.json和tasks.json中的 host start 后增加 --verbose 参数: { "version": "0.2.0", "configurations": [ { "name": "Attach to Python Functions", …

Azure Azure Functions Python

Azure Functions Blob Trigger 触发已经存在的文件的处理方式

在使用Azure Functions Blob Trigger 时,会出现container里已经存在的blob会触发functions执行,但我们想只针对新上传的文件进行触发。   原因: Azure Functions Blob trigger是通过blob 回执判断某个blob是否已经执行过触发,blob回执记录在AzureWebJobsStorage这个storage account中, 该storage account 配置在local.setting.json中:   触发后,会在云端Storage Account中的azure-webjobs-hosts中看到如下图的回执记录: 因为回执记录里不包含之前存在的文件,故而会依次触发已经存在的文件,直到全部触发一遍。   针对此问题,可以使用 事件网格触发器  代替 blob 触发器, 参考文档: https://docs. …

Azure Functions Azure Functions Python Trigger

Power Apps Send push notification-移动端消息推送

本文 介绍: 使用Send push notification 想移动端Power Apps 推送消息。   实现功能: 1.当有文件上传到Storage Account 的Container中时,自动向Power Apps 发送推送通知,在手机上可以看到消息通知弹窗。 2.消息带有参数,点击弹窗可以打开Power Apps 并将参数传递给页面。 如上图,可以显示具体那个 app 收到的通知,也可以显示通知的自定义内容。 可以设置点击通知,打开指定的Power Apps并将通知中的参数传递到指定的页面中。 如上图中的文本框里的内容即为通知传递的参数。   本文参考文档: https://docs.microsoft.com/zh-cn/connectors/powerappsnotificationv2/ https://docs.microsoft.com/en-us/ …

Power Automate Power Platform Power Apps Notification push

Power Apps 页面切换及传值

本文是Power Platform 低代码开发物联网App 系列文章第5.2讲: 《 概览 -Power Platform低代码开发物联网App》 《(1)-Power Platform 试用账号注册》 《(2)-Power Apps 连接Azure SQL Database 读取物联网设备清单》 《(3)-Power Apps 通过Power BI 磁贴显示物联网设备实时数据曲线》 《(4.1)-将Azure IoT Service SDK 集成到 Azure Function并发布 》 《(4.2)-Power Apps 通过Power Automate 发起Http请求调用Azure functions 进行设备远程控制》 《(5.1)-利用Azure Stream Analytics 将物联网遥测历史消息写入Azure SQL Database 》 《(5.2)-Power …

IOT Video IoT Hub Power Apps

Power Apps 通过SQl 连接器查询数据库(物联网遥测历史记录)

本文是Power Platform 低代码开发物联网App 系列文章的第5.1讲: 《 概览 -Power Platform低代码开发物联网App》 《(1)-Power Platform 试用账号注册》 《(2)-Power Apps 连接Azure SQL Database 读取物联网设备清单》 《(3)-Power Apps 通过Power BI 磁贴显示物联网设备实时数据曲线》 《(4.1)-将Azure IoT Service SDK 集成到 Azure Function并发布 》 《(4.2)-Power Apps 通过Power Automate 发起Http请求调用Azure functions 进行设备远程控制》 《(5.1)-利用Azure Stream Analytics 将物联网遥测历史消息写入Azure SQL Database 》 《(5.2)-Power …

IOT Video Power Automate Azure SQL Power Apps Stream Analytics

Power Apps 控制物联网设备(通过Power automate 发起 http请求)

本文是Power Platform 低代码开发物联网App 系列文章的第4.2 讲: 《 概览 -Power Platform低代码开发物联网App》 《(1)-Power Platform 试用账号注册》 《(2)-Power Apps 连接Azure SQL Database 读取物联网设备清单》 《(3)-Power Apps 通过Power BI 磁贴显示物联网设备实时数据曲线》 《(4.1)-将Azure IoT Service SDK 集成到 Azure Function并发布 》 《(4.2)-Power Apps 通过Power Automate 发起Http请求调用Azure functions 进行设备远程控制》 《(5.1)-利用Azure Stream Analytics 将物联网遥测历史消息写入Azure SQL Database 》 《(5.2)-Power …

IOT Video Power Automate IoT Hub Functions Power Platform Power Apps