【Azure 存储服务】使用POST方式向Azure Storage Queue中插入Message的办法
问题描述
使用POST HTTP Request, 如何向Azure Storage Queue中写入Message呢?例如使用CURL发送POST指令是否可以呢?
CURL -H "Content-Type: application/xml" -X POST -d "message body" "azure storage queue endpoint"
问题解答
可以的,首先从Azure Storage Account中获取访问令牌,示例中使用的为SAS( Shared access signature : 共享访问签名)。然后直接发送POST请求。
第一步:获取SAS Token,进入Storage Account的 Shared access signature 页面,选择“Queue” ,Allow resource type全部选择,然后根据所需要的操作设置Allow Permissions。

第二步:拼接 Endpoint。把上一步的SAS Token复制出来,与Queue的地址进行拼接:

完整的Endpoint URL为:
https://xxxxxxxx.queue.core.chinacloudapi.cn
/testpostmethod
/messages
?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacupx&se=2021-10-16T15:10:22Z&st=2021-10-16T07:10:22Z&spr=https&sig=f%2Fktxxxxxc8qNeeAM9izhpAZttlpGivTLc%3D
第三步:发送POST 请求,消息体为XML格式 <QueueMessage><MessageText>【message body】</MessageText></QueueMessage>
<QueueMessage>
<MessageText>Test the Azure Storage message 1016 -1</MessageText>
</QueueMessage>
- Postman VS CURL
|
|
![]() |
- CURL 示例:
curl -H "Content-Type: application/xml"
-X POST
-d "<QueueMessage><MessageText>Test the Azure Storage message 1016 - 9</MessageText></QueueMessage>"
"https://xxxxxxxx.queue.core.chinacloudapi.cn/testpostmethod/messages?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacupx&se=2021-10-16T15:10:22Z&st=2021-10-16T07:10:22Z&spr=https&sig=f%2FkttQxxxxxxxxAZttlpGivTLc%3D"
-v
第四步:在Queue中查看数据

