Azure / azure-sdk-for-net

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

Open alexanderbikk opened 1 month ago

alexanderbikk commented 1 month ago

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 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.

Environment

No response

github-actions[bot] commented 1 month ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @acsdevx-msft.