Thanks for reaching out.
Yes, it is possible to use the web app for the DefaultAzureCredential to authenticate and allow creating of keys, secrets, and certificates. The DefaultAzureCredential
class supports multiple authentication methods and determines which method should be used at runtime.
- Environment - The
DefaultAzureCredential
will read account information specified via environment variables and use it to authenticate.
- For
Environment
, we need to set theAzure
-ClientID
,Client Secret
andTenantID
in the Visual Studio localEnvironment Variables
.
- Managed Identity - If the application is deployed to an Azure host with Managed Identity enabled, the
DefaultAzureCredential
will authenticate with that account. To useManaged Identity
the Application has to be deployed in Azure App Service. Reference -https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/keyvault/Azure.Security.KeyVault.Keys/README.md Alternatively, to authenticate using the web app, you can use theInteractiveBrowserCredential
class provided by the Azure Identity client library. This class allows users to authenticate with Microsoft Entra ID interactively through a web browser. Similar issue - https://stackoverflow.com/questions/69810410/how-to-give-credentials-defaultazurecredential-to-azure-c-sharp-secretclient
Thanks,
Shweta
Please remember to "Accept Answer" if answer helped you.