Use Azure AI Document Intelligence

Completed

In this exercise, you can see Azure AI Document Intelligence in action by deploying a Document Intelligence resource and an application – just by copying and pasting one Azure CLI command.

To start, you need to activate the Sandbox – just select the Activate sandbox button and sign in, no payment or Azure subscription required. Despite having full administrative access to the website and Azure resources, the resources in this exercise are created on Microsoft's subscription, so they don't cost you anything. After you accept the required permissions, return to this page to get started.

Choose your learning experience

You can treat this exercise as a demo, just to see what you can do with Document Intelligence. However, you fully control these resources, so if you're interested in checking out the technical details, you can choose to dive deeper. Browse the code in GitHub, check out the resources in the Azure portal, or even use Visual Studio remote debugging to step through the process.

For more guided hands-on learning about Document Intelligence, we have more Learn modules for you to check out. After that, you can always come back here to apply what you learn in the free sandbox.

Deploy Document Intelligence

To create the Document Intelligence resource and deploy the application, complete the following steps:

  1. Once the Cloud Shell is loaded and shows a prompt, copy the following command and paste it into the Cloud Shell. Just select Copy, right-click, and then paste the command into the Cloud shell.

    Run the following command in the Cloud Shell:

    curl -s https://raw.githubusercontent.com/MicrosoftDocs/mslearn-intro-to-form-recognizer/main/scripts/deploy-in-sandbox.sh | bash 
    
  2. Wait several minutes for the command to run. You can finish reading this page and navigate to other pages within this module - it doesn't affect the running script.

  3. Select the link to the URL displayed at the bottom of the shell. The web app opens and lets you use Document Intelligence. You can also cut and paste the URL from here, but remember, it doesn't work until the script finishes running: https://fr-[sandboxName].azurewebsites.net

After you run the code, you can play around with Document Intelligence at your own pace.

Optional: Browse or clone the code in GitHub

The source code for this entire demo is fully available to the public on GitHub. Browse it, use it to debug the demo app, or ignore it entirely.

You can visit the GitHub repository here.

An example of a good place to start browsing is where we use the SDK to call the service:

public async Task<RecognizedForm> Analyze(Uri invoiceUri)
{
    RecognizeInvoicesOperation operation = await GetClient().StartRecognizeInvoicesFromUriAsync(invoiceUri, OperationOptions);
    Response<RecognizedFormCollection> operationResponse = await operation.WaitForCompletionAsync();
    RecognizedFormCollection invoices = operationResponse.Value;

    return ProcessResults(invoices);
}

Notice that we use a convenience method specifically for Invoice since it's one of the built-in form types.

Optional: Review the resource in the CLI or Azure portal

You can look at the resource created in the Azure portal.

Or if you prefer a command-line experience, you can use the Cloud Shell again to browse. You could start by listing the Azure AI services resources (there should only be one):

az cognitiveservices account list