azure-search-openai-demo icon indicating copy to clipboard operation
azure-search-openai-demo copied to clipboard

Update prepdocs hook to use AzureDeveloperCliCredential

Open vhvb1989 opened this issue 1 year ago • 0 comments

The prepdocs hook uses DefaultAzureCredential, which might incorrectly use another source of auth for Azure. For example, DAC might use an environment credential that is set within the system, or the default account set for the Azure CLI, if az was previously login.

This change makes sure that the hook uses the same auth that was used when provisioning the template, by calling azd for an auth token.

The TenantId is important to support accounts with access to multiple tenants, as azd would return home-tenant if no tenant id is provided.

vhvb1989 avatar Mar 13 '23 19:03 vhvb1989