Skip to content

Commit 40ff65e

Browse files
authored
Merge pull request #298912 from Lucky-Wang16/0427-Update_M365_SP_cert
Update Microsoft 365 Service Principal cert auth
2 parents d5d2345 + 976838c commit 40ff65e

File tree

5 files changed

+58
-3
lines changed

5 files changed

+58
-3
lines changed

articles/data-factory/connector-office-365.md

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: jianleishen
66
ms.subservice: data-movement
77
ms.custom: synapse
88
ms.topic: conceptual
9-
ms.date: 10/29/2024
9+
ms.date: 04/27/2025
1010
ms.author: jianleishen
1111
---
1212
# Copy from Microsoft 365 (Office 365) into Azure using Azure Data Factory or Synapse Analytics
@@ -111,15 +111,21 @@ The following properties are supported for Microsoft 365 (Office 365) linked ser
111111
| office365TenantId | Azure tenant ID to which the Microsoft 365 (Office 365) account belongs. | Yes |
112112
| servicePrincipalTenantId | Specify the tenant information under which your Microsoft Entra web application resides. | Yes |
113113
| servicePrincipalId | Specify the application's client ID. | Yes |
114-
| servicePrincipalKey | Specify the application's key. Mark this field as a SecureString to store it securely. | Yes |
114+
| servicePrincipalCredentialType | Specify the credential type to use for service principal authentication. Allowed values are `ServicePrincipalKey` and `ServicePrincipalCert`. | No |
115+
| ***For ServicePrincipalKey*** | | |
116+
| servicePrincipalKey | Specify the application's key. Mark this field as a **SecureString** to store it securely, or [reference a secret stored in Azure Key Vault](store-credentials-in-key-vault.md). | No (Required when `servicePrincipalCredentialType` is `ServicePrincipalKey`) |
117+
| ***For ServicePrincipalCert*** | | |
118+
| servicePrincipalEmbeddedCert | Specify the base64 encoded certificate of your application registered in Azure Active Directory. Mark this field as a **SecureString** to store it securely, or [reference a secret stored in Azure Key Vault](store-credentials-in-key-vault.md). Go to this [section](#save-the-service-principal-certificate-in-azure-key-vault) to learn how to save the certificate in Azure Key Vault. | No (Required when `servicePrincipalCredentialType` is `ServicePrincipalCert`) |
119+
| servicePrincipalEmbeddedCertPassword | Specify the password of your certificate if your certificate has a password and you are using AadServicePrincipal authentication. Mark this field as a **SecureString** to store it securely, or [reference a secret stored in Azure Key Vault](store-credentials-in-key-vault.md). | No |
120+
| | | |
115121
| connectVia | The Integration Runtime to be used to connect to the data store. If not specified, it uses the default Azure Integration Runtime. | No |
116122

117123
>[!NOTE]
118124
> The difference between **office365TenantId** and **servicePrincipalTenantId** and the corresponding value to provide:
119125
>- If you're an enterprise developer developing an application against Microsoft 365 (Office 365) data for your own organization's usage, then you should supply the same tenant ID for both properties, which is your organization's Microsoft Entra tenant ID.
120126
>- If you're an ISV developer developing an application for your customers, then office365TenantId will be your customer's (application installer) Microsoft Entra tenant ID and servicePrincipalTenantId will be your company's Microsoft Entra tenant ID.
121127
122-
**Example:**
128+
**Example 1: Using service principal key authentication**
123129

124130
```json
125131
{
@@ -129,16 +135,65 @@ The following properties are supported for Microsoft 365 (Office 365) linked ser
129135
"typeProperties": {
130136
"office365TenantId": "<Microsoft 365 (Office 365) tenant id>",
131137
"servicePrincipalTenantId": "<AAD app service principal tenant id>",
138+
"servicePrincipalCredentialType": "ServicePrincipalKey",
132139
"servicePrincipalId": "<AAD app service principal id>",
133140
"servicePrincipalKey": {
134141
"type": "SecureString",
135142
"value": "<AAD app service principal key>"
136143
}
144+
},
145+
"connectVia": {
146+
"referenceName": "<name of Integration Runtime>",
147+
"type": "IntegrationRuntimeReference"
148+
}
149+
}
150+
}
151+
```
152+
153+
**Example 2: Using service principal certificate authentication**
154+
155+
```json
156+
{
157+
"name": "Office365LinkedService",
158+
"properties": {
159+
"type": "Office365",
160+
"typeProperties": {
161+
"office365TenantId": "<Microsoft 365 (Office 365) tenant id>",
162+
"servicePrincipalTenantId": "<AAD app service principal tenant id>",
163+
"servicePrincipalCredentialType": "ServicePrincipalCert",
164+
"servicePrincipalId": "<AAD app service principal id>",
165+
"servicePrincipalEmbeddedCert": "<AAD app service principal cert in base64>",
166+
"servicePrincipalEmbeddedCertPassword": "<AAD app service principal cert password>"
167+
},
168+
"connectVia": {
169+
"referenceName": "<name of Integration Runtime>",
170+
"type": "IntegrationRuntimeReference"
137171
}
138172
}
139173
}
140174
```
141175

176+
#### Save the service principal certificate in Azure Key Vault
177+
178+
You have two options to save the service principal certificate in Azure Key Vault:
179+
180+
- **Option 1**
181+
182+
1. Convert the service principal certificate to a base64 string. Learn more from this [article](https://blog.tekspace.io/convert-certificate-from-pfx-to-base64-with-powershell/).
183+
184+
185+
2. Save the base64 string as a secret in Azure Key Vault.
186+
187+
:::image type="content" source="media/connector-office-365/secrets.png" alt-text="Screenshot of secrets.":::
188+
189+
:::image type="content" source="media/connector-office-365/secret-value.png" alt-text="Screenshot of secret value.":::
190+
191+
- **Option 2**
192+
193+
If you can't download the certificate from Azure Key Vault, you can use this [template](https://supportability.visualstudio.com/256c8350-cb4b-49c9-ac6e-a012aeb312d1/_apis/git/repositories/da6cf5d9-0dc5-4ba9-a5e2-6e6a93adf93c/Items?path=/AzureDataFactory/.attachments/ConvertCertToBase64StringInAKVPipeline-47f8e507-e7ef-4343-a73b-733b9a7f8e4e.zip&download=false&resolveLfs=true&%24format=octetStream&api-version=5.0-preview.1&sanitize=true&includeContentMetadata=true&versionDescriptor.version=master) to save the converted service principal certificate as a secret in Azure Key Vault.
194+
195+
:::image type="content" source="media/connector-office-365/template-pipeline.png" alt-text="Screenshot of template pipeline to save service principal certificate as a secret in AKV.":::
196+
142197
## Dataset properties
143198

144199
For a full list of sections and properties available for defining datasets, see the [datasets](concepts-datasets-linked-services.md) article. This section provides a list of properties supported by Microsoft 365 (Office 365) dataset.
11.1 KB
Loading
40.8 KB
Loading
8.96 KB
Loading
35.1 KB
Loading

0 commit comments

Comments
 (0)