Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
Azure AI Search is available through the Azure portal, REST APIs, and Azure SDKs. It also underpins Foundry IQ, the managed knowledge layer that transforms enterprise content into reusable, permission-aware knowledge bases for agents in the Microsoft Foundry portal.
Deploy the search-enabled website to Azure Container Apps by using the Azure Developer CLI (azd). This deployment includes the React client, the .NET API, Azure AI Search, managed identity, and supporting Azure resources.
The deployment uses managed identity as the default authentication method for Azure AI Search. You can opt in to key-based authentication by setting USE_KEYLESS_AUTH to false before deployment.
Sign in to Azure
In Visual Studio Code, open a terminal at the repository root, such as
azure-search-static-web-app.Sign in to Azure by using
azd.azd auth loginIf prompted by your browser, complete the sign-in flow by using the Azure account that you're using for this tutorial.
Create an azd environment
Create an
azdenvironment. ReplaceYOUR-ENVIRONMENT-NAMEwith a short name that identifies this tutorial deployment.azd env new YOUR-ENVIRONMENT-NAME
(Optional) Configure key-based authentication
The default authentication method is managed identity, so most environments can skip this section. Complete this section only if your environment requires API keys.
Set USE_KEYLESS_AUTH to false.
azd env set USE_KEYLESS_AUTH false
If you don't set USE_KEYLESS_AUTH, the deployment uses managed identity. The Bicep infrastructure grants the container app identity access to the Azure AI Search data plane.
Deploy with azd up
From the repository root, run
azd up.azd upWhen prompted, select the Azure subscription and location for the resources.
Wait for
azdto provision the infrastructure, build the containers, push the images, and deploy the services to Azure Container Apps.Review the output after deployment. The output includes the client and server fully qualified domain names (FQDNs) for the Azure Container Apps deployment.
AZURE_CLIENT_URL: <client-container-app-fqdn> AZURE_SERVER_URL: <server-container-app-fqdn> SEARCH_SERVICE_NAME: <search-service-name>Use the
AZURE_CLIENT_URLvalue to open the website. The client app calls the server app through the endpoint configured during deployment.The deployment also created the Azure AI Search service and loaded the
good-booksindex automatically through thepostprovisionhook in the sample repository.
Use search in your Container Apps website
Open the client FQDN from the
azd upoutput in a browser.In the website search bar, enter a search query, such as
code. The autocomplete feature suggests matching book titles.Select a suggestion or continue entering your own query. Select Enter when you finish your search query.
Review the results, and then select a book to see more details.
Troubleshooting
If the web app doesn't deploy or work, use the following list to determine and fix the issue:
Did
azd upcomplete?Review the
azd upoutput for the first failed provisioning, build, or deploy step. If deployment stops during provisioning, check your subscription permissions and the selected region. If deployment stops during the container build or deploy steps, rerunazd upafter you fix the reported issue.Can you open the client endpoint?
Open the
AZURE_CLIENT_URLvalue from theazd upoutput. If the page doesn't load, go to the Azure portal, open the client container app and review its revision status and logs.Can the client call the server endpoint?
Open your browser developer tools and review the network calls from the client app. If calls to the API fail, confirm that the server container app is running and that the client app received the server FQDN during deployment.
Can the server query Azure AI Search?
If searches return errors, review the server container app logs. For managed identity, confirm that the identity has Azure AI Search data-plane access. For key-based authentication, confirm that you set
USE_KEYLESS_AUTHtofalsebefore deployment and that the generated container environment contains the search service configuration.
Clean up resources
Use azd down --purge to delete the Azure resources that this tutorial created. The --purge flag permanently removes resources that support soft-delete, instead of leaving them in a recoverable state for their retention period. Purging avoids naming conflicts if you redeploy this tutorial later.
From the repository root, run the clean-up command.
azd down --purgeReview the resources that
azdlists.Confirm the deletion when prompted.
If you created an Azure AI Search service outside the azd deployment, go to your search service in the Azure portal and select Delete at the top of the page.