pulumi / pulumi-azure-native

Azure Native Provider
Apache License 2.0
126 stars 34 forks source link

Pulumi.AzureNative.ApiManagement.Api fails on 502 when trying to fetch swagger docs #2542

Closed viktorliljequist closed 11 months ago

danielrbradley commented 1 year ago

Hi @viktorliljequist thanks for getting in contact.

To make sure I'm understanding this correctly ..

  1. You've got a service deployed at https://ProductPdfService.elkds-dev-elkjop.com
  2. This service should provide a swagger document at the path /swagger/v1/swagger.json
  3. You pass this path to the ApiManagement.Api Value property.
  4. When deploying the Api resource Azure returns an error that it's unable to load the swagger specification because it recieved a 502 response when requesting https://ProductPdfService.elkds-dev-elkjop.com/swagger/v1/swagger.json

Does that summarise the issue you're seeing?

viktorliljequist commented 1 year ago

Correct. Rerunning the release works and sometimes it works on the first try.

danielrbradley commented 1 year ago

Ok. This sounds more like an issue with the internals of Azure rather than a provider issue then. It might be worth raising a support request with Azure as to why the service returns a 502 error for the schema for a while after creation. Please do let us know how Azure responds as this might help others hitting a similar issue.

As a temporary workaround you could use an async wait (e.g. using await Task.Delay(1000)) during an Apply (e.g. on the Value property) to delay the creation of the Api enough for Azure to have finished initializing the service.

viktorliljequist commented 11 months ago

Thanks we have found that the issue is on our side