GUIDs generated by WireMock.NET differ between instances when deployed to Azure with multiple instances. #593

Closed
opened 2025-12-29 15:27:52 +01:00 by adam · 6 comments
Owner

Originally created by @fenildesai on GitHub (May 2, 2024).

Originally assigned to: @StefH on GitHub.

Describe the bug

When deploying an application using WireMock.NET to Azure with multiple instances, we've observed that the GUIDs generated by WireMock.NET differ between instances. This inconsistency leads to requests not matching the expected stub mappings, resulting in unexpected behavior such as 404 errors.

Expected behavior:

We expect WireMock.NET to generate consistent GUIDs for stub mappings across all instances, ensuring that requests are properly matched to the appropriate stub responses regardless of the instance handling the request.

Test to reproduce

  1. Deploy an application using WireMock.NET to Azure with multiple instances.
  2. Send requests to the deployed application.
  3. Observe that the GUIDs generated by WireMock.NET differ between instances.
  4. Notice that requests do not match the expected stub mappings, leading to 404 errors.

We have session affinity enabled in the Azure App Service configuration to ensure that requests from the same client are consistently routed to the same instance.

Originally created by @fenildesai on GitHub (May 2, 2024). Originally assigned to: @StefH on GitHub. ### Describe the bug When deploying an application using WireMock.NET to Azure with multiple instances, we've observed that the GUIDs generated by WireMock.NET differ between instances. This inconsistency leads to requests not matching the expected stub mappings, resulting in unexpected behavior such as 404 errors. ### Expected behavior: We expect WireMock.NET to generate consistent GUIDs for stub mappings across all instances, ensuring that requests are properly matched to the appropriate stub responses regardless of the instance handling the request. ### Test to reproduce 1. Deploy an application using WireMock.NET to Azure with multiple instances. 2. Send requests to the deployed application. 3. Observe that the GUIDs generated by WireMock.NET differ between instances. 4. Notice that requests do not match the expected stub mappings, leading to 404 errors. ### Other related info We have session affinity enabled in the Azure App Service configuration to ensure that requests from the same client are consistently routed to the same instance.
adam added the question label 2025-12-29 15:27:52 +01:00
adam closed this issue 2025-12-29 15:27:52 +01:00
Author
Owner

@StefH commented on GitHub (May 3, 2024):

Note that each WireMock.Net instance saves the mappings in memory from that instance. And if a GUID is generated by WireMock.Net, it's just a random GUID.

However I'm not sure I understand why you have issues with GUIDs? Do you run WireMock.Net in proxy mode or in normal mode?

Because when adding stub-mappings via C# code, mapping file or admin interface, you can provide a guid. If the guid is not provided, a random guid is used.

@StefH commented on GitHub (May 3, 2024): Note that each WireMock.Net instance saves the mappings in memory from that instance. And if a GUID is generated by WireMock.Net, it's just a random GUID. However I'm not sure I understand why you have issues with GUIDs? Do you run WireMock.Net in proxy mode or in normal mode? Because when adding stub-mappings via C# code, mapping file or admin interface, you can provide a guid. If the guid is not provided, a random guid is used.
Author
Owner

@StefH commented on GitHub (May 9, 2024):

@fenildesai
Is my explanation clear?

@StefH commented on GitHub (May 9, 2024): @fenildesai Is my explanation clear?
Author
Owner

@StefH commented on GitHub (May 22, 2024):

@fenildesai
Is my explanation clear?

@StefH commented on GitHub (May 22, 2024): @fenildesai Is my explanation clear?
Author
Owner

@StefH commented on GitHub (Jun 13, 2024):

@fenildesai
Is my explanation clear?

@StefH commented on GitHub (Jun 13, 2024): @fenildesai Is my explanation clear?
Author
Owner

@StefH commented on GitHub (Jun 29, 2024):

@fenildesai
Is my explanation clear?

@StefH commented on GitHub (Jun 29, 2024): @fenildesai Is my explanation clear?
Author
Owner

@StefH commented on GitHub (Jul 27, 2024):

Closing...

@StefH commented on GitHub (Jul 27, 2024): Closing...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#593