Skip to content

Commit ad4d73f

Browse files
Update README.md
1 parent 25c2163 commit ad4d73f

1 file changed

Lines changed: 22 additions & 21 deletions

File tree

  • samples/features/security/azure-active-directory-auth/token

samples/features/security/azure-active-directory-auth/token/README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,40 @@
88

99
## About this sample
1010

11-
The Token project contains a simple console application that connects to Azure SQL database using a self-signed certificate.
11+
The Token project contains a simple console application that connects to Azure SQL Database using a self-signed certificate.
1212

1313
**Software prerequisites:**
1414

1515
1. The `makecert.exe` utility, which is included in the Windows SDK
1616
+ It is sometimes included in Visual Studio installations (depending on the selections made during installation). A search of your machine for `makecert.exe` would provide verification that the Windows SDK was installed.
17-
+ If the Windows SDK was not installed, you may [download it here](http://msdn.microsoft.com/en-US/windows/desktop/aa904949)
17+
+ If the Windows SDK was not installed, you may [download it here](https://learn.microsoft.com/windows/apps/windows-app-sdk/downloads)
1818
+ You can learn more about the `makecert.exe` [utility here](https://msdn.microsoft.com/library/windows/desktop/aa386968.aspx)
1919
2. PowerShell with Azure Active Directory Module
20-
+ To download the latest PowerShell version [see this page](https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/#Install)
21-
+ [Install the Azure AD PowerShell Module](https://msdn.microsoft.com/en-us/library/azure/jj151815.aspx), if it is not already installed in your client machine.
20+
+ To download the latest PowerShell version [see this page](https://azure.microsoft.com/documentation/articles/powershell-install-configure/#Install)
21+
+ [Install the Microsoft Entra ID PowerShell Module](https://msdn.microsoft.com/en-us/library/azure/jj151815.aspx), if it is not already installed in your client machine.
2222

2323
<a name=run-this-sample></a>
2424
## Run this sample
2525

26-
1. Create an application account in Azure AD for your service.
26+
1. Create an application account in Microsoft Entra ID for your service.
2727
- Sign in to the Azure management portal.
2828
- Click on Azure Active Directory in the left hand navigation
2929
- Click the directory tenant where you wish to register the sample application. This must be the same directory that is associated with your database (the server hosting your database).
3030
- Click the Applications tab
3131
- In the drawer, click Add.
3232
- Click "Add an application my organization is developing".
3333
- Enter mytokentest as a friendly name for the application, select "Web Application and/or Web API", and click next.
34-
- Assuming this application is a daemon/service and not a web application, it doesn't have a sign-in URL or app ID URI. For these two fields, enter http://mytokentest
35-
- While still in the Azure portal, click the Configure tab of your application.
36-
- Find the Client ID value and copy it into a text editor, you will need this later when configuring your application ( i.e. a4bbfe26-dbaa-4fec-8ef5-223d229f647d /see the snapshot below/)
37-
![active directory portal Client ID image](/samples/features/security/azure-active-directory-auth/img/azure-active-directory-application-portal.png)
34+
- Assuming this application is a daemon/service and not a web application, it doesn't have a sign-in URL or app ID URI. For these two fields, enter `http://mytokentest`
35+
- While still in the Azure portal, select Configure in your application.
36+
- Find the Client ID value and copy it into a text editor, you will need this later when configuring your application
3837

39-
2. Logon to your Azure SQL Server’s user database as an Azure AD admin and using a T-SQL command provision a contained database user for your application principal:
38+
![active directory portal Client ID image](../img/azure-active-directory-application-portal.png)
39+
40+
2. Logon to your Azure SQL Server’s user database as an Microsoft Entra ID admin and using a T-SQL command provision a contained database user for your application principal:
4041
```sql
4142
CREATE USER [mytokentest] FROM EXTERNAL PROVIDER
4243
```
43-
- [See this link](https://azure.microsoft.com/en-us/documentation/articles/sql-database-aad-authentication/) for more details on how to create an Azure Ad admin and a contained database user.
44+
- [See this link](https://azure.microsoft.com/documentation/articles/sql-database-aad-authentication/) for more details on how to create an Microsoft Entra ID admin and a contained database user.
4445

4546
3. On the machine you are going to run the project on, generate and install a self-signed certificate.
4647
- To complete this step, you will need to use `Makecert.exe`
@@ -53,10 +54,10 @@ The Token project contains a simple console application that connects to Azure S
5354
```
5455
c:/"Program Files (x86)/Windows Kits/8.1/bin/x64"/makecert -r -pe -n "CN=mytokentestCert" -ss My -len 2048 mytokentestCert.cer
5556
```
56-
4. Add the certificate as a key for the application you created in Azure AD.
57-
- Click the Microsoft Azure Active Directory Module for Windows PowerShell shortcut on desktop to open a Windows PowerShell workspace that has the Azure AD cmdlets.
57+
4. Add the certificate as a key for the application you created in Microsoft Entra ID.
58+
- Click the Microsoft Azure Active Directory Module for Windows PowerShell shortcut on desktop to open a Windows PowerShell workspace that has the Microsoft Entra ID cmdlets.
5859
- Copy the following code snippet to a text editor.
59-
- `connect-msolservice` will ask for you Azure AD credentials. Please be sure to use credentials that are part of Azure AD global admin to connect and to proceed with the scripts below.
60+
- `connect-msolservice` will ask for you Microsoft Entra ID credentials. Please be sure to use credentials that are part of Microsoft Entra ID global admin to connect and to proceed with the scripts below.
6061
```
6162
connect-msolservice
6263

@@ -74,23 +75,23 @@ The Token project contains a simple console application that connects to Azure S
7475

7576
5. Configure the certificate and your application account in the *app.config* file in the project.
7677
+ In Visual Studio, open *app.config* in the Solution Explorer
77-
![App.config file highlights](/samples/features/security/azure-active-directory-auth/img/app-config-key-value-example.png)
78+
![App.config file highlights](../img/app-config-key-value-example.png)
7879
- Find the app key `ida:Tenant` and replace the value with your AAD tenant name (your AAD domain)
7980
- Find the app key `ida:ClientID` and replace the value with the Client ID for the application registration from the Azure Portal (the value from step 1).
8081
- Find the app key `ida:Cert_Name` and replace the value with the subject name (CN) of the self-signed certificate you created
8182
- For example:
8283
```csharp
83-
<add key="ida:Tenant" value="cqclinic.onmicrosoft.com" /> //this is the AAD domain
84-
<add key="ida:ClientId" value="a4bbfe26-dbaa-4fec-8ef5-223d229f647d"/> //this is the Client ID
84+
<add key="ida:Tenant" value="<tenant name>" /> //this is the domain
85+
<add key="ida:ClientId" value="<client id>"/> //this is the Client ID
8586
<add key="ida:CertName" value="CN=mytokentestCert"/> //this is the Cert_name use by makecert.exe
8687
```
8788
+ In Visual Studio, open *Program.cs* in the Solution Explorer
88-
![Program.cs field highlights](/samples/features/security/azure-active-directory-auth/img/program-cs-builder-highlight.png)
89+
![Program.cs field highlights](../img/program-cs-builder-highlight.png)
8990
- Make the following changes:
9091
```csharp
91-
builder["Data Source"] = "aad-managed-demo.database.windows.net"; // replace with your server name
92+
builder["Data Source"] = "<servername>.database.windows.net"; // replace with your server name
9293
builder["Initial Catalog"] = "demo"; // replace with your database name
9394
```
94-
6. Run the demo. (Click *Run* or press *F5*)
95+
6. Run the demo. (Select *Run* or press *F5*)
9596
+ A successful authorization should result in a message that states "Connected to the database" similar to the following:
96-
![succesful auth](/samples/features/security/azure-active-directory-auth/img/token-press-any-key-to-stop.png)
97+
![succesful auth](../img/token-press-any-key-to-stop.png)

0 commit comments

Comments
 (0)