简体   繁体   English

IIS托管服务访问Azure队列存储

[英]IIS hosted service accessing Azure Queue storage

We are currently in this inbetween stage of hosting services on a VM in IIS and migrating some of them to Azure. 当前,我们处于将服务托管在IIS中的VM上并将其中一些迁移到Azure的中间阶段。

I have two services, Service A - which inserts items into an Azure Queue Storage and Service B - which is a Console app which uses the Web Job libraries and consumes messages from the Queue. 我有两个服务,服务A-将项目插入到Azure队列存储中,服务B-这是一个控制台应用程序,它使用Web作业库并使用队列中的消息。

As far as I understand the Service B (consumer) must be hosted in Azure and be given access to the Azure Queue, but can Service A (producer) that inserts messages into the Queue be hosted in IIS? 据我了解,服务B(消费者)必须托管在Azure中并有权访问Azure队列,但是将消息插入队列的服务A(生产者)是否可以托管在IIS中? Is that possible? 那可能吗?

I can currently use the local storage emulator to reproduce this behaviour locally, but it's not really something we can use in production. 我目前可以使用本地存储仿真器在本地重现此行为,但是实际上我们不能在生产中使用它。 Ideally I'd like the means to connect to the Queue storage remotely, I'm just not sure if it is possible. 理想情况下,我想要远程连接到Queue存储的方法,但是我不确定是否可以。

The reason why I want to host the Service A in IIS is that it communicates with other IIS hosted services and uses logging to a file, which Azure doesn't support very well and Azure logging would be very different to how we currently monitor/log events. 我之所以要在IIS中托管服务A的原因是,它与其他IIS托管的服务进行通信并使用对文件的日志记录,Azure无法很好地支持该日志,Azure日志记录与我们当前监视/日志记录的方式非常不同事件。

Any app using the Azure Storage SDK can connect to and work with Storage Queues. 使用Azure Storage SDK的任何应用程序都可以连接到存储队列并与之一起使用。 The app could be hosted anywhere; 该应用程序可以托管在任何地方; in Azure App Service, in Azure VM, On-premises VM, in AWS VM, anywhere. 在Azure应用服务,Azure VM,本地VM,AWS VM中的任何位置。

can Service A (producer) that inserts messages into the Queue be hosted in IIS? 可以在IIS中托管将消息插入队列的服务A(生产者)吗?

Like Chris said, any app on the internet can insert messages into the Queue if it knows the Storage value and key, if you do not want to let app knows the Azure Storage key but also want to insert messages, please consider use SAS , this is another story. 就像Chris所说的那样,互联网上的任何应用程序都可以在知道存储值和密钥的情况下将消息插入到Queue中,如果您不想让应用程序知道Azure存储键但也想插入消息,请考虑使用SAS ,是另一个故事。 Anyway, please do not worry about this. 无论如何,请不要为此担心。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM