简体   繁体   中英

Azure Form Recognizer Billing

I have.Net 6 API deployed on Azure with one method Recognize. This method calls Azure Form Recognizer endpoint with invoice PDF and its returning structured object. With this object, I do something on API and return the result to customer. The Form Recognizer is listed under my Subscription in Azure. The fee for one call of Form Recognizer is a small amount. I need this: The customer (with his own subscription in Azure) calls my API with an OAuth token. The API calls Form Recognizer and I need the fee to be charged to the customer's subscription.

Is it possible? Thanks

It is not mandatory that the azure form recognizer service resource can be used within subscription. It can be accessed with endpoint and key secret (Regardless of subscription) from SDK.

You can use SDKs to access the form recognizer service resource. You can analyze files with form recognizer resource in customer's subscription from your API logic from API resource in your subscription. Learn more about Form Recognizer SDK: Use Form Recognizer SDKs or REST API

I didnt find a way to pass customers subsription id to form recognizer throught Form Recognizer SDK. My authentication looks like this:

AzureKeyCredential credential = new AzureKeyCredential(key);
DocumentAnalysisClient client = new DocumentAnalysisClient(new Uri(endpoint), credential);

AnalyzeDocumentOperation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, modelId, fileStream);

Where key and the endpoint is from Form recognizer Keys and Endpoint :

在此处输入图像描述

When I tried to past Subsription ID as Key it ended in error

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM