|
1 | 1 | ---
|
2 |
| -title: "Azure Digital Twins request failed with Status: 404 (Not found)" |
3 |
| -description: "Causes and resolutions for 'Service request failed. Status: 404 (Not found)' on Azure Digital Twins." |
| 2 | +title: "Azure Digital Twins request failed with Status: 404 Sub-Domain not found" |
| 3 | +description: "Causes and resolutions for 'Service request failed. Status: 404 Sub-Domain not found' on Azure Digital Twins." |
4 | 4 | ms.service: digital-twins
|
5 | 5 | author: baanders
|
6 | 6 | ms.author: baanders
|
7 | 7 | ms.topic: troubleshooting
|
8 | 8 | ms.date: 4/13/2021
|
9 | 9 | ---
|
10 | 10 |
|
11 |
| -# Service request failed. Status: 404 (Not found) |
| 11 | +# Service request failed. Status: 404 Sub-Domain not found |
12 | 12 |
|
13 | 13 | This article describes causes and resolution steps for receiving a 404 error from service requests to Azure Digital Twins.
|
14 | 14 |
|
15 | 15 | ## Symptoms
|
16 | 16 |
|
17 |
| -This error may occur when accessing an Azure Digital Twins instance using a principal or user account that lives in a different [Azure Active Directory (Azure AD) tenant](../active-directory/develop/quickstart-create-new-tenant.md) from the instance. The correct [roles](concepts-security.md) seem to be assigned to the identity, but API requests fail with an error status of `404 (Not found)`. |
| 17 | +This error may occur when accessing an Azure Digital Twins instance using a service principal or user account that lives in a different [Azure Active Directory (Azure AD) tenant](../active-directory/develop/quickstart-create-new-tenant.md) from the instance. The correct [roles](concepts-security.md) seem to be assigned to the identity, but API requests fail with an error status of `404 Sub-Domain not found`. |
18 | 18 |
|
19 | 19 | ## Causes
|
20 | 20 |
|
21 | 21 | ### Cause #1
|
22 | 22 |
|
23 | 23 | While [Azure AD B2B](../active-directory/external-identities/what-is-b2b.md) allows for the mapping of identities from one tenant into a second tenant, other Azure services may not support multiple tenants. Azure Digital Twins is a service that only supports one tenant: the main tenant from the subscription where the Azure Digital Twins instance is located.
|
24 | 24 |
|
| 25 | +[!INCLUDE [digital-twins-tenant-limitation](../../includes/digital-twins-tenant-limitation.md)] |
| 26 | + |
25 | 27 | ## Solutions
|
26 | 28 |
|
27 | 29 | ### Solution #1
|
28 | 30 |
|
29 |
| -You can mitigate this issue by having each federated identity from another tenant request a **token** from the Azure Digital Twins instance's "home" tenant. One way to do this is with the following CLI command: |
30 |
| - |
31 |
| -```azurecli-interactive |
32 |
| -az account get-access-token --tenant <home-tenant-ID> --resource https://digitaltwins.azure.net |
33 |
| -``` |
| 31 | +You can resolve this issue by having each federated identity from another tenant request a **token** from the Azure Digital Twins instance's "home" tenant. |
34 | 32 |
|
35 |
| -After requesting this, the identity will receive a token issued for the *https://digitaltwins.azure.net* Azure AD resource, which has a matching tenant ID claim to the Azure Digital Twins instance. Using this token in API requests or with the DefaultAzureCredential should allow the federated identity to access the Azure Digital Twins resource. |
| 33 | +[!INCLUDE [digital-twins-tenant-solution-1](../../includes/digital-twins-tenant-solution-1.md)] |
36 | 34 |
|
37 | 35 | ### Solution #2
|
38 | 36 |
|
39 |
| -If you're using the `DefaultAzureCredential` class in your code, you can specify the home tenant in the `DefaultAzureCredential` options, like with `InteractiveBrowserTenantId` in the following example: |
40 |
| - |
41 |
| -:::image type="content" source="media/troubleshoot-error-404/defaultazurecredentialoptions.png" alt-text="Screenshot of code showing the DefaultAzureCredentialOptions method. The value of InteractiveBrowserTenantId is set to a sample tenant ID value."::: |
| 37 | +If you're using the `DefaultAzureCredential` class in your code and you continue encountering this issue after getting a token, you can specify the home tenant in the `DefaultAzureCredential` options to clarify the tenant even when authentication defaults down to another type. |
42 | 38 |
|
43 |
| -There are similar options available to set a tenant for authentication with Visual Studio and Visual Studio Code. For more information on the options available, see the [DefaultAzureCredentialOptions documentation](/dotnet/api/azure.identity.defaultazurecredentialoptions?view=azure-dotnet&preserve-view=true). |
| 39 | +[!INCLUDE [digital-twins-tenant-solution-2](../../includes/digital-twins-tenant-solution-2.md)] |
44 | 40 |
|
45 | 41 | ## Next steps
|
46 | 42 |
|
|
0 commit comments