This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.25k
stars
4.6k
forks
source link
[QUERY] How to track ACS phone number purchase operation asynchronously #45256
It's straightforward and works well when I await the purchase operation immediately. But unfortunately, it could take more than 2 minutes to purchase the number (at least time to time).
I would like to introduce an async operation here. So once purchase starting, I want to get the operation information and time to time check the status of that operation until it's completed. It seems like the PurchasePhoneNumbersOperation has all that I need for it the Idand HasCompleted properties. Also looks like the operation has Rehydration token,
But how I can construct PurchasePhoneNumbersOperation fromId or Rehydration token programmatically via sdk? I see there is a RehidrateAsync method where HttpPipline expected. This is where I stuck.
The other way is to start purchase operation and periodical get purchased numbers using GetPurchasedPhoneNumbersAsync which is looks not that good and probably not that reliable.
Library name and version
Azure.Communication.PhoneNumbers 1.1.0
Query/Question
I follow [this guide] (https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.PhoneNumbers/samples/Sample_PhoneNumbersClientAsync.md) to purchase phone number in ACS via SDK.
It's straightforward and works well when I await the purchase operation immediately. But unfortunately, it could take more than 2 minutes to purchase the number (at least time to time).
I would like to introduce an async operation here. So once purchase starting, I want to get the operation information and time to time check the status of that operation until it's completed. It seems like the
PurchasePhoneNumbersOperation
has all that I need for it theId
andHasCompleted
properties. Also looks like the operation hasRehydration
token,But how I can construct
PurchasePhoneNumbersOperation
fromId
orRehydration
token programmatically via sdk? I see there is aRehidrateAsync
method whereHttpPipline
expected. This is where I stuck.The other way is to start purchase operation and periodical get purchased numbers using
GetPurchasedPhoneNumbersAsync
which is looks not that good and probably not that reliable.Environment
No response