当前位置: 首页 > news >正文

Azure 学习总结

文章目录

    • 1. Azure Function
      • 1.1 Azure Function 概念
      • 1.2 Azure Function 实现原理
      • 1.3 Azure Function 本地调试
      • 1.4 Azure Function 云部署
    • 2. Azure API Managment 概念 以及使用
      • 2.1 Azure API 概念
      • 2.2 Azure API 基本使用
    • 3. Service Bus 应用场景及相关特性
      • 3.1 Service Bus 基本简介与特性
      • 3.2 Service Bus 消息队列
    • 4. Azure Monitor相关内容,了解可观测性相关配置与查询操作

1. Azure Function

参考资料:Microsoft Azure
参考资料(快速入门):使用Visual studio在Azure中创建第一个c#函数
参考资料:AZ-900

1.1 Azure Function 概念

在这里插入图片描述

Azure Function:
1. 可以直接编写重要代码,不需要关心基础结构的维护,可以直接上传到云服务当中.

1.2 Azure Function 实现原理

1. 利用提供的触发器和绑定进行连接服务,例如绑定的Web API(HTTP触发器服务),当发生HTTP请求
时,Azure 云服务就可以对这个请求做出响应

代码分析:
在这里插入图片描述
效果图:
在这里插入图片描述

1.3 Azure Function 本地调试

### 本地调试
1.  创建Azure Function项目(c#类),之后将其进行运行即可.

在这里插入图片描述

1.4 Azure Function 云部署

1. 本地测试代码通过
2. Azure本地资源当中创建函数应用
3. 将Azure Function本地代码上传到Azure当中对应的函数应用组当中/api/HttpExample?name=Functions 追加至url地址之后

效果图:
在这里插入图片描述

2. Azure API Managment 概念 以及使用

参考资料:Azure API管理文档

2.1 Azure API 概念

在这里插入图片描述

  1. Azure API 管理是由API网关、管理平面以及开发人员组成的,API管理提供Azure当中组件的相关API管理的使用

2.2 Azure API 基本使用

  1. 通过Azure 创建第一个 Azure API实例
  2. 在API管理当中创建测试API,并设置其返回Json{“word” : “beautiful”}
  3. 启用响应式模拟,测试模拟API

效果图:
在这里插入图片描述

3. Service Bus 应用场景及相关特性

Azure Service Bus 服务

3.1 Service Bus 基本简介与特性

Service Bus简介
在这里插入图片描述
Service Bus 队列
在这里插入图片描述

  1. Service Bus. 企业消息服务代理,其中有消息队列和发布订阅主题两种。
  2. Service Bus 队列类似于一个中间管理服务,将所有发送方的请求暂时以队列FIFO的方式暂存在中间通道,消息使用方按顺序从此中间站当中获取相应的服务.

3.2 Service Bus 消息队列

  1. 首先需要在Azure当中创建 Service Bus命名空间(可以为队列以及主题提供范围容器)
  2. 在对应Service Bus 当中创建队列
  3. 利用Visual Studio 测试队列消息的接受与发送

消息队列创建
在这里插入图片描述

消息队列代码

using Azure.Messaging.ServiceBus;
using Azure.Identity;// service bus 队列,用于发送以及接收消息
ServiceBusClient client;// the sender used to publish messages to the queue
ServiceBusSender sender;// number of messages to be sent to the queue
const int numOfMessages = 3;// The Service Bus client types are safe to cache and use as a singleton for the lifetime
// of the application, which is best practice when messages are being published or read
// regularly.
//
// Set the transport type to AmqpWebSockets so that the ServiceBusClient uses the port 443. 
// If you use the default AmqpTcp, ensure that ports 5671 and 5672 are open.
var clientOptions = new ServiceBusClientOptions
{TransportType = ServiceBusTransportType.AmqpWebSockets
};
// ServiceBus 的命名空间以及队列名称,以及默认的登录用户权限信息
client = new ServiceBusClient("ServiceBusExampleTestZhangyunyi.servicebus.windows.net", // new DefaultAzureCredential(),clientOptions);
sender = client.CreateSender("myqueue");// create a batch 
using ServiceBusMessageBatch messageBatch = await sender.CreateMessageBatchAsync();for (int i = 1; i <= numOfMessages; i++)
{// try adding a message to the batchif (!messageBatch.TryAddMessage(new ServiceBusMessage($"Message {i}"))){// if it is too large for the batchthrow new Exception($"The message {i} is too large to fit in the batch.");}
}try
{// Use the producer client to send the batch of messages to the Service Bus queueawait sender.SendMessagesAsync(messageBatch);Console.WriteLine($"A batch of {numOfMessages} messages has been published to the queue.");
}
finally
{// Calling DisposeAsync on client types is required to ensure that network// resources and other unmanaged objects are properly cleaned up.await sender.DisposeAsync();await client.DisposeAsync();
}Console.WriteLine("Press any key to end the application");
Console.ReadKey();

4. Azure Monitor相关内容,了解可观测性相关配置与查询操作

http://www.lryc.cn/news/268908.html

相关文章:

  • 数据库是否可以直接作为数据仓库的数据源
  • IntelliJ IDE 插件开发 | (四)开发一个时间管理大师插件
  • 【ChatGPT 默认强化学习策略】PPO 近端策略优化算法
  • 【银行测试】金融银行-理财项目面试/分析总结(二)
  • 张江智荟毁约offer
  • ubuntu 系统终端颜色设置
  • 【Vue】class与style绑定
  • 大厂前端面试题总结(百度、字节跳动、腾讯、小米.....),附上热乎面试经验!
  • EXPLORING DIFFUSION MODELS FOR UNSUPERVISED VIDEO ANOMALY DETECTION 论文阅读
  • 当 ML 遇到 DevOps:如何理解 MLOps
  • vue+element+springboot实现多张图片上传
  • react使用useState更新数组失败
  • 《LIO-SAM阅读笔记》3.后端优化
  • mac下jd-gui提示没有找到合适的jdk版本
  • FlinkSQL窗口实例分析
  • 18-网络安全框架及模型-信息系统安全保障模型
  • Android 提取(备份)apk(安装包)
  • gRPC-Go基础(4)metadata和超时设置
  • 语言模型:从n-gram到神经网络的演进
  • docker compose 部署 grafana + loki + vector 监控kafka消息
  • kubeadm创建k8s集群
  • 鸿蒙开发之android对比开发《基础知识》
  • 2702 高级打字机
  • yolov5旋转目标检测-遥感图像检测-无人机旋转目标检测-附代码和原理
  • Qt学习:Qt的意义安装Qt
  • Anylogic Pro 8.8.x for Mac / for Linux Crack
  • ROS无人机初始化GPS定位漂移误差,确保无人机稳定飞行
  • k8s网络类型
  • Seata 中封装了四种分布式事务模式,分别是: AT 模式, TCC 模式, Saga 模式, XA 模式,
  • 为什么设计制造行业需要数据加密?