简体   繁体   English

Azure Durable Function - 更改 Azure 存储模拟器的端口

[英]Azure Durable Function - Change the port for Azure Storage Emulator

I was revising some concepts on Azure Durable function to become ready for a new project and facing an issues with Azure Storage emulator.我正在修改有关 Azure Durable 功能的一些概念,以便为新项目做好准备,并面临 Azure 存储模拟器的问题。 The azure storage emulator uses the following ports: Azure 存储模拟器使用以下端口:

<service name="Blob" url="http://127.0.0.1:10000/"/>
<service name="Queue" url="http://127.0.0.1:10001/"/>
<service name="Table" url="http://127.0.0.1:10002/"/>

The problem is that I cant use 10000-10002 because some other services are already running and I cant control it as they are controlled by admins.问题是我不能使用 10000-10002,因为其他一些服务已经在运行,我无法控制它,因为它们由管理员控制。 I was able to change the ports in AzureStorageEmulator.exe.config我能够更改 AzureStorageEmulator.exe.config 中的端口

<service name="Blob" url="http://127.0.0.1:10003/"/>
<service name="Queue" url="http://127.0.0.1:10004/"/>
<service name="Table" url="http://127.0.0.1:10005/"/>

The problem I face now is that my durable function still looks at 10000-10002 and fails.我现在面临的问题是,我的持久函数仍然在 10000-10002 处查找并失败。 How can I change the ports for storage account emulator for my durable function.如何为我的持久功能更改存储帐户模拟器的端口。

You should be able to change the Storage connection string that you use locally to this form:您应该能够将本地使用的存储连接字符串更改为以下形式:

DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;

In there you can define the port numbers.在那里你可以定义端口号。 The account name and key should work as those are the default ones for the emulator.帐户名和密钥应该有效,因为它们是模拟器的默认值。 Documentation: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio#connection-strings文档: https ://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio#connection-strings

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

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