So I have this method
public async System.Threading.Tasks.Task<HttpResponseMessage>
EmbedBIReport(string reportId)
And once it has gone off and done various async calls, such as
var authenticationAccessToken =
await _wrapperPowerBi.AuthenticationAccessToken(LookupValues.PbiResourceUrl,
LookupValues.PbiClientId, credential)
.ConfigureAwait(false);
it builds a response, like this
var embedConfig = new EmbedConfigModel
{
EmbedToken = tokenResponse,
EmbedUrl = report.EmbedUrl,
Id = report.Id
};
var responseMessage = new ApiResponseMessageModel(
(int)BaseApiResponseCodeEnum.Ok,
LookupValues.PbiSuccessMessage);
var response = _responseBuilder.BuidPowerBiResponse(
Request,
RequestId.Get,
HttpStatusCode.OK,
new List<ApiResponseMessageModel> { responseMessage },
embedConfig);
Debug writes confirm that it gets to this point, successfully building the response.
So far, so good.
Finally, we have
return response;
And this is where it gets weird...
Initially, it wasn't working at all when deployed to the Azure test environment. When I put .ConfigureAwait(false) on the end of every await, things were a lot better. But it doesn't actually return the response at the end, and the call times out.
Locally, obviously, it all works wonderfully (it wouldn't have been deplyed if it didn't!).
Does anyone have any suggestions as to what on Earth is going wrong?