miniature-leather-70472
04/13/2021, 10:21 AMvar token = await Pulumi.AzureNative.Authorization.GetClientToken.InvokeAsync();
I don't get any error, it just does not proceed past this line in my async method. Any ideas why, or what I can do to try and find the issue?
I am calling this async method from the main Pulumi code using getawaiter, so my understanding is that it should wait.tall-librarian-49374
04/13/2021, 10:30 AMI am calling this async method from the main Pulumi code using getawaiter,GetAwaiter doesn’t block on its own. Could you show your code?
miniature-leather-70472
04/13/2021, 10:35 AMstatic async Task<string> SetIpGroupIp(string ipGroupId, string ip)
{
var ipGroupResourceGroup = ipGroupId.Split("/")[4];
var ipGroupName = ipGroupId.Split("/")[8];
var token = await Pulumi.AzureNative.Authorization.GetClientToken.InvokeAsync();
var networkClient =
new NetworkManagementClient(new TokenCredentials(new StringTokenProvider(token.Token, "Bearer")))
{
SubscriptionId = ipGroupId.Split("/")[2]
};
var ipGroup = (await networkClient.IpGroups.GetWithHttpMessagesAsync(ipGroupResourceGroup, ipGroupName))
.Body;
Log.Warn(ipGroup.IpAddresses[0]);
if (!ipGroup.IpAddresses.Contains(ip))
{
ipGroup.IpAddresses.Add(ip);
await networkClient.IpGroups.CreateOrUpdateWithHttpMessagesAsync(ipGroupResourceGroup, ipGroupName,
ipGroup);
}
return ip;
}
if (!Pulumi.Deployment.Instance.IsDryRun)
{
aksIp.Apply(ip =>
{
var aksip = SetIpGroupIp(config.Require("AKSIpGroup"), ip).GetAwaiter().GetResult();
return aksip;
});
}
tall-librarian-49374
04/13/2021, 10:37 AMApply
as a stack output?miniature-leather-70472
04/13/2021, 11:01 AM