Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update prepdocs hook to use AzureDeveloperCliCredential #10

Merged
merged 6 commits into from
Mar 17, 2023

Conversation

vhvb1989
Copy link
Contributor

@vhvb1989 vhvb1989 commented Mar 13, 2023

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.

fix: #7

@vhvb1989 vhvb1989 marked this pull request as draft March 13, 2023 20:47
@vhvb1989 vhvb1989 marked this pull request as ready for review March 14, 2023 02:40
infra/main.bicep Outdated Show resolved Hide resolved
@jongio jongio merged commit 1403bf4 into Azure-Samples:dev Mar 17, 2023
dantelmomsft added a commit to dantelmomsft/azure-search-openai-demo-java that referenced this pull request Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DefaultAzureCredential failed to retrieve a token from the included credentials
2 participants