参考资料
Azure Storage Account Queue - Put Message : https://docs.microsoft.com/en-us/rest/api/storageservices/put-message
The Put Message operation adds a new message to the back of the message queue. A visibility timeout can also be specified to make the message invisible until the visibility timeout expires. A message must be in a format that can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KiB in size for versions 2011-08-18 and newer, or 8 KiB in size for previous versions.
The Put Message request may be constructed as follows. HTTPS is recommended. Replace myaccount with the name of your storage account, and myqueue with the name of your queue:
【Azure 存储服务】使用POST方式向Azure Storage Queue中插入Message的办法的更多相关文章
- 【Azure 存储服务】代码版 Azure Storage Blob 生成 SAS (Shared Access Signature: 共享访问签名)
问题描述 在使用Azure存储服务,为了有效的保护Storage的Access Keys.可以使用另一种授权方式访问资源(Shared Access Signature: 共享访问签名), 它的好处可 ...
- 解读 Windows Azure 存储服务的账单 – 带宽、事务数量,以及容量
经常有人询问我们,如何估算 Windows Azure 存储服务的成本,以便了解如何更好地构建一个经济有效的应用程序.本文我们将从带宽.事务数量,以及容量这三种存储成本的角度探讨这一问题. 在使用 W ...
- 【Azure 存储服务】.NET7.0 示例代码之上传大文件到Azure Storage Blob
问题描述 在使用Azure的存储服务时候,如果上传的文件大于了100MB, 1GB的情况下,如何上传呢? 问题解答 使用Azure存储服务时,如果要上传文件到Azure Blob,有很多种工具可以实现 ...
- 玩转Windows Azure存储服务——网盘
存储服务是除了计算服务之外最重要的云服务之一.说到云存储,大家可以想到很多产品,例如:AWS S3,Google Drive,百度云盘...而在Windows Azure中,存储服务却是在默默无闻的工 ...
- 【Azure 存储服务】Python模块(azure.cosmosdb.table)直接对表存储(Storage Account Table)做操作示例
什么是表存储 Azure 表存储是一项用于在云中存储结构化 NoSQL 数据的服务,通过无结构化的设计提供键/属性存储. 因为表存储无固定的数据结构要求,因此可以很容易地随着应用程序需求的发展使数据适 ...
- 玩转Windows Azure存储服务——高级存储
在上一篇我们把Windows Azure的存储服务用作网盘,本篇我们继续挖掘Windows Azure的存储服务——高级存储.高级存储自然要比普通存储高大上的,因为高级存储是SSD存储!其吞吐量和IO ...
- 【Azure 存储服务】Java Azure Storage SDK V12使用Endpoint连接Blob Service遇见 The Azure Storage endpoint url is malformed
问题描述 使用Azure Storage Account的共享访问签名(Share Access Signature) 生成的终结点,连接时遇见 The Azure Storage endpoint ...
- 【Azure 存储服务】如何把开启NFS 3.0协议的Azure Blob挂载在Linux VM中呢?(NFS: Network File System 网络文件系统)
问题描述 如何把开启NFS协议的Azure Blob挂载到Linux虚拟机中呢? [答案]:可以使用 NFS 3.0 协议从基于 Linux 的 Azure 虚拟机 (VM) 或在本地运行的 Linu ...
- azure 云服务证书下载方式
打开地址自动下载证书,vs中项目-右键-发布-导入证书. https://manage.windowsazure.cn/publishsettings/index 在 Visual Studio 中打 ...
- 【Azure 存储服务】Hadoop集群中使用ADLS(Azure Data Lake Storage)过程中遇见执行PUT操作报错
问题描述 在Hadoop集中中,使用ADLS 作为数据源,在执行PUT操作(上传文件到ADLS中),遇见 400错误[put: Operation failed: "An HTTP head ...
随机推荐
- 手把手带你开发starter,点对点带你讲解原理
京东物流 孔祥东 _____ _ ____ _ / ____| (_) | _ \ | | | (___ _ __ _ __ _ _ __ __ _| |_) | ___ ___ | |_ \___ ...
- js加减乘除运算出现精度丢失
做乘法运算出现精度丢失 let aa= 2106.49 console.log( aa*10000 ) //21064899.999999996 console.log( Math.round(aa* ...
- Ant Design Vue中Table的选中详解
<template> <a-table :columns="columns" :data-source="data" :row-selecti ...
- Keepalive-Haproxy高可用介绍
假设我们现在开发了一个应用应用的端口号为 8080,这个应用我们想让它去实现一个负载均衡的访问,就是说我们有两台服务器都部署了我们的 8080 应用,我们想让它一会访问 ip 为: 192.168.0 ...
- Win32汇编:字符串浮点数运算过程
整理复习汇编语言的知识点,以前在学习<Intel汇编语言程序设计 - 第五版>时没有很认真的整理笔记,主要因为当时是以学习理解为目的没有整理的很详细,这次是我第三次阅读此书,每一次阅读都会 ...
- 创建Vue项目,报错spawn yarn ENOENT
1. 使用 vue 创建项目的时候,报错 Error: spawn yarn ENOENT 1.1 用户自己设置了默认的包管理 yarn 1.2 没有安装 yarn 解决方式1: 打开 C盘 , 在 ...
- 你天天用4G 这些基本常识都知道吗?
不少朋友在选购4G智能手机的时候,经常可能会遇到这样的名词,五模十三频.五模十七频.双4G.移动4G.联通4G.那这些名词到底是什么意思呢?它们之间又有什么区别呢? 其实上面的这些说法其实都是比较具有 ...
- CF1921F Sum of Progression 题解
题目链接:CF 或者 洛谷 一道经典的类型题,把这种类型的题拿出来单独说一下. 注意到问题中涉及到需要维护 \(a_{x+k\times step}\) 这样的信息,这样的信息很难用树型结构维护,比较 ...
- Python 国内常用python模块下载地址
国内常用python模块下载地址 清华大学:https://pypi.tuna.tsinghua.edu.cn/simple 中国科技大学 https://pypi.mirrors.ustc.edu. ...
- linux统计文件大小-以KB、MB、GB、TB为单位
fileSize=`hadoop fs -ls /data/internetLog/home/DPI/idc/20180806/*201808062[0-2]* | awk 'BEGIN{ sum=0 ...

