All Posts in 2020.7


Monitoring Azure virtual machine scale set memory with Azure monitor

This article describes how to use Azure monitor to collect memory usage from virtual machine instances in scale set. Memory related metrics are guest operating system level metrics, vm had to enable "log analytics agent" which collects monitoring data from the guest operating system and workloads of virtual machines in Azure, other cloud providers, and on-premises. It collects data into a Log …

Video VM VMSS Monitor

Monitor Azure vm memory through metrics

本文介绍: 通过Azure monitor监控虚拟机内存,并通过内存占用率触发某些操作。 主要原理:通过azure vm 扩展收集了 性能计数器的数据发送到log analytics workspace,在log analytics workspace中查询metrics的信息用来触发报警。 视频介绍: 图文介绍: Azure vm 监控页面默认没有虚拟机的内存占用情况 ,因为虚拟机的cpu/硬盘/网络属于主机级别的监控,而内存属于os级别监控,需要额外的配置才能采集到。 创建log analytics workspace: 设定区域等配置后,创建: 开启vm性能计数器: 针对windows 系统的采集: 针对linux 系统: 开启vm insights输出到log analytics …

Azure Video VM Monitor

Monitor Azure vm memory through custom log search

本文介绍: 通过Azure monitor监控虚拟机内存,并通过内存占用率触发某些操作。 视频介绍: 图文介绍: Azure vm 监控页面默认没有虚拟机的内存占用情况 ,因为虚拟机的cpu/硬盘/网络属于主机级别的监控,而内存属于os级别监控,需要额外的配置才能采集到。 创建log analytics workspace: 设定区域等配置后,创建: 开启vm性能计数器: 针对windows 系统的采集: 针对linux 系统: 开启vm insights输出到log analytics workspace: 点击enable,等待验证通过 在下拉列表中选择刚才创建的log analytics workspace 在azure monitor创建报 …

Azure Video VM Monitor

using azure functions blob trigger and azcopy copy blob from source storage account to destination in different subscription

This blob sharing topic: using azure functions blob trigger and azcopy copy blob from source storage account to destination in different subscription; This is also work copy blob from global subscription and Azure China( mooncake azure ); 本文介绍: 在不同的订阅间,使用 azure functions blob trigger 和 azcopy 增量同步 blob,本方案同样适用于同步到 azure file share。 videos: steps: 1. create source …

Video Cloud Storage Functions Blob azcopy PowerShell

Get Virtual Machine Scale Set Instance Terminate Notification By Scheduled Events

本文介绍: 在虚拟机规模集“终结”某个具体的实例前获得通知; 视频介绍: 图文介绍: 为什么会有这样的需求? 通常情况下,我们使用vmss 会部署一些非交易的网站类型的应用,这类应用可能对规模集内的实例重启/故障/退出规模集的操作不敏感: 比如我们检测到规模集cpu利用率>70%后,触发规则自动增加一台实例到负载均衡器后,然后负载均衡将流量导向这台新增的实例; 当cpu利用率 <50%后,触发一条自动减少虚拟机实例的规则,此时vmss直接终结掉虚拟机实例,负载均衡将流量导向其他的实例; 但如果规模集的实例运营的是一些对可靠性要求非常高的应用,或者虚拟机实例里有需要维护状态的session等状况,在减少实例时,并不能直接“终结”掉该实例,否则将导致用户数据丢失,在这样的场景下,我们就需要在& …

Video Cloud VMSS

虚拟机规模集vmss 在自动增加虚拟机后发出通知

本文介绍: vmss 在自动增加/减少虚拟机后得到通知: 1.通过web hook或电子邮件得到通知 2.通过诊断将信息发送到事件中心event hub或者storage blob 视频讲解: 图文内容: 创建新的资源组: 本文所有操作均在新的资源组中进行: 创建虚拟机规模集: 为了节约虚拟机费用,我们选择配置不高的虚拟机,另外,本例中windows 或者 linux虚拟机均可以。 在网络配置中: 创建新的nic中 开启公共网络会为每一台虚拟机添加一个公网ip; 负载均衡开启后,所有虚拟机会通过负载均衡添加一个公网ip,可通过nat转发实现登录到虚拟机中 初始实例数量为首次创建虚拟机规模集时生成的虚拟机数量: 虚拟机规模集因为包含多台虚拟机,创建过程会稍微长,大概5分钟左右。 创建诊断用的 …

Video Cloud VMSS EventHubs

azure function 和 signalr service 广播/群组/单独发送

本文介绍: Azure Functions 和SignalR service 实现广播/组播/单独发送给指定用户。 视频讲解: 图文步骤: 创建SignalR Service: 填写信息,完成创建: 找到SignalR 连接字符串: Functions完整代码: using System; using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Extensions.Http; using Microsoft.AspNetCore.Http; using Microsoft. …

Azure Video Cloud Functions SignalR

技巧-IOT hub message routing to storage account write messages in base 64

本文介绍: IoT Hub 消息路由功能JSON格式消息以base64编码存储到blob中的处理方式。 通过消息路由配置了一个路由到Stoage 的路由,编码格式采用了JSON格式,路由生效后,在Storage中发现消息体成了base64编码: base64 编码的消息体: 处理方案: 在遥测消息体里对系统属性进行手动设置: 官网文档描述:https://docs.azure.cn/zh-cn/iot-hub/iot-hub-devguide-messages-d2c#azure-storage IoT 中心支持将数据以 Apache Avro 格式和 JSON 格式写入 Azure 存储。 默认值为 AVRO。 只有在配置 Blob 存储终结点时才能设置编码格式。 不能编辑现有终结点的格式。 使用 JSON 编码时,必须在消息系统属性中将 …

Azure IOT IoT Hub