添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I have one Azure function app and I am trying to run that locally but getting the below error. I have the storage emulator up and running. My 10000 port is busy to do something so I changed the port of emulator from AzureStorageEmulator.exe.config file and started with admin mood. it started successfully.

My storage emulator is running on 12000,12001, 12002 respectively for blob, queue, table.

Local host file is like below,

"IsEncrypted": false, "Values": { "AzureWebJobsStorage": "UseDevelopmentStorage=true", "FUNCTIONS_WORKER_RUNTIME": "dotnet"

Getting the below error at runtime. Can you pls guide me how the issue can be solved to run the function app locally? I am not sure why the listener is trying to find 10000 if I run locally from Visual Studio 2022

The listener for function 'ABCFunction' was unable to start. Azure.Core: Retry failed after 6 tries. Retry settings can be adjusted in ClientOptions.Retry. (No connection could be made because the target machine actively refused it. (127.0.0.1:10000)) (No connection could be made because the target machine actively refused it. (127.0.0.1:10000)) (No connection could be made because the target machine actively refused it. (127.0.0.1:10000)) (No connection could be made because the target machine actively refused it. (127.0.0.1:10000)) (No connection could be made because the target machine actively refused it. (127.0.0.1:10000)) (No connection could be made because the target machine actively refused it. (127.0.0.1:10000)). Azure.Core: No connection could be made because the target machine actively refused it. (127.0.0.1:10000). System.Net.Http: No connection could be made because the target machine actively refused it.

@Souvik Sardar By default, the storage emulator services should be running on the below port as mentioned here . It looks like the below port might not be available and the storage services used a different port or the ports were changed manually.

  • Blob service: http://127.0.0.1:10000/
  • Queue service: http://127.0.0.1:10001/
  • Table service: http://127.0.0.1:10002/
  • I will suggest you to navigate to the C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator directory (i.e the directory where your emulator is installed) and open the AzureStorageEmulator.exe.config file and update the ports to the default port as the function try to find the storage emulator services in the default IP and port.

     <services>  
          <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/"/>  
     </services>  
    

    You can also use the below command to verify which service is using port 10001. Similarly, you can verify for other ports 10001 and 10002.

    netstat -p tcp -ano | findstr :10001  
    

    Update:

    In case someone is not able to kill the system process. The alternative would be specifying the below connection in your local.settings.json for every function that you will be running locally. You can modify the ports as per your need i.e. the ports where your storage service is running. The same is documented here on how you can use the other value instead of UseDevelopmentStorage=true

    "AzureWebJobsStorage": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:20000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:20001/devstoreaccount1;TableEndpoint=http://127.0.0.1:20002/devstoreaccount1;",    
    												

    @MayankBargali-MSFT Thank you for your response.

    If I change port details in config file and try to start the emulator is shows port conflict error.

    I was trying to see the PID for the port 10000 using netstat -p tcp -ano | findstr :10000 where I am getting PID as 4. I was trying to kill the process using taskkill /PID 4 /F here I am getting 'access denied' error because that is used by system.

    I am not understanding how to make 10000 port free. can you pls guide further?

    Initially

    @Souvik Sardar You will not able to kill the system process. The alternative would be specifying the below connection in your local.settings.json for every function that you will be running locally. You can modify the ports as per your need i.e. the ports where your storage service is running. The same is documented here on how you can use the other value instead of UseDevelopmentStorage=true

    "AzureWebJobsStorage": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:20000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:20001/devstoreaccount1;TableEndpoint=http://127.0.0.1:20002/devstoreaccount1;",    
    

    Let me know if you need any assistance.