How to automatically extend the virtual machine vertically based on memory metrics

The virtual machine on Azure can monitor the guest operating system’s data, such as CPU, memory usage, and so on, by enabling guest OS diagnostic data collection. And even better, we can also manage VMs based on monitored data, such as vertical scaling. This article will talk about how to use the memory usage to automatically extend the virtual machine vertically. 1. First enable guest OS diagnostics data collection so that we can collect more disk, CPU, and memory data. If it is not checked during creation, it can be configured by monitoring the diagnostic settings in the VM panel.... Read more

Graph API 关于如何上传其他文件类型

当我们在使用Microsoft Graph上传文件的时候,根据官方文档 ,只有如何上传TXT文档的sample。那么其他类型的文档我们该如何上传呢? 首先,Microsoft Graph API不支持以下文件的上传: .ashx – ASP.NET Web 处理程序文件 .asmx – ASP.NET Web 服务源文件 .json – JavaScript 对象表示法文件 .soap – 简单对象访问协议文件 .svc – Windows Communication Foundation (WCF) 服务文件 .xamlx – Visual Studio 工作流服务文件 其它类型的都是支持的,下面会详细给出如何上传CSV/XlSX类型的文件: URL: FolderA:要上传文件的文件夹   FileB.csv:文件的名称 方法:Put 权限:委托 Files.ReadWrite,Files.ReadWrite.All,Sites.ReadWrite.All                                                                               应用程序 Files.ReadWrite.All,Sites.ReadWrite.All 身份验证:                                     ... Read more

How to upload CSV file via graph api

When we use Microsoft Graph to upload files, according to the official document, we can only upload TXT document sample. So how do we upload other types of documents? Firstly, the Microsoft Graph API does not support the following file uploads: .ashx – ASP.NET Web handler file .asmx – ASP.NET Web Services source file .json – JavaScript Object Notation file .soap – Simple Object Access Protocol file .svc – Windows Communication Foundation (WCF) service file .xamlx – Visual Studio Workflow service file Except the above types of files , other types are supported by Microsoft Graph API, the following details will... Read more

How to connect to VM hosted MySQL using Node.js in Azure Function

Recently, some customers asked for a demo about how to connect to VM hosted MySQL using Node.js in Azure Function, so this article provides a simple demo describes how to connect to VM hosted MySQL using Node.js in Azure Function. Prerequisites: A VM hosted MySQL server with remote connection allowed for user root : Procedures: 1.Create a JS Webhook connect, my function name is “testMysqlConn”: 2.Paste code below into the function(this function will connect to the VM hosted MySQL server and then execute sql in request body): module.exports = function (context, req) { context.log('JavaScript HTTP trigger function processed a request.'); var... Read more

The Refresh Token in Oauth2.0

The Refresh Token in Oauth2.0 1.Concept The biggest difference between Oauth2.0 and Oauth1.0 is the acquirement of access token, the access token of Oauth1.0 can be stored in the database and used for long time, the validity period is basically infinite, which result in its insecurity. The access token of And Oauth2.0 is valid for a short period, Therefore, Oauth2.0 brought in refresh token. In the oauth2.0, authorization code obtained the token and the default validity period is 1 hour (authorization code is disposable, once used and it will be invalid), so to use the refresh token, when we acquire... Read more

Using Azure Automation to Manage local resources | Part I : Get started on Hybrid Runbook Worker

Microsoft Azure Automation provides a way for users to automate the manual, long-running, error-prone, and frequently repeated tasks that are commonly performed in a cloud and enterprise environment. In this article, I will introduce how to install hybrid runbook worker, then we can manage our on-premise resources via azure automation later. Introduction The Hybrid Runbook Worker feature of Azure Automation allows you to run runbooks directly on the computer hosting the role and against resources in the environment to manage those local resources. Runbooks are stored and managed in Azure Automation and then delivered to one or more designated computers.... Read more

Using Azure Automation to Manage local resources | Part II : Schedule file copies from a local machine to an Azure Blob

In the Part I, we have learned how to manage local resources via azure automation hybrid runbook worker. In this article, I will show you how to schedule file copies from a local machine to an azure blob storage container. Steps Create a runbook using following code. <#PSScriptInfo .VERSION 1.0 .GUID 3a796b9a-623d-499d-86c8-c249f10a6986 .AUTHOR Azure Automation Team .COMPANYNAME Microsoft .COPYRIGHT .TAGS Azure Automation .LICENSEURI .PROJECTURI .ICONURI .EXTERNALMODULEDEPENDENCIES .REQUIREDSCRIPTS .EXTERNALSCRIPTDEPENDENCIES .RELEASENOTES #> <#  .SYNOPSIS  Exports the Run As certificate from an Azure Automation account to a hybrid worker in that account. .DESCRIPTION  This runbook exports the Run As certificate from an Azure... Read more

Develop with Azure Service Bus (3): Topic and Subscription

In this article, I will introduce you how to use “Azure Service Bus Client for Java” to work with topics and subscriptions in Service Bus. The architecture is showed as below: In contrast to queues, in which each message is processed by a single consumer, topics and subscriptions provide a one-to-many form of communication, in a publish/subscribe pattern. You can create multiple subscriptions for one topic. When sending messages to the topic, every subscription will be able to process the message. Next I will demonstrate the features with two pieces of code. To try it by yourself, you need the prerequisites below: The connection string of Service... Read more

Develop with Azure Service Bus (2): Queue

In this part, I will show you how to use Azure Service Bus through java sdk. It has undergone major changes that the Azure Service Bus Client for Java updated to 1.0.0 version , relative to the past  0.9.7 version. Here I provide 2 snippet code to show how to use the latest SDK to send/received messages in queue. Prerequisites The connection string of Service Bus. And its shared access policy should have “Send” and “Listen” permission enabled. Java Runtime Environment Java IDE (Optional) 1, Configuration Create a Maven project, and add the following dependency: <dependency> <groupId></groupId> <artifactId>azure-servicebus</artifactId> <version>1.0.0</version> </dependency> 2, Send message ... Read more

Develop with Azure Service Bus (1): Manage Service Bus

Microsoft Azure Service Bus is a reliable information delivery service. The purpose of this service is to make communication easier and implement the decoupling between modules. On the Azure service bus introduction, I will not repeat here, please refer to the official description: Azure service bus. To achieve the full operation of this article, you need to have the following prerequisites: An active Azure subscription Java Runtime Environment  Java IDE, Eclipse (Optional) This article will introduce how to use Azure portal / Java SDK to manage Azure Service Bus. 1. Create a Namespace To begin using Service Bus queues in Azure, you... Read more