Skip to content

Commit

Permalink
Merge pull request #151 from microsoft/dlevy-msft-patch-2
Browse files Browse the repository at this point in the history
Add note on CLI authentication
  • Loading branch information
dlevy-msft authored Sep 1, 2023
2 parents 2c72afb + d611ee3 commit 80cf4b6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@ For further information on usage:
Azure Active Directory authentication uses temporary authentication tokens to authenticate.
The `mssql` package does not provide an implementation to obtain tokens: instead, import the `azuread` package and use driver name `azuresql`. This driver uses [azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#section-readme) to acquire tokens using a variety of credential types.

To reduce friction in local development, `ActiveDirectoryDefault` can authenticate as the user signed into the Azure CLI.

Run the following command to sign into the Azure CLI before running your application using the `ActiveDirectoryDefault` connection string parameter:

```azurecli
az login
```

Azure CLI authentication isn't recommended for applications running in Azure. More details are available via the [Azure authentication with the Azure Identity module for Go](https://learn.microsoft.com/en-us/azure/developer/go/azure-sdk-authentication) tutorial.
The credential type is determined by the new `fedauth` connection string parameter.
* `fedauth=ActiveDirectoryServicePrincipal` or `fedauth=ActiveDirectoryApplication` - authenticates using an Azure Active Directory application client ID and client secret or certificate. Implemented using [ClientSecretCredential or CertificateCredential](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/azidentity#authenticating-service-principals)
Expand Down

0 comments on commit 80cf4b6

Please sign in to comment.