Updates from: 03/07/2022 02:05:00
Service Microsoft Docs article Related commit history on GitHub Change details
active-directory-b2c Claimsschema https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/active-directory-b2c/claimsschema.md
Previously updated : 02/16/2022 Last updated : 03/06/2022
The **Mask** element contains the following attributes:
| `Type` | Yes | The type of the claim mask. Possible values: `Simple` or `Regex`. The `Simple` value indicates that a simple text mask is applied to the leading portion of a string claim. The `Regex` value indicates that a regular expression is applied to the string claim as whole. If the `Regex` value is specified, an optional attribute must also be defined with the regular expression to use. | | `Regex` | No | If **`Type`** is set to `Regex`, specify the regular expression to use.
-The following example configures a **PhoneNumber** claim with the `Simple` mask:
+The following example configures a **PhoneNumber** claim with the `Simple` mask. For more samples, check out the [Claim simple mask live demo](https://github.com/azure-ad-b2c/unit-tests/tree/main/claims#simple-mask).
```xml <ClaimType Id="PhoneNumber">
The Identity Experience Framework renders the phone number while hiding the firs
![Phone number claim shown in browser with first six digits masked by Xs](./media/claimsschema/mask.png)
-The following example configures a **AlternateEmail** claim with the `Regex` mask:
+The following example configures a **AlternateEmail** claim with the `Regex` mask. For more samples, check out the [Regex mask live demo](https://github.com/azure-ad-b2c/unit-tests/tree/main/claims#regex-mask).
```xml <ClaimType Id="AlternateEmail">
The Identity Experience Framework renders only the first letter of the email add
![Email claim shown in browser with characters masked by asterisks](./media/claimsschema/mask-regex.png) - ### Restriction The **Restriction** element may contain the following attribute:
The **Enumeration** element contains the following attributes:
|Value | Yes | The claim value that is associated with selecting this option. | | SelectByDefault | No | Indicates whether or not this option should be selected by default in the UI. Possible values: True or False. |
-The following example configures a **city** dropdown list claim with a default value set to `New York`:
+The following example configures a **city** dropdown list claim with a default value set to `New York`. For more samples, check out the [Claim restriction enumeration live demo](https://github.com/azure-ad-b2c/unit-tests/tree/main/claims#restriction-enumeration).
```xml <ClaimType Id="city">
The **Readonly** user input type is used to provide a readonly field to display
</ClaimType> ``` - #### Paragraph The **Paragraph** user input type is used to provide a field that shows text only in a paragraph tag. For example, &lt;p&gt;text&lt;/p&gt;. A **Paragraph** user input type `OutputClaim` of self-asserted technical profile, must set the `Required` attribute `false` (default).
The **Paragraph** user input type is used to provide a field that shows text onl
<AdminHelpText>A claim responsible for holding response messages to send to the relying party</AdminHelpText> <UserHelpText>A claim responsible for holding response messages to send to the relying party</UserHelpText> <UserInputType>Paragraph</UserInputType>
- <Restriction>
- <Enumeration Text="B2C_V1_90001" Value="You cannot sign in because you are a minor" />
- <Enumeration Text="B2C_V1_90002" Value="This action can only be performed by gold members" />
- <Enumeration Text="B2C_V1_90003" Value="You have not been enabled for this operation" />
- </Restriction>
</ClaimType> ```
active-directory-b2c Localization https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/active-directory-b2c/localization.md
Previously updated : 01/21/2022 Last updated : 03/06/2022
The **Item** element contains the following attributes:
| Value | Yes | The string claim value associated with selecting this option. | | SelectByDefault | No | Indicates whether or not this option should be selected by default in the UI. Possible values: True or False. |
-The following example shows the use of the **LocalizedCollections** element. It contains two **LocalizedCollection** elements, one for English and another one for Spanish. Both set the **Restriction** collection of the claim `Gender` with a list of items for English and Spanish.
+The following example shows the use of the **LocalizedCollections** element. It contains two **LocalizedCollection** elements, one for English and another one for Spanish. Both set the **Restriction** collection of the claim `Gender` with a list of items for English and Spanish. For more samples, check out the [Claim restriction enumeration live demo](https://github.com/azure-ad-b2c/unit-tests/tree/main/claims#restriction-enumeration).
```xml <LocalizedResources Id="api.selfasserted.en">
- <LocalizedCollections>
- <LocalizedCollection ElementType="ClaimType" ElementId="Gender" TargetCollection="Restriction">
+ <LocalizedCollections>
+ <LocalizedCollection ElementType="ClaimType" ElementId="Gender" TargetCollection="Restriction">
<Item Text="Female" Value="F" /> <Item Text="Male" Value="M" /> </LocalizedCollection>
-</LocalizedCollections>
+ </LocalizedCollections>
+</LocalizedResources>
<LocalizedResources Id="api.selfasserted.es"> <LocalizedCollections>
The following example shows the use of the **LocalizedCollections** element. It
<Item Text="Femenino" Value="F" /> <Item Text="Masculino" Value="M" /> </LocalizedCollection>
-</LocalizedCollections>
+ </LocalizedCollections>
+</LocalizedResources>
``` ### LocalizedStrings
active-directory Create Access Review https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/active-directory/governance/create-access-review.md
For more information, see [License requirements](access-reviews-overview.md#lice
## Create a multi-stage access review (preview) A multi-stage review allows the administrator to define two or three sets of reviewers to complete a review one after another. In a single-stage review, all reviewers make a decision within the same period and the last reviewer to make a decision "wins". In a multi-stage review, two or three independent sets of reviewers make a decision within their own stage, and the next stage doesn't happen until a decision is made in the previous stage. Multi-stage reviews can be used to reduce the burden on later-stage reviewers, allow for escalation of reviewers, or have independent groups of reviewers agree on decisions.
+> [!WARNING]
+> Data of users included in multi-stage access reviews are a part of the audit record at the start of the review. Administrators may delete the data at any time by deleting the multi-stage access review series.
1. After you have selected the resource and scope of your review, move on to the **Reviews** tab.
aks Supported Kubernetes Versions https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/aks/supported-kubernetes-versions.md
For the past release history, see [Kubernetes](https://en.wikipedia.org/wiki/Kub
| 1.20 | Dec-08-20 | Jan 2021 | Mar 2021 | 1.23 GA | | 1.21 | Apr-08-21 | May 2021 | Jul 2021 | 1.24 GA | | 1.22 | Aug-04-21 | Sept 2021 | Dec 2021 | 1.25 GA |
-| 1.23 | Dec 2021 | Jan 2022 | Mar 2022 | 1.26 GA |
+| 1.23 | Dec 2021 | Jan 2022 | Apr 2022 | 1.26 GA |
| 1.24 | Apr-22-22 | May 2022 | Jul 2022 | 1.27 GA | 1.25 | Aug 2022 | Sept 2022 | Nov 2022 | 1.28 GA
api-management Configure Custom Domain https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/api-management/configure-custom-domain.md
Choose the steps according to the [domain certificate](#domain-certificate-optio
* Configure a CNAME record for your custom domain. * When using API Management's free, managed certificate, also configure a TXT record to establish your ownership of the domain.
+> [!NOTE]
+> The free certificate is issued by DigiCert. For some domains, you must explicitly allow DigiCert as a certificate issuer by creating a [CAA domain record](https://wikipedia.org/wiki/DNS_Certification_Authority_Authorization) with the value: `0 issue digicert.com`.
+ ### CNAME record Configure a CNAME record that points from your custom domain name (for example, `api.contoso.com`) to your API Management service hostname (for example, `<apim-service-name>.azure-api.net`). A CNAME record is more stable than an A-record in case the IP address changes. For more information, see [IP addresses of Azure API Management](api-management-howto-ip-addresses.md#changes-to-the-ip-addresses) and the [API Management FAQ](./api-management-faq.yml#how-can-i-secure-the-connection-between-the-api-management-gateway-and-my-back-end-services-).
automation Add User Assigned Identity https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/automation/add-user-assigned-identity.md
If you don't have an Azure subscription, create a [free account](https://azure.m
- A user-assigned managed identity. For instructions, see [Create a user-assigned managed identity](../active-directory/managed-identities-azure-resources/how-to-manage-ua-identity-portal.md#create-a-user-assigned-managed-identity). -- The user-assigned managed identity and the target Azure resources that your runbook manages using that identity must be in the same Azure subscription.
+- The user-assigned managed identity and the target Azure resources that your runbook manages using that identity can be in different Azure subscriptions.
- The latest version of Azure Account modules. Currently this is 2.2.8. (See [Az.Accounts](https://www.powershellgallery.com/packages/Az.Accounts/) for details about this version.)
azure-monitor Manage Cost Storage https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/azure-monitor/logs/manage-cost-storage.md
na Previously updated : 02/18/2022 Last updated : 03/05/2022
Here is the pricing tier recommendation query:
```kusto // Set these parameters before running query.
-// For Pay-As-You-Go (per-GB) pricing details, see https://azure.microsoft.com/pricing/details/monitor/.
+// For Pay-As-You-Go (per-GB) and commitment tier pricing details, see https://azure.microsoft.com/pricing/details/monitor/.
// You can see your per-node costs in your Azure usage and charge data. For more information, see https://docs.microsoft.com/en-us/azure/cost-management-billing/understand/download-azure-daily-usage. let daysToEvaluate = 7; // Enter number of previous days to analyze (reduce if the query is taking too long) let workspaceHasSecurityCenter = false; // Specify if the workspace has Defender for Cloud (formerly known as Azure Security Center)
-let PerNodePrice = 15.; // Enter your monthly price per monitored nodes
-let PerNodeOveragePrice = 2.30; // Enter your price per GB for data overage in the Per Node pricing tier
-let PerGBPrice = 2.30; // Enter your price per GB in the Pay-as-you-go pricing tier
+let PerNodePrice = 15.; // Montly price per monitored node
+let PerNodeOveragePrice = 2.30; // Price per GB for data overage in the Per Node pricing tier
+let PerGBPrice = 2.30; // Enter the Pay-as-you-go price for your workspace's region (from https://azure.microsoft.com/pricing/details/monitor/)
let CommitmentTier100Price = 196.; // Enter your price for the 100 GB/day commitment tier let CommitmentTier200Price = 368.; // Enter your price for the 200 GB/day commitment tier let CommitmentTier300Price = 540.; // Enter your price for the 300 GB/day commitment tier
azure-monitor Search Jobs https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/azure-monitor/logs/search-jobs.md
Status code: 202 accepted.
## Get search job status and details+ Call the **Tables - Get** API to get the status and details of a search job: ```http GET https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/<TableName>_SRCH?api-version=2021-12-01-preview
This example retrieves the table status for the search job in the previous examp
**Request** ```http
-GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/testRG/providers/Microsoft.OperationalInsights/workspaces/testWS/tables/Syslog_SRCH?2021-07-01-privatepreview
+GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/testRG/providers/Microsoft.OperationalInsights/workspaces/testWS/tables/Syslog_SRCH?api-version=2021-12-01-preview
``` **Response**<br>
azure-portal Set Preferences https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/azure-portal/set-preferences.md
Choose your language and the regional format that will influence how data such a
### Language
-Use the drop-down list to select from the list of available languages. This setting controls the language you see for text throughout the Azure portal.
+Use the drop-down list to select from the list of available languages. This setting controls the language you see for text throughout the Azure portal. Azure portal supports the following 18 languages in addition to English: Chinese (Simplified), Chinese (Traditional), Czech, Dutch, French, German, Hungarian, Indonesian, Italian, Japanese, Korean, Polish, Portuguese (Brazil), Portuguese (Portugal), Russian, Spanish, Swedish, and Turkish.
### Regional format
bastion Connect Native Client Windows https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/bastion/connect-native-client-windows.md
# Connect to a VM using a native client (Preview)
-This article helps you configure your Bastion deployment, and then connect to a VM in the VNet using a native client (SSH or RDP) on your local computer. The native client feature lets you connect to your target VMs via Bastion using Azure CLI, and expands your sign-in options to include local SSH key pair and Azure Active Directory (Azure AD). Additionally with this feature, you can now also upload and download files, depending on the connection type and client.
+This article helps you configure your Bastion deployment, and then connect to a VM in the VNet using a native client (SSH or RDP) on your local computer. The native client feature lets you connect to your target VMs via Bastion using Azure CLI, and expands your sign-in options to include local SSH key pair and Azure Active Directory (Azure AD). Additionally with this feature, you can now also upload or download files, depending on the connection type and client.
Your capabilities on the VM when connecting via a native client are dependent on what is enabled on the native client. Controlling access to features such as file transfer via Bastion isn't supported.
To connect to a Windows VM using native client support, you must have the follow
## <a name="connect"></a>Connect - Windows native client
-This section helps you connect to your virtual machine from the native client on a local Windows computer. If you want to upload and download files after connecting, you must use an RDP connection. For more information about file transfers, see [Upload and download files](vm-upload-download-native.md).
+This section helps you connect to your virtual machine from the native client on a local Windows computer. If you want to upload and download files after connecting, you must use an RDP connection. For more information about file transfers, see [Upload or download files](vm-upload-download-native.md).
Use the example that corresponds to the type of target VM to which you want to connect.
This connection supports file upload from the local computer to the target VM. F
## Next steps
-[Upload and download files](vm-upload-download-native.md)
+[Upload or download files](vm-upload-download-native.md)
bastion Vm Upload Download Native https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/bastion/vm-upload-download-native.md
Title: 'Upload and download files - native client'
+ Title: 'Upload or download files - native client'
-description: Learn how to upload and download files using Azure Bastion and a native client.
+description: Learn how to upload or download files using Azure Bastion and a native client.
-# Upload and download files using the native client (Preview)
+# Upload or download files using the native client (Preview)
Azure Bastion offers support for file transfer between your target VM and local computer using Bastion and a native RDP or SSH client. To learn more about native client support, refer to [Connect to a VM using the native client](connect-native-client-windows.md).
communication-services Number Types https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/communication-services/concepts/numbers/number-types.md
Previously updated : 11/28/2021 Last updated : 03/04/2022 -
-# Number Types
+# Number types
+ Azure Communication Services allows you to use phone numbers to make voice calls and send SMS messages with the public-switched telephone network (PSTN). In this document, we'll review the phone number types, region availability, and use cases for planning your telephony and SMS solution using Communication Services.
-## Available Options
+## Available options
+ Azure Communication Services offers three types of Numbers: Toll-Free, Local, and Short Codes.-- **To send or receive an SMS**, choose a Toll-Free Number or a Short Code-- **To make or receive phone calls**, choose a Toll-Free Number or a Local Number+
+- **To send or receive an SMS**, choose a Toll-Free Number or a Short Code
+- **To make or receive phone calls**, choose a Toll-Free Number or a Local Number
The table below summarizes these number types with supported capabilities:
-|Type |Example|Send SMS | Receive SMS |Make Calls |Receive Calls|Typical Use Case|Restrictions|
-|:-|:-|:-:|:-:|:-:|:-:|:-|:-|
-|[Toll-Free](../../quickstarts/telephony/get-phone-number.md)|+1 (8AB) XYZ PQRS|X |X |X |X |Receive calls on IVR bots, SMS Notifications|SMS in US only|
-|[Local (Geographic)](../../quickstarts/telephony/get-phone-number.md)|+1 (ABC) XYZ PQRS| | |X |X |Geography Specific Number|Calling Only|
-|[Short-Codes](../../quickstarts/sms/apply-for-short-code.md)|ABC-XYZ|X |X | | |High-velocity SMS|SMS only|
+| Type | Example | Send SMS | Receive SMS | Make Calls | Receive Calls | Typical Use Case | Restrictions |
+| :-- | :- | :: | :: | :--: | :--: | :- | :- |
+| [Toll-Free](../../quickstarts/telephony/get-phone-number.md) | +1 (8AB) XYZ PQRS | Yes | Yes | Yes | Yes | Receive calls on IVR bots, SMS Notifications | SMS in US only |
+| [Local (Geographic)](../../quickstarts/telephony/get-phone-number.md) | +1 (ABC) XYZ PQRS | No | No | Yes | Yes | Geography Specific Number | Calling Only |
+| [Short-Codes](../../quickstarts/sms/apply-for-short-code.md) | ABC-XYZ | Yes | Yes | No | No | High-velocity SMS | SMS only |
+
+## Next steps
+
+For additional information about getting or managing phone numbers please see the following pages:
-## Next Steps
- Get a [Toll-Free or Local Phone Number](../../quickstarts/telephony/get-phone-number.md) - Get a [Short-Code](../../quickstarts/sms/apply-for-short-code.md)
communication-services Sub Eligibility Number Capability https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/communication-services/concepts/numbers/sub-eligibility-number-capability.md
Previously updated : 11/28/2021 Last updated : 03/04/2022
-# Subscription Eligibility and Number Capabilities
+# Subscription eligibility and number capabilities
Numbers can be purchased on eligible Azure subscriptions and in geographies where Communication Services is legally eligible to provide them.
-## Subscription Eligibility
+## Subscription eligibility
To acquire a phone number, you need to be on a paid Azure subscription. Phone numbers can't be acquired on trial accounts or by Azure free credits. Additional details on eligible subscription types are as follows:
-|Number Type |Eligible Azure Agreement Type|
-|:|:|
-|Toll-Free and Local (Geographic)|Modern Customer Agreement (Field and Customer Led), Modern Partner Agreement (CSP), Enterprise Agreement|
-|Short-Codes |Modern Customer Agreement (Field Led) and Enterprise Agreement Only|
+| Number Type | Eligible Azure Agreement Type |
+| :- | :- |
+| Toll-Free and Local (Geographic) | Modern Customer Agreement (Field and Customer Led), Modern Partner Agreement (CSP), Enterprise Agreement |
+| Short-Codes | Modern Customer Agreement (Field Led) and Enterprise Agreement Only |
-## Number Capabilities
+## Number capabilities
The capabilities that are available to you depend on the country that you're operating within (your Azure billing address location), your use case, and the phone number type that you've selected. These capabilities vary by country due to regulatory requirements. The tables below summarize current availability:
-## Customers with US Azure Billing Addresses
-|Number|Type |Send SMS | Receive SMS |Make Calls |Receive Calls|
-|:|:|:|:|:|:|
-|USA (includes PR) |Toll-Free |GA |GA |GA |GA* |
-|USA (includes PR) |Local | | |GA |GA* |
-|USA |Short-Codes |Public Preview |Public Preview* | | |
-
-## Customers with UK Azure Billing Addresses
-|Number|Type |Send SMS | Receive SMS |Make Calls |Receive Calls|
-|:|:|:|:|:|:|
-|UK |Toll-Free | | |Public Preview |Public Preview* |
-|UK |Local | | |Public Preview |Public Preview* |
-|USA (includes PR) |Toll-Free |GA |GA |Public Preview |Public Preview* |
-|USA (includes PR) |Local | | |Public Preview |Public Preview* |
-
-## Customers with Ireland Azure Billing Addresses
-|Number|Type |Send SMS | Receive SMS |Make Calls |Receive Calls|
-|:|:|:|:|:|:|
-|USA (includes PR) |Toll-Free |GA |GA |GA |GA* |
-|USA (includes PR) |Local | | |GA |GA* |
+## Customers with US Azure billing addresses
+
+| Number | Type | Send SMS | Receive SMS | Make Calls | Receive Calls |
+| :- | :- | :- | :- | :- | : |
+| USA & Puerto Rico | Toll-Free | General Availability | General Availability | General Availability | General Availability\* |
+| USA & Puerto Rico | Local | Not Available | Not Available | General Availability | General Availability\* |
+| USA | Short-Codes | Public Preview | Public Preview\* | Not Available | Not Available |
+
+\* Available through Azure Bot Framework and Dynamics only
+
+## Customers with UK Azure billing addresses
+
+| Number | Type | Send SMS | Receive SMS | Make Calls | Receive Calls |
+| :- | :-- | :- | :- | :- | : |
+| UK | Toll-Free | Not Available | Not Available | Public Preview | Public Preview\* |
+| UK | Local | Not Available | Not Available | Public Preview | Public Preview\* |
+| USA & Puerto Rico | Toll-Free | General Availability | General Availability | Public Preview | Public Preview\* |
+| USA & Puerto Rico | Local | Not Available | Not Available | Public Preview | Public Preview\* |
+
+\* Available through Azure Bot Framework and Dynamics only
+
+## Customers with Ireland Azure billing addresses
+
+| Number | Type | Send SMS | Receive SMS | Make Calls | Receive Calls |
+| :- | :-- | :- | :- | :- | : |
+| USA & Puerto Rico | Toll-Free | General Availability | General Availability | General Availability | General Availability\* |
+| USA & Puerto Rico | Local | Not Available | Not Available | General Availability | General Availability\* |
+
+\* Available through Azure Bot Framework and Dynamics only
## Customers with Denmark Azure Billing Addresses
-|Number|Type |Send SMS | Receive SMS |Make Calls |Receive Calls|
-|:|:|:|:|:|:|
-|Denmark |Toll-Free | | |Public Preview |Public Preview* |
-|Denmark |Local | | |Public Preview |Public Preview* |
-***
+| Number | Type | Send SMS | Receive SMS | Make Calls | Receive Calls |
+| : | :-- | : | : | :- | : |
+| Denmark | Toll-Free | Not Available | Not Available | Public Preview | Public Preview\* |
+| Denmark | Local | Not Available | Not Available | Public Preview | Public Preview\* |
+ \* Available through Azure Bot Framework and Dynamics only
-## Next Steps
-In this quickstart, you learned about Subscription Eligibility and Number Capabilities for Communication Services.
+## Next steps
+
+For additional information about ACS' telephony options please see the following pages:
-The following documents may be interesting to you:
- [Learn more about Telephony](../telephony/telephony-concept.md) - Get a Telephony capable [phone number](../../quickstarts/telephony/get-phone-number.md)
data-factory Data Flow Expression Functions https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/data-factory/data-flow-expression-functions.md
Previously updated : 02/02/2022 Last updated : 03/05/2022 # Expression functions in mapping data flow
In Data Factory and Synapse pipelines, use the expression language of the mappin
| [cbrt](data-flow-expressions-usage.md#cbrt) | Calculates the cube root of a number. | | [ceil](data-flow-expressions-usage.md#ceil) | Returns the smallest integer not smaller than the number. | | [coalesce](data-flow-expressions-usage.md#coalesce) | Returns the first not null value from a set of inputs. All inputs should be of the same type. |
-| [columnNames](data-flow-expressions-usage.md#columnNames) | Gets the names of all output columns for a stream. You can pass an optional stream name as the second argument. |
+| [columnNames](data-flow-expressions-usage.md#columnNames) | Gets the names of all output columns for a stream. You can pass an optional stream name as the first argument and optional second argument to only return schema drift columns. |
| [columns](data-flow-expressions-usage.md#columns) | Gets the values of all output columns for a stream. You can pass an optional stream name as the second argument. | | [compare](data-flow-expressions-usage.md#compare) | Compares two values of the same type. Returns a negative integer if value1 < value2, 0 if value1 == value2, positive value if value1 > value2. | | [concat](data-flow-expressions-usage.md#concat) | Concatenates a variable number of strings together. Same as the + operator with strings. |
In Data Factory and Synapse pipelines, use the expression language of the mappin
- List of all [metafunctions](data-flow-metafunctions.md). - List of all [window functions](data-flow-window-functions.md). - [Usage details of all data transformation expressions](data-flow-expressions-usage.md).-- [Learn how to use Expression Builder](concepts-data-flow-expression-builder.md).
+- [Learn how to use Expression Builder](concepts-data-flow-expression-builder.md).
data-factory Data Flow Expressions Usage https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/data-factory/data-flow-expressions-usage.md
Previously updated : 02/02/2022 Last updated : 03/05/2022 # Data transformation expression usage in mapping data flow
___
<a name="columnNames" ></a> ### <code>columnNames</code>
-<code><b>columnNames(<i>&lt;value1&gt;</i> : string) => array</b></code><br/><br/>
-Gets the names of all output columns for a stream. You can pass an optional stream name as the second argument.
+<code><b>columnNames(<i>&lt;value1&gt;</i> : string, i>&lt;value1&gt;</i> : boolean) => array</b></code><br/><br/>
+Gets the names of all output columns for a stream. You can pass an optional stream name as the first argument. The second argument is also optional, with false as the default. If you set the second argument to ``true()``, ADF will return only columns that are drifted via schema drift.
* ``columnNames()`` * ``columnNames('DeriveStream')``
+* ``columnNames('DeriveStream', true())``
+* ``columnNames('', true())``
+ ___
data-factory Data Flow Metafunctions https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/data-factory/data-flow-metafunctions.md
Previously updated : 02/02/2022 Last updated : 03/05/2022 # Metafunctions in mapping data flow
Metafunctions primarily function on metadata in your data flow
- List of all [map functions](data-flow-map-functions.md). - List of all [window functions](data-flow-window-functions.md). - [Usage details of all data transformation expressions](data-flow-expressions-usage.md).-- [Learn how to use Expression Builder](concepts-data-flow-expression-builder.md).
+- [Learn how to use Expression Builder](concepts-data-flow-expression-builder.md).
defender-for-cloud Upcoming Changes https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/defender-for-cloud/upcoming-changes.md
Title: Important changes coming to Microsoft Defender for Cloud description: Upcoming changes to Microsoft Defender for Cloud that you might need to be aware of and for which you might need to plan Previously updated : 02/15/2022 Last updated : 03/06/2022 # Important upcoming changes to Microsoft Defender for Cloud
If you're looking for the latest release notes, you'll find them in the [What's
|--|--| | [Deprecating a preview alert: ARM.MCAS_ActivityFromAnonymousIPAddresses](#deprecating-a-preview-alert-armmcas_activityfromanonymousipaddresses) | January 2022 | | [Legacy implementation of ISO 27001 is being replaced with new ISO 27001:2013](#legacy-implementation-of-iso-27001-is-being-replaced-with-new-iso-270012013) | January 2022 |
-| [Multiple changes to identity recommendations](#multiple-changes-to-identity-recommendations) | February 2022 |
| [Deprecating the recommendation to use service principals to protect your subscriptions](#deprecating-the-recommendation-to-use-service-principals-to-protect-your-subscriptions) | February 2022 | | [Moving recommendation Vulnerabilities in container security configurations should be remediated from the secure score to best practices](#moving-recommendation-vulnerabilities-in-container-security-configurations-should-be-remediated-from-the-secure-score-to-best-practices) | February 2022 | | [Changes to recommendations for managing endpoint protection solutions](#changes-to-recommendations-for-managing-endpoint-protection-solutions) | March 2022 |
If you're looking for the latest release notes, you'll find them in the [What's
| [Relocation of custom recommendations](#relocation-of-custom-recommendations) | March 2022 | | [Deprecating Microsoft Defender for IoT device recommendations](#deprecating-microsoft-defender-for-iot-device-recommendations)| March 2022 | | [Deprecating Microsoft Defender for IoT device alerts](#deprecating-microsoft-defender-for-iot-device-alerts) | March 2022 |
+| [Multiple changes to identity recommendations](#multiple-changes-to-identity-recommendations) | May 2022 |
+ ### Deprecating a preview alert: ARM.MCAS_ActivityFromAnonymousIPAddresses **Estimated date for change:** January 2022
The legacy implementation of ISO 27001 will be removed from Defender for Cloud's
:::image type="content" source="media/upcoming-changes/removing-iso-27001-legacy-implementation.png" alt-text="Defender for Cloud's regulatory compliance dashboard showing the message about the removal of the legacy implementation of ISO 27001." lightbox="media/upcoming-changes/removing-iso-27001-legacy-implementation.png"::: -
-### Multiple changes to identity recommendations
-
-**Estimated date for change:** February 2022
-
-Defender for Cloud includes multiple recommendations for improving the management of users and accounts. In December, we'll be making the changes outlined below.
--- **Improved freshness interval** - Currently, the identity recommendations have a freshness interval of 24 hours. This update will reduce that interval to 12 hours.--- **Account exemption capability** - Defender for Cloud has many features for customizing the experience and making sure your secure score reflects your organization's security priorities. The exempt option on security recommendations is one such feature. For a full overview and instructions, see [Exempting resources and recommendations from your secure score](exempt-resource.md). With this update, you'll be able to exempt specific accounts from evaluation by the eight recommendations listed in the following table.-
- Typically, you'd exempt emergency ΓÇ£break glassΓÇ¥ accounts from MFA recommendations, because such accounts are often deliberately excluded from an organization's MFA requirements. Alternatively, you might have external accounts that you'd like to permit access to but which don't have MFA enabled.
-
- > [!TIP]
- > When you exempt an account, it won't be shown as unhealthy and also won't cause a subscription to appear unhealthy.
-
- |Recommendation| Assessment key|
- |-|-|
- |[MFA should be enabled on accounts with owner permissions on your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/94290b00-4d0c-d7b4-7cea-064a9554e681)|94290b00-4d0c-d7b4-7cea-064a9554e681|
- |[MFA should be enabled on accounts with read permissions on your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/151e82c5-5341-a74b-1eb0-bc38d2c84bb5)|151e82c5-5341-a74b-1eb0-bc38d2c84bb5|
- |[MFA should be enabled on accounts with write permissions on your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/57e98606-6b1e-6193-0e3d-fe621387c16b)|57e98606-6b1e-6193-0e3d-fe621387c16b|
- |[External accounts with owner permissions should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/c3b6ae71-f1f0-31b4-e6c1-d5951285d03d)|c3b6ae71-f1f0-31b4-e6c1-d5951285d03d|
- |[External accounts with read permissions should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/a8c6a4ad-d51e-88fe-2979-d3ee3c864f8b)|a8c6a4ad-d51e-88fe-2979-d3ee3c864f8b|
- |[External accounts with write permissions should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/04e7147b-0deb-9796-2e5c-0336343ceb3d)|04e7147b-0deb-9796-2e5c-0336343ceb3d|
- |[Deprecated accounts with owner permissions should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/e52064aa-6853-e252-a11e-dffc675689c2)|e52064aa-6853-e252-a11e-dffc675689c2|
- |[Deprecated accounts should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/00c6d40b-e990-6acf-d4f3-471e747a27c4)|00c6d40b-e990-6acf-d4f3-471e747a27c4|
- |||
-
-- **Recommendations rename** - From this update, we're renaming two recommendations. We're also revising their descriptions. The assessment keys will remain unchanged. --
- |Property |Current value | From the update|
- ||||
- |Assessment key | e52064aa-6853-e252-a11e-dffc675689c2 | Unchanged|
- |Name |[Deprecated accounts with owner permissions should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/e52064aa-6853-e252-a11e-dffc675689c2) |Subscriptions should be purged of accounts that are blocked in Active Directory and have owner permissions |
- |Description |User accounts that have been blocked from signing in, should be removed from your subscriptions.<br>These accounts can be targets for attackers looking to find ways to access your data without being noticed.|User accounts that have been blocked from signing into Active Directory, should be removed from your subscriptions. These accounts can be targets for attackers looking to find ways to access your data without being noticed.<br>Learn more about securing the identity perimeter in [Azure Identity Management and access control security best practices](../security/fundamentals/identity-management-best-practices.md).|
- |Related policy |[Deprecated accounts with owner permissions should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2fproviders%2fMicrosoft.Authorization%2fpolicyDefinitions%2febb62a0c-3560-49e1-89ed-27e074e9f8ad) |Subscriptions should be purged of accounts that are blocked in Active Directory and have owner permissions |
- |||
-
- |Property |Current value | From the update|
- ||||
- |Assessment key | 00c6d40b-e990-6acf-d4f3-471e747a27c4 | Unchanged|
- |Name |[Deprecated accounts should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/00c6d40b-e990-6acf-d4f3-471e747a27c4)|Subscriptions should be purged of accounts that are blocked in Active Directory and have read and write permissions|
- |Description |User accounts that have been blocked from signing in, should be removed from your subscriptions.<br>These accounts can be targets for attackers looking to find ways to access your data without being noticed.|User accounts that have been blocked from signing into Active Directory, should be removed from your subscriptions. These accounts can be targets for attackers looking to find ways to access your data without being noticed.<br>Learn more about securing the identity perimeter in [Azure Identity Management and access control security best practices](../security/fundamentals/identity-management-best-practices.md).|
- |Related policy |[Deprecated accounts should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2fproviders%2fMicrosoft.Authorization%2fpolicyDefinitions%2f6b1cbf55-e8b6-442f-ba4c-7246b6381474)|Subscriptions should be purged of accounts that are blocked in Active Directory and have read and write permissions|
- |||
-- ### Deprecating the recommendation to use service principals to protect your subscriptions **Estimated date for change:** February 2022
The following recommendations will be deprecated:
All Microsoft Defender for IoT device alerts will no longer be visible in Microsoft Defender for Cloud. These alerts will still be available on Microsoft Defender for IoT's Alert page, and in Microsoft Sentinel.
+### Multiple changes to identity recommendations
+
+**Estimated date for change:** May 2022
+
+Defender for Cloud includes multiple recommendations for improving the management of users and accounts. In December, we'll be making the changes outlined below.
+
+- **Improved freshness interval** - Currently, the identity recommendations have a freshness interval of 24 hours. This update will reduce that interval to 12 hours.
+
+- **Account exemption capability** - Defender for Cloud has many features for customizing the experience and making sure your secure score reflects your organization's security priorities. The exempt option on security recommendations is one such feature. For a full overview and instructions, see [Exempting resources and recommendations from your secure score](exempt-resource.md). With this update, you'll be able to exempt specific accounts from evaluation by the eight recommendations listed in the following table.
+
+ Typically, you'd exempt emergency ΓÇ£break glassΓÇ¥ accounts from MFA recommendations, because such accounts are often deliberately excluded from an organization's MFA requirements. Alternatively, you might have external accounts that you'd like to permit access to but which don't have MFA enabled.
+
+ > [!TIP]
+ > When you exempt an account, it won't be shown as unhealthy and also won't cause a subscription to appear unhealthy.
+
+ |Recommendation| Assessment key|
+ |-|-|
+ |[MFA should be enabled on accounts with owner permissions on your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/94290b00-4d0c-d7b4-7cea-064a9554e681)|94290b00-4d0c-d7b4-7cea-064a9554e681|
+ |[MFA should be enabled on accounts with read permissions on your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/151e82c5-5341-a74b-1eb0-bc38d2c84bb5)|151e82c5-5341-a74b-1eb0-bc38d2c84bb5|
+ |[MFA should be enabled on accounts with write permissions on your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/57e98606-6b1e-6193-0e3d-fe621387c16b)|57e98606-6b1e-6193-0e3d-fe621387c16b|
+ |[External accounts with owner permissions should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/c3b6ae71-f1f0-31b4-e6c1-d5951285d03d)|c3b6ae71-f1f0-31b4-e6c1-d5951285d03d|
+ |[External accounts with read permissions should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/a8c6a4ad-d51e-88fe-2979-d3ee3c864f8b)|a8c6a4ad-d51e-88fe-2979-d3ee3c864f8b|
+ |[External accounts with write permissions should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/04e7147b-0deb-9796-2e5c-0336343ceb3d)|04e7147b-0deb-9796-2e5c-0336343ceb3d|
+ |[Deprecated accounts with owner permissions should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/e52064aa-6853-e252-a11e-dffc675689c2)|e52064aa-6853-e252-a11e-dffc675689c2|
+ |[Deprecated accounts should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/00c6d40b-e990-6acf-d4f3-471e747a27c4)|00c6d40b-e990-6acf-d4f3-471e747a27c4|
+ |||
+
+- **Recommendations rename** - From this update, we're renaming two recommendations. We're also revising their descriptions. The assessment keys will remain unchanged.
++
+ |Property |Current value | From the update|
+ ||||
+ |Assessment key | e52064aa-6853-e252-a11e-dffc675689c2 | Unchanged|
+ |Name |[Deprecated accounts with owner permissions should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/e52064aa-6853-e252-a11e-dffc675689c2) |Subscriptions should be purged of accounts that are blocked in Active Directory and have owner permissions |
+ |Description |User accounts that have been blocked from signing in, should be removed from your subscriptions.<br>These accounts can be targets for attackers looking to find ways to access your data without being noticed.|User accounts that have been blocked from signing into Active Directory, should be removed from your subscriptions. These accounts can be targets for attackers looking to find ways to access your data without being noticed.<br>Learn more about securing the identity perimeter in [Azure Identity Management and access control security best practices](../security/fundamentals/identity-management-best-practices.md).|
+ |Related policy |[Deprecated accounts with owner permissions should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2fproviders%2fMicrosoft.Authorization%2fpolicyDefinitions%2febb62a0c-3560-49e1-89ed-27e074e9f8ad) |Subscriptions should be purged of accounts that are blocked in Active Directory and have owner permissions |
+ |||
+
+ |Property |Current value | From the update|
+ ||||
+ |Assessment key | 00c6d40b-e990-6acf-d4f3-471e747a27c4 | Unchanged|
+ |Name |[Deprecated accounts should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/00c6d40b-e990-6acf-d4f3-471e747a27c4)|Subscriptions should be purged of accounts that are blocked in Active Directory and have read and write permissions|
+ |Description |User accounts that have been blocked from signing in, should be removed from your subscriptions.<br>These accounts can be targets for attackers looking to find ways to access your data without being noticed.|User accounts that have been blocked from signing into Active Directory, should be removed from your subscriptions. These accounts can be targets for attackers looking to find ways to access your data without being noticed.<br>Learn more about securing the identity perimeter in [Azure Identity Management and access control security best practices](../security/fundamentals/identity-management-best-practices.md).|
+ |Related policy |[Deprecated accounts should be removed from your subscription](https://portal.azure.com/#blade/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2fproviders%2fMicrosoft.Authorization%2fpolicyDefinitions%2f6b1cbf55-e8b6-442f-ba4c-7246b6381474)|Subscriptions should be purged of accounts that are blocked in Active Directory and have read and write permissions|
+ |||
+ ## Next steps For all recent changes to Defender for Cloud, see [What's new in Microsoft Defender for Cloud?](release-notes.md)
defender-for-iot How To Configure Windows Endpoint Monitoring https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/defender-for-iot/organizations/how-to-configure-windows-endpoint-monitoring.md
Before you begin scanning, create a firewall rule that allows outgoing traffic f
## Set up scanning
-1. In Defender for Cloud select **System Settings**.
+1. In Defender for IoT select **System Settings**.
1. Under **Network monitoring**, select **Windows Endpoint Monitoring (WMI)** 1. In the **Windows Endpoint Monitoring (WMI) dialog, select **Add ranges**. You can also import and export ranges. 1. Specify the IP address range you want to scan. You can add multiple ranges.
digital-twins Concepts Apis Sdks https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-apis-sdks.md
description: Learn about the Azure Digital Twins API and SDK options, including information about SDK helper classes and general usage notes. Previously updated : 10/25/2021 Last updated : 02/28/2022
This article gives an overview of the Azure Digital Twins APIs available, and the methods for interacting with them. You can either use the REST APIs directly with their associated Swaggers (through a tool like [Postman](how-to-use-postman.md)), or through an SDK.
-Azure Digital Twins comes equipped with **control plane APIs**, **data plane APIs**, and **SDKs** for managing your instance and its elements.
+Azure Digital Twins comes equipped with control plane APIs, data plane APIs, and SDKs for managing your instance and its elements.
* The control plane APIs are [Azure Resource Manager (ARM)](../azure-resource-manager/management/overview.md) APIs, and cover resource management operations like creating and deleting your instance. * The data plane APIs are Azure Digital Twins APIs, and are used for data management operations like managing models, twins, and the graph. * The SDKs take advantage of the existing APIs to allow for ease of development of custom applications making use of Azure Digital Twins. The control plane SDKs are available in [.NET (C#)](/dotnet/api/overview/azure/digitaltwins/management?view=azure-dotnet&preserve-view=true) and [Java](/java/api/overview/azure/digitaltwins/resourcemanagement?view=azure-java-stable&preserve-view=true), and the data plane SDKs are available in [.NET (C#)](/dotnet/api/overview/azure/digitaltwins/client?view=azure-dotnet&preserve-view=true), [Java](/java/api/overview/azure/digitaltwins/client?view=azure-java-stable&preserve-view=true), [JavaScript](/javascript/api/@azure/digital-twins-core/?view=azure-node-latest&preserve-view=true), and [Python](/python/api/azure-digitaltwins-core/azure.digitaltwins.core?view=azure-python&preserve-view=true).
Azure Digital Twins comes equipped with **control plane APIs**, **data plane API
The control plane APIs are [ARM](../azure-resource-manager/management/overview.md) APIs used to manage your Azure Digital Twins instance as a whole, so they cover operations like creating or deleting your entire instance. You'll also use these APIs to create and delete endpoints.
-The most current control plane API version is _**2020-12-01**_.
+The most current control plane API version is 2020-12-01.
To use the control plane APIs: * You can call the APIs directly by referencing the latest Swagger folder in the [control plane Swagger repo](https://github.com/Azure/azure-rest-api-specs/tree/master/specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable). This folder also includes a folder of examples that show the usage.
You can also exercise control plane APIs by interacting with Azure Digital Twins
## Overview: data plane APIs The data plane APIs are the Azure Digital Twins APIs used to manage the elements within your Azure Digital Twins instance. They include operations like creating routes, uploading models, creating relationships, and managing twins, and can be broadly divided into the following categories:
-* **DigitalTwinModels** - The DigitalTwinModels category contains APIs to manage the [models](concepts-models.md) in an Azure Digital Twins instance. Management activities include upload, validation, retrieval, and deletion of models authored in DTDL.
-* **DigitalTwins** - The DigitalTwins category contains the APIs that let developers create, modify, and delete [digital twins](concepts-twins-graph.md) and their relationships in an Azure Digital Twins instance.
-* **Query** - The Query category lets developers [find sets of digital twins in the twin graph](how-to-query-graph.md) across relationships.
-* **Event Routes** - The Event Routes category contains APIs to [route data](concepts-route-events.md), through the system and to downstream services.
+* DigitalTwinModels - The DigitalTwinModels category contains APIs to manage the [models](concepts-models.md) in an Azure Digital Twins instance. Management activities include upload, validation, retrieval, and deletion of models authored in DTDL.
+* DigitalTwins - The DigitalTwins category contains the APIs that let developers create, modify, and delete [digital twins](concepts-twins-graph.md) and their relationships in an Azure Digital Twins instance.
+* Query - The Query category lets developers [find sets of digital twins in the twin graph](how-to-query-graph.md) across relationships.
+* Event Routes - The Event Routes category contains APIs to [route data](concepts-route-events.md), through the system and to downstream services.
-The most current data plane API version is _**2020-10-31**_.
+The most current data plane API version is 2020-10-31.
To use the data plane APIs: * You can call the APIs directly, by... - Referencing the latest Swagger folder in the [data plane Swagger repo](https://github.com/Azure/azure-rest-api-specs/tree/master/specification/digitaltwins/data-plane/Microsoft.DigitalTwins). This folder also includes a folder of examples that show the usage. - Viewing the [API reference documentation](/rest/api/azure-digitaltwins/).
-* You can use the **.NET (C#) SDK**. To use the .NET SDK...
+* You can use the .NET (C#) SDK. To use the .NET SDK...
- You can view and add the package from NuGet: [Azure.DigitalTwins.Core](https://www.nuget.org/packages/Azure.DigitalTwins.Core). - You can view the [SDK reference documentation](/dotnet/api/overview/azure/digitaltwins/client?view=azure-dotnet&preserve-view=true). - You can find the SDK source, including a folder of samples, in GitHub: [Azure IoT Digital Twins client library for .NET](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/digitaltwins/Azure.DigitalTwins.Core). - You can see detailed information and usage examples by continuing to the [.NET (C#) SDK (data plane)](#net-c-sdk-data-plane) section of this article.
-* You can use the **Java SDK**. To use the Java SDK...
+* You can use the Java SDK. To use the Java SDK...
- You can view and install the package from Maven: [`com.azure:azure-digitaltwins-core`](https://search.maven.org/artifact/com.azure/azure-digitaltwins-core/1.0.0/jar) - You can view the [SDK reference documentation](/java/api/overview/azure/digitaltwins/client?view=azure-java-stable&preserve-view=true) - You can find the SDK source in GitHub: [Azure IoT Digital Twins client library for Java](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/digitaltwins/azure-digitaltwins-core)
-* You can use the **JavaScript SDK**. To use the JavaScript SDK...
+* You can use the JavaScript SDK. To use the JavaScript SDK...
- You can view and install the package from npm: [Azure Azure Digital Twins Core client library for JavaScript](https://www.npmjs.com/package/@azure/digital-twins-core). - You can view the [SDK reference documentation](/javascript/api/@azure/digital-twins-core/?view=azure-node-latest&preserve-view=true). - You can find the SDK source in GitHub: [Azure Azure Digital Twins Core client library for JavaScript](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/digitaltwins/digital-twins-core)
-* You can use the **Python SDK**. To use the Python SDK...
+* You can use the Python SDK. To use the Python SDK...
- You can view and install the package from PyPi: [Azure Azure Digital Twins Core client library for Python](https://pypi.org/project/azure-digitaltwins-core/). - You can view the [SDK reference documentation](/python/api/azure-digitaltwins-core/azure.digitaltwins.core?view=azure-python&preserve-view=true). - You can find the SDK source in GitHub: [Azure Azure Digital Twins Core client library for Python](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/digitaltwins/azure-digitaltwins-core)
The Azure Digital Twins .NET (C#) SDK is part of the Azure SDK for .NET. It's op
> [!NOTE] > For more information on SDK design, see the general [design principles for Azure SDKs](https://azure.github.io/azure-sdk/general_introduction.html) and the specific [.NET design guidelines](https://azure.github.io/azure-sdk/dotnet_introduction.html).
-To use the SDK, include the NuGet package **Azure.DigitalTwins.Core** with your project. You'll also need the latest version of the **Azure.Identity** package. In Visual Studio, you can add these packages using the NuGet Package Manager (accessed through *Tools > NuGet Package Manager > Manage NuGet Packages for Solution*). You can also use the .NET command-line tool with the commands found in the NuGet package links below to add these packages to your project:
+To use the SDK, include the NuGet package `Azure.DigitalTwins.Core` with your project. You'll also need the latest version of the `Azure.Identity` package. In Visual Studio, you can add these packages using the NuGet Package Manager (accessed through **Tools > NuGet Package Manager > Manage NuGet Packages for Solution**). You can also use the .NET command-line tool with the commands found in the NuGet package links below to add these packages to your project:
* [Azure.DigitalTwins.Core](https://www.nuget.org/packages/Azure.DigitalTwins.Core): The package for the [Azure Digital Twins SDK for .NET](/dotnet/api/overview/azure/digitaltwins/client?view=azure-dotnet&preserve-view=true). * [Azure.Identity](https://www.nuget.org/packages/Azure.Identity): The library that provides tools to help with authentication against Azure.
The available helper classes are:
## General API/SDK usage notes > [!NOTE]
-> Please note that Azure Digital Twins doesn't currently support **Cross-Origin Resource Sharing (CORS)**. For more info about the impact and resolution strategies, see the [Cross-Origin Resource Sharing (CORS)](concepts-security.md#cross-origin-resource-sharing-cors) section of *Concepts: Security for Azure Digital Twins solutions*.
+> Please note that Azure Digital Twins doesn't currently support Cross-Origin Resource Sharing (CORS). For more info about the impact and resolution strategies, see the [Cross-Origin Resource Sharing (CORS)](concepts-security.md#cross-origin-resource-sharing-cors) section of *Concepts: Security for Azure Digital Twins solutions*.
The following list provides more detail and general guidelines for using the APIs and SDKs. * You can use an HTTP REST-testing tool like Postman to make direct calls to the Azure Digital Twins APIs. For more information about this process, see [Make API requests with Postman](how-to-use-postman.md). * To use the SDK, instantiate the `DigitalTwinsClient` class. The constructor requires credentials that can be obtained with different kinds of authentication methods in the `Azure.Identity` package. For more on `Azure.Identity`, see its [namespace documentation](/dotnet/api/azure.identity?view=azure-dotnet&preserve-view=true). * You may find the `InteractiveBrowserCredential` useful while getting started, but there are several other options, including credentials for [managed identity](/dotnet/api/azure.identity.interactivebrowsercredential?view=azure-dotnet&preserve-view=true), which you'll likely use to authenticate [Azure functions set up with MSI](../app-service/overview-managed-identity.md?tabs=dotnet) against Azure Digital Twins. For more about `InteractiveBrowserCredential`, see its [class documentation](/dotnet/api/azure.identity.interactivebrowsercredential?view=azure-dotnet&preserve-view=true).
-* Requests to the Azure Digital Twins APIs require a user or service principal that is a part of the same [Azure Active Directory](../active-directory/fundamentals/active-directory-whatis.md) (Azure AD) tenant where the Azure Digital Twins instance exists. To prevent malicious scanning of Azure Digital Twins endpoints, requests with access tokens from outside the originating tenant will be returned a "404 Sub-Domain not found" error message. This error will be returned *even if* the user or service principal was given an Azure Digital Twins Data Owner or Azure Digital Twins Data Reader role through [Azure AD B2B](../active-directory/external-identities/what-is-b2b.md) collaboration. For information on how to achieve access across multiple tenants, see [Write app authentication code](how-to-authenticate-client.md#authenticate-across-tenants).
+* Requests to the Azure Digital Twins APIs require a user or service principal that is a part of the same [Azure Active Directory](../active-directory/fundamentals/active-directory-whatis.md) (Azure AD) tenant where the Azure Digital Twins instance exists. To prevent malicious scanning of Azure Digital Twins endpoints, requests with access tokens from outside the originating tenant will be returned a "404 Sub-Domain not found" error message. This error will be returned even if the user or service principal was given an Azure Digital Twins Data Owner or Azure Digital Twins Data Reader role through [Azure AD B2B](../active-directory/external-identities/what-is-b2b.md) collaboration. For information on how to achieve access across multiple tenants, see [Write app authentication code](how-to-authenticate-client.md#authenticate-across-tenants).
* All service API calls are exposed as member functions on the `DigitalTwinsClient` class. * All service functions exist in synchronous and asynchronous versions. * All service functions throw an exception for any return status of 400 or above. Make sure you wrap calls into a `try` section, and catch at least `RequestFailedExceptions`. For more about this type of exception, see its [reference documentation](/dotnet/api/azure.requestfailedexception?view=azure-dotnet&preserve-view=true).
Service methods return strongly typed objects wherever possible. However, becaus
API metrics such as requests, latency, and failure rate can be viewed in the [Azure portal](https://portal.azure.com/).
-From the portal homepage, search for your Azure Digital Twins instance to pull up its details. Select the **Metrics** option from the Azure Digital Twins instance's menu to bring up the *Metrics* page.
+From the portal homepage, search for your Azure Digital Twins instance to pull up its details. Select the **Metrics** option from the Azure Digital Twins instance's menu to bring up the **Metrics** page.
:::image type="content" source="media/troubleshoot-metrics/azure-digital-twins-metrics.png" alt-text="Screenshot showing the metrics page for Azure Digital Twins.":::
digital-twins Concepts Azure Digital Twins Explorer https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-azure-digital-twins-explorer.md
description: Learn about the capabilities and purpose of Azure Digital Twins Explorer and when it can be a useful tool for visualizing digital models, twins, and graphs. Previously updated : 10/29/2021 Last updated : 02/28/2022
# Azure Digital Twins Explorer (preview)
-This article contains information about the **Azure Digital Twins Explorer**, including its use cases and an overview of its features. For detailed steps on using each feature, see [Use Azure Digital Twins Explorer](how-to-use-azure-digital-twins-explorer.md).
+This article contains information about the Azure Digital Twins Explorer, including its use cases and an overview of its features. For detailed steps on using each feature, see [Use Azure Digital Twins Explorer](how-to-use-azure-digital-twins-explorer.md).
-Azure Digital Twins Explorer is a developer tool for visualizing and interacting with the data in your Azure Digital Twins instance, including your [models](concepts-models.md) and [twin graph](concepts-twins-graph.md).
+*Azure Digital Twins Explorer* is a developer tool for visualizing and interacting with the data in your Azure Digital Twins instance, including your [models](concepts-models.md) and [twin graph](concepts-twins-graph.md).
>[!NOTE]
->This tool is currently in **public preview**.
+>This tool is currently in public preview.
Here's a view of the explorer window, showing models and twins that have been populated for a sample graph:
The visual interface is a great tool for exploring and understanding the shape o
Azure Digital Twins Explorer is a visual tool designed for users who want to explore their twin graph, and modify twins and relationships in the context of their graph. Developers may find this tool especially useful in the following scenarios:
-* **Exploration**: Use the explorer to learn about Azure Digital Twins and the way it represents your real-world environment. Import sample models and graphs that you can view and edit to familiarize yourself with the service. For guided steps to get started using Azure Digital Twins Explorer, see [Get started with Azure Digital Twins Explorer](quickstart-azure-digital-twins-explorer.md).
-* **Development**: Use the explorer to view and validate your twin graph. You can also use it to investigate specific properties of models, twins, and relationships. Make on the spot modifications to your graph and its data. For detailed instructions on how to use each feature, see [Use Azure Digital Twins Explorer](how-to-use-azure-digital-twins-explorer.md).
+* Exploration: Use the explorer to learn about Azure Digital Twins and the way it represents your real-world environment. Import sample models and graphs that you can view and edit to familiarize yourself with the service. For guided steps to get started using Azure Digital Twins Explorer, see [Get started with Azure Digital Twins Explorer](quickstart-azure-digital-twins-explorer.md).
+* Development: Use the explorer to view and validate your twin graph. You can also use it to investigate specific properties of models, twins, and relationships. Make on the spot modifications to your graph and its data. For detailed instructions on how to use each feature, see [Use Azure Digital Twins Explorer](how-to-use-azure-digital-twins-explorer.md).
The explorer's main purpose is to help you visualize and understand your graph, and update your graph as needed. For large-scale solutions and for work that should be repeated or automated, consider using the [APIs and SDKs](./concepts-apis-sdks.md) to interact with your instance through code instead.
For detailed instructions on how to use each feature, see [Use Azure Digital Twi
## How to contribute
-Azure Digital Twins Explorer is an **open-source** tool that welcomes contributions to the code and documentation. The hosted application is deployed regularly from a source code repository in GitHub.
+Azure Digital Twins Explorer is an open-source tool that welcomes contributions to the code and documentation. The hosted application is deployed regularly from a source code repository in GitHub.
To view the source code for the tool and read detailed instructions on how to contribute to the code, visit its GitHub repository: [digital-twins-explorer](https://github.com/Azure-Samples/digital-twins-explorer).
digital-twins Concepts Cli https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-cli.md
description: Learn about the Azure Digital Twins CLI command set. Previously updated : 12/07/2021 Last updated : 02/28/2022
Some of the actions you can do using the command set include:
* Managing [routes](concepts-route-events.md) * Configuring [security](concepts-security.md) via Azure role-based access control (Azure RBAC)
-The command set is called **az dt**, and is part of the [Azure IoT extension for Azure CLI](https://github.com/Azure/azure-iot-cli-extension). You can view the full list of commands and their usage as part of the reference documentation for the `az iot` command set: [az dt command reference](/cli/azure/dt).
+The command set is called `az dt`, and is part of the [Azure IoT extension for Azure CLI](https://github.com/Azure/azure-iot-cli-extension). You can view the full list of commands and their usage as part of the reference documentation for the `az iot` command set: [az dt command reference](/cli/azure/dt).
## Uses (deploy and validate)
Apart from generally managing your instance, the CLI is also a useful tool for d
## Get the command set
-The Azure Digital Twins commands are part of the [Azure IoT extension for Azure CLI (azure-iot)](https://github.com/Azure/azure-iot-cli-extension), so follow these steps to make sure you have the latest `azure-iot` extension with the **az dt** commands.
+The Azure Digital Twins commands are part of the [Azure IoT extension for Azure CLI (azure-iot)](https://github.com/Azure/azure-iot-cli-extension), so follow these steps to make sure you have the latest `azure-iot` extension with the `az dt` commands.
### CLI version requirements
-If you're using the Azure CLI with PowerShell, your Azure CLI version should be **2.3.1** or above as a requirement of the extension package.
+If you're using the Azure CLI with PowerShell, your Azure CLI version should be 2.3.1 or above as a requirement of the extension package.
You can check the version of your Azure CLI with this CLI command: ```azurecli
digital-twins Concepts Data Explorer Plugin https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-data-explorer-plugin.md
description: Learn about the Azure Digital Twins query plugin for Azure Data Explorer Previously updated : 12/06/2021 Last updated : 03/01/2022
If you're ingesting time series data directly into Azure Data Explorer, you'll l
An [update policy](/azure/data-explorer/kusto/management/updatepolicy) in Azure Data Explorer allows you to automatically transform and append data to a target table whenever new data is inserted into a source table.
-You can use an update policy to enrich your raw time series data with the corresponding **twin ID** from Azure Digital Twins, and persist it to a target table. Using the twin ID, the target table can then be joined against the digital twins selected by the Azure Digital Twins plugin.
+You can use an update policy to enrich your raw time series data with the corresponding twin ID from Azure Digital Twins, and persist it to a target table. Using the twin ID, the target table can then be joined against the digital twins selected by the Azure Digital Twins plugin.
For example, say you created the following table to hold the raw time series data flowing into your Azure Data Explorer instance.
digital-twins Concepts Data Ingress Egress https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-data-ingress-egress.md
description: Learn about the data ingress and egress requirements for integrating Azure Digital Twins with other services. Previously updated : 12/07/2021 Last updated : 03/01/2022
You can also learn how to connect Azure Digital Twins to a Logic Apps trigger in
## Data egress services
-Azure Digital Twins can send data to connected **endpoints**. Supported endpoints can be:
+Azure Digital Twins can send data to connected endpoints. Supported endpoints can be:
* [Event Hubs](../event-hubs/event-hubs-about.md) * [Event Grid](../event-grid/overview.md) * [Service Bus](../service-bus-messaging/service-bus-messaging-overview.md)
There are many other services where you may want to ultimately direct your data,
For example, if you're also using Azure Maps and want to correlate location with your Azure Digital Twins graph, you can use Azure Functions with Event Grid to establish communication between all the services in your deployment. For more information on integrating Azure Maps, see [Use Azure Digital Twins to update an Azure Maps indoor map](how-to-integrate-maps.md). For information on routing data in a similar way to Time Series Insights, see [Integrate with Time Series Insights](how-to-integrate-time-series-insights.md).
-Azure Digital Twins implements **at least once** delivery for data emitted to egress services.
+Azure Digital Twins implements *at least once* delivery for data emitted to egress services.
## Next steps
digital-twins Concepts Event Notifications https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-event-notifications.md
description: Learn to interpret various event types and their different notification messages. Previously updated : 12/08/2021 Last updated : 03/01/2022
This article covers event notifications generated by Azure Digital Twins, their structure, and details about the various types that can be generated.
-Different events in Azure Digital Twins produce **notifications**, which allow the solution backend to be aware when different actions are happening. These notifications are then [routed](concepts-route-events.md) to different locations inside and outside of Azure Digital Twins that can use this information to take action.
+Different events in Azure Digital Twins produce *notifications*, which allow the solution backend to be aware when different actions are happening. These notifications are then [routed](concepts-route-events.md) to different locations inside and outside of Azure Digital Twins that can use this information to take action.
There are several types of notifications that can be generated, and notification messages may look different depending on which type of event generated them. This article gives detail about different types of messages, and what they might look like.
The following sections go into more detail about the different types of notifica
## Digital twin change notifications
-**Digital twin change notifications** are triggered when a digital twin is being updated, like:
+*Digital twin change notifications* are triggered when a digital twin is being updated, like:
* When property values or metadata changes. * When digital twin or component metadata changes. An example of this scenario is changing the model of a digital twin.
This data is the information that will go in the `data` field of the lifecycle n
## Digital twin lifecycle notifications
-Whether [digital twins](concepts-twins-graph.md) represent [IoT Hub devices in Azure Digital Twins](how-to-ingest-iot-hub-data.md) or not, they will all emit notifications. They do so because of **lifecycle notifications**, which are about the digital twin itself.
+Whether [digital twins](concepts-twins-graph.md) represent [IoT Hub devices in Azure Digital Twins](how-to-ingest-iot-hub-data.md) or not, they will all emit notifications. They do so because of *lifecycle notifications*, which are about the digital twin itself.
Lifecycle notifications are triggered when: * A digital twin is created
Here's another example of digital twin data. This one is based on a [model](conc
## Digital twin relationship change notifications
-**Relationship change notifications** are triggered when any relationship of a digital twin is created, updated, or deleted.
+*Relationship change notifications* are triggered when any relationship of a digital twin is created, updated, or deleted.
### Properties
Here's an example of the data for a create or delete relationship notification.
## Digital twin telemetry messages
-**Telemetry messages** are received in Azure Digital Twins from connected devices that collect and send measurements.
+*Telemetry messages* are received in Azure Digital Twins from connected devices that collect and send measurements.
### Properties
digital-twins Concepts High Availability Disaster Recovery https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-high-availability-disaster-recovery.md
description: Learn about Azure high availability and disaster recovery features as they pertain to Azure Digital Twins, which will help you build highly available Azure IoT solutions with disaster recovery capabilities. Previously updated : 12/09/2021 Last updated : 03/01/2022
# Azure Digital Twins high availability and disaster recovery
-This article discusses the **High Availability (HA)** and **Disaster Recovery (DR)** features offered specifically by the Azure Digital Twins service. The article covers intra-region HA, cross region DR, monitoring service health, and best practices on HA/DR.
+This article discusses the High Availability (HA) and Disaster Recovery (DR) features offered specifically by the Azure Digital Twins service. The article covers intra-region HA, cross region DR, monitoring service health, and best practices on HA/DR.
A key area of consideration for resilient IoT solutions is business continuity and disaster recovery. Designing for HA and DR can help you define and achieve appropriate uptime goals for your solution.
You can also see the [Best practices](#best-practices) section for general Azure
## Intra-region HA
-Azure Digital Twins provides intra-region HA by implementing redundancies within the service. This functionality is reflected in the [service SLA](https://azure.microsoft.com/support/legal/sla/digital-twins) for uptime. **No additional work is required by the developers of an Azure Digital Twins solution to take advantage of these HA features.** Although Azure Digital Twins offers a reasonably high uptime guarantee, transient failures can still be expected, as with any distributed computing platform. Appropriate retry policies should be built in to the components interacting with a cloud application to deal with transient failures.
+Azure Digital Twins provides *intra-region HA* by implementing redundancies within the service. This functionality is reflected in the [service SLA](https://azure.microsoft.com/support/legal/sla/digital-twins) for uptime. No additional work is required by the developers of an Azure Digital Twins solution to take advantage of these HA features. Although Azure Digital Twins offers a reasonably high uptime guarantee, transient failures can still be expected, as with any distributed computing platform. Appropriate retry policies should be built in to the components interacting with a cloud application to deal with transient failures.
## Cross region DR There could be some rare situations when a data center experiences extended outages because of power failures or other events in the region. Such events are rare, and during such failures, the intra region HA capability described above may not help. Azure Digital Twins addresses this scenario with Microsoft-initiated failover.
-**Microsoft-initiated failover** is exercised in rare situations to failover all the Azure Digital Twins instances from an affected region to the corresponding [geo-paired region](../availability-zones/cross-region-replication-azure.md). This process is a default option (with no way for users to opt out), and requires no intervention from the user. Microsoft reserves the right to make a determination of when this option will be exercised. This mechanism doesn't involve user consent before the user's instance is failed over.
+*Microsoft-initiated failover* is exercised in rare situations to failover all the Azure Digital Twins instances from an affected region to the corresponding [geo-paired region](../availability-zones/cross-region-replication-azure.md). This process is a default option (with no way for users to opt out), and requires no intervention from the user. Microsoft reserves the right to make a determination of when this option will be exercised. This mechanism doesn't involve user consent before the user's instance is failed over.
>[!NOTE]
-> Some Azure services provide an additional option called **customer-initiated failover**, which enables customers to initiate a failover just for their instance, such as to run a DR drill. This mechanism is currently **not supported** by Azure Digital Twins.
+> Some Azure services provide an additional option called *customer-initiated failover*, which enables customers to initiate a failover just for their instance, such as to run a DR drill. This mechanism is currently not supported by Azure Digital Twins.
If it's important for you to keep all data within certain geographical areas, check the location of the [geo-paired region](../availability-zones/cross-region-replication-azure.md#azure-cross-region-replication-pairings-for-all-geographies) for the region where you're creating your instance, to ensure that it meets your data residency requirements. >[!NOTE]
-> Some Azure services provide an option for users to configure a different region for failover, as a way to meet data residency requirements. This capability is currently **not supported** by Azure Digital Twins.
+> Some Azure services provide an option for users to configure a different region for failover, as a way to meet data residency requirements. This capability is currently not supported by Azure Digital Twins.
## Monitor service health
During a failover event, Service Health can provide an indication of when your s
To view Service Health events... 1. Navigate to [Service Health](https://portal.azure.com/?feature.customportal=false#blade/Microsoft_Azure_Health/AzureHealthBrowseBlade/serviceIssues) in the Azure portal (you can use this link or search for it using the portal search bar).
-1. Use the left menu to switch to the *Health history* page.
-1. Look for an *Issue Name* beginning with **Azure Digital Twins**, and select it.
+1. Use the left menu to switch to the **Health history** page.
+1. Look for an **Issue Name** beginning with **Azure Digital Twins**, and select it.
:::image type="content" source="media/concepts-high-availability-disaster-recovery/navigate.png" alt-text="Screenshot of the Azure portal showing the 'Health History' page. An issue called 'Azure Digital Twins - West Europe - Mitigated' is highlighted." lightbox="media/concepts-high-availability-disaster-recovery/navigate.png":::
-1. For general information about the outage, view the *Summary* tab.
+1. For general information about the outage, view the **Summary** tab.
:::image type="content" source="media/concepts-high-availability-disaster-recovery/summary.png" alt-text="Screenshot of the Azure portal showing the 'Health History' page with the 'Summary' tab highlighted. The tab displays general information." lightbox="media/concepts-high-availability-disaster-recovery/summary.png":::
-1. For more information and updates on the issue over time, view the *Issue updates* tab.
+1. For more information and updates on the issue over time, view the **Issue updates** tab.
:::image type="content" source="media/concepts-high-availability-disaster-recovery/issue-updates.png" alt-text="Screenshot of the Azure portal showing the 'Health History' page with the 'Issue updates' tab highlighted. The tab displays the status of entries." lightbox="media/concepts-high-availability-disaster-recovery/issue-updates.png":::
digital-twins Concepts Models https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-models.md
description: Learn how Azure Digital Twins uses custom models to describe entities in your environment and how to define these models using the Digital Twin Definition Language (DTDL). Previously updated : 10/7/2021 Last updated : 03/01/2022
# Learn about twin models and how to define them in Azure Digital Twins
-A key characteristic of Azure Digital Twins is the ability to define your own vocabulary and build your twin graph in the self-defined terms of your business. This capability is provided through user-provided **models**. You can think of models as the nouns in a description of your world. Azure Digital Twins models are represented in the JSON-LD-based **Digital Twin Definition Language (DTDL)**.
+A key characteristic of Azure Digital Twins is the ability to define your own vocabulary and build your twin graph in the self-defined terms of your business. This capability is provided through user-provided *models*. You can think of models as the nouns in a description of your world. Azure Digital Twins models are represented in the JSON-LD-based *Digital Twin Definition Language (DTDL)*.
-A model is similar to a **class** in an object-oriented programming language, defining a data shape for one particular concept in your real work environment. Models have names (such as *Room* or *TemperatureSensor*), and contain elements such as properties, telemetry/events, and commands that describe what this type of entity in your environment can do. Later, you'll use these models to create [digital twins](concepts-twins-graph.md) that represent specific entities that meet this type description.
+A model is similar to a *class* in an object-oriented programming language, defining a data shape for one particular concept in your real work environment. Models have names (such as Room or TemperatureSensor), and contain elements such as properties, telemetry/events, and commands that describe what this type of entity in your environment can do. Later, you'll use these models to create [digital twins](concepts-twins-graph.md) that represent specific entities that meet this type description.
## Digital Twin Definition Language (DTDL) for models
Models for Azure Digital Twins are defined using the Digital Twins Definition La
You can view the full language specs for DTDL in GitHub: [Digital Twins Definition Language (DTDL) - Version 2](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md). This page includes detailed DTDL reference and examples to help you get started writing your own DTDL models.
-DTDL is based on JSON-LD and is programming-language independent. DTDL isn't exclusive to Azure Digital Twins, but is also used to represent device data in other IoT services such as [IoT Plug and Play](../iot-develop/overview-iot-plug-and-play.md). Azure Digital Twins uses DTDL **version 2** (use of DTDL version 1 with Azure Digital Twins has now been deprecated).
+DTDL is based on JSON-LD and is programming-language independent. DTDL isn't exclusive to Azure Digital Twins, but is also used to represent device data in other IoT services such as [IoT Plug and Play](../iot-develop/overview-iot-plug-and-play.md). Azure Digital Twins uses DTDL version 2 (use of DTDL version 1 with Azure Digital Twins has now been deprecated).
The rest of this article summarizes how the language is used in Azure Digital Twins.
Not all services that use DTDL implement the exact same features of DTDL. There
For a DTDL model to be compatible with Azure Digital Twins, it must also meet these requirements:
-* All top-level DTDL elements in a model must be of type *interface*. The reason for this requirement is that Azure Digital Twins model APIs can receive JSON objects that represent either an interface or an array of interfaces. As a result, no other DTDL element types are allowed at the top level.
-* DTDL for Azure Digital Twins must not define any *commands*.
+* All top-level DTDL elements in a model must be of type `Interface`. The reason for this requirement is that Azure Digital Twins model APIs can receive JSON objects that represent either an interface or an array of interfaces. As a result, no other DTDL element types are allowed at the top level.
+* DTDL for Azure Digital Twins must not define any commands.
* Azure Digital Twins only allows a single level of component nesting, meaning that an interface that's being used as a component can't have any components itself. * Interfaces can't be defined inline within other DTDL interfaces; they must be defined as separate top-level entities with their own IDs. Then, when another interface wants to include that interface as a component or through inheritance, it can reference its ID.
For a DTDL model to be compatible with Azure Digital Twins, it must also meet th
### Elements of a model
-Within a model definition, the top-level code item is an **interface**. This type encapsulates the entire model, and the rest of the model is defined within the interface.
+Within a model definition, the top-level code item is an *interface*. This type encapsulates the entire model, and the rest of the model is defined within the interface.
A DTDL model interface may contain zero, one, or many of each of the following fields:
-* **Property** - Properties are data fields that represent the state of an entity (like the properties in many object-oriented programming languages). Properties have backing storage and can be read at any time. For more information, see [Properties and telemetry](#properties-and-telemetry) below.
-* **Telemetry** - Telemetry fields represent measurements or events, and are often used to describe device sensor readings. Unlike properties, telemetry isn't stored on a digital twin; it's a series of time-bound data events that need to be handled as they occur. For more information, see [Properties and telemetry](#properties-and-telemetry) below.
-* **Relationship** - Relationships let you represent how a digital twin can be involved with other digital twins. Relationships can represent different semantic meanings, such as *contains* ("floor contains room"), *cools* ("hvac cools room"), *isBilledTo* ("compressor is billed to user"), and so on. Relationships allow the solution to provide a graph of interrelated entities. Relationships can also have properties of their own. For more information, see [Relationships](#relationships) below.
-* **Component** - Components allow you to build your model interface as an assembly of other interfaces, if you want. An example of a component is a *frontCamera* interface (and another component interface *backCamera*) that are used in defining a model for a *phone*. First define an interface for *frontCamera* as though it were its own model, and then reference it when defining *Phone*.
+* *Property* - Properties are data fields that represent the state of an entity (like the properties in many object-oriented programming languages). Properties have backing storage and can be read at any time. For more information, see [Properties and telemetry](#properties-and-telemetry) below.
+* *Telemetry* - Telemetry fields represent measurements or events, and are often used to describe device sensor readings. Unlike properties, telemetry isn't stored on a digital twin; it's a series of time-bound data events that need to be handled as they occur. For more information, see [Properties and telemetry](#properties-and-telemetry) below.
+* *Relationship* - Relationships let you represent how a digital twin can be involved with other digital twins. Relationships can represent different semantic meanings, such as `contains` ("floor contains room"), `cools` ("hvac cools room"), `isBilledTo` ("compressor is billed to user"), and so on. Relationships allow the solution to provide a graph of interrelated entities. Relationships can also have properties of their own. For more information, see [Relationships](#relationships) below.
+* *Component* - Components allow you to build your model interface as an assembly of other interfaces, if you want. An example of a component is a frontCamera interface (and another component interface backCamera) that are used in defining a model for a phone. First define an interface for frontCamera as though it were its own model, and then reference it when defining Phone.
- Use a component to describe something that is an integral part of your solution but doesn't need a separate identity, and doesn't need to be created, deleted, or rearranged in the twin graph independently. If you want entities to have independent existences in the twin graph, represent them as separate digital twins of different models, connected by **relationships**.
+ Use a component to describe something that is an integral part of your solution but doesn't need a separate identity, and doesn't need to be created, deleted, or rearranged in the twin graph independently. If you want entities to have independent existences in the twin graph, represent them as separate digital twins of different models, connected by relationships.
>[!TIP] >Components can also be used for organization, to group sets of related properties within a model interface. In this situation, you can think of each component as a namespace or "folder" inside the interface.
A DTDL model interface may contain zero, one, or many of each of the following f
> [!NOTE]
-> The [spec for DTDL](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md) also defines **Commands**, which are methods that can be executed on a digital twin (like a reset command, or a command to switch a fan on or off). However, *commands are not currently supported in Azure Digital Twins.*
+> The [spec for DTDL](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md) also defines *Commands*, which are methods that can be executed on a digital twin (like a reset command, or a command to switch a fan on or off). However, commands are not currently supported in Azure Digital Twins.
### Model code
The fields of the model are:
| Field | Description | | | | | `@id` | An identifier for the model. Must be in the format `dtmi:<domain>:<unique-model-identifier>;<model-version-number>`. |
-| `@type` | Identifies the kind of information being described. For an interface, the type is *Interface*. |
+| `@type` | Identifies the kind of information being described. For an interface, the type is `Interface`. |
| `@context` | Sets the [context](https://niem.github.io/json/reference/json-ld/context/) for the JSON document. Models should use `dtmi:dtdl:context;2`. | | `displayName` | [optional] Gives you the option to define a friendly name for the model. |
-| `contents` | All remaining interface data is placed here, as an array of attribute definitions. Each attribute must provide a `@type` (**property**, **telemetry**, **command**, **relationship**, or **component**) to identify the sort of interface information it describes, and then a set of properties that define the actual attribute (for example, `name` and `schema` to define a **property**). |
+| `contents` | All remaining interface data is placed here, as an array of attribute definitions. Each attribute must provide a `@type` (`Property`, `Telemetry`, `Command`, `Relationship`, or `Component`) to identify the sort of interface information it describes, and then a set of properties that define the actual attribute (for example, `name` and `schema` to define a `Property`). |
#### Example model This section contains an example of a basic model, written as a DTDL interface.
-This model describes a Home, with one **property** for an ID. The Home model also defines a **relationship** to a Floor model, which can be used to indicate that a Home twin is connected to certain Floor twins.
+This model describes a Home, with one property for an ID. The Home model also defines a relationship to a Floor model, which can be used to indicate that a Home twin is connected to certain Floor twins.
:::code language="json" source="~/digital-twins-docs-samples-getting-started/models/basic-home-example/IHome.json"::: ## Properties and telemetry
-This section goes into more detail about **properties** and **telemetry** in DTDL models.
+This section goes into more detail about *properties* and *telemetry* in DTDL models.
For a comprehensive list of the fields that may appear as part of a property, see [Property in the DTDL v2 spec](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#property). For a comprehensive list of the fields that may appear as part of telemetry, see [Telemetry in the DTDL v2 spec](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#telemetry).
For a comprehensive list of the fields that may appear as part of a property, se
### Difference between properties and telemetry
-Here's some guidance on conceptually distinguishing between DTDL **property** and **telemetry** in Azure Digital Twins.
-* **Properties** are expected to have backing storage, which means that you can read a property at any time and retrieve its value. If the property is writable, you can also store a value in the property.
-* **Telemetry** is more like a stream of events; it's a set of data messages that have short lifespans. If you don't set up listening for the event and actions to take when it happens, there's no trace of the event at a later time. You can't come back to it and read it later.
+Here's some guidance on conceptually distinguishing between DTDL properties and telemetry in Azure Digital Twins.
+* *Properties* are expected to have backing storage, which means that you can read a property at any time and retrieve its value. If the property is writable, you can also store a value in the property.
+* *Telemetry* is more like a stream of events; it's a set of data messages that have short lifespans. If you don't set up listening for the event and actions to take when it happens, there's no trace of the event at a later time. You can't come back to it and read it later.
- In C# terms, telemetry is like a C# event. - In IoT terms, telemetry is typically a single measurement sent by a device.
-**Telemetry** is often used with IoT devices, because many devices either can't, or aren't interested in, storing the measurement values they generate. Instead, they send them out as a stream of "telemetry" events. In this case, you can't query the device at any time for the latest value of the telemetry field. You'll need to listen to the messages from the device and take actions as the messages arrive.
+Telemetry is often used with IoT devices, because many devices either can't, or aren't interested in, storing the measurement values they generate. Instead, they send them out as a stream of "telemetry" events. In this case, you can't query the device at any time for the latest value of the telemetry field. You'll need to listen to the messages from the device and take actions as the messages arrive.
-As a result, when designing a model in Azure Digital Twins, you'll probably use **properties** in most cases to model your twins. Doing so allows you to have the backing storage and the ability to read and query the data fields.
+As a result, when designing a model in Azure Digital Twins, you'll probably use properties in most cases to model your twins. Doing so allows you to have the backing storage and the ability to read and query the data fields.
Telemetry and properties often work together to handle data ingress from devices. As all ingress to Azure Digital Twins is via [APIs](concepts-apis-sdks.md), you'll typically use your ingress function to read telemetry or property events from devices, and set a property in Azure Digital Twins in response.
You can also publish a telemetry event from the Azure Digital Twins API. As with
### Schema
-As per DTDL, the schema for **property** and **telemetry** attributes can be of standard primitive typesΓÇö`integer`, `double`, `string`, and `boolean`ΓÇöand other types such as `dateTime` and `duration`.
+As per DTDL, the schema for property and telemetry attributes can be of standard primitive typesΓÇö`integer`, `double`, `string`, and `boolean`ΓÇöand other types such as `dateTime` and `duration`.
In addition to primitive types, property and telemetry fields can have these [complex types](#complex-object-type-example): * `Object` * `Map` * `Enum`
-* (**telemetry** only) `Array`
+* (telemetry only) `Array`
They can also be [semantic types](#semantic-type-example), which allow you to annotate values with units. ### Basic property and telemetry examples
-Here's a basic example of a **property** on a DTDL model. This example shows the ID property of a Home.
+Here's a basic example of a property on a DTDL model. This example shows the ID property of a Home.
:::code language="json" source="~/digital-twins-docs-samples-getting-started/models/basic-home-example/IHome.json" highlight="7-11":::
-Here's a basic example of a **telemetry** field on a DTDL model. This example shows Temperature telemetry on a Sensor.
+Here's a basic example of a telemetry field on a DTDL model. This example shows Temperature telemetry on a Sensor.
:::code language="json" source="~/digital-twins-docs-samples-getting-started/models/basic-home-example/ISensor.json" highlight="7-11":::
The following example shows a Sensor model with a semantic-type telemetry for Te
## Relationships
-This section goes into more detail about **relationships** in DTDL models.
+This section goes into more detail about *relationships* in DTDL models.
For a comprehensive list of the fields that may appear as part of a relationship, see [Relationship in the DTDL v2 spec](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#relationship).
Here's a basic example of a relationship on a DTDL model. This example shows a r
### Targeted and non-targeted relationships
-Relationships can be defined with or without a **target**. A target specifies which types of twin the relationship can reach. For example, you might include a target to specify that a Home model can only have a *rel_has_floors* relationship with twins that are Floor twins.
+Relationships can be defined with or without a *target*. A target specifies which types of twin the relationship can reach. For example, you might include a target to specify that a Home model can only have a `rel_has_floors` relationship with twins that are Floor twins.
Sometimes, you might want to define a relationship without a specific target, so that the relationship can connect to many different types of twins.
Here's an example of a relationship on a DTDL model that doesn't have a target.
### Properties of relationships
-DTDL also allows for **relationships** to have properties of their own. When defining a relationship within a DTDL model, the relationship can have its own `properties` field where you can define custom properties to describe relationship-specific state.
+DTDL also allows for relationships to have properties of their own. When defining a relationship within a DTDL model, the relationship can have its own `properties` field where you can define custom properties to describe relationship-specific state.
The following example shows another version of the Home model, where the `rel_has_floors` relationship has a property representing when the related Floor was last occupied.
The following example shows another version of the Home model, where the `rel_ha
## Components
-This section goes into more detail about **components** in DTDL models.
+This section goes into more detail about *components* in DTDL models.
For a comprehensive list of the fields that may appear as part of a component, see [Component in the DTDL v2 spec](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#component).
If other models in this solution should also contain a thermostat, they can refe
## Model inheritance
-Sometimes, you may want to specialize a model further. For example, it might be useful to have a generic model Room, and specialized variants ConferenceRoom and Gym. To express specialization, **DTDL supports inheritance**. Interfaces can inherit from one or more other interfaces. You can do so by adding an `extends` field to the model.
+Sometimes, you may want to specialize a model further. For example, it might be useful to have a generic model Room, and specialized variants ConferenceRoom and Gym. To express specialization, DTDL supports *inheritance*. Interfaces can inherit from one or more other interfaces. You can do so by adding an `extends` field to the model.
The `extends` section is an interface name, or an array of interface names (allowing the extending interface to inherit from multiple parent models). A single parent can serve as the base model for multiple extending interfaces.
In this case, Core contributes an ID and name to Home. Other models can also ext
Once inheritance is applied, the extending interface exposes all properties from the entire inheritance chain.
-The extending interface can't change any of the definitions of the parent interfaces; it can only add to them. It also can't redefine a capability already defined in any of its parent interfaces (even if the capabilities are defined to be the same). For example, if a parent interface defines a `double` property *mass*, the extending interface can't contain a declaration of *mass*, even if it's also a `double`.
+The extending interface can't change any of the definitions of the parent interfaces; it can only add to them. It also can't redefine a capability already defined in any of its parent interfaces (even if the capabilities are defined to be the same). For example, if a parent interface defines a `double` property `mass`, the extending interface can't contain a declaration of `mass`, even if it's also a `double`.
## Modeling best practices
digital-twins Concepts Ontologies Adopt https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-ontologies-adopt.md
description: Learn about existing industry ontologies that can be adopted for Azure Digital Twins Previously updated : 10/27/2021 Last updated : 03/01/2022
Each ontology is focused on an initial set of models. The ontology authors welco
## RealEstateCore smart building ontology
-*Get the ontology from the following repository:* [Digital Twins Definition Language-based RealEstateCore ontology for smart buildings](https://github.com/Azure/opendigitaltwins-building).
+Get the ontology from the following repository: [Digital Twins Definition Language-based RealEstateCore ontology for smart buildings](https://github.com/Azure/opendigitaltwins-building).
Microsoft has partnered with [RealEstateCore](https://www.realestatecore.io/) to deliver this open-source DTDL ontology for the real estate industry. [RealEstateCore](https://www.realestatecore.io/) is a Swedish consortium of real estate owners, software vendors, and research institutions.
You can also read more about the partnership with RealEstateCore and goals for t
## Smart cities ontology
-*Get the ontology from the following repository:* [Digital Twins Definition Language (DTDL) ontology for Smart Cities](https://github.com/Azure/opendigitaltwins-smartcities).
+Get the ontology from the following repository: [Digital Twins Definition Language (DTDL) ontology for Smart Cities](https://github.com/Azure/opendigitaltwins-smartcities).
Microsoft has collaborated with [Open Agile Smart Cities (OASC)](https://oascities.org/) and [Sirus](https://sirus.be/) to provide a DTDL-based ontology for smart cities, starting with [ETSI CIM NGSI-LD](https://www.etsi.org/committee/cim). Apart from ETSI NGSI-LD, we've also evaluated Saref4City, CityGML, ISO, and others.
You can also read more about the partnerships and approach for smart cities in t
## Energy grid ontology
-*Get the ontology from the following repository:* [Digital Twins Definition Language (DTDL) ontology for Energy Grid](https://github.com/Azure/opendigitaltwins-energygrid/).
+Get the ontology from the following repository: [Digital Twins Definition Language (DTDL) ontology for Energy Grid](https://github.com/Azure/opendigitaltwins-energygrid/).
This ontology was created to help solution providers accelerate development of digital twin solutions for energy use cases like monitoring grid assets, outage and impact analysis, simulation, and predictive maintenance. Additionally, the ontology can be used to enable the digital transformation and modernization of the energy grid. It's adapted from the [Common Information Model (CIM)](https://cimug.ucaiug.org/), a global standard for energy grid assets management, power system operations modeling, and physical energy commodity market.
digital-twins Concepts Ontologies Convert https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-ontologies-convert.md
description: Understand the process of converting industry-standard models into DTDL for Azure Digital Twins Previously updated : 2/12/2021 Last updated : 02/28/2022
Most [ontologies](concepts-ontologies.md) are based on semantic web standards such as [OWL](https://www.w3.org/OWL/), [RDF](https://www.w3.org/2001/sw/wiki/RDF), and [RDFS](https://www.w3.org/2001/sw/wiki/RDFS).
-To use a model with Azure Digital Twins, it must be in DTDL format. This article describes general design guidance in the form of a **conversion pattern** for converting RDF-based models to DTDL so that they can be used with Azure Digital Twins.
+To use a model with Azure Digital Twins, it must be in DTDL format. This article describes general design guidance in the form of a conversion pattern for converting RDF-based models to DTDL so that they can be used with Azure Digital Twins.
The article also contains [sample converter code](#converter-samples) for RDF and OWL converters, which can be extended for other schemas in the building industry.
digital-twins Concepts Ontologies https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-ontologies.md
description: Learn about digital twin ontologies, how they're used in Azure Digital Twins, and how these DTDL ontologies can be used for modeling in the context of certain industries. Previously updated : 10/21/2021 Last updated : 02/28/2022
There are three possible strategies for integrating industry-standard ontologies
| Strategy | Description | Resources | | | | |
-| **Adopt** | You can start your solution with an open-source DTDL ontology that has been built on widely adopted industry standards. You can either use these model-sets out-of-the-box, or extend them with your own additions for a customized solution. | [Adopting&nbsp;industry&nbsp;standard ontologies](concepts-ontologies-adopt.md)<br><br>[Extending&nbsp;ontologies](concepts-ontologies-extend.md) |
-| **Convert** | If you already have existing models represented in another standard format, you can convert them to DTDL to use them with Azure Digital Twins. | [Converting&nbsp;ontologies](concepts-ontologies-convert.md)<br><br>[Extending&nbsp;ontologies](concepts-ontologies-extend.md) |
-| **Author** | You can always develop your own custom DTDL models from scratch, using any applicable industry standards as inspiration. | [DTDL models](concepts-models.md) |
+| Adopt | You can start your solution with an open-source DTDL ontology that has been built on widely adopted industry standards. You can either use these model-sets out-of-the-box, or extend them with your own additions for a customized solution. | [Adopting&nbsp;industry&nbsp;standard ontologies](concepts-ontologies-adopt.md)<br><br>[Extending&nbsp;ontologies](concepts-ontologies-extend.md) |
+| Convert | If you already have existing models represented in another standard format, you can convert them to DTDL to use them with Azure Digital Twins. | [Converting&nbsp;ontologies](concepts-ontologies-convert.md)<br><br>[Extending&nbsp;ontologies](concepts-ontologies-extend.md) |
+| Author | You can always develop your own custom DTDL models from scratch, using any applicable industry standards as inspiration. | [DTDL models](concepts-models.md) |
### Using ontology strategies in a model development path
digital-twins Concepts Query Language https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-query-language.md
description: Learn about the basics of the Azure Digital Twins query language. Previously updated : 10/27/2021 Last updated : 02/28/2022
# Azure Digital Twins query language
-This article describes the basics of the query language and its capabilities. Recall that the center of Azure Digital Twins is the [twin graph](concepts-twins-graph.md), constructed from digital twins and relationships. This graph can be queried to get information about the digital twins and relationships it contains. These queries are written in a custom SQL-like query language, referred to as the **Azure Digital Twins query language**. This language is similar to the [IoT Hub query language](../iot-hub/iot-hub-devguide-query-language.md) with many comparable features.
+This article describes the basics of the query language and its capabilities. Recall that the center of Azure Digital Twins is the [twin graph](concepts-twins-graph.md), constructed from digital twins and relationships. This graph can be queried to get information about the digital twins and relationships it contains. These queries are written in a custom SQL-like query language, referred to as the *Azure Digital Twins query language*. This language is similar to the [IoT Hub query language](../iot-hub/iot-hub-devguide-query-language.md) with many comparable features.
For more detailed examples of query syntax and how to run query requests, see [Query the twin graph](how-to-query-graph.md).
To submit a query to the service from a client app, you'll use the Azure Digital
## Considerations for querying When writing queries for Azure Digital Twins, keep the following considerations in mind:
-* **Remember case sensitivity**: All Azure Digital Twins query operations are case-sensitive, so take care to use the exact names defined in the models. If property names are misspelled or incorrectly cased, the result set is empty with no errors returned.
-* **Escape single quotes**: If your query text includes a single quote character in the data, the quote will need to be escaped with the `\` character. Here's an example that deals with a property value of *D'Souza*:
+* Remember case sensitivity: All Azure Digital Twins query operations are case-sensitive, so take care to use the exact names defined in the models. If property names are misspelled or incorrectly cased, the result set is empty with no errors returned.
+* Escape single quotes: If your query text includes a single quote character in the data, the quote will need to be escaped with the `\` character. Here's an example that deals with a property value of *D'Souza*:
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="EscapedSingleQuote":::
digital-twins Concepts Query Units https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-query-units.md
description: Learn about the billing concept of Query Units in Azure Digital Twins Previously updated : 12/09/2021 Last updated : 03/01/2022
This article covers Query Units, how they're used by Azure Digital Twins, and how to find the Query Unit consumption in Azure Digital Twins.
-An Azure Digital Twins **Query Unit (QU)** is a unit of on-demand computation that's used to execute your [Azure Digital Twins queries](how-to-query-graph.md) using the [Query API](/rest/api/digital-twins/dataplane/query).
+An Azure Digital Twins *Query Unit (QU)* is a unit of on-demand computation that's used to execute your [Azure Digital Twins queries](how-to-query-graph.md) using the [Query API](/rest/api/digital-twins/dataplane/query).
It abstracts away the system resources like CPU, IOPS, and memory that are required to perform query operations supported by Azure Digital Twins, allowing you to track usage in Query Units instead.
digital-twins Concepts Route Events https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-route-events.md
description: Learn how to route events within Azure Digital Twins and to other Azure Services. Previously updated : 12/08/2021 Last updated : 03/01/2022
# Route events within and outside of Azure Digital Twins
-This article covers **event routes** and how Azure Digital Twins uses them to send data internally and to consumers outside the service.
+This article covers *event routes* and how Azure Digital Twins uses them to send data internally and to consumers outside the service.
There are two major cases for sending Azure Digital Twins data: * Sending data from one twin in the Azure Digital Twins graph to another. For instance, when a property on one digital twin changes, you may want to notify and update another digital twin based on the updated data.
Event routes are used for both of these scenarios.
An event route lets you send event data from digital twins in Azure Digital Twins to custom-defined endpoints in your subscriptions. Three Azure services are currently supported for endpoints: [Event Hubs](../event-hubs/event-hubs-about.md), [Event Grid](../event-grid/overview.md), and [Service Bus](../service-bus-messaging/service-bus-messaging-overview.md). Each of these Azure services can be connected to other services and acts as the middleman, sending data along to final destinations such as Time Series Insights or Azure Maps for whatever processing you need.
-Azure Digital Twins implements **at least once** delivery for data emitted to egress services.
+Azure Digital Twins implements *at least once* delivery for data emitted to egress services.
The following diagram illustrates the flow of event data through a larger IoT solution with an Azure Digital Twins aspect:
To walk through the process of setting up an Azure function to process digital t
## Create an endpoint
-To define an event route, developers first must define endpoints. An **endpoint** is a destination outside of Azure Digital Twins that supports a route connection. Supported destinations include:
+To define an event route, developers first must define endpoints. An *endpoint* is a destination outside of Azure Digital Twins that supports a route connection. Supported destinations include:
* Event Grid custom topics * Event Hubs * Service Bus
When defining an endpoint, you'll need to provide:
* The endpoint's name * The endpoint type (Event Grid, Event Hubs, or Service Bus) * The primary connection string and secondary connection string to authenticate
-* The topic path of the endpoint, such as *your-topic.westus2.eventgrid.azure.net*
+* The topic path of the endpoint, such as `your-topic.westus2.eventgrid.azure.net`
The endpoint APIs that are available in control plane are: * Create endpoint
Here's an example of creating an event route within a client application, using
## Dead-letter events
-When an endpoint can't deliver an event within a certain time period or after trying to deliver the event several times, it can send the undelivered event to a storage account. This process is known as **dead-lettering**. Azure Digital Twins will dead-letter an event when **one of the following** conditions is met:
+When an endpoint can't deliver an event within a certain time period or after trying to deliver the event several times, it can send the undelivered event to a storage account. This process is known as *dead-lettering*. Azure Digital Twins will dead-letter an event when one of the following conditions is met:
* Event isn't delivered within the time-to-live period * The number of tries to deliver the event has exceeded the limit
-If either of the conditions is met, the event is dropped or dead-lettered. By default, each endpoint **does not** turn on dead-lettering. To enable it, you must specify a storage account to hold undelivered events when creating the endpoint. You can then pull events from this storage account to resolve deliveries.
+If either of the conditions is met, the event is dropped or dead-lettered. By default, each endpoint doesn't turn on dead-lettering. To enable it, you must specify a storage account to hold undelivered events when creating the endpoint. You can then pull events from this storage account to resolve deliveries.
Before setting the dead-letter location, you must have a storage account with a container. You provide the URL for this container when creating the endpoint. The dead-letter is provided as a container URL with a SAS token. That token needs only `write` permission for the destination container within the storage account. The fully formed URL will be in the format of: `https://<storage-account-name>.blob.core.windows.net/<container-name>?<SAS-token>`
digital-twins Concepts Security https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-security.md
description: Learn about Azure Digital Twins security best practices. Previously updated : 12/10/2021 Last updated : 03/01/2022
You can use Azure RBAC to grant permissions to a *security principal*, which may
With Azure AD, access is a two-step process. When a security principal (a user, group, or application) attempts to access Azure Digital Twins, the request must be *authenticated* and *authorized*.
-1. First, the security principal's identity is *authenticated*, and an OAuth 2.0 token is returned.
-2. Next, the token is passed as part of a request to the Azure Digital Twins service, to *authorize* access to the specified resource.
+1. First, the security principal's identity is authenticated, and an OAuth 2.0 token is returned.
+2. Next, the token is passed as part of a request to the Azure Digital Twins service, to authorize access to the specified resource.
-The authentication step requires any application request to contain an OAuth 2.0 access token at runtime. If an application is running within an Azure entity such as an [Azure Functions](../azure-functions/functions-overview.md) app, it can use a **managed identity** to access the resources. Read more about managed identities in the next section.
+The authentication step requires any application request to contain an OAuth 2.0 access token at runtime. If an application is running within an Azure entity such as an [Azure Functions](../azure-functions/functions-overview.md) app, it can use a *managed identity* to access the resources. Read more about managed identities in the next section.
The authorization step requires that an Azure role be assigned to the security principal. The roles that are assigned to a security principal determine the permissions that the principal will have. Azure Digital Twins provides Azure roles that encompass sets of permissions for Azure Digital Twins resources. These roles are described later in this article.
With managed identities, the Azure platform manages this runtime identity. You d
#### Authorization: Azure roles for Azure Digital Twins
-Azure provides **two Azure built-in roles** for authorizing access to the Azure Digital Twins [data plane APIs](concepts-apis-sdks.md#overview-data-plane-apis). You can refer to the roles either by name or by ID:
+Azure provides two Azure built-in roles for authorizing access to the Azure Digital Twins [data plane APIs](concepts-apis-sdks.md#overview-data-plane-apis). You can refer to the roles either by name or by ID:
| Built-in role | Description | ID | | | | |
For more information about how built-in roles are defined, see [Understand role
##### Automating roles
-When referring to roles in automated scenarios, it's recommended to refer to them by their **IDs** rather than their names. The names may change between releases, but the IDs won't, making them a more stable reference in automation.
+When referring to roles in automated scenarios, it's recommended to refer to them by their IDs rather than their names. The names may change between releases, but the IDs won't, making them a more stable reference in automation.
> [!TIP] > If you're assigning roles with a cmdlet, such as `New-AzRoleAssignment` ([reference](/powershell/module/az.resources/new-azroleassignment)), you can use the `-RoleDefinitionId` parameter instead of `-RoleDefinitionName` to pass an ID instead of a name for the role.
If a user attempts to perform an action not allowed by their role, they may rece
## Managed identity for accessing other resources
-Setting up an [Azure Active Directory (Azure AD)](../active-directory/fundamentals/active-directory-whatis.md) **managed identity** for an Azure Digital Twins instance can allow the instance to easily access other Azure AD-protected resources, such as [Azure Key Vault](../key-vault/general/overview.md). The identity is managed by the Azure platform, and doesn't require you to provision or rotate any secrets. For more about managed identities in Azure AD, see [Managed identities for Azure resources](../active-directory/managed-identities-azure-resources/overview.md).
+Setting up an [Azure Active Directory (Azure AD)](../active-directory/fundamentals/active-directory-whatis.md) *managed identity* for an Azure Digital Twins instance can allow the instance to easily access other Azure AD-protected resources, such as [Azure Key Vault](../key-vault/general/overview.md). The identity is managed by the Azure platform, and doesn't require you to provision or rotate any secrets. For more about managed identities in Azure AD, see [Managed identities for Azure resources](../active-directory/managed-identities-azure-resources/overview.md).
-Azure supports two types of managed identities: system-assigned and user-assigned. Currently, Azure Digital Twins supports only **system-assigned identities**.
+Azure supports two types of managed identities: system-assigned and user-assigned. Currently, Azure Digital Twins supports only *system-assigned identities*.
You can use a system-assigned managed identity for your Azure Digital Instance to authenticate to a [custom-defined endpoint](concepts-route-events.md#create-an-endpoint). Azure Digital Twins supports system-assigned identity-based authentication to endpoints for [Event Hubs](../event-hubs/event-hubs-about.md) and [Service Bus](../service-bus-messaging/service-bus-messaging-overview.md) destinations, and to an [Azure Storage Container](../storage/blobs/storage-blobs-introduction.md) endpoint for [dead-letter events](concepts-route-events.md#dead-letter-events). [Event Grid](../event-grid/overview.md) endpoints are currently not supported for managed identities.
For instructions on how to set up Private Link for Azure Digital Twins, see [Ena
### Design considerations When working with Private Link for Azure Digital Twins, here are some factors you may want to consider:
-* **Pricing**: For pricing details, see [Azure Private Link pricing](https://azure.microsoft.com/pricing/details/private-link).
-* **Regional availability**: For Azure Digital Twins, this feature is available in all the Azure regions where Azure Digital Twins is available.
-* **Maximum number of private endpoints per Azure Digital Twins instance**: 10
+* Pricing: For pricing details, see [Azure Private Link pricing](https://azure.microsoft.com/pricing/details/private-link).
+* Regional availability: For Azure Digital Twins, this feature is available in all the Azure regions where Azure Digital Twins is available.
+* Maximum number of private endpoints per Azure Digital Twins instance: 10
For information on the limits of Private Link, see [Azure Private Link documentation: Limitations](../private-link/private-link-service-overview.md#limitations). ## Service tags
-A **service tag** represents a group of IP address prefixes from a given Azure service. Microsoft manages the address prefixes encompassed by the service tag and automatically updates the service tag as addresses change, minimizing the complexity of frequent updates to network security rules. For more information about service tags, see [Virtual network tags](../virtual-network/service-tags-overview.md).
+A *service tag* represents a group of IP address prefixes from a given Azure service. Microsoft manages the address prefixes encompassed by the service tag and automatically updates the service tag as addresses change, minimizing the complexity of frequent updates to network security rules. For more information about service tags, see [Virtual network tags](../virtual-network/service-tags-overview.md).
-You can use service tags to define network access controls on [network security groups](../virtual-network/network-security-groups-overview.md#security-rules) or [Azure Firewall](../firewall/service-tags.md), by using service tags in place of specific IP addresses when you create security rules. By specifying the service tag name (in this case, **AzureDigitalTwins**) in the appropriate *source* or *destination* field of a rule, you can allow or deny the traffic for the corresponding service.
+You can use service tags to define network access controls on [network security groups](../virtual-network/network-security-groups-overview.md#security-rules) or [Azure Firewall](../firewall/service-tags.md), by using service tags in place of specific IP addresses when you create security rules. By specifying the service tag name (in this case, AzureDigitalTwins) in the appropriate **source** or **destination** field of a rule, you can allow or deny the traffic for the corresponding service.
-Below are the details of the **AzureDigitalTwins** service tag.
+Below are the details of the AzureDigitalTwins service tag.
| Tag | Purpose | Can use inbound or outbound? | Can be regional? | Can use with Azure Firewall? | | | | | | |
Here are the steps to access [event route](concepts-route-events.md) endpoints u
3. Refer to the documentation of the external resource connected to the endpoint (for example, the [Event Grid](../event-grid/overview.md), [Event Hubs](../event-hubs/event-hubs-about.md), [Service Bus](../service-bus-messaging/service-bus-messaging-overview.md), or [Azure Storage](../storage/blobs/storage-blobs-overview.md) for [dead-letter events](concepts-route-events.md#dead-letter-events)) to see how to set IP filters for that resource.
-4. Set IP filters on the external resource(s) using the IP ranges from *Step 2*.
+4. Set IP filters on the external resource(s) using the IP ranges from Step 2.
5. Update the IP ranges periodically as required. The ranges may change over time, so it's a good idea to check them regularly and refresh them when needed. The frequency of these updates can vary, but it's a good idea to check them once a week.
Azure Digital Twins provides encryption of data at rest and in-transit as it's w
## Cross-Origin Resource Sharing (CORS)
-Azure Digital Twins doesn't currently support **Cross-Origin Resource Sharing (CORS)**. As a result, if you're calling a REST API from a browser app, an [API Management (APIM)](../api-management/api-management-key-concepts.md) interface, or a [Power Apps](/powerapps/powerapps-overview) connector, you may see a policy error.
+Azure Digital Twins doesn't currently support Cross-Origin Resource Sharing (CORS). As a result, if you're calling a REST API from a browser app, an [API Management (APIM)](../api-management/api-management-key-concepts.md) interface, or a [Power Apps](/powerapps/powerapps-overview) connector, you may see a policy error.
To resolve this error, you can do one of the following actions: * Strip the CORS header `Access-Control-Allow-Origin` from the message. This header indicates whether the response can be shared.
digital-twins Concepts Twins Graph https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/concepts-twins-graph.md
description: Learn about digital twins, and how their relationships form a digital twin graph. Previously updated : 10/20/2021 Last updated : 03/01/2022
# Digital twins and their twin graph
-This article describes what **digital twins** are in the context of Azure Digital Twins, and how relationships between them can form a **twin graph**. In an Azure Digital Twins solution, the entities in your environment are represented by **digital twins**. A digital twin is an instance of one of your custom-defined [models](concepts-models.md). It can be connected to other digital twins via **relationships** to form a **twin graph**: this twin graph is the representation of your entire environment.
+This article describes what digital twins are in the context of Azure Digital Twins, and how relationships between them can form a twin graph. In an Azure Digital Twins solution, the entities in your environment are represented by *digital twins*. A digital twin is an instance of one of your custom-defined [models](concepts-models.md). It can be connected to other digital twins via *relationships* to form a *twin graph*: this twin graph is the representation of your entire environment.
> [!TIP] > "Azure Digital Twins" refers to this Azure service as a whole. "Digital twin(s)" or just "twin(s)" refers to individual twin nodes inside your instance of the service.
After creating and uploading a model, your client app can create an instance of
Twins are connected into a twin graph by their relationships. The relationships that a twin can have are defined as part of its model.
-For example, the model Floor might define a *contains* relationship that targets twins of type Room. With this definition, Azure Digital Twins will allow you to create *contains* relationships from any Floor twin to any Room twin (including twins that are of Room subtypes).
+For example, the model Floor might define a `contains` relationship that targets twins of type Room. With this definition, Azure Digital Twins will allow you to create `contains` relationships from any Floor twin to any Room twin (including twins that are of Room subtypes).
The result of this process is a set of nodes (the digital twins) connected via edges (their relationships) in a graph.
You can initialize the properties of a twin when it's created, or set them later
:::code language="csharp" source="~/digital-twins-docs-samples/sdks/csharp/twin_operations_other.cs" id="CreateTwin_noHelper":::
-You can also use a helper class called `BasicDigitalTwin` to store property fields in a "twin" object more directly, as an alternative to using a dictionary. For more information about the helper class and examples of its use, see the [Create a digital twin](how-to-manage-twin.md#create-a-digital-twin) section of *How-to: Manage digital twins*.
+You can also use a helper class called `BasicDigitalTwin` to store property fields in a "twin" object more directly, as an alternative to using a dictionary. For more information about the helper class and examples of its use, see [Create a digital twin](how-to-manage-twin.md#create-a-digital-twin).
>[!NOTE]
->While twin properties are treated as optional and thus don't have to be initialized, any [components](concepts-models.md#elements-of-a-model) on the twin **do** need to be set when the twin is created. They can be empty objects, but the components themselves must exist.
+>While twin properties are treated as optional and thus don't have to be initialized, any [components](concepts-models.md#elements-of-a-model) on the twin need to be set when the twin is created. They can be empty objects, but the components themselves must exist.
### Create relationships
digital-twins How To Authenticate Client https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-authenticate-client.md
description: Learn how to write authentication code in a client application Previously updated : 1/3/2022 Last updated : 02/22/2022
Here's a code sample to add a `DefaultAzureCredential` to your project:
:::code language="csharp" source="~/digital-twins-docs-samples/sdks/csharp/authentication.cs" id="DefaultAzureCredential_full"::: + #### Set up local Azure credentials [!INCLUDE [Azure Digital Twins: local credentials prereq (inner)](../../includes/digital-twins-local-credentials-inner.md)]
digital-twins How To Create App Registration Cli https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-create-app-registration-cli.md
When working with Azure Digital Twins, it's common to interact with your instanc
The app registration isn't required for all authentication scenarios. However, if you're using an authentication strategy or code sample that does require an app registration, this article shows you how to set one up and grant it permissions to the Azure Digital Twins APIs. It also covers how to collect important values that you'll need to use the app registration when authenticating. >[!TIP]
-> You may prefer to set up a new app registration every time you need one, *or* to do this only once, establishing a single app registration that will be shared among all scenarios that require it.
+> You may prefer to set up a new app registration every time you need one, or to do this only once, establishing a single app registration that will be shared among all scenarios that require it.
[!INCLUDE [azure-cli-prepare-your-environment.md](../../includes/azure-cli-prepare-your-environment.md)]
The app registration isn't required for all authentication scenarios. However, i
First, create a file containing certain service information that your app registration will need to access the Azure Digital Twins APIs. Later, you'll pass in this file when creating the app registration, to set up the Azure Digital Twins permissions.
-Create a new .json file on your computer called **manifest.json**. Copy this text into the file:
+Create a new .json file on your computer called *manifest.json*. Copy this text into the file:
```json [
To upload the file, go to the Cloud Shell window in your browser. Select the "Up
:::image type="content" source="media/how-to-set-up-instance/cloud-shell/cloud-shell-upload.png" alt-text="Screenshot of Azure Cloud Shell. The Upload icon is highlighted.":::
-Navigate to the **manifest.json** file on your machine and select "Open." Doing so will upload the file to the root of your Cloud Shell storage.
+Navigate to the *manifest.json* file on your machine and select **Open**. Doing so will upload the file to the root of your Cloud Shell storage.
## Create the registration
You can also verify the app registration was successfully created with the neces
## Collect important values Next, collect some important values about the app registration that you'll need to use the app registration to authenticate a client application. These values include:
-* **resource name**
-* **client ID**
-* **tenant ID**
-* **client secret**
+* resource name
+* client ID
+* tenant ID
+* client secret
-To work with Azure Digital Twins, the **resource name** is `http://digitaltwins.azure.net`.
+To work with Azure Digital Twins, the resource name is `http://digitaltwins.azure.net`.
The following sections describe how to find the other values.
Directory (tenant) ID:
### Collect client secret
-To create a **client secret** for your app registration, you'll need your app registration's client ID value from the previous section. Use the value in the following CLI command to create a new secret:
+To create a client secret for your app registration, you'll need your app registration's client ID value from the previous section. Use the value in the following CLI command to create a new secret:
```azurecli-interactive az ad app credential reset --id <client-ID> --append
digital-twins How To Create App Registration Portal https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-create-app-registration-portal.md
When working with Azure Digital Twins, it's common to interact with your instanc
The app registration isn't required for all authentication scenarios. However, if you're using an authentication strategy or code sample that does require an app registration, this article shows you how to set one up and grant it permissions to the Azure Digital Twins APIs. It also covers how to collect important values that you'll need to use the app registration when authenticating. >[!TIP]
-> You may prefer to set up a new app registration every time you need one, *or* to do this only once, establishing a single app registration that will be shared among all scenarios that require it.
+> You may prefer to set up a new app registration every time you need one, or to do this only once, establishing a single app registration that will be shared among all scenarios that require it.
## Create the registration
-Start by navigating to [Azure Active Directory](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/Overview) in the Azure portal (you can use this link or find it with the portal search bar). Select *App registrations* from the service menu, and then *+ New registration*.
+Start by navigating to [Azure Active Directory](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/Overview) in the Azure portal (you can use this link or find it with the portal search bar). Select **App registrations** from the service menu, and then **+ New registration**.
:::image type="content" source="media/how-to-create-app-registration/new-registration.png" alt-text="Screenshot of the Azure AD service page in the Azure portal, showing the steps to create a new registration in the 'App registrations' page.":::
-In the *Register an application* page that follows, fill in the requested values:
+In the **Register an application** page that follows, fill in the requested values:
* **Name**: An Azure AD application display name to associate with the registration
-* **Supported account types**: Select *Accounts in this organizational directory only (Default Directory only - Single tenant)*
-* **Redirect URI**: An *Azure AD application reply URL* for the Azure AD application. Add a *Public client/native (mobile & desktop)* URI for `http://localhost`.
+* **Supported account types**: Select **Accounts in this organizational directory only (Default Directory only - Single tenant)**
+* **Redirect URI**: An **Azure AD application reply URL** for the Azure AD application. Add a **Public client/native (mobile & desktop)** URI for `http://localhost`.
-When you're finished, select the *Register* button.
+When you're finished, select the **Register** button.
:::image type="content" source="media/how-to-create-app-registration/register-an-application.png" alt-text="Screenshot of the 'Register an application' page in the Azure portal with the described values filled in.":::
When the registration is finished setting up, the portal will redirect you to it
## Collect important values Next, collect some important values about the app registration that you'll need to use the app registration to authenticate a client application. These values include:
-* **resource name**
-* **client ID**
-* **tenant ID**
-* **client secret**
+* resource name
+* client ID
+* tenant ID
+* client secret
-To work with Azure Digital Twins, the **resource name** is `http://digitaltwins.azure.net`.
+To work with Azure Digital Twins, the resource name is `http://digitaltwins.azure.net`.
The following sections describe how to find the other values. ### Collect client ID and tenant ID
-The **client ID** and **tenant ID** values can be collected from the app registration's details page in the Azure portal:
+The client ID and tenant ID values can be collected from the app registration's details page in the Azure portal:
:::image type="content" source="media/how-to-create-app-registration/client-id-tenant-id.png" alt-text="Screenshot of the Azure portal showing the important values for the app registration." lightbox="media/how-to-create-app-registration/client-id-tenant-id.png":::
-Take note of the **Application (client) ID** and **Directory (tenant) ID** shown on **your** page.
+Take note of the **Application (client) ID** and **Directory (tenant) ID** shown on your page.
### Collect client secret
-To set up a **client secret** for your app registration, start on your app registration page in the Azure portal.
+To set up a client secret for your app registration, start on your app registration page in the Azure portal.
-1. Select **Certificates and secrets** from the registration's menu, and then select **+ New client secret**.
+1. Select **Certificates & secrets** from the registration's menu, and then select **+ New client secret**.
:::image type="content" source="media/how-to-create-app-registration/client-secret.png" alt-text="Screenshot of the Azure portal showing an Azure AD app registration and a highlight around 'New client secret'.":::
To set up a **client secret** for your app registration, start on your app regis
## Provide Azure Digital Twins permissions
-Next, configure the app registration you've created with permissions to access Azure Digital Twins. First, **create a role assignment** for the app registration within the Azure Digital Twins instance. Then, **provide API permissions** for the app to read and write to the Azure Digital Twins APIs.
+Next, configure the app registration you've created with permissions to access Azure Digital Twins. First, you'll create a role assignment for the app registration within the Azure Digital Twins instance. Then, you'll provide API permissions for the app to read and write to the Azure Digital Twins APIs.
### Create role assignment
In this section, you'll create a role assignment for the app registration on the
#### Verify role assignment
-You can view the role assignment you've set up under *Access control (IAM) > Role assignments*.
+You can view the role assignment you've set up under **Access control (IAM) > Role assignments**.
:::image type="content" source="media/how-to-create-app-registration/verify-role-assignment.png" alt-text="Screenshot of the Role Assignments page for an Azure Digital Twins instance in the Azure portal.":::
The app registration should show up in the list along with the role you assigned
In this section, you'll grant your app baseline read/write permissions to the Azure Digital Twins APIs.
-From the portal page for your app registration, select *API permissions* from the menu. On the following permissions page, select the *+ Add a permission* button.
+From the portal page for your app registration, select **API permissions** from the menu. On the following permissions page, select the **+ Add a permission** button.
:::image type="content" source="media/how-to-create-app-registration/add-permission.png" alt-text="Screenshot of the app registration in the Azure portal, highlighting the 'API permissions' menu option and 'Add a permission' button.":::
-In the *Request API permissions* page that follows, switch to the *APIs my organization uses* tab and search for *Azure digital twins*. Select _**Azure Digital Twins**_ from the search results to continue with assigning permissions for the Azure Digital Twins APIs.
+In the **Request API permissions** page that follows, switch to the **APIs my organization uses** tab and search for *Azure digital twins*. Select **Azure Digital Twins** from the search results to continue with assigning permissions for the Azure Digital Twins APIs.
:::image type="content" source="media/how-to-create-app-registration/request-api-permissions-1.png" alt-text="Screenshot of the 'Request API Permissions' page search result in the Azure portal showing Azure Digital Twins."::: >[!NOTE]
-> If your subscription still has an existing Azure Digital Twins instance from the previous public preview of the service (before July 2020), you'll need to search for and select _**Azure Smart Spaces Service**_ instead. This is an older name for the same set of APIs (notice that the *Application (client) ID* is the same as in the screenshot above), and your experience won't be changed beyond this step.
+> If your subscription still has an existing Azure Digital Twins instance from the previous public preview of the service (before July 2020), you'll need to search for and select **Azure Smart Spaces Service** instead. This is an older name for the same set of APIs (notice that the **Application (client) ID** is the same as in the screenshot above), and your experience won't be changed beyond this step.
> :::image type="content" source="media/how-to-create-app-registration/request-api-permissions-1-smart-spaces.png" alt-text="Screenshot of the 'Request API Permissions' page search result showing Azure Smart Spaces Service in the Azure portal.":::
-Next, you'll select which permissions to grant for these APIs. Expand the **Read (1)** permission and check the box that says *Read.Write* to grant this app registration reader and writer permissions.
+Next, you'll select which permissions to grant for these APIs. Expand the **Read (1)** permission and check the box that says **Read.Write** to grant this app registration reader and writer permissions.
:::image type="content" source="media/how-to-create-app-registration/request-api-permissions-2.png" alt-text="Screenshot of the 'Request API Permissions' page and selecting 'Read.Write' permissions for the Azure Digital Twins APIs in the Azure portal.":::
-Select *Add permissions* when finished.
+Select **Add permissions** when finished.
#### Verify API permissions
-On the *API permissions* page, verify that there's now an entry for Azure Digital Twins reflecting Read/Write permissions:
+On the **API permissions** page, verify that there's now an entry for Azure Digital Twins reflecting **Read.Write** permissions:
:::image type="content" source="media/how-to-create-app-registration/verify-api-permissions.png" alt-text="Screenshot of the API permissions for the Azure AD app registration in the Azure portal, showing 'Read/Write Access' for Azure Digital Twins.":::
If these values are missing, retry the steps in the [section for adding the API
It's possible that your organization requires more actions from subscription Owners/administrators to successfully set up an app registration. The steps required may vary depending on your organization's specific settings. Here are some common potential activities that an Owner/administrator on the subscription may need to do. These and other operations can be performed from the [Azure AD App registrations](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps) page in the Azure portal.
-* Grant admin consent for the app registration. Your organization may have *Admin Consent Required* globally turned on in Azure AD for all app registrations within your subscription. If so, the Owner/administrator will need to select this button for your company on the app registration's *API permissions* page for the app registration to be valid:
+* Grant admin consent for the app registration. Your organization may have **Admin Consent Required** globally turned on in Azure AD for all app registrations within your subscription. If so, the Owner/administrator will need to select this button for your company on the app registration's **API permissions** page for the app registration to be valid:
:::image type="content" source="media/how-to-create-app-registration/grant-admin-consent.png" alt-text="Screenshot of the Azure portal showing the 'Grant admin consent' button under API permissions.":::
- - If consent was granted successfully, the entry for Azure Digital Twins should then show a *Status* value of _Granted for **(your company)**_
+ - If consent was granted successfully, the entry for Azure Digital Twins should then show a **Status** value of **Granted for (your company)**
:::image type="content" source="media/how-to-create-app-registration/granted-admin-consent-done.png" alt-text="Screenshot of the Azure portal showing the admin consent granted for the company under API permissions."::: * Activate public client access
digital-twins How To Enable Private Link https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-enable-private-link.md
description: Learn how to enable private access for Azure Digital Twins solutions with Private Link. Previously updated : 1/3/2022 Last updated : 02/22/2022
Select the endpoint to view its information in detail, make changes to its confi
# [CLI](#tab/cli)
-Once a private endpoint has been created for your Azure Digital Twins instance, you can use the [az dt network private-endpoint connection](/cli/azure/dt/network/private-endpoint/connection) commands to continue managing private endpoint **connections** with respect to the instance. Operations include:
+Once a private endpoint has been created for your Azure Digital Twins instance, you can use the [az dt network private-endpoint connection](/cli/azure/dt/network/private-endpoint/connection) commands to continue managing private endpoint connections with respect to the instance. Operations include:
* Show a private endpoint connection * Set the state of the private endpoint connection * Delete the private endpoint connection
For more information and examples, see the [az dt network private-link reference
## Disable / enable public network access flags
-You can configure your Azure Digital Twins instance to deny all public connections and allow only connections through private endpoints to enhance the network security. This action is done with a **public network access flag**.
+You can configure your Azure Digital Twins instance to deny all public connections and allow only connections through private endpoints to enhance the network security. This action is done with a *public network access flag*.
-This policy allows you to restrict API access to Private Link connections only. When the public network access flag is set to *disabled*, all REST API calls to the Azure Digital Twins instance data plane from the public cloud will return `403, Unauthorized`. Otherwise, when the policy is set to *disabled* and a request is made through a private endpoint, the API call will succeed.
+This policy allows you to restrict API access to Private Link connections only. When the public network access flag is set to `disabled`, all REST API calls to the Azure Digital Twins instance data plane from the public cloud will return `403, Unauthorized`. Otherwise, when the policy is set to `disabled` and a request is made through a private endpoint, the API call will succeed.
You can update the value of the network flag using the [Azure portal](https://portal.azure.com), [Azure CLI](/cli/azure/), or [ARMClient command tool](https://github.com/projectkudu/ARMClient).
To disable or enable public network access in the [Azure portal](https://portal.
In the Azure CLI, you can disable or enable public network access by adding a `--public-network-access` parameter to the `az dt create` command. While this command can also be used to create a new instance, you can use it to edit the properties of an existing instance by providing it the name of an instance that already exists. (For more information about this command, see its [reference documentation](/cli/azure/dt#az_dt_create) or the [general instructions for setting up an Azure Digital Twins instance](how-to-set-up-instance-cli.md#create-the-azure-digital-twins-instance)).
-To **disable** public network access for an Azure Digital Twins instance, use the `--public-network-access` parameter like this:
+To disable public network access for an Azure Digital Twins instance, use the `--public-network-access` parameter like this:
```azurecli-interactive az dt create --dt-name <name-of-existing-instance> --resource-group <resource-group> --public-network-access Disabled ```
-To **enable** public network access on an instance where it's currently disabled, use the following similar command:
+To enable public network access on an instance where it's currently disabled, use the following similar command:
```azurecli-interactive az dt create --dt-name <name-of-existing-instance> --resource-group <resource-group> --public-network-access Enabled
az dt create --dt-name <name-of-existing-instance> --resource-group <resource-gr
With the [ARMClient command tool](https://github.com/projectkudu/ARMClient), public network access is enabled or disabled using the commands below.
-To **disable** public network access:
+To disable public network access:
```cmd/sh armclient login
armclient login
armclient PATCH /subscriptions/<your-Azure-subscription-ID>/resourceGroups/<your-resource-group>/providers/Microsoft.DigitalTwins/digitalTwinsInstances/<your-Azure-Digital-Twins-instance>?api-version=2020-12-01 "{ 'properties': { 'publicNetworkAccess': 'disabled' } }" ```
-To **enable** public network access:
+To enable public network access:
```cmd/sh armclient login
digital-twins How To Ingest Iot Hub Data https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-ingest-iot-hub-data.md
description: Learn how to ingest device telemetry messages from Azure IoT Hub to digital twins in an instance of Azure Digital Twins. Previously updated : 10/28/2021 Last updated : 02/22/2022
This how-to document walks through the process for writing a function that can i
## Prerequisites Before continuing with this example, you'll need to set up the following resources as prerequisites:
-* **An IoT hub**. For instructions, see the *Create an IoT Hub* section of this [IoT Hub quickstart](../iot-hub/quickstart-send-telemetry-cli.md).
-* **An Azure Digital Twins instance** that will receive your device telemetry. For instructions, see [Set up an Azure Digital Twins instance and authentication](./how-to-set-up-instance-portal.md).
+* An IoT hub. For instructions, see the [Create an IoT Hub section of this IoT Hub quickstart](../iot-hub/quickstart-send-telemetry-cli.md).
+* An Azure Digital Twins instance that will receive your device telemetry. For instructions, see [Set up an Azure Digital Twins instance and authentication](./how-to-set-up-instance-portal.md).
-This article also uses **Visual Studio**. You can download the latest version from [Visual Studio Downloads](https://visualstudio.microsoft.com/downloads/).
+This article also uses Visual Studio. You can download the latest version from [Visual Studio Downloads](https://visualstudio.microsoft.com/downloads/).
## Example telemetry scenario
This how-to outlines how to send messages from IoT Hub to Azure Digital Twins, u
> [!NOTE] > This example uses a straightforward ID match between the device ID and a corresponding digital twin's ID, but it is possible to provide more sophisticated mappings from the device to its twin (such as with a mapping table).
-Whenever a temperature telemetry event is sent by the thermostat device, a function processes the telemetry and the *temperature* property of the digital twin should update. This scenario is outlined in a diagram below:
+Whenever a temperature telemetry event is sent by the thermostat device, a function processes the telemetry and the `Temperature` property of the digital twin should update. This scenario is outlined in a diagram below:
:::image type="content" source="media/how-to-ingest-iot-hub-data/events.png" alt-text="Diagram of IoT Hub device sending Temperature telemetry to a function in Azure, which updates a temperature property on a twin in Azure Digital Twins." border="false":::
To create a thermostat-type twin, you'll first need to upload the thermostat [mo
[!INCLUDE [digital-twins-thermostat-model-upload.md](../../includes/digital-twins-thermostat-model-upload.md)]
-You'll then need to **create one twin using this model**. Use the following command to create a thermostat twin named thermostat67, and set 0.0 as an initial temperature value.
+You'll then need to create one twin using this model. Use the following command to create a thermostat twin named thermostat67, and set 0.0 as an initial temperature value.
```azurecli-interactive az dt twin create --dt-name <instance-name> --dtmi "dtmi:contosocom:DigitalTwins:Thermostat;1" --twin-id thermostat67 --properties '{"Temperature": 0.0,}'
To access Azure Digital Twins, your function app needs a system-managed identity
### Configure the function app
-Next, **assign an access role** for the function and **configure the application settings** so that it can access your Azure Digital Twins instance.
+Next, assign an access role for the function and configure the application settings so that it can access your Azure Digital Twins instance.
[!INCLUDE [digital-twins-configure-function-app.md](../../includes/digital-twins-configure-function-app.md)]
In the [Azure portal](https://portal.azure.com/), navigate to your IoT Hub insta
In the **Create Event Subscription** page, fill the fields as follows: 1. For **Name**, choose whatever name you want for the event subscription.
- 2. For **Event Schema**, choose _Event Grid Schema_.
+ 2. For **Event Schema**, choose **Event Grid Schema**.
3. For **System Topic Name**, choose whatever name you want.
- 1. For **Filter to Event Types**, choose the _Device Telemetry_ checkbox and uncheck other event types.
- 1. For **Endpoint Type**, Select _Azure Function_.
- 1. For **Endpoint**, use the _Select an endpoint_ link to choose what Azure Function to use for the endpoint.
+ 1. For **Filter to Event Types**, choose the **Device Telemetry** checkbox and uncheck other event types.
+ 1. For **Endpoint Type**, Select **Azure Function**.
+ 1. For **Endpoint**, use the **Select an endpoint** link to choose what Azure Function to use for the endpoint.
:::image type="content" source="media/how-to-ingest-iot-hub-data/create-event-subscription.png" alt-text="Screenshot of the Azure portal to create the event subscription details.":::
-In the _Select Azure Function_ page that opens up, verify or fill in the below details.
+In the **Select Azure Function** page that opens up, verify or fill in the below details.
1. **Subscription**: Your Azure subscription. 2. **Resource group**: Your resource group. 3. **Function app**: Your function app name.
- 4. **Slot**: _Production_.
+ 4. **Slot**: **Production**.
5. **Function**: Select the function from earlier, *IoTHubtoTwins*, from the dropdown.
-Save your details with the _Confirm Selection_ button.
+Save your details with the **Confirm Selection** button.
:::image type="content" source="media/how-to-ingest-iot-hub-data/select-azure-function.png" alt-text="Screenshot of the Azure portal to select the function.":::
-Select the _Create_ button to create the event subscription.
+Select the **Create** button to create the event subscription.
## Send simulated IoT data
-To test your new ingress function, use the device simulator from [Connect an end-to-end solution](./tutorial-end-to-end.md). That tutorial is driven by this [Azure Digital Twins end-to-end sample project written in C#](/samples/azure-samples/digital-twins-samples/digital-twins-samples). You'll be using the **DeviceSimulator** project in that repository.
+To test your new ingress function, use the device simulator from [Connect an end-to-end solution](./tutorial-end-to-end.md). That tutorial is driven by this [Azure Digital Twins end-to-end sample project written in C#](/samples/azure-samples/digital-twins-samples/digital-twins-samples). You'll be using the *DeviceSimulator* project in that repository.
In the end-to-end tutorial, complete the following steps: 1. [Register the simulated device with IoT Hub](./tutorial-end-to-end.md#register-the-simulated-device-with-iot-hub)
digital-twins How To Ingest Opcua Data https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-ingest-opcua-data.md
description: Steps to get your Azure OPC UA data into Azure Digital Twins Previously updated : 8/27/2021 Last updated : 02/22/2022 # Optional fields. Don't forget to remove # if you need a field.
This article shows how to connect all these pieces together to get your OPC UA n
## Prerequisites Before completing this article, complete the following prerequisites:
-* **Download sample repo**: This article uses a [DTDL model](concepts-models.md) file and an Azure function body from the [OPC UA to Azure Digital Twins GitHub Repo](https://github.com/Azure-Samples/opcua-to-azure-digital-twins). Start by downloading the sample repo onto your machine. You can select the **Code** button for the repo to either clone the repository or download it as a .zip file to your machine.
+* Download sample repo: This article uses a [DTDL model](concepts-models.md) file and an Azure function body from the [OPC UA to Azure Digital Twins GitHub Repo](https://github.com/Azure-Samples/opcua-to-azure-digital-twins). Start by downloading the sample repo onto your machine. You can select the **Code** button for the repo to either clone the repository or download it as a .zip file to your machine.
:::image type="content" source="media/how-to-ingest-opcua-data/download-repo.png" alt-text="Screenshot of the digital-twins-samples repo on GitHub, highlighting the steps to clone or download the code." lightbox="media/how-to-ingest-opcua-data/download-repo.png"::: If you download the repository as a .zip, be sure to unzip it and extract the files.
-* **Download Visual Studio**: This article uses Visual Studio to publish an Azure function. You can download the latest version of Visual Studio from [Visual Studio Downloads](https://visualstudio.microsoft.com/downloads/).
+* Download Visual Studio: This article uses Visual Studio to publish an Azure function. You can download the latest version of Visual Studio from [Visual Studio Downloads](https://visualstudio.microsoft.com/downloads/).
## Architecture
First, deploy a new Azure Digital Twins instance, using the guidance in [Set up
Next, add a model and twin to your instance. The model file that you'll upload to the instance is part of the sample project you downloaded in the [Prerequisites](#prerequisites) section, located at *Simulation Example/simulation-dtdl-model.json*.
-You can use [Azure Digital Twins Explorer](concepts-azure-digital-twins-explorer.md) to upload the Simulation model, and create a new twin called **simulation-1**.
+You can use [Azure Digital Twins Explorer](concepts-azure-digital-twins-explorer.md) to upload the Simulation model, and create a new twin called simulation-1.
:::image type="content" source="media/how-to-ingest-opcua-data/azure-digital-twins-explorer.png" alt-text="Screenshot of Azure Digital Twins Explorer, showing the Simulation model and simulation-1 twin.":::
Next, create a [shared access signature for the container](../storage/common/sto
In this section, you'll publish an Azure function that you downloaded in [Prerequisites](#prerequisites) that will process the OPC UA data and update Azure Digital Twins.
-1. Navigate to the downloaded [OPC UA to Azure Digital Twins](https://github.com/Azure-Samples/opcua-to-azure-digital-twins) project on your local machine, and into the *Azure Functions/OPCUAFunctions* folder. Open the **OPCUAFunctions.sln** solution in Visual Studio.
+1. Navigate to the downloaded [OPC UA to Azure Digital Twins](https://github.com/Azure-Samples/opcua-to-azure-digital-twins) project on your local machine, and into the *Azure Functions/OPCUAFunctions* folder. Open the *OPCUAFunctions.sln* solution in Visual Studio.
2. Publish the project to a function app in Azure. For instructions on how to do so, see [Develop Azure Functions using Visual Studio](../azure-functions/functions-develop-vs.md#publish-to-azure). #### Configure the function app
-Next, **assign an access role** for the function and **configure the application settings** so that it can access your Azure Digital Twins instance.
+Next, assign an access role for the function and configure the application settings so that it can access your Azure Digital Twins instance.
[!INCLUDE [digital-twins-configure-function-app.md](../../includes/digital-twins-configure-function-app.md)]
There are three application settings you need to create:
### Create event subscription
-Lastly, create an event subscription to connect your function app and *ProcessOPCPublisherEventsToADT* function to your IoT Hub. The event subscription is needed so that data can flow from the gateway device into IoT Hub through the function, which then updates Azure Digital Twins.
+Lastly, create an event subscription to connect your function app and ProcessOPCPublisherEventsToADT function to your IoT Hub. The event subscription is needed so that data can flow from the gateway device into IoT Hub through the function, which then updates Azure Digital Twins.
For instructions, follow the same steps used in [Connect the IoT hub to the Azure function](tutorial-end-to-end.md#connect-the-iot-hub-to-the-azure-function) from the Azure Digital Twins *Tutorial: Connect an end-to-end solution*.
-The event subscription will have an Endpoint type of **Azure function**, and an Endpoint of **ProcessOPCPublisherEventsToADT**.
+The event subscription will have an **Endpoint type** of **Azure function**, and an **Endpoint** of **ProcessOPCPublisherEventsToADT**.
:::image type="content" source="media/how-to-ingest-opcua-data/event-subscription.png" alt-text="Screenshot of Azure portal showing creation of a new event subscription.":::
After this step, all required components should be installed and running. Data s
In this section, you set up an Azure function to connect the OPC UA data to Azure Digital Twins. Verify that you've completed the following checklist: > [!div class="checklist"] > * Created and imported *opcua-mapping.json* file into a blob storage container.
-> * Published the sample function *ProcessOPCPublisherEventsToADT* to a function app in Azure.
+> * Published the sample function ProcessOPCPublisherEventsToADT to a function app in Azure.
> * Added three new application settings to the Azure Functions app. > * Created an event subscription to send IoT Hub events to the function app.
Next, use the following resources to read more about the supporting tools and pr
* [OPC Publisher](https://github.com/Azure/iot-edge-opc-publisher) * [Configure OPC Publisher](/previous-versions/azure/iot-accelerators/howto-opc-publisher-configure) * [UANodeSetWebViewer](https://github.com/barnstee/UANodesetWebViewer)
-* [OPCUA2DTDL](https://github.com/khilscher/OPCUA2DTDL)
+* [OPCUA2DTDL](https://github.com/khilscher/OPCUA2DTDL)
digital-twins How To Integrate Azure Signalr https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-integrate-azure-signalr.md
description: Learn how to stream Azure Digital Twins telemetry to clients using Azure SignalR Previously updated : 1/3/2022 Last updated : 02/22/2022
You'll be attaching Azure SignalR Service to Azure Digital Twins through the pat
First, download the required sample apps. You'll need both of the following samples: * [Azure Digital Twins end-to-end samples](/samples/azure-samples/digital-twins-samples/digital-twins-samples/): This sample contains an *AdtSampleApp* that holds two Azure functions for moving data around an Azure Digital Twins instance (you can learn about this scenario in more detail in [Connect an end-to-end solution](tutorial-end-to-end.md)). It also contains a *DeviceSimulator* sample application that simulates an IoT device, generating a new temperature value every second.
- - If you haven't already downloaded the sample as part of the tutorial in [Prerequisites](#prerequisites), [navigate to the sample](/samples/azure-samples/digital-twins-samples/digital-twins-samples/) and select the *Browse code* button underneath the title. Doing so will take you to the GitHub repo for the samples, which you can download as a .zip by selecting the *Code* button and *Download ZIP*.
+ - If you haven't already downloaded the sample as part of the tutorial in [Prerequisites](#prerequisites), [navigate to the sample](/samples/azure-samples/digital-twins-samples/digital-twins-samples/) and select the **Browse code** button underneath the title. Doing so will take you to the GitHub repo for the samples, which you can download as a .zip by selecting the **Code** button and **Download ZIP**.
:::image type="content" source="media/includes/download-repo-zip.png" alt-text="Screenshot of the digital-twins-samples repo on GitHub and the steps for downloading it as a zip." lightbox="media/includes/download-repo-zip.png":::
- This button will download a copy of the sample repo in your machine, as **digital-twins-samples-master.zip**. Unzip the folder.
+ This button will download a copy of the sample repo in your machine, as *digital-twins-samples-master.zip*. Unzip the folder.
* [SignalR integration web app sample](/samples/azure-samples/digitaltwins-signalr-webapp-sample/digital-twins-samples/): This sample React web app will consume Azure Digital Twins telemetry data from an Azure SignalR Service.
- - Navigate to the sample link and use the same download process to download a copy of the sample to your machine, as _**digitaltwins-signalr-webapp-sample-main.zip**_. Unzip the folder.
+ - Navigate to the sample link and use the same download process to download a copy of the sample to your machine, as *digitaltwins-signalr-webapp-sample-main.zip*. Unzip the folder.
[!INCLUDE [Create instance](../azure-signalr/includes/signalr-quickstart-create-instance.md)]
Leave the browser window open to the Azure portal, as you'll use it again in the
## Publish and configure the Azure Functions app In this section, you'll set up two Azure functions:
-* **negotiate** - A HTTP trigger function. It uses the *SignalRConnectionInfo* input binding to generate and return valid connection information.
-* **broadcast** - An [Event Grid](../event-grid/overview.md) trigger function. It receives Azure Digital Twins telemetry data through the event grid, and uses the output binding of the *SignalR* instance you created in the previous step to broadcast the message to all connected client applications.
+* *negotiate* - A HTTP trigger function. It uses the *SignalRConnectionInfo* input binding to generate and return valid connection information.
+* *broadcast* - An [Event Grid](../event-grid/overview.md) trigger function. It receives Azure Digital Twins telemetry data through the event grid, and uses the output binding of the SignalR instance you created in the previous step to broadcast the message to all connected client applications.
Start Visual Studio (or another code editor of your choice), and open the code solution in the *digital-twins-samples-master > ADTSampleApp* folder. Then do the following steps to create the functions:
-1. In the *SampleFunctionsApp* project, create a new C# class called **SignalRFunctions.cs**. For instructions on how to create a new class, see [Develop Azure Functions using Visual Studio](../azure-functions/functions-develop-vs.md#add-a-function-to-your-project).
+1. In the *SampleFunctionsApp* project, create a new C# class called *SignalRFunctions.cs*. For instructions on how to create a new class, see [Develop Azure Functions using Visual Studio](../azure-functions/functions-develop-vs.md#add-a-function-to-your-project).
1. Replace the contents of the class file with the following code: :::code language="csharp" source="~/digital-twins-docs-samples/sdks/csharp/signalRFunction.cs":::
-1. In Visual Studio's *Package Manager Console* window, or any command window on your machine, navigate to the folder *digital-twins-samples-master\AdtSampleApp\SampleFunctionsApp*, and run the following command to install the `SignalRService` NuGet package to the project:
+1. In Visual Studio's **Package Manager Console** window, or any command window on your machine, navigate to the folder *digital-twins-samples-master\AdtSampleApp\SampleFunctionsApp*, and run the following command to install the `SignalRService` NuGet package to the project:
```cmd dotnet add package Microsoft.Azure.WebJobs.Extensions.SignalRService --version 1.2.0 ```
Start Visual Studio (or another code editor of your choice), and open the code s
### Configure the function
-Next, configure the function to communicate with your Azure SignalR instance. You'll start by gathering the SignalR instance's **connection string**, and then add it to the functions app's settings.
+Next, configure the function to communicate with your Azure SignalR instance. You'll start by gathering the SignalR instance's connection string, and then add it to the functions app's settings.
1. Go to the [Azure portal](https://portal.azure.com/) and search for the name of your SignalR instance in the search bar at the top of the portal. Select the instance to open it. 1. Select **Keys** from the instance menu to view the connection strings for the SignalR service instance.
-1. Select the *Copy* icon to copy the primary connection string.
+1. Select the **Copy** icon to copy the **Primary CONNECTION STRING**.
:::image type="content" source="media/how-to-integrate-azure-signalr/signalr-keys.png" alt-text="Screenshot of the Azure portal that shows the Keys page for the SignalR instance. The connection string is being copied." lightbox="media/how-to-integrate-azure-signalr/signalr-keys.png":::
-1. Finally, add your Azure SignalR **connection string** to the function's app settings, using the following Azure CLI command. Also, replace the placeholders with your resource group and app service/function app name from the [tutorial prerequisite](how-to-integrate-azure-signalr.md#prerequisites). The command can be run in [Azure Cloud Shell](https://shell.azure.com), or locally if you have the [Azure CLI installed on your machine](/cli/azure/install-azure-cli):
+1. Finally, add your Azure SignalR connection string to the function's app settings, using the following Azure CLI command. Also, replace the placeholders with your resource group and app service/function app name from the [tutorial prerequisite](how-to-integrate-azure-signalr.md#prerequisites). The command can be run in [Azure Cloud Shell](https://shell.azure.com), or locally if you have the [Azure CLI installed on your machine](/cli/azure/install-azure-cli):
```azurecli-interactive az functionapp config appsettings set --resource-group <your-resource-group> --name <your-function-app-name> --settings "AzureSignalRConnectionString=<your-Azure-SignalR-ConnectionString>"
Next, configure the function to communicate with your Azure SignalR instance. Yo
## Connect the function to Event Grid
-Next, subscribe the *broadcast* Azure function to the **Event Grid topic** you created during the [tutorial prerequisite](how-to-integrate-azure-signalr.md#prerequisites). This action will allow telemetry data to flow from the thermostat67 twin through the Event Grid topic and to the function. From here, the function can broadcast the data to all the clients.
+Next, subscribe the *broadcast* Azure function to the Event Grid topic you created during the [tutorial prerequisite](how-to-integrate-azure-signalr.md#prerequisites). This action will allow telemetry data to flow from the thermostat67 twin through the Event Grid topic and to the function. From here, the function can broadcast the data to all the clients.
-To broadcast the data, you'll create an **Event subscription** from your Event Grid topic to your *broadcast* Azure function as an endpoint.
+To broadcast the data, you'll create an Event subscription from your Event Grid topic to your *broadcast* Azure function as an endpoint.
-In the [Azure portal](https://portal.azure.com/), navigate to your Event Grid topic by searching for its name in the top search bar. Select *+ Event Subscription*.
+In the [Azure portal](https://portal.azure.com/), navigate to your Event Grid topic by searching for its name in the top search bar. Select **+ Event Subscription**.
:::image type="content" source="media/how-to-integrate-azure-signalr/event-subscription-1b.png" alt-text="Screenshot of how to create an event subscription in the Azure portal.":::
-On the *Create Event Subscription* page, fill in the fields as follows (fields filled by default aren't mentioned):
-* *EVENT SUBSCRIPTION DETAILS* > **Name**: Give a name to your event subscription.
-* *ENDPOINT DETAILS* > **Endpoint Type**: Select *Azure Function* from the menu options.
-* *ENDPOINT DETAILS* > **Endpoint**: Select the *Select an endpoint* link, which will open a *Select Azure Function* window:
- - Fill in your **Subscription**, **Resource group**, **Function app**, and **Function** (*broadcast*). Some of these fields may autopopulate after selecting the subscription.
+On the **Create Event Subscription** page, fill in the fields as follows (fields filled by default aren't mentioned):
+* **EVENT SUBSCRIPTION DETAILS** > **Name**: Give a name to your event subscription.
+* **ENDPOINT DETAILS** > **Endpoint Type**: Select **Azure Function** from the menu options.
+* **ENDPOINT DETAILS** > **Endpoint**: Select the **Select an endpoint** link, which will open a **Select Azure Function** window:
+ - Fill in your **Subscription**, **Resource group**, **Function app**, and **Function** (**broadcast**). Some of these fields may autopopulate after selecting the subscription.
- Select **Confirm Selection**. :::image type="content" source="media/how-to-integrate-azure-signalr/create-event-subscription.png" alt-text="Screenshot of the form for creating an event subscription in the Azure portal.":::
-Back on the *Create Event Subscription* page, select **Create**.
+Back on the **Create Event Subscription** page, select **Create**.
-At this point, you should see two event subscriptions in the *Event Grid Topic* page.
+At this point, you should see two event subscriptions in the **Event Grid Topic** page.
:::image type="content" source="media/how-to-integrate-azure-signalr/view-event-subscriptions.png" alt-text="Screenshot of the Azure portal showing two event subscriptions in the Event Grid topic page." lightbox="media/how-to-integrate-azure-signalr/view-event-subscriptions.png"::: ## Configure and run the web app
-In this section, you'll see the result in action. First, configure the **sample client web app** to connect to the Azure SignalR flow you've set up. Next, you'll start up the **simulated device sample app** that sends telemetry data through your Azure Digital Twins instance. After that, you'll view the sample web app to see the simulated device data updating the sample web app in real time.
+In this section, you'll see the result in action. First, configure the sample client web app to connect to the Azure SignalR flow you've set up. Next, you'll start up the simulated device sample app that sends telemetry data through your Azure Digital Twins instance. After that, you'll view the sample web app to see the simulated device data updating the sample web app in real time.
### Configure the sample client web app
-Next, you'll configure the sample client web app. Start by gathering the **HTTP endpoint URL** of the *negotiate* function, and then use it to configure the app code on your machine.
+Next, you'll configure the sample client web app. Start by gathering the HTTP endpoint URL of the *negotiate* function, and then use it to configure the app code on your machine.
-1. Go to the Azure portal's [Function apps](https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.Web%2Fsites/kind/functionapp) page and select your function app from the list. In the app menu, select *Functions* and choose the *negotiate* function.
+1. Go to the Azure portal's [Function apps](https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.Web%2Fsites/kind/functionapp) page and select your function app from the list. In the app menu, select **Functions** and choose the **negotiate** function.
:::image type="content" source="media/how-to-integrate-azure-signalr/functions-negotiate.png" alt-text="Screenshot of the Azure portal function apps, with 'Functions' highlighted in the menu and 'negotiate' highlighted in the list of functions.":::
-1. Select *Get function URL* and copy the value **up through _/api_ (don't include the last _/negotiate?_)**. You'll use this value in the next step.
+1. Select **Get function URL** and copy the value up through **/api** (don't include the last **/negotiate?**). You'll use this value in the next step.
:::image type="content" source="media/how-to-integrate-azure-signalr/get-function-url.png" alt-text="Screenshot of the Azure portal showing the 'negotiate' function with the 'Get function URL' button and the function URL highlighted.":::
Next, you'll configure the sample client web app. Start by gathering the **HTTP
.withUrl('<Function-URL>') .build(); ```
-1. In Visual Studio's *Developer command prompt* or any command window on your machine, navigate to the *digitaltwins-signalr-webapp-sample-main\src* folder. Run the following command to install the dependent node packages:
+1. In Visual Studio's **Developer command prompt** or any command window on your machine, navigate to the *digitaltwins-signalr-webapp-sample-main\src* folder. Run the following command to install the dependent node packages:
```cmd npm install
Next, you'll configure the sample client web app. Start by gathering the **HTTP
Next, set permissions in your function app in the Azure portal: 1. In the Azure portal's [Function apps](https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.Web%2Fsites/kind/functionapp) page, select your function app instance.
-1. Scroll down in the instance menu and select *CORS*. On the CORS page, add `http://localhost:3000` as an allowed origin by entering it into the empty box. Check the box for *Enable Access-Control-Allow-Credentials* and select *Save*.
+1. Scroll down in the instance menu and select **CORS**. On the CORS page, add `http://localhost:3000` as an allowed origin by entering it into the empty box. Check the box for **Enable Access-Control-Allow-Credentials** and select **Save**.
:::image type="content" source="media/how-to-integrate-azure-signalr/cors-setting-azure-function.png" alt-text="Screenshot of the Azure portal showing the CORS Setting in Azure Function.":::
You don't need to do anything else in this console, but leave it running while y
### See the results
-To see the results in action, start the **SignalR integration web app sample**. You can do so from any console window at the *digitaltwins-signalr-webapp-sample-main\src* location, by running this command:
+To see the results in action, start the SignalR integration web app sample. You can do so from any console window at the *digitaltwins-signalr-webapp-sample-main\src* location, by running this command:
```cmd npm start
digital-twins How To Integrate Logic Apps https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-integrate-logic-apps.md
description: Learn how to connect Logic Apps to Azure Digital Twins, using a custom connector Previously updated : 1/3/2022 Last updated : 02/22/2022
# Integrate with Logic Apps using a custom connector
-In this article, you'll use the [Azure portal](https://portal.azure.com) to **create a custom connector** that can be used to connect Logic Apps to an Azure Digital Twins instance. You'll then **create a logic app** that uses this connection for an example scenario, in which events triggered by a timer will automatically update a twin in your Azure Digital Twins instance.
+In this article, you'll use the [Azure portal](https://portal.azure.com) to create a *custom connector* that can be used to connect Logic Apps to an Azure Digital Twins instance. You'll then create a *logic app* that uses this connection for an example scenario, in which events triggered by a timer will automatically update a twin in your Azure Digital Twins instance.
[Azure Logic Apps](../logic-apps/logic-apps-overview.md) is a cloud service that helps you automate workflows across apps and services. By connecting Logic Apps to the Azure Digital Twins APIs, you can create such automated flows around Azure Digital Twins and their data.
This article uses Logic Apps to update a twin in your Azure Digital Twins instan
You can add twins using the [DigitalTwins APIs](/rest/api/digital-twins/dataplane/twins), the [.NET (C#) SDK](/dotnet/api/overview/azure/digitaltwins/client?view=azure-dotnet&preserve-view=true), or the [Azure Digital Twins CLI](/cli/azure/dt). For detailed steps on how to create twins using these methods, see [Manage digital twins](how-to-manage-twin.md).
-You'll need the **Twin ID** of a twin in your instance that you've created.
+You'll need the Twin ID of a twin in your instance that you've created.
### Set up app registration
You'll need the **Twin ID** of a twin in your instance that you've created.
Now, you're ready to create a [custom Logic Apps connector](../logic-apps/custom-connector-overview.md) for the Azure Digital Twins APIs. Doing so will let you hook up Azure Digital Twins when creating a logic app in the next section.
-Navigate to the [Logic Apps Custom Connector](https://portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Web%2FcustomApis) page in the Azure portal (you can use this link or search for it in the portal search bar). Select *+ Create*.
+Navigate to the [Logic Apps Custom Connector](https://portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Web%2FcustomApis) page in the Azure portal (you can use this link or search for it in the portal search bar). Select **+ Create**.
:::image type="content" source="media/how-to-integrate-logic-apps/logic-apps-custom-connector.png" alt-text="Screenshot of the 'Logic Apps Custom Connector' page in the Azure portal. The 'Add' button is highlighted.":::
First, download a custom Azure Digital Twins Swagger that has been modified to w
Navigate to the downloaded folder and unzip it.
-The custom Swagger for this tutorial is located in the *digital-twins-custom-swaggers-main\LogicApps* folder. This folder contains subfolders called *stable* and *preview*, both of which hold different versions of the Swagger organized by date. The folder with the most recent date will contain the latest copy of the Swagger definition file. Whichever version you select, the Swagger file is named _digitaltwins.json_.
+The custom Swagger for this tutorial is located in the *digital-twins-custom-swaggers-main\LogicApps* folder. This folder contains subfolders called *stable* and *preview*, both of which hold different versions of the Swagger organized by date. The folder with the most recent date will contain the latest copy of the Swagger definition file. Whichever version you select, the Swagger file is named *digitaltwins.json*.
> [!NOTE]
-> Unless you're working with a preview feature, it's generally recommended to use the most recent *stable* version of the Swagger file. However, earlier versions and preview versions of the Swagger file are also still supported.
+> Unless you're working with a preview feature, it's generally recommended to use the most recent stable version of the Swagger file. However, earlier versions and preview versions of the Swagger file are also still supported.
Next, go to your connector's Overview page in the [Azure portal](https://portal.azure.com) and select **Edit**.
Next, go to your connector's Overview page in the [Azure portal](https://portal.
In the **Edit Logic Apps Custom Connector** page that follows, configure this information: * **Custom connectors**
- - API Endpoint: REST (leave default)
- - Import mode: OpenAPI file (leave default)
- - File: This configuration will be the custom Swagger file you downloaded earlier. Select **Import**, locate the file on your machine (*Azure_Digital_Twins_custom_Swaggers__Logic_Apps_connector_\LogicApps\...\digitaltwins.json*), and select **Open**.
+ - **API Endpoint**: **REST** (leave default)
+ - **Import mode**: **OpenAPI file** (leave default)
+ - **File**: This configuration will be the custom Swagger file you downloaded earlier. Select **Import**, locate the file on your machine (*Azure_Digital_Twins_custom_Swaggers__Logic_Apps_connector_\LogicApps\...\digitaltwins.json*), and select **Open**.
* **General information**
- - Icon: Upload an icon that you like.
- - Icon background color: Enter hexadecimal code in the format '#xxxxxx' for your color.
- - Description: Fill whatever values you want.
- - Connect via on-premises data gateway: Toggled off (leave default)
- - Scheme: HTTPS (leave default)
- - Host: The **host name** of your Azure Digital Twins instance.
- - Base URL: / (leave default)
+ - **Icon**: Upload an icon that you like.
+ - **Icon background color**: Enter hexadecimal code in the format '#xxxxxx' for your color.
+ - **Description**: Fill whatever values you want.
+ - **Connect via on-premises data gateway**: **Toggled off** (leave default)
+ - **Scheme**: **HTTPS** (leave default)
+ - **Host**: The host name of your Azure Digital Twins instance.
+ - **Base URL**: */* (leave default)
Then, select the **Security** button at the bottom of the window to continue to the next configuration step. :::image type="content" source="media/how-to-integrate-logic-apps/configure-next.png" alt-text="Screenshot of the bottom of the 'Edit Logic Apps Custom Connector' page. Highlight around button to continue to Security."::: In the Security step, select **Edit** and configure this information:
-* **Authentication type**: OAuth 2.0
+* **Authentication type**: **OAuth 2.0**
* **OAuth 2.0**:
- - Identity provider: Azure Active Directory
- - Client ID: The **Application (client) ID** for the Azure AD app registration you created in [Prerequisites](#prerequisites)
- - Client secret: The **Client secret** from the app registration
- - Login URL: https://login.windows.net (leave default)
- - Tenant ID: The **Directory (tenant) ID** for your Azure AD app registration
- - Resource URL: 0b07f429-9f4b-4714-9392-cc5e8e80c8b0
- - Scope: Directory.AccessAsUser.All
- - Redirect URL: (leave default for now)
+ - **Identity provider**: **Azure Active Directory**
+ - **Client ID**: The Application (client) ID for the Azure AD app registration you created in [Prerequisites](#prerequisites)
+ - **Client secret**: The Client secret from the app registration
+ - **Login URL**: `https://login.windows.net` (leave default)
+ - **Tenant ID**: The Directory (tenant) ID for your Azure AD app registration
+ - **Resource URL**: *0b07f429-9f4b-4714-9392-cc5e8e80c8b0*
+ - **Scope**: *Directory.AccessAsUser.All*
+ - **Redirect URL**: (leave default for now)
-The Redirect URL field says *Save the custom connector to generate the redirect URL*. Generate it now by selecting **Update connector** across the top of the pane to confirm your connector settings.
+The Redirect URL field says **Save the custom connector to generate the redirect URL**. Generate it now by selecting **Update connector** across the top of the pane to confirm your connector settings.
:::image type="content" source="media/how-to-integrate-logic-apps/update-connector.png" alt-text="Screenshot of the top of the 'Edit Logic Apps Custom Connector' page. Highlight around 'Update connector' button.":::
Under **Authentication** from the registration's menu, add a URI.
:::image type="content" source="media/how-to-integrate-logic-apps/add-uri.png" alt-text="Screenshot of the Authentication page for the app registration in the Azure portal, highlighting the 'Add a URI' button and the 'Authentication' menu.":::
-Enter the custom connector's **Redirect URL** into the new field, and select the **Save** icon.
+Enter the custom connector's redirect URL into the new field, and select the **Save** icon.
:::image type="content" source="media/how-to-integrate-logic-apps/save-uri.png" alt-text="Screenshot of the Authentication page for the app registration in the Azure portal, highlighting the new redirect URL and the 'Save' button.":::
You're now done setting up a custom connector that can access the Azure Digital
Next, you'll create a logic app that will use your new connector to automate Azure Digital Twins updates.
-In the [Azure portal](https://portal.azure.com), search for **Logic apps** in the portal search bar. Selecting it should take you to the **Logic apps** page. Select **+ Add** to create a new logic app.
+In the [Azure portal](https://portal.azure.com), search for *Logic apps* in the portal search bar. Selecting it should take you to the **Logic apps** page. Select **+ Add** to create a new logic app.
:::image type="content" source="media/how-to-integrate-logic-apps/create-logic-app.png" alt-text="Screenshot of the 'Logic Apps' page in the Azure portal, highlighting the 'Create logic app' button."::: In the **Logic App** page that follows, enter your subscription and resource group. Under **Instance Details** select a **Consumption** instance type, choose a name for your logic app, and select the deployment location. Choose whether you want to enable or disable log analytics.
-Select the _Review + create_ button.
+Select the **Review + create** button.
Doing so will take you to the **Review + create** tab, where you can review your details and select **Create** at the bottom to create your resource.
Select it to display the list of APIs contained in that connector. Use the searc
You may be asked to sign in with your Azure credentials to connect to the connector. If you get a **Permissions requested** dialogue, follow the prompts to grant consent for your app and accept. In the new **DigitalTwinsAdd** box, fill the fields as follows:
-* id: Fill the **Twin ID** of the digital twin in your instance that you want the Logic App to update.
-* twin: This field is where you'll enter the body that the chosen API request requires. For **DigitalTwinsUpdate**, this body is in the form of JSON Patch code. For more about structuring a JSON Patch to update your twin, see the [Update a digital twin](how-to-manage-twin.md#update-a-digital-twin) section of *How-to: Manage digital twins*.
-* api-version: The latest API version. Currently, this value is *2020-10-31*.
+* **id**: Fill the *Twin ID* of the digital twin in your instance that you want the Logic App to update.
+* **twin**: This field is where you'll enter the body that the chosen API request requires. For **DigitalTwinsUpdate**, this body is in the form of JSON Patch code. For more about structuring a JSON Patch to update your twin, see the [Update a digital twin](how-to-manage-twin.md#update-a-digital-twin) section of *How-to: Manage digital twins*.
+* **api-version**: The latest API version. Currently, this value is *2020-10-31*.
Select **Save** in the Logic Apps Designer.
-You can choose other operations by selecting _+ New step_ on the same window.
+You can choose other operations by selecting **+ New step** on the same window.
:::image type="content" source="media/how-to-integrate-logic-apps/save-logic-app.png" alt-text="Screenshot of the finished view of the app in the Logic App Connector. The DigitalTwinsAdd box is filled with the values described above.":::
digital-twins How To Integrate Maps https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-integrate-maps.md
description: Learn how to use Azure Functions to create a function that can use the twin graph and Azure Digital Twins notifications to update an Azure Maps indoor map. Previously updated : 1/4/2022 Last updated : 02/22/2022
This guide will cover:
* You'll be extending this twin with another endpoint and route. You'll also be adding another function to your function app from that tutorial. * Follow the Azure Maps in [Use Azure Maps Creator to create indoor maps](../azure-maps/tutorial-creator-indoor-maps.md) to create an Azure Maps indoor map with a *feature stateset*. * [Feature statesets](../azure-maps/creator-indoor-maps.md#feature-statesets) are collections of dynamic properties (states) assigned to dataset features such as rooms or equipment. In the Azure Maps tutorial above, the feature stateset stores room status that you'll be displaying on a map.
- * You'll need your feature *stateset ID* and Azure Maps *subscription key*.
+ * You'll need your feature **stateset ID** and Azure Maps **subscription key**.
### Topology
This pattern reads from the room twin directly, rather than the IoT device, whic
3. Create a route in Azure Digital Twins to send twin update events to your endpoint. >[!NOTE]
- >There is currently a **known issue** in Cloud Shell affecting these command groups: `az dt route`, `az dt model`, `az dt twin`.
+ >There is currently a known issue in Cloud Shell affecting these command groups: `az dt route`, `az dt model`, `az dt twin`.
> >To resolve, either run `az login` in Cloud Shell prior to running the command, or use the [local CLI](/cli/azure/install-azure-cli) instead of Cloud Shell. For more detail on this, see [Troubleshooting: Known issues in Azure Digital Twins](troubleshoot-known-issues.md#400-client-error-bad-request-in-cloud-shell).
This pattern reads from the room twin directly, rather than the IoT device, whic
## Create a function to update maps
-You're going to create an **Event Grid-triggered function** inside your function app from the end-to-end tutorial ([Connect an end-to-end solution](./tutorial-end-to-end.md)). This function will unpack those notifications and send updates to an Azure Maps feature stateset to update the temperature of one room.
+You're going to create an Event Grid-triggered function inside your function app from the end-to-end tutorial ([Connect an end-to-end solution](./tutorial-end-to-end.md)). This function will unpack those notifications and send updates to an Azure Maps feature stateset to update the temperature of one room.
See the following document for reference info: [Azure Event Grid trigger for Azure Functions](../azure-functions/functions-bindings-event-grid-trigger.md).
az functionapp config appsettings set --name <your-function-app-name> --resourc
To see live-updating temperature, follow the steps below:
-1. Begin sending simulated IoT data by running the **DeviceSimulator** project from the Azure Digital Twins [Connect an end-to-end solution](tutorial-end-to-end.md). The instructions for this process are in the [Configure and run the simulation](././tutorial-end-to-end.md#configure-and-run-the-simulation) section.
+1. Begin sending simulated IoT data by running the *DeviceSimulator* project from the Azure Digital Twins [Connect an end-to-end solution](tutorial-end-to-end.md). The instructions for this process are in the [Configure and run the simulation](././tutorial-end-to-end.md#configure-and-run-the-simulation) section.
2. Use [the Azure Maps Indoor module](../azure-maps/how-to-use-indoor-module.md) to render your indoor maps created in Azure Maps Creator. 1. Copy the HTML from the [Example: Use the Indoor Maps Module](../azure-maps/how-to-use-indoor-module.md#example-use-the-indoor-maps-module) section of the indoor maps in [Use the Azure Maps Indoor Maps module](../azure-maps/how-to-use-indoor-module.md) to a local file.
- 1. Replace the *subscription key*, *tilesetId*, and *statesetID* in the local HTML file with your values.
+ 1. Replace the **subscription key**, **tilesetId**, and **statesetID** in the local HTML file with your values.
1. Open that file in your browser. Both samples send temperature in a compatible range, so you should see the color of room 121 update on the map about every 30 seconds.
digital-twins How To Integrate Time Series Insights https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-integrate-time-series-insights.md
description: Learn how to set up event routes from Azure Digital Twins to Azure Time Series Insights. Previously updated : 1/4/2022 Last updated : 02/23/2022
The solution described in this article will allow you to gather and analyze hist
## Prerequisites Before you can set up a relationship with Time Series Insights, you'll need to set up the following resources:
-* An **Azure Digital Twins instance**. For instructions, see [Set up an Azure Digital Twins instance and authentication](./how-to-set-up-instance-portal.md).
-* A **model and a twin in the Azure Digital Twins instance**. You'll need to update twin's information a few times to see that data tracked in Time Series Insights. For instructions, see the [Add a model and twin](how-to-ingest-iot-hub-data.md#add-a-model-and-twin) section of the *Ingest telemetry from IoT Hub* article.
+* An Azure Digital Twins instance. For instructions, see [Set up an Azure Digital Twins instance and authentication](./how-to-set-up-instance-portal.md).
+* A model and a twin in the Azure Digital Twins instance. You'll need to update twin's information a few times to see that data tracked in Time Series Insights. For instructions, see [Add a model and twin](how-to-ingest-iot-hub-data.md#add-a-model-and-twin).
> [!TIP] > In this article, the changing digital twin values that are viewed in Time Series Insights are updated manually for simplicity. However, if you want to complete this article with live simulated data, you can set up an Azure function that updates digital twins based on IoT telemetry events from a simulated device. For instructions, follow [Ingest IoT Hub data](how-to-ingest-iot-hub-data.md), including the final steps to run the device simulator and validate that the data flow works.
az eventhubs namespace create --name <name-for-your-Event-Hubs-namespace> --reso
You'll be using this Event Hubs namespace to hold the two event hubs that are needed for this article:
- 1. **Twins hub** - Event hub to receive twin change events
- 2. **Time series hub** - Event hub to stream events to Time Series Insights
+ 1. *Twins hub* - Event hub to receive twin change events
+ 2. *Time series hub* - Event hub to stream events to Time Series Insights
The next sections will walk you through creating and configuring these hubs within your event hub namespace. ## Create twins hub
-The first event hub you'll create in this article is the **twins hub**. This event hub will receive twin change events from Azure Digital Twins.
-To set up the twins hub, you'll complete the following steps in this section:
+The first event hub you'll create in this article is the *twins hub*. This event hub will receive twin change events from Azure Digital Twins. To set up the twins hub, you'll complete the following steps in this section:
1. Create the twins hub 2. Create an authorization rule to control permissions to the hub
To set up the twins hub, you'll complete the following steps in this section:
4. Create a route in Azure Digital Twins that sends twin updates event to the endpoint and connected twins hub 5. Get the twins hub connection string
-Create the **twins hub** with the following CLI command. Specify a name for your twins hub.
+Create the twins hub with the following CLI command. Specify a name for your twins hub.
```azurecli-interactive az eventhubs eventhub create --name <name-for-your-twins-hub> --resource-group <your-resource-group> --namespace-name <your-Event-Hubs-namespace-from-earlier>
az dt endpoint create eventhub --dt-name <your-Azure-Digital-Twins-instance-name
### Create twins hub event route
-Azure Digital Twins instances can emit [twin update events](./concepts-event-notifications.md) whenever a twin's state is updated. In this section, you'll create an Azure Digital Twins **event route** that will direct these update events to the twins hub for further processing.
+Azure Digital Twins instances can emit [twin update events](./concepts-event-notifications.md) whenever a twin's state is updated. In this section, you'll create an Azure Digital Twins event route that will direct these update events to the twins hub for further processing.
Create a [route](concepts-route-events.md#create-an-event-route) in Azure Digital Twins to send twin update events to your endpoint from above. The filter in this route will only allow twin update messages to be passed to your endpoint. Specify a name for the twins hub event route.
Take note of the **primaryConnectionString** value from the result to configure
## Create time series hub
-The second event hub you'll create in this article is the **time series hub**. This event hub is the one that will stream the Azure Digital Twins events to Time Series Insights.
-To set up the time series hub, you'll complete these steps:
+The second event hub you'll create in this article is the *time series hub*. This event hub is the one that will stream the Azure Digital Twins events to Time Series Insights. To set up the time series hub, you'll complete these steps:
1. Create the time series hub 2. Create an authorization rule to control permissions to the hub
To set up the time series hub, you'll complete these steps:
Later, when you create the Time Series Insights instance, you'll connect this time series hub as the event source for the Time Series Insights instance.
-Create the **time series hub** using the following command. Specify a name for the time series hub.
+Create the time series hub using the following command. Specify a name for the time series hub.
```azurecli-interactive az eventhubs eventhub create --name <name-for-your-time-series-hub> --resource-group <your-resource-group> --namespace-name <your-Event-Hub-namespace-from-earlier>
Save the function app name to use later to configure app settings for the two ev
### Configure the function app
-Next, **assign an access role** for the function and **configure the application settings** so that it can access your resources.
+Next, assign an access role for the function and configure the application settings so that it can access your resources.
[!INCLUDE [digital-twins-configure-function-app-cli.md](../../includes/digital-twins-configure-function-app-cli.md)]
-Next, add environment variables in the function app's settings that allow it to access the **twins hub** and **time series hub**.
+Next, add environment variables in the function app's settings that allow it to access the twins hub and time series hub.
-Use the **twins hub primaryConnectionString** value that you saved earlier to create an app setting in your function app that contains the twins hub connection string:
+Use the twins hub primaryConnectionString value that you saved earlier to create an app setting in your function app that contains the twins hub connection string:
```azurecli-interactive az functionapp config appsettings set --settings "EventHubAppSetting-Twins=<your-twins-hub-primaryConnectionString>" --resource-group <your-resource-group> --name <your-function-app-name> ```
-Use the **time series hub primaryConnectionString** value that you saved earlier to create an app setting in your function app that contains the time series hub connection string:
+Use the time series hub primaryConnectionString value that you saved earlier to create an app setting in your function app that contains the time series hub connection string:
```azurecli-interactive az functionapp config appsettings set --settings "EventHubAppSetting-TSI=<your-time-series-hub-primaryConnectionString>" --resource-group <your-resource-group> --name <your-function-app-name>
In this section, you'll set up Time Series Insights instance to receive data fro
* **Tier** - Choose the **Gen2(L1)** pricing tier. * **Property name** - Enter **$dtId** (Read more about selecting an ID value in [Best practices for choosing a Time Series ID](../time-series-insights/how-to-select-tsid.md)). * **Storage account name** - Specify a storage account name.
- * **Enable warm store** - Leave this field set to *Yes*.
+ * **Enable warm store** - Leave this field set to **Yes**.
You can leave default values for other properties on this page. Select the **Next : Event Source >** button.
In this section, you'll set up Time Series Insights instance to receive data fro
:::image type="content" source="media/how-to-integrate-time-series-insights/create-time-series-insights-environment-2.png" alt-text="Screenshot of the Azure portal showing how to create Time Series Insights environment (part 2/3)." lightbox="media/how-to-integrate-time-series-insights/create-time-series-insights-environment-2.png":::
-2. In the *Event Source* tab, choose the following fields:
+2. In the **Event Source** tab, choose the following fields:
- * **Create an event source?** - Choose *Yes*.
- * **Source type** - Choose *Event Hub*.
+ * **Create an event source?** - Choose **Yes**.
+ * **Source type** - Choose **Event Hub**.
* **Name** - Specify a name for your event source. * **Subscription** - Choose your Azure subscription. * **Event Hub namespace** - Choose the namespace that you created earlier in this article.
- * **Event Hub name** - Choose the **time series hub** name that you created earlier in this article.
- * **Event Hub access policy name** - Choose the **time series hub auth rule** that you created earlier in this article.
- * **Event Hub consumer group** - Select *New* and specify a name for your event hub consumer group. Then, select *Add*.
+ * **Event Hub name** - Choose the time series hub name that you created earlier in this article.
+ * **Event Hub access policy name** - Choose the time series hub auth rule that you created earlier in this article.
+ * **Event Hub consumer group** - Select **New** and specify a name for your event hub consumer group. Then, select **Add**.
* **Property name** - Leave this field blank. Choose the **Review + Create** button to review all the details. Then, select the **Review + Create** button again to create the time series environment.
In this section, you'll set up Time Series Insights instance to receive data fro
To begin sending data to Time Series Insights, you'll need to start updating the digital twin properties in Azure Digital Twins with changing data values.
-Use the [az dt twin update](/cli/azure/dt/twin#az_dt_twin_update) CLI command to update a property on the twin you added in the [Prerequisites](#prerequisites) section. If you used the twin creation instructions from [Ingest telemetry from IoT Hub](how-to-ingest-iot-hub-data.md)), you can use the following command in the local CLI or the Cloud Shell **bash** terminal to update the temperature property on the thermostat67 twin.
+Use the [az dt twin update](/cli/azure/dt/twin#az_dt_twin_update) CLI command to update a property on the twin you added in the [Prerequisites](#prerequisites) section. If you used the twin creation instructions from [Ingest telemetry from IoT Hub](how-to-ingest-iot-hub-data.md)), you can use the following command in the local CLI or the Cloud Shell bash terminal to update the temperature property on the thermostat67 twin.
```azurecli-interactive az dt twin update --dt-name <your-Azure-Digital-Twins-instance-name> --twin-id thermostat67 --json-patch '{"op":"replace", "path":"/Temperature", "value": 20.5}' ```
-**Repeat the command at least 4 more times with different property values**, to create several data points that can be observed later in the Time Series Insights environment.
+Repeat the command at least 4 more times with different property values to create several data points that can be observed later in the Time Series Insights environment.
> [!TIP] > If you want to complete this article with live simulated data instead of manually updating the digital twin values, first make sure you've completed the TIP from the [Prerequisites](#prerequisites) section to set up an Azure function that updates twins from a simulated device.
After that, you can run the device now to start sending simulated data and updat
Now, data should be flowing into your Time Series Insights instance, ready to be analyzed. Follow the steps below to explore the data coming in.
-1. In the [Azure portal](https://portal.azure.com), search for your time series environment name that you created earlier. In the menu options on the left, select *Overview* to see the *Time Series Insights Explorer URL*. Select the URL to view the temperature changes reflected in the Time Series Insights environment.
+1. In the [Azure portal](https://portal.azure.com), search for your time series environment name that you created earlier. In the menu options on the left, select **Overview** to see the **Time Series Insights Explorer URL**. Select the URL to view the temperature changes reflected in the Time Series Insights environment.
:::image type="content" source="media/how-to-integrate-time-series-insights/view-environment.png" alt-text="Screenshot of the Azure portal showing the Time Series Insights explorer URL in the overview tab of the Time Series Insights environment." lightbox="media/how-to-integrate-time-series-insights/view-environment.png":::
digital-twins How To Manage Graph https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-manage-graph.md
description: Learn how to manage a graph of digital twins by connecting them with relationships. Previously updated : 1/5/2022 Last updated : 02/23/2022
Then, **copy the following code** of the runnable sample into your project:
:::code language="csharp" source="~/digital-twins-docs-samples/sdks/csharp/graph_operations_sample.cs"::: + ### Configure project Next, complete the following steps to configure your project code:
digital-twins How To Manage Model https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-manage-model.md
description: Learn how to manage DTDL models within Azure Digital Twins, including how to create, edit, and delete them. Previously updated : 10/20/2021 Last updated : 02/23/2022
The first step towards the solution is to create models to represent aspects of
> [!NOTE] > This is a sample body for a .json file in which a model is defined and saved, to be uploaded as part of a client project. The REST API call, on the other hand, takes an array of model definitions like the one above (which is mapped to a `IEnumerable<string>` in the .NET SDK). So to use this model in the REST API directly, surround it with brackets.
-This model defines a name and a unique ID for the patient room, and properties to represent visitor count and hand-wash status. These counters will be updated from motion sensors and smart soap dispensers, and will be used together to calculate a *handwash percentage* property. The model also defines a relationship *hasDevices*, which will be used to connect any [digital twins](concepts-twins-graph.md) based on this Room model to the actual devices.
+This model defines a name and a unique ID for the patient room, and properties to represent visitor count and hand-wash status. These counters will be updated from motion sensors and smart soap dispensers, and will be used together to calculate a `handwash percentage` property. The model also defines a relationship `hasDevices`, which will be used to connect any [digital twins](concepts-twins-graph.md) based on this Room model to the actual devices.
Following this method, you can go on to define models for the hospital's wards, zones, or the hospital itself.
Instead, if you want to make changes to a modelΓÇösuch as updating `displayName`
There are two strategies to choose from when replacing a model: * [Strategy 1: Upload new model version](#strategy-1-upload-new-model-version): Upload the model, with a new version number, and update your twins to use that new model. Both the new and old versions of the model will exist in your instance until you delete one.
- - **Use this strategy when** you want to update only some of your twins that use the model, or when you want to make sure twins stay conformant with their models and writable through the model transition.
+ - Use this strategy when you want to update only some of your twins that use the model, or when you want to make sure twins stay conformant with their models and writable through the model transition.
* [Strategy 2: Delete old model and reupload](#strategy-2-delete-old-model-and-reupload): Delete the original model and upload the new model with the same name and ID (DTMI value) in its place. Completely replaces the old model with the new one.
- - **Use this strategy when** you want to update all twins that use this model at once, in addition to all code reacting to the models. If your model update contains a breaking change with the model update, twins will be nonconformant with their models for a short time while you're transitioning them from the old model to the new one, meaning that they won't be able to take any updates until the new model is uploaded and the twins conform to it.
+ - Use this strategy when you want to update all twins that use this model at once, in addition to all code reacting to the models. If your model update contains a breaking change with the model update, twins will be nonconformant with their models for a short time while you're transitioning them from the old model to the new one, meaning that they won't be able to take any updates until the new model is uploaded and the twins conform to it.
>[!NOTE] > Making breaking changes to your models is discouraged outside of development.
Continue to the next sections to read more about each strategy option in detail.
This option involves creating a new version of the model and uploading it to your instance.
-This operation **doesn't** overwrite earlier versions of the model, so multiple versions of the model will coexist in your instance until you [remove them](#remove-models). Since the new model version and the old model version coexist, twins can use either the new version of the model or the older version, meaning that uploading a new version of a model doesn't automatically affect existing twins. The existing twins will remain as instances of the old model version, and you can update these twins to the new model version by patching them.
+This operation doesn't overwrite earlier versions of the model, so multiple versions of the model will coexist in your instance until you [remove them](#remove-models). Since the new model version and the old model version coexist, twins can use either the new version of the model or the older version, meaning that uploading a new version of a model doesn't automatically affect existing twins. The existing twins will remain as instances of the old model version, and you can update these twins to the new model version by patching them.
To use this strategy, follow the steps below.
Version 2 of this model might look like this:
Then, [upload](#upload-models) the new version of the model to your instance.
-This version of the model will then be available in your instance to use for digital twins. It **does not** overwrite earlier versions of the model, so multiple versions of the model now coexist in your instance.
+This version of the model will then be available in your instance to use for digital twins. It doesn't overwrite earlier versions of the model, so multiple versions of the model now coexist in your instance.
#### 2. Update graph elements as needed
-Next, update the **twins and relationships** in your instance to use the new model version instead of the old.
+Next, update the twins and relationships in your instance to use the new model version instead of the old.
You can use the following instructions to [update twins](how-to-manage-twin.md#update-a-digital-twins-model) and [update relationships](how-to-manage-graph.md#update-relationships). The patch operation to update a twin's model will look something like this: :::code language="json" source="~/digital-twins-docs-samples/models/patch-model-1.json"::: >[!IMPORTANT]
->When updating twins, use the **same patch** to update both the model ID (to the new model version) and any fields that must be altered on the twin to make it conform to the new model.
+>When updating twins, use the same patch to update both the model ID (to the new model version) and any fields that must be altered on the twin to make it conform to the new model.
-You may also need to update **relationships** and other **models** in your instance that reference this model, to make them refer to the new model version. You'll need to do another model update operation to achieve this purpose, so return to the beginning of this section and repeat the process for any more models that need updating.
+You may also need to update relationships and other models in your instance that reference this model, to make them refer to the new model version. You'll need to do another model update operation to achieve this purpose, so return to the beginning of this section and repeat the process for any more models that need updating.
#### 3. (Optional) Decommission or delete old model version
Then, [upload the model](#upload-models) to the instance, as though it were a ne
### 3. Update graph elements as needed
-Now that your new model has been uploaded in place of the old one, the twins in your graph will automatically begin to use the new model definition once the caching in your instance expires and resets. **This process may take 10-15 minutes or longer**, depending on the size of your graph. After that, new and changed properties on your model should be accessible, and removed properties won't be accessible anymore.
+Now that your new model has been uploaded in place of the old one, the twins in your graph will automatically begin to use the new model definition once the caching in your instance expires and resets. This process may take 10-15 minutes or longer, depending on the size of your graph. After that, new and changed properties on your model should be accessible, and removed properties won't be accessible anymore.
>[!NOTE] > If you removed other dependent models earlier in order to delete the original model, reupload them now after the cache has reset. If you updated the dependent models to temporarily remove references to the original model, you can update them again to put the reference back.
-Next, update the **twins and relationships** in your instance so their properties match the properties defined by the new model. Before this step is completed, the twins that don't match their model can still be read, but cannot be written to. For more information on the state of twins without a valid model, see [Twins without models](#after-deletion-twins-without-models).
+Next, update the twins and relationships in your instance so their properties match the properties defined by the new model. Before this step is completed, the twins that don't match their model can still be read, but cannot be written to. For more information on the state of twins without a valid model, see [Twins without models](#after-deletion-twins-without-models).
There are two ways to update twins and relationships for the new model so that they're writable again: * Patch the twins and relationships as needed so they fit the new model. You can use the following instructions to [update twins](how-to-manage-twin.md#update-a-digital-twin) and [update relationships](how-to-manage-graph.md#update-relationships).
- - **If you've added properties**: Updating twins and relationships to have the new values isn't required, since twins missing the new values will still be valid twins. You can patch them however you want to add values for the new properties.
- - **If you've removed properties**: It's required to patch twins to remove the properties that are now invalid with the new model.
- - **If you've updated properties**: It's required to patch twins to update the values of changed properties to be valid with the new model.
+ - If you've added properties: Updating twins and relationships to have the new values isn't required, since twins missing the new values will still be valid twins. You can patch them however you want to add values for the new properties.
+ - If you've removed properties: It's required to patch twins to remove the properties that are now invalid with the new model.
+ - If you've updated properties: It's required to patch twins to update the values of changed properties to be valid with the new model.
* Delete twins and relationships that use the model, and recreate them. You can use the following instructions to [delete twins](how-to-manage-twin.md#delete-a-digital-twin) and [recreate twins](how-to-manage-twin.md#create-a-digital-twin), and [delete relationships](how-to-manage-graph.md#delete-relationships) and [recreate relationships](how-to-manage-graph.md#create-relationships). - You might want to do this operation if you're making many changes to the model, and it will be difficult to update the existing twins to match it. However, recreation can be complicated if you have many twins that are interconnected by many relationships. ## Remove models Models can be removed from the service in one of two ways:
-* **Decommissioning** : Once a model is decommissioned, you can no longer use it to create new digital twins. Existing digital twins that already use this model aren't affected, so you can still update them with things like property changes and adding or deleting relationships.
-* **Deletion** : This operation will completely remove the model from the solution. Any twins that were using this model are no longer associated with any valid model, so they're treated as though they don't have a model at all. You can still read these twins, but you can't make any updates on them until they're reassigned to a different model.
+* Decommissioning: Once a model is decommissioned, you can no longer use it to create new digital twins. Existing digital twins that already use this model aren't affected, so you can still update them with things like property changes and adding or deleting relationships.
+* Deletion: This operation will completely remove the model from the solution. Any twins that were using this model are no longer associated with any valid model, so they're treated as though they don't have a model at all. You can still read these twins, but you can't make any updates on them until they're reassigned to a different model.
These operations are separate features and they don't impact each other, although they may be used together to remove a model gradually.
You can also delete a model with the [DigitalTwinModels Delete](/rest/api/digita
#### After deletion: Twins without models
-Once a model is deleted, any digital twins that were using the model are now considered to be without a model. There's no query that can give you a list of all the twins in this stateΓÇöalthough you *can* still query the twins by the deleted model to know what twins are affected.
+Once a model is deleted, any digital twins that were using the model are now considered to be without a model. There's no query that can give you a list of all the twins in this stateΓÇöalthough you can still query the twins by the deleted model to know what twins are affected.
Here's an overview of what you can and can't do with twins that don't have a model.
-Things you **can** do:
+Things you can do:
* Query the twin * Read properties * Read outgoing relationships
-* Add and delete incoming relationships (as in, other twins can still form relationships *to* this twin)
+* Add and delete incoming relationships (as in, other twins can still form relationships to this twin)
- The `target` in the relationship definition can still reflect the DTMI of the deleted model. A relationship with no defined target can also work here. * Delete relationships * Delete the twin
-Things you **can't** do:
-* Edit outgoing relationships (as in, relationships *from* this twin to other twins)
+Things you can't do:
+* Edit outgoing relationships (as in, relationships from this twin to other twins)
* Edit properties #### After deletion: Reuploading a model
digital-twins How To Manage Routes https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-manage-routes.md
description: Learn how to set up and manage endpoints and event routes for Azure Digital Twins data Previously updated : 1/5/2022 Last updated : 02/23/2022
This article walks you through the process of creating endpoints and routes using the [Azure portal](https://portal.azure.com), the [REST APIs](/rest/api/azure-digitaltwins/), the [.NET (C#) SDK](/dotnet/api/overview/azure/digitaltwins/client?view=azure-dotnet&preserve-view=true), and the [Azure Digital Twins CLI](/cli/azure/dt).
-In Azure Digital Twins, you can route [event notifications](concepts-event-notifications.md) to downstream services or connected compute resources. This process is done by first setting up **endpoints** that can receive the events. You can then create [event routes](concepts-route-events.md) that specify which events generated by Azure Digital Twins are delivered to which endpoints.
+In Azure Digital Twins, you can route [event notifications](concepts-event-notifications.md) to downstream services or connected compute resources. This process is done by first setting up *endpoints* that can receive the events. You can then create [event routes](concepts-route-events.md) that specify which events generated by Azure Digital Twins are delivered to which endpoints.
## Prerequisites
-* You'll need an **Azure account**, which [can be set up for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F)
-* You'll need an **Azure Digital Twins instance** in your Azure subscription. If you don't have an instance already, you can create one using the steps in [Set up an instance and authentication](how-to-set-up-instance-portal.md). Have the following values from setup handy to use later in this article:
+* You'll need an Azure account, which [can be set up for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F)
+* You'll need an Azure Digital Twins instance in your Azure subscription. If you don't have an instance already, you can create one using the steps in [Set up an instance and authentication](how-to-set-up-instance-portal.md). Have the following values from setup handy to use later in this article:
- Instance name - Resource group
These services are the supported types of endpoints that you can create for your
* [Service Bus](../service-bus-messaging/service-bus-messaging-overview.md) topic >[!NOTE]
-> For Event Grid endpoints, only event grid **topics** are supported. Event grid **domains** are not supported as endpoints.
+> For Event Grid endpoints, only event grid topics are supported. Event grid domains are not supported as endpoints.
For more information on the different endpoint types, see [Choose between Azure messaging services](../event-grid/compare-messaging-services.md).
Once you've created the endpoint resources, you can use them for an Azure Digita
To create a new endpoint, go to your instance's page in the [Azure portal](https://portal.azure.com) (you can find the instance by entering its name into the portal search bar).
-1. From the instance menu, select _Endpoints_. Then from the *Endpoints* page that follows, select *+ Create an endpoint*. Doing so will open the *Create an endpoint* page, where you'll fill in the fields in the following steps.
+1. From the instance menu, select **Endpoints**. Then from the **Endpoints** page that follows, select **+ Create an endpoint**. Doing so will open the **Create an endpoint** page, where you'll fill in the fields in the following steps.
:::image type="content" source="media/how-to-manage-routes/create-endpoint-event-grid.png" alt-text="Screenshot of creating an endpoint of type Event Grid in the Azure portal." lightbox="media/how-to-manage-routes/create-endpoint-event-grid.png":::
To create a new endpoint, go to your instance's page in the [Azure portal](https
:::column-end::: :::row-end:::
-1. Finish creating your endpoint by selecting _Save_.
+1. Finish creating your endpoint by selecting **Save**.
>[!IMPORTANT] > In order to successfully use identity-based authentication for your endpoint, you'll need to create a managed identity for your instance by following the steps in [Route events with a managed identity](how-to-route-with-managed-identity.md).
After creating your endpoint, you can verify that the endpoint was successfully
If the endpoint creation fails, observe the error message and retry after a few minutes.
-You can also view the endpoint that was created back on the *Endpoints* page for your Azure Digital Twins instance.
+You can also view the endpoint that was created back on the **Endpoints** page for your Azure Digital Twins instance.
-Now the event grid, event hub, or Service Bus topic is available as an endpoint in Azure Digital Twins, under the name you chose for the endpoint. You'll typically use that name as the target of an **event route**, which you'll create [later in this article](#create-an-event-route).
+Now the event grid, event hub, or Service Bus topic is available as an endpoint in Azure Digital Twins, under the name you chose for the endpoint. You'll typically use that name as the target of an event route, which you'll create [later in this article](#create-an-event-route).
# [CLI](#tab/cli)
To create a Service Bus topic endpoint (key-based authentication):
az dt endpoint create servicebus --endpoint-name <Service-Bus-endpoint-name> --servicebus-resource-group <Service-Bus-resource-group-name> --servicebus-namespace <Service-Bus-namespace> --servicebus-topic <Service-Bus-topic-name> --servicebus-policy <Service-Bus-topic-policy> --dt-name <your-Azure-Digital-Twins-instance-name> ```
-After successfully running these commands, the event grid, event hub, or Service Bus topic will be available as an endpoint in Azure Digital Twins, under the name you supplied with the `--endpoint-name` argument. You'll typically use that name as the target of an **event route**, which you'll create [later in this article](#create-an-event-route).
+After successfully running these commands, the event grid, event hub, or Service Bus topic will be available as an endpoint in Azure Digital Twins, under the name you supplied with the `--endpoint-name` argument. You'll typically use that name as the target of an event route, which you'll create [later in this article](#create-an-event-route).
#### Create an endpoint with identity-based authentication
az resource create --id <Azure-Digital-Twins-instance-Azure-resource-ID>/endpoin
### Create an endpoint with dead-lettering
-When an endpoint can't deliver an event within a certain time period or after trying to deliver the event a certain number of times, it can send the undelivered event to a storage account. This process is known as **dead-lettering**.
+When an endpoint can't deliver an event within a certain time period or after trying to deliver the event a certain number of times, it can send the undelivered event to a storage account. This process is known as *dead-lettering*.
You can set up the necessary storage resources using the [Azure portal](https://portal.azure.com/#home) or the [Azure Digital Twins CLI](/cli/azure/dt). However, to create an endpoint with dead-lettering enabled, you'll need use the [Azure Digital Twins CLI](/cli/azure/dt) or [control plane APIs](concepts-apis-sdks.md#overview-control-plane-apis).
To learn more about dead-lettering, see [Endpoints and event routes](concepts-ro
Before setting the dead-letter location, you must have a [storage account](../storage/common/storage-account-create.md?tabs=azure-portal) with a [container](../storage/blobs/storage-quickstart-blobs-portal.md#create-a-container) set up in your Azure account.
-You'll provide the URI for this container when creating the endpoint later. The dead-letter location will be provided to the endpoint as a container URI with a [SAS token](../storage/common/storage-sas-overview.md). That token needs `write` permission for the destination container within the storage account. The fully formed **dead letter SAS URI** will be in the format of: `https://<storage-account-name>.blob.core.windows.net/<container-name>?<SAS-token>`.
+You'll provide the URI for this container when creating the endpoint later. The dead-letter location will be provided to the endpoint as a container URI with a [SAS token](../storage/common/storage-sas-overview.md). That token needs `write` permission for the destination container within the storage account. The fully formed dead letter SAS URI will be in the format of: `https://<storage-account-name>.blob.core.windows.net/<container-name>?<SAS-token>`.
Follow the steps below to set up these storage resources in your Azure account, to prepare to set up the endpoint connection in the next section.
-1. Follow the steps in [Create a storage account](../storage/common/storage-account-create.md?tabs=azure-portal) to create a **storage account** in your Azure subscription. Make a note of the storage account name to use it later.
-1. Follow the steps in [Create a container](../storage/blobs/storage-quickstart-blobs-portal.md#create-a-container) to create a **container** within the new storage account. Make a note of the container name to use it later.
+1. Follow the steps in [Create a storage account](../storage/common/storage-account-create.md?tabs=azure-portal) to create a storage account in your Azure subscription. Make a note of the storage account name to use it later.
+1. Follow the steps in [Create a container](../storage/blobs/storage-quickstart-blobs-portal.md#create-a-container) to create a container within the new storage account. Make a note of the container name to use it later.
##### Create a SAS token
-Next, create a **SAS token** for your storage account that the endpoint can use to access it.
+Next, create a SAS token for your storage account that the endpoint can use to access it.
# [Portal](#tab/portal) 1. Start by navigating to your storage account in the [Azure portal](https://portal.azure.com/#home) (you can find it by name with the portal search bar).
-1. In the storage account page, choose the _Shared access signature_ link in the left navigation bar to start setting up the SAS token.
+1. In the storage account page, choose the **Shared access signature** link in the left navigation bar to start setting up the SAS token.
:::image type="content" source="./media/how-to-manage-routes/generate-sas-token-1.png" alt-text="Screenshot of the storage account page in the Azure portal." lightbox="./media/how-to-manage-routes/generate-sas-token-1.png":::
-1. On the *Shared access signature page*, under *Allowed services* and *Allowed resource types*, select whatever settings you want. You'll need to select at least one box in each category. Under *Allowed permissions*, choose **Write** (you can also select other permissions if you want).
+1. On the **Shared access signature page**, under **Allowed services** and **Allowed resource types**, select whatever settings you want. You'll need to select at least one box in each category. Under **Allowed permissions**, choose **Write** (you can also select other permissions if you want).
1. Set whatever values you want for the remaining settings.
-1. When you're finished, select the _Generate SAS and connection string_ button to generate the SAS token.
+1. When you're finished, select the **Generate SAS and connection string** button to generate the SAS token.
:::image type="content" source="./media/how-to-manage-routes/generate-sas-token-2.png" alt-text="Screenshot of the storage account page in the Azure portal showing all the setting selection to generate a SAS token." lightbox="./media/how-to-manage-routes/generate-sas-token-2.png":::
-1. Doing so will generate several SAS and connection string values at the bottom of the same page, underneath the setting selections. Scroll down to view the values, and use the *Copy to clipboard* icon to copy the **SAS token** value. Save it to use later.
+1. Doing so will generate several SAS and connection string values at the bottom of the same page, underneath the setting selections. Scroll down to view the values, and use the **Copy to clipboard** icon to copy the **SAS token** value. Save it to use later.
:::image type="content" source="./media/how-to-manage-routes/copy-sas-token.png" alt-text="Screenshot of the storage account page in the Azure portal highlighting how to copy the SAS token to use in the dead-letter secret." lightbox="./media/how-to-manage-routes/copy-sas-token.png":::
For instructions on how to create this type of endpoint with the Azure CLI, swit
To create an endpoint that has dead-lettering enabled, add the following dead letter parameter to the [az dt endpoint create](/cli/azure/dt/endpoint/create) command for the [Azure Digital Twins CLI](/cli/azure/dt).
-The value for the parameter is the **dead letter SAS URI** made up of the storage account name, container name, and SAS token that you gathered in the [previous section](#set-up-storage-resources). This parameter creates the endpoint with key-based authentication.
+The value for the parameter is the dead letter SAS URI made up of the storage account name, container name, and SAS token that you gathered in the [previous section](#set-up-storage-resources). This parameter creates the endpoint with key-based authentication.
```azurecli --deadletter-sas-uri https://<storage-account-name>.blob.core.windows.net/<container-name>?<SAS-token>
Here are the values you'll need to plug into the placeholders in the command:
* An endpoint type * The endpoint resource's namespace * The name of the event hub or Service Bus topic
-* **Dead letter SAS URI** details: storage account name, container name
+* Dead letter SAS URI details: storage account name, container name
* The location of your Azure Digital Twins instance ```azurecli-interactive
Here's an example of a dead-letter message for a [twin create notification](conc
## Create an event route
-To actually send data from Azure Digital Twins to an endpoint, you'll need to define an **event route**. These routes let developers wire up event flow, throughout the system and to downstream services. A single route can allow multiple notifications and event types to be selected. Read more about event routes in [Endpoints and event routes](concepts-route-events.md).
+To actually send data from Azure Digital Twins to an endpoint, you'll need to define an event route. These routes let developers wire up event flow, throughout the system and to downstream services. A single route can allow multiple notifications and event types to be selected. Read more about event routes in [Endpoints and event routes](concepts-route-events.md).
-**Prerequisite**: Create endpoints as described earlier in this article before you move on to creating a route. You can continue to create an event route once your endpoints are finished setting up.
+Prerequisite: Create endpoints as described earlier in this article before you move on to creating a route. You can continue to create an event route once your endpoints are finished setting up.
>[!NOTE]
->If you have recently deployed your endpoints, validate that they're finished deploying **before** attempting to use them for a new event route. If route deployment fails because the endpoints aren't ready, wait a few minutes and try again.
+>If you have recently deployed your endpoints, validate that they're finished deploying before attempting to use them for a new event route. If route deployment fails because the endpoints aren't ready, wait a few minutes and try again.
> > If you are scripting this flow, you may want to account for this by building in 2-3 minutes of wait time for the endpoint service to finish deploying before moving on to route setup.
Event routes can be created with the [Azure portal](https://portal.azure.com), [
To create an event route, go to the details page for your Azure Digital Twins instance in the [Azure portal](https://portal.azure.com) (you can find the instance by entering its name into the portal search bar).
-From the instance menu, select _Event routes_. Then from the *Event routes* page that follows, select *+ Create an event route*.
+From the instance menu, select **Event routes**. Then from the **Event routes** page that follows, select **+ Create an event route**.
-On the *Create an event route* page that opens up, choose at minimum:
-* A name for your route in the _Name_ field
-* The _Endpoint_ you want to use to create the route
+On the **Create an event route** page that opens up, choose at minimum:
+* A name for your route in the **Name** field
+* The **Endpoint** you want to use to create the route
-For the route to be enabled, you must also **Add an event route filter** of at least `true`. (Leaving the default value of `false` will create the route, but no events will be sent to it.) To do so, toggle the switch for the _Advanced editor_ to enable it, and write `true` in the *Filter* box.
+For the route to be enabled, you must also **Add an event route filter** of at least `true`. (Leaving the default value of `false` will create the route, but no events will be sent to it.) To do so, toggle the switch for the **Advanced editor** to enable it, and write `true` in the **Filter** box.
:::image type="content" source="media/how-to-manage-routes/create-event-route-no-filter.png" alt-text="Screenshot of creating an event route for your instance in the Azure portal." lightbox="media/how-to-manage-routes/create-event-route-no-filter.png":::
-When finished, select the _Save_ button to create your event route.
+When finished, select the **Save** button to create your event route.
# [CLI](#tab/cli2)
The following sample method shows how to create, list, and delete an event route
## Filter events
-As described above, routes have a **filter** field. If the filter value on your route is `false`, no events will be sent to your endpoint.
+As described above, routes have a filter field. If the filter value on your route is `false`, no events will be sent to your endpoint.
After enabling the minimal filter of `true`, endpoints will receive different kinds of events from Azure Digital Twins: * Telemetry fired by [digital twins](concepts-twins-graph.md) using the Azure Digital Twins service API
After enabling the minimal filter of `true`, endpoints will receive different ki
You can restrict the types of events being sent by defining a more-specific filter. >[!NOTE]
-> Filters are **case-sensitive** and need to match the payload case.
+> Filters are case-sensitive and need to match the payload case.
> > For telemetry filters, this means that the casing needs to match the casing in the telemetry sent by the device, not necessarily the casing defined in the twin's model. # [Portal](#tab/portal3)
-To add an event filter while you're creating an event route, use the "Add an event route filter" section of the *Create an event route* page.
+To add an event filter while you're creating an event route, use the **Add an event route filter** section of the **Create an event route** page.
You can either select from some basic common filter options, or use the advanced filter options to write your own custom filters. ### Use the basic filters
-To use the basic filters, expand the _Event types_ option and select the checkboxes corresponding to the events you want to send to your endpoint.
+To use the basic filters, expand the **Event types** option and select the checkboxes corresponding to the events you want to send to your endpoint.
:::row::: :::column:::
Doing so will autopopulate the filter text box with the text of the filter you'v
You can also use the advanced filter option to write your own custom filters.
-To create an event route with advanced filter options, toggle the switch for the _Advanced editor_ to enable it. You can then write your own event filters in the *Filter* box:
+To create an event route with advanced filter options, toggle the switch for the **Advanced editor** to enable it. You can then write your own event filters in the **Filter** box:
:::row::: :::column:::
Here are the supported route filters.
| | | | | | True / False | Allows creating a route with no filtering, or disabling a route so no events are sent | `<true/false>` | `true` = route is enabled with no filtering <br> `false` = route is disabled | | Type | The [type of event](concepts-route-events.md#types-of-event-messages) flowing through your digital twin instance | `type = '<event-type>'` | Here are the possible event type values: <br>`Microsoft.DigitalTwins.Twin.Create` <br> `Microsoft.DigitalTwins.Twin.Delete` <br> `Microsoft.DigitalTwins.Twin.Update`<br>`Microsoft.DigitalTwins.Relationship.Create`<br>`Microsoft.DigitalTwins.Relationship.Update`<br> `Microsoft.DigitalTwins.Relationship.Delete` <br> `microsoft.iot.telemetry` |
-| Source | Name of Azure Digital Twins instance | `source = '<host-name>'`| Here are the possible host name values: <br> **For notifications**: `<your-Digital-Twins-instance>.api.<your-region>.digitaltwins.azure.net` <br> **For telemetry**: `<your-Digital-Twins-instance>.api.<your-region>.digitaltwins.azure.net/<twin-ID>`|
-| Subject | A description of the event in the context of the event source above | `subject = '<subject>'` | Here are the possible subject values: <br>**For notifications**: The subject is `<twin-ID>` <br> or a URI format for subjects, which are uniquely identified by multiple parts or IDs:<br>`<twin-ID>/relationships/<relationship-ID>`<br> **For telemetry**: The subject is the component path (if the telemetry is emitted from a twin component), such as `comp1.comp2`. If the telemetry isn't emitted from a component, then its subject field is empty. |
-| Data schema | DTDL model ID | `dataschema = '<model-dtmi-ID>'` | **For telemetry**: The data schema is the model ID of the twin or the component that emits the telemetry. For example, `dtmi:example:com:floor4;2` <br>**For notifications (create/delete)**: Data schema can be accessed in the notification body at `$body.$metadata.$model`. <br>**For notifications (update)**: Data schema can be accessed in the notification body at `$body.modelId`|
+| Source | Name of Azure Digital Twins instance | `source = '<host-name>'`| Here are the possible host name values: <br><br> For notifications: `<your-Digital-Twins-instance>.api.<your-region>.digitaltwins.azure.net` <br><br> For telemetry: `<your-Digital-Twins-instance>.api.<your-region>.digitaltwins.azure.net/<twin-ID>`|
+| Subject | A description of the event in the context of the event source above | `subject = '<subject>'` | Here are the possible subject values: <br><br>For notifications: The subject is `<twin-ID>` <br> or a URI format for subjects, which are uniquely identified by multiple parts or IDs:<br>`<twin-ID>/relationships/<relationship-ID>`<br><br> For telemetry: The subject is the component path (if the telemetry is emitted from a twin component), such as `comp1.comp2`. If the telemetry isn't emitted from a component, then its subject field is empty. |
+| Data schema | DTDL model ID | `dataschema = '<model-dtmi-ID>'` | For telemetry: The data schema is the model ID of the twin or the component that emits the telemetry. For example, `dtmi:example:com:floor4;2` <br><br>For notifications (create/delete): Data schema can be accessed in the notification body at `$body.$metadata.$model`. <br><br>For notifications (update): Data schema can be accessed in the notification body at `$body.modelId`|
| Content type | Content type of data value | `datacontenttype = '<content-type>'` | The content type is `application/json` | | Spec version | The version of the event schema you're using | `specversion = '<version>'` | The version must be `1.0`. This value indicates the CloudEvents schema version 1.0 | | Notification body | Reference any property in the `data` field of a notification | `$body.<property>` | See [Event notifications](concepts-event-notifications.md) for examples of notifications. Any property in the `data` field can be referenced using `$body`
The following data types are supported as values returned by references to the d
| Data type | Example | |-|-|-|
-|**String**| `STARTS_WITH($body.$metadata.$model, 'dtmi:example:com:floor')` <br> `CONTAINS(subject, '<twin-ID>')`|
-|**Integer**|`$body.errorCode > 200`|
-|**Double**|`$body.temperature <= 5.5`|
-|**Bool**|`$body.poweredOn = true`|
-|**Null**|`$body.prop != null`|
+|String| `STARTS_WITH($body.$metadata.$model, 'dtmi:example:com:floor')` <br> `CONTAINS(subject, '<twin-ID>')`|
+|Integer|`$body.errorCode > 200`|
+|Double|`$body.temperature <= 5.5`|
+|Bool|`$body.poweredOn = true`|
+|Null|`$body.prop != null`|
The following operators are supported when defining route filters:
When you implement or update a filter, the change may take a few minutes to be r
Routing metrics such as count, latency, and failure rate can be viewed in the [Azure portal](https://portal.azure.com/).
-From the portal homepage, search for your Azure Digital Twins instance to pull up its details. Select the **Metrics** option from the Azure Digital Twins instance's navigation menu on the left to bring up the *Metrics* page.
+From the portal homepage, search for your Azure Digital Twins instance to pull up its details. Select the **Metrics** option from the Azure Digital Twins instance's navigation menu on the left to bring up the **Metrics** page.
:::image type="content" source="media/troubleshoot-metrics/azure-digital-twins-metrics.png" alt-text="Screenshot showing the metrics page for Azure Digital Twins.":::
digital-twins How To Manage Twin https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-manage-twin.md
description: See how to retrieve, update, and delete individual twins and relationships. Previously updated : 9/13/2021 Last updated : 02/23/2022
Then, **copy the following code** of the runnable sample into your project:
:::code language="csharp" source="~/digital-twins-docs-samples/sdks/csharp/twin_operations_sample.cs"::: + ### Configure project Next, complete the following steps to configure your project code:
digital-twins How To Move Regions https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-move-regions.md
description: Learn how to move an Azure Digital Twins instance from one Azure region to another. Previously updated : 1/5/2022 Last updated : 02/23/2022
Before you attempt to recreate your Azure Digital Twins instance, go over the co
Here are some questions to consider:
-* What are the **models** uploaded to my instance? How many are there?
-* What are the **twins** in my instance? How many are there?
-* What's the general shape of the **graph** in my instance? How many relationships are there?
-* What **endpoints** do I have in my instance?
-* What **routes** do I have in my instance? Do they have filters?
-* Where does my instance **connect to other Azure services**? Some common integration points include:
+* What are the models uploaded to my instance? How many are there?
+* What are the twins in my instance? How many are there?
+* What's the general shape of the graph in my instance? How many relationships are there?
+* What endpoints do I have in my instance?
+* What routes do I have in my instance? Do they have filters?
+* Where does my instance connect to other Azure services? Some common integration points include:
- Azure Event Grid, Azure Event Hubs, or Azure Service Bus - Azure Functions
Here are some questions to consider:
- Azure Time Series Insights - Azure Maps - Azure IoT Hub Device Provisioning Service
-* What other **personal or company apps** do I have that connect to my instance?
+* What other personal or company apps do I have that connect to my instance?
You can gather this information by using the [Azure portal](https://portal.azure.com), [Azure Digital Twins APIs and SDKs](concepts-apis-sdks.md), [Azure Digital Twins CLI commands](/cli/azure/dt), or the [Azure Digital Twins Explorer](concepts-azure-digital-twins-explorer.md).
Next, you'll complete the "move" of your instance by creating a new instance in
First, create a new instance of Azure Digital Twins in your target region. Follow the steps in [Set up an instance and authentication](how-to-set-up-instance-portal.md). Keep these pointers in mind:
-* You can keep the same name for the new instance *if* it's in a different resource group. If you need to use the same resource group that contains your original instance, your new instance will need its own distinct name.
+* You can keep the same name for the new instance if it's in a different resource group. If you need to use the same resource group that contains your original instance, your new instance will need its own distinct name.
* Enter the new target region when prompted for a location. After this step is complete, you'll need the host name of your new instance to continue setting it up with your data. If you didn't make a note of the host name during setup, follow [these instructions](how-to-set-up-instance-portal.md#verify-success-and-collect-important-values) to get it now from the Azure portal.
If you have endpoints or routes in your original instance, you'll need to recrea
Otherwise, follow the steps in [Manage endpoints and routes](how-to-manage-routes.md) using the new instance. Keep these pointers in mind:
-* You *don't* need to recreate the Event Grid, Event Hubs, or Service Bus resource that you're using for the endpoint. For more information, see the "Prerequisites" section in the endpoint instructions. You just need to recreate the endpoint on the Azure Digital Twins instance.
+* You don't need to recreate the Event Grid, Event Hubs, or Service Bus resource that you're using for the endpoint. For more information, see the [Prerequisites section](how-to-manage-routes.md#prerequisite-create-endpoint-resources) in the endpoint instructions. You just need to recreate the endpoint on the Azure Digital Twins instance.
* You can reuse endpoint and route names because they're scoped to a different instance. * Remember to add any required filters to the routes you create.
The exact resources you need to edit depends on your scenario, but here are some
* Azure Maps. * IoT Hub Device Provisioning Service. * Personal or company apps outside of Azure, such as the client app created in [Code a client app](tutorial-code.md), that connect to the instance and call Azure Digital Twins APIs.
-* Azure AD app registrations *don't* need to be recreated. If you're using an [app registration](./how-to-create-app-registration-portal.md) to connect to the Azure Digital Twins APIs, you can reuse the same app registration with your new instance.
+* Azure AD app registrations don't need to be recreated. If you're using an [app registration](./how-to-create-app-registration-portal.md) to connect to the Azure Digital Twins APIs, you can reuse the same app registration with your new instance.
After you finish this step, your new instance in the target region should be a copy of the original instance.
digital-twins How To Parse Models https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-parse-models.md
description: Learn how to use the parser library to parse DTDL models. Previously updated : 1/6/2022 Last updated : 02/23/2022
This article describes how to parse and validate Azure Digital Twins models using the DTDL validator sample or the .NET parser library.
-[Models](concepts-models.md) in Azure Digital Twins are defined using the JSON-LD-based Digital Twins Definition language (DTDL). **It is recommended to validate your models offline before uploading them to your Azure Digital Twins instance.**
+[Models](concepts-models.md) in Azure Digital Twins are defined using the JSON-LD-based Digital Twins Definition language (DTDL). It is recommended to validate your models offline before uploading them to your Azure Digital Twins instance.
To help you validate your models, a .NET client-side DTDL parsing library is provided on NuGet: [Microsoft.Azure.DigitalTwins.Parser](https://nuget.org/packages/Microsoft.Azure.DigitalTwins.Parser/).
You can view the code in GitHub by selecting the **Browse code** button at the s
The source code shows examples for how to use the parser library. You can use the validator sample as a command line utility to validate a directory tree of DTDL files. It also provides an interactive mode.
-In the folder for the DTDL Validator sample, see the **readme.md** file for instructions on how to package the sample into a self-contained executable.
+In the folder for the DTDL Validator sample, see the *readme.md* file for instructions on how to package the sample into a self-contained executable.
After you have built a self-contained package and added the executable to your path, you can run the validator with this command in a console on your machine:
digital-twins How To Provision Using Device Provisioning Service https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-provision-using-device-provisioning-service.md
description: Learn how to set up an automated process to provision and retire IoT devices in Azure Digital Twins using Device Provisioning Service (DPS). Previously updated : 1/6/2022 Last updated : 02/23/2022
In this article, you'll learn how to integrate Azure Digital Twins with [Device Provisioning Service (DPS)](../iot-dps/about-iot-dps.md).
-The solution described in this article will allow you to automate the process to **_provision_** and **_retire_** IoT Hub devices in Azure Digital Twins, using Device Provisioning Service.
+The solution described in this article will allow you to automate the process to provision and retire IoT Hub devices in Azure Digital Twins, using Device Provisioning Service.
-For more information about the _provision_ and _retire_ stages, and to better understand the set of general device management stages that are common to all enterprise IoT projects, see the [Device lifecycle section](../iot-hub/iot-hub-device-management-overview.md#device-lifecycle) of IoT Hub's device management documentation.
+For more information about the provision and retire stages, and to better understand the set of general device management stages that are common to all enterprise IoT projects, see the [Device lifecycle section](../iot-hub/iot-hub-device-management-overview.md#device-lifecycle) of IoT Hub's device management documentation.
## Prerequisites Before you can set up the provisioning, you'll need to set up the following resources:
-* An **Azure Digital Twins instance**. Follow the instructions in [Set up an instance and authentication](how-to-set-up-instance-portal.md) to create an Azure digital twins instance. Gather the instance's **_host name_** in the Azure portal ([instructions](how-to-set-up-instance-portal.md#verify-success-and-collect-important-values)).
-* An **IoT hub**. For instructions, see the "Create an IoT Hub" section of [the IoT Hub quickstart](../iot-hub/quickstart-send-telemetry-cli.md).
-* An [Azure function](../azure-functions/functions-overview.md) that updates digital twin information based on IoT Hub data. Follow the instructions in [Ingest IoT hub data](how-to-ingest-iot-hub-data.md) to create this Azure function. Gather the function **_name_** to use it in this article.
+* An Azure Digital Twins instance. Follow the instructions in [Set up an instance and authentication](how-to-set-up-instance-portal.md) to create an Azure digital twins instance. Gather the instance's **host name** in the Azure portal ([instructions](how-to-set-up-instance-portal.md#verify-success-and-collect-important-values)).
+* An IoT hub. For instructions, see the "Create an IoT Hub" section of [the IoT Hub quickstart](../iot-hub/quickstart-send-telemetry-cli.md).
+* An [Azure function](../azure-functions/functions-overview.md) that updates digital twin information based on IoT Hub data. Follow the instructions in [Ingest IoT hub data](how-to-ingest-iot-hub-data.md) to create this Azure function. Gather the function **name** to use it in this article.
-This sample also uses a **device simulator** that includes provisioning using the Device Provisioning Service. The device simulator is located here: [Azure Digital Twins and IoT Hub Integration Sample](/samples/azure-samples/digital-twins-iothub-integration/adt-iothub-provision-sample/). Get the sample project on your machine by navigating to the sample link and selecting the **Browse code** button underneath the title. This button will take you to the GitHub repo for the sample, which you can download as a .zip file by selecting the **Code** button and **Download ZIP**.
+This sample also uses a *device simulator* that includes provisioning using the Device Provisioning Service. The device simulator is located here: [Azure Digital Twins and IoT Hub Integration Sample](/samples/azure-samples/digital-twins-iothub-integration/adt-iothub-provision-sample/). Get the sample project on your machine by navigating to the sample link and selecting the **Browse code** button underneath the title. This button will take you to the GitHub repo for the sample, which you can download as a .zip file by selecting the **Code** button and **Download ZIP**.
:::image type="content" source="media/how-to-provision-using-device-provisioning-service/download-repo-zip.png" alt-text="Screenshot of the digital-twins-iothub-integration repo on GitHub, highlighting the steps to download it as a zip." lightbox="media/how-to-provision-using-device-provisioning-service/download-repo-zip.png"::: Unzip the downloaded folder.
-You'll need [Node.js](https://nodejs.org/download) installed on your machine. The device simulator is based on **Node.js**, version 10.0.x or later.
+You'll need [Node.js](https://nodejs.org/download) installed on your machine. The device simulator is based on Node.js, version 10.0.x or later.
## Solution architecture
Inside your function app project that you created in the [Prerequisites section]
Start by opening the function app project in Visual Studio on your machine and follow the steps below.
-1. First, create a new function of type *HTTP-trigger* in the function app project in Visual Studio. For instructions on how to create this function, see [Develop Azure Functions using Visual Studio](../azure-functions/functions-develop-vs.md#add-a-function-to-your-project).
+1. First, create a new function of type **HTTP-trigger** in the function app project in Visual Studio. For instructions on how to create this function, see [Develop Azure Functions using Visual Studio](../azure-functions/functions-develop-vs.md#add-a-function-to-your-project).
2. Add a new NuGet package to the project: [Microsoft.Azure.Devices.Provisioning.Service](https://www.nuget.org/packages/Microsoft.Azure.Devices.Provisioning.Service/). You might need to add more packages to your project as well, if the packages used in the code aren't part of the project already.
Start by opening the function app project in Visual Studio on your machine and f
### Create Device Provisioning enrollment
-Next, you'll need to create an enrollment in Device Provisioning Service using a **custom allocation function**. To create an enrollment, follow the instructions in the [Create the enrollment](../iot-dps/how-to-use-custom-allocation-policies.md#create-the-enrollment) section of the custom allocation policies article in the Device Provisioning Service documentation.
+Next, you'll need to create an enrollment in Device Provisioning Service using a *custom allocation function*. To create an enrollment, follow the instructions in the [Create the enrollment](../iot-dps/how-to-use-custom-allocation-policies.md#create-the-enrollment) section of the custom allocation policies article in the Device Provisioning Service documentation.
While going through that flow, make sure you select the following options to link the enrollment to the function you created. * **Select how you want to assign devices to hubs**: Custom (Use Azure Function).
-* **Select the IoT hubs this group can be assigned to:** Choose your IoT hub name or select the *Link a new IoT hub* button, and choose your IoT hub from the dropdown.
+* **Select the IoT hubs this group can be assigned to:** Choose your IoT hub name or select the **Link a new IoT hub** button, and choose your IoT hub from the dropdown.
-Next, choose the *Select a new function* button to link your function app to the enrollment group. Then, fill in the following values:
+Next, choose the **Select a new function** button to link your function app to the enrollment group. Then, fill in the following values:
* **Subscription**: Your Azure subscription is autopopulated. Make sure it's the right subscription. * **Function App**: Choose your function app name.
In your command window, navigate to the downloaded sample *Azure Digital Twins a
npm install ```
-Next, in your device simulator directory, copy the .env.template file to a new file called .env, and gather the following values to fill in the settings:
+Next, in your device simulator directory, copy the *.env.template* file to a new file called *.env*, and gather the following values to fill in the settings:
-* PROVISIONING_IDSCOPE: To get this value, navigate to your device provisioning service in the [Azure portal](https://portal.azure.com/), then select *Overview* in the menu options and look for the field *ID Scope*.
+* PROVISIONING_IDSCOPE: To get this value, navigate to your device provisioning service in the [Azure portal](https://portal.azure.com/), then select **Overview** in the menu options and look for the field **ID Scope**.
:::image type="content" source="media/how-to-provision-using-device-provisioning-service/id-scope.png" alt-text="Screenshot of the Azure portal view of the device provisioning overview page highlighting the ID Scope value." lightbox="media/how-to-provision-using-device-provisioning-service/id-scope.png"::: * PROVISIONING_REGISTRATION_ID: You can choose a registration ID for your device. * ADT_MODEL_ID: `dtmi:contosocom:DigitalTwins:Thermostat;1`
-* PROVISIONING_SYMMETRIC_KEY: This environment variable is the primary key for the enrollment you set up earlier. To get this value again, navigate to your device provisioning service in the Azure portal, select *Manage enrollments*, then select the enrollment group that you created earlier and copy the *Primary Key*.
+* PROVISIONING_SYMMETRIC_KEY: This environment variable is the primary key for the enrollment you set up earlier. To get this value again, navigate to your device provisioning service in the Azure portal, select **Manage enrollments**, then select the enrollment group that you created earlier and copy the **Primary Key**.
:::image type="content" source="media/how-to-provision-using-device-provisioning-service/sas-primary-key.png" alt-text="Screenshot of the Azure portal view of the device provisioning service manage enrollments page highlighting the SAS primary key value." lightbox="media/how-to-provision-using-device-provisioning-service/sas-primary-key.png":::
-Now, use the values above to update the .env file settings.
+Now, use the values above to update the *.env* file settings.
```cmd PROVISIONING_HOST = "global.azure-devices-provisioning.net"
The screenshot below illustrates the creation of the event hub.
Next, you'll need to create a [shared access signature (SAS) policy](../event-hubs/authorize-access-shared-access-signature.md) to configure the event hub with your function app. To create the SAS policy: 1. Navigate to the event hub you created in the Azure portal and select **Shared access policies** in the menu options on the left.
-2. Select **Add**. In the *Add SAS Policy* window that opens, enter a policy name of your choice and select the *Listen* checkbox.
+2. Select **Add**. In the **Add SAS Policy** window that opens, enter a policy name of your choice and select the **Listen** checkbox.
3. Select **Create**. :::image type="content" source="media/how-to-provision-using-device-provisioning-service/add-event-hub-sas-policy.png" alt-text="Screenshot of the Azure portal showing how to add an event hub SAS policy." lightbox="media/how-to-provision-using-device-provisioning-service/add-event-hub-sas-policy.png":::
For more about lifecycle events, see [IoT Hub Non-telemetry events](../iot-hub/i
Start by opening the function app project in Visual Studio on your machine and follow the steps below.
-1. First, create a new function of type *Event Hub Trigger* in the function app project in Visual Studio. For instructions on how to create this function, see [Develop Azure Functions using Visual Studio](../azure-functions/functions-develop-vs.md#add-a-function-to-your-project).
+1. First, create a new function of type **Event Hub Trigger** in the function app project in Visual Studio. For instructions on how to create this function, see [Develop Azure Functions using Visual Studio](../azure-functions/functions-develop-vs.md#add-a-function-to-your-project).
2. Add a new NuGet package to the project: [Microsoft.Azure.Devices.Provisioning.Service](https://www.nuget.org/packages/Microsoft.Azure.Devices.Provisioning.Service/). You might need to add more packages to your project as well, if the packages used in the code aren't part of the project already.
Follow these steps to create an event hub endpoint:
:::image type="content" source="media/how-to-provision-using-device-provisioning-service/event-hub-custom-endpoint.png" alt-text="Screenshot of the Visual Studio window showing how to add an event hub custom endpoint." lightbox="media/how-to-provision-using-device-provisioning-service/event-hub-custom-endpoint.png":::
-4. In the window *Add an event hub endpoint* that opens, choose the following values:
+4. In the window **Add an event hub endpoint** that opens, choose the following values:
* **Endpoint name**: Choose an endpoint name. * **Event hub namespace**: Select your event hub namespace from the dropdown list. * **Event hub instance**: Choose the event hub name that you created in the previous step.
Follow these steps to create an event hub endpoint:
Next, you'll add a route that connects to the endpoint you created in the above step, with a routing query that sends the delete events. Follow these steps to create a route:
-1. Navigate to the *Routes* tab and select **Add** to add a route.
+1. Navigate to the **Routes** tab and select **Add** to add a route.
:::image type="content" source="media/how-to-provision-using-device-provisioning-service/add-message-route.png" alt-text="Screenshot of the Visual Studio window showing how to add a route to send events." lightbox="media/how-to-provision-using-device-provisioning-service/add-message-route.png":::
-2. In the *Add a route* page that opens, choose the following values:
+2. In the **Add a route** page that opens, choose the following values:
* **Name**: Choose a name for your route. * **Endpoint**: Choose the Event Hubs endpoint you created earlier from the dropdown.
- * **Data source**: Choose *Device Lifecycle Events*.
+ * **Data source**: Choose **Device Lifecycle Events**.
* **Routing query**: Enter `opType='deleteDeviceIdentity'`. This query limits the device lifecycle events to only send the delete events. 3. Select **Save**.
digital-twins How To Query Graph https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-query-graph.md
description: See how to query the Azure Digital Twins twin graph for information. Previously updated : 11/19/2020 Last updated : 02/23/2022
# Query the Azure Digital Twins twin graph
-This article offers query examples and instructions for using the **Azure Digital Twins query language** to query your [twin graph](concepts-twins-graph.md) for information. (For an introduction to the query language, see [Query language](concepts-query-language.md).)
+This article offers query examples and instructions for using the *Azure Digital Twins query language* to query your [twin graph](concepts-twins-graph.md) for information. (For an introduction to the query language, see [Query language](concepts-query-language.md).)
The article contains sample queries that illustrate the query language structure and common query operations for digital twins. It also describes how to run your queries after you've written them, using the Azure Digital Twins [Query API](/rest/api/digital-twins/dataplane/query) or an [SDK](concepts-apis-sdks.md#overview-data-plane-apis).
Here's the basic query that will return a list of all digital twins in the insta
## Query by property
-Get digital twins by **properties** (including ID and metadata):
+Get digital twins by properties (including ID and metadata):
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="QueryByProperty1":::
As shown in the query above, the ID of a digital twin is queried using the metad
>[!TIP] > If you are using Cloud Shell to run a query with metadata fields that begin with `$`, you should escape the `$` with a backslash to let Cloud Shell know it's not a variable and should be consumed as a literal in the query text.
-You can also get twins based on **whether a certain property is defined**. Here's a query that gets twins that have a defined *Location* property:
+You can also get twins based on whether a certain property is defined. Here's a query that gets twins that have a defined `Location` property:
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="QueryByProperty2":::
-This query can help you to get twins by their *tag* properties, as described in [Add tags to digital twins](how-to-use-tags.md). Here's a query that gets all twins tagged with *red*:
+This query can help you get twins by their `tag` properties, as described in [Add tags to digital twins](how-to-use-tags.md). Here's a query that gets all twins tagged with `red`:
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="QueryMarkerTags1":::
-You can also get twins based on the **type of a property**. Here's a query that gets twins whose *Temperature* property is a number:
+You can also get twins based on the type of a property. Here's a query that gets twins whose `Temperature` property is a number:
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="QueryByProperty3":::
You can also get twins based on the **type of a property**. Here's a query that
The `IS_OF_MODEL` operator can be used to filter based on the twin's [model](concepts-models.md).
-It considers [inheritance](concepts-models.md#model-inheritance) and model [versioning](how-to-manage-model.md#update-models), and evaluates to **true** for a given twin if the twin meets either of these conditions:
+It considers [inheritance](concepts-models.md#model-inheritance) and model [versioning](how-to-manage-model.md#update-models), and evaluates to `true` for a given twin if the twin meets either of these conditions:
-* The twin directly implements the model provided to `IS_OF_MODEL()`, and the version number of the model on the twin is *greater than or equal to* the version number of the provided model
-* The twin implements a model that *extends* the model provided to `IS_OF_MODEL()`, and the twin's extended model version number is *greater than or equal to* the version number of the provided model
+* The twin directly implements the model provided to `IS_OF_MODEL()`, and the version number of the model on the twin is greater than or equal to the version number of the provided model
+* The twin implements a model that extends the model provided to `IS_OF_MODEL()`, and the twin's extended model version number is greater than or equal to the version number of the provided model
-So for example, if you query for twins of the model `dtmi:example:widget;4`, the query will return all twins based on **version 4 or greater** of the **widget** model, and also twins based on version **4 or greater** of any **models that inherit from widget**.
+So for example, if you query for twins of the model `dtmi:example:widget;4`, the query will return all twins based on version 4 or greater of the widget model, and also twins based on version 4 or greater of any models that inherit from widget.
`IS_OF_MODEL` can take several different parameters, and the rest of this section is dedicated to its different overload options.
Here's a query example specifying a value for all three parameters:
## Query by relationship
-When querying based on digital twins' **relationships**, the Azure Digital Twins query language has a special syntax.
+When querying based on digital twins' relationships, the Azure Digital Twins query language has a special syntax.
Relationships are pulled into the query scope in the `FROM` clause. Unlike in "classical" SQL-type languages, each expression in the `FROM` clause isn't a table; rather, the `FROM` clause expresses a cross-entity relationship traversal. To traverse across relationships, Azure Digital Twins uses a custom version of `JOIN`.
The following sections give examples of what this looks like.
### Basic relationship query
-Here's a sample relationship-based query. This code snippet selects all digital twins with an *ID* property of 'ABC', and all digital twins related to these digital twins via a *contains* relationship.
+Here's a sample relationship-based query. This code snippet selects all digital twins with an `ID` property of `ABC`, and all digital twins related to these digital twins via a `contains` relationship.
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="QueryByRelationship1":::
-The type of the relationship (`contains` in the example above) is indicated using the relationship's **name** field from its [DTDL definition](concepts-models.md#basic-relationship-example).
+The type of the relationship (`contains` in the example above) is indicated using the relationship's `name` field from its [DTDL definition](concepts-models.md#basic-relationship-example).
> [!NOTE] > The developer does not need to correlate this `JOIN` with a key value in the `WHERE` clause (or specify a key value inline with the `JOIN` definition). This correlation is computed automatically by the system, as the relationship properties themselves identify the target entity.
The type of the relationship (`contains` in the example above) is indicated usin
You can use the relationship query structure to identify a digital twin that's the source or the target of a relationship.
-For instance, you can start with a source twin and follow its relationships to find the target twins of the relationships. Here's an example of a query that finds the target twins of the *feeds* relationships coming from the twin source-twin.
+For instance, you can start with a source twin and follow its relationships to find the target twins of the relationships. Here's an example of a query that finds the target twins of the `feeds` relationships coming from the twin source-twin.
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="QueryByRelationshipSource":::
-You can also start with the target of the relationship and trace the relationship back to find the source twin. Here's an example of a query that finds the source twin of a *feeds* relationship to the twin target-twin.
+You can also start with the target of the relationship and trace the relationship back to find the source twin. Here's an example of a query that finds the source twin of a `feeds` relationship to the twin target-twin.
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="QueryByRelationshipTarget"::: ### Query the properties of a relationship
-Similarly to the way digital twins have properties described via DTDL, relationships can also have properties. You can query twins **based on the properties of their relationships**.
+Similarly to the way digital twins have properties described via DTDL, relationships can also have properties. You can query twins based on the properties of their relationships.
The Azure Digital Twins query language allows filtering and projection of relationships, by assigning an alias to the relationship within the `JOIN` clause.
-As an example, consider a *servicedBy* relationship that has a *reportedCondition* property. In the below query, this relationship is given an alias of 'R' to reference its property.
+As an example, consider a `servicedBy` relationship that has a `reportedCondition` property. In the below query, this relationship is given an alias of `R` to reference its property.
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="QueryByRelationship2":::
-In the example above, note how *reportedCondition* is a property of the *servicedBy* relationship itself (NOT of some digital twin that has a *servicedBy* relationship).
+In the example above, note how `reportedCondition` is a property of the `servicedBy` relationship itself (NOT of some digital twin that has a `servicedBy` relationship).
### Query with multiple JOINs
You can select the several "top" items in a query using the `Select TOP` clause.
By using projections in the `SELECT` statement, you can choose which columns a query will return. Projection is now supported for both primitive and complex properties. For more information about projections with Azure Digital Twins, see the [SELECT clause reference documentation](reference-query-clause-select.md#select-columns-with-projections).
-Here's an example of a query that uses projection to return twins and relationships. The following query projects the Consumer, Factory and Edge from a scenario where a Factory with an ID of *ABC* is related to the Consumer through a relationship of *Factory.customer*, and that relationship is presented as the *Edge*.
+Here's an example of a query that uses projection to return twins and relationships. The following query projects the Consumer, Factory, and Edge from a scenario where a Factory with an ID of `ABC` is related to the Consumer through a relationship of `Factory.customer`, and that relationship is presented as the `Edge`.
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="Projections1":::
-You can also use projection to return a property of a twin. The following query projects the *Name* property of the Consumers that are related to the Factory with an ID of *ABC* through a relationship of *Factory.customer*.
+You can also use projection to return a property of a twin. The following query projects the `Name` property of the Consumers that are related to the Factory with an ID of `ABC` through a relationship of `Factory.customer`.
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="Projections2":::
-You can also use projection to return a property of a relationship. Like in the previous example, the following query projects the *Name* property of the Consumers related to the Factory with an ID of *ABC* through a relationship of *Factory.customer*; but now it also returns two properties of that relationship, *prop1* and *prop2*. It does this by naming the relationship *Edge* and gathering its properties.
+You can also use projection to return a property of a relationship. Like in the previous example, the following query projects the `Name` property of the Consumers related to the Factory with an ID of `ABC` through a relationship of `Factory.customer`; but now it also returns two properties of that relationship, `prop1` and `prop2`. It does this by naming the relationship `Edge` and gathering its properties.
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="Projections3":::
The following query does the same operations as the previous example, but it ali
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="Projections4":::
-Here's a similar query that queries the same set as above, but projects only the *Consumer.name* property as `consumerName`, and projects the complete Factory as a twin.
+Here's a similar query that queries the same set as above, but projects only the `Consumer.name` property as `consumerName`, and projects the complete Factory as a twin.
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="Projections5":::
For example, consider a scenario in which Buildings contain Floors and Floors co
## Other compound query examples
-You can **combine** any of the above types of query using combination operators to include more detail in a single query. Here are some other examples of compound queries that query for more than one type of twin descriptor at once.
+You can combine any of the above types of query using combination operators to include more detail in a single query. Here are some other examples of compound queries that query for more than one type of twin descriptor at once.
* Out of the devices that Room 123 has, return the MxChip devices that serve the role of Operator :::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="OtherExamples1":::
-* Get twins that have a relationship named *Contains* with another twin that has an ID of *id1*
+* Get twins that have a relationship named `Contains` with another twin that has an ID of `id1`
:::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="OtherExamples2"::: * Get all the rooms of this room model that are contained by floor11 :::code language="sql" source="~/digital-twins-docs-samples/queries/examples.sql" id="OtherExamples3":::
digital-twins How To Route With Managed Identity https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-route-with-managed-identity.md
description: See how to enable a system-assigned identity for Azure Digital Twins and use it to forward events, using the Azure portal or CLI. Previously updated : 6/15/2021 Last updated : 02/23/2022
Here are the steps that are covered in this article:
When you enable a system-assigned identity on your Azure Digital Twins instance, Azure automatically creates an identity for it in [Azure Active Directory (Azure AD)](../active-directory/fundamentals/active-directory-whatis.md). That identity can then be used to authenticate to Azure Digital Twins endpoints for event forwarding.
-You can enable system-managed identities for an Azure Digital Twins instance **as part of the instance's initial setup**, or **enable it later on an instance that already exists**.
+You can enable system-managed identities for an Azure Digital Twins instance in two different ways:
+
+- Enable it as part of the instance's initial setup.
+- Enable it later on an instance that already exists.
Either of these creation methods will give the same configuration options and the same end result for your instance. This section describes how to do both.
You can copy the **Object ID** from here if needed, and use the **Permissions**
Again, you can add the identity to your instance by using the `az dt create` command and `--assign-identity` parameter. Instead of providing a new name of an instance to create, you can provide the name of an instance that already exists to update the value of `--assign-identity` for that instance.
-The command to **enable** managed identity is the same as the command to create an instance with a system managed identity. All that changes is the value of the instance name parameter:
+The command to enable managed identity is the same as the command to create an instance with a system managed identity. All that changes is the value of the instance name parameter:
```azurecli-interactive az dt create --dt-name <name-of-existing-instance> --resource-group <resource-group> --assign-identity ```
-To **disable** managed identity on an instance where it's currently enabled, use the following similar command to set `--assign-identity` to `false`.
+To disable managed identity on an instance where it's currently enabled, use the following similar command to set `--assign-identity` to `false`.
```azurecli-interactive az dt create --dt-name <name-of-existing-instance> --resource-group <resource-group> --assign-identity false
digital-twins How To Send Twin To Twin Events https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-send-twin-to-twin-events.md
description: Learn how to create a function in Azure for propagating events through the twin graph. Previously updated : 1/07/2022 Last updated : 02/24/2022
ms.devlang: azurecli
# Set up twin-to-twin event handling
-This article shows how to **send events from twin to twin**, so that when one digital twin in the graph is updated, related twins in the graph that are affected by this information can also update. This event handling will help you create a fully connected Azure Digital Twins graph, where data that arrives into Azure Digital Twins from external sources like IoT Hub is propagated through the entire graph.
+This article shows how to send events from twin to twin, so that when one digital twin in the graph is updated, related twins in the graph that are affected by this information can also update. This event handling will help you create a fully connected Azure Digital Twins graph, where data that arrives into Azure Digital Twins from external sources like IoT Hub is propagated through the entire graph.
To set up this twin-to-twin event handling, you'll create an [Azure function](../azure-functions/functions-overview.md) that watches for twin life-cycle events. The function recognizes which events should affect other twins in the graph, and uses the event data to update the affected twins accordingly. ## Prerequisites
-This article uses **Visual Studio**. You can download the latest version from [Visual Studio Downloads](https://visualstudio.microsoft.com/downloads/).
+This article uses Visual Studio. You can download the latest version from [Visual Studio Downloads](https://visualstudio.microsoft.com/downloads/).
-To set up twin-to-twin handling, you'll need an **Azure Digital Twins instance** to work with. For instructions on how to create an instance, see [Set up an Azure Digital Twins instance and authentication](./how-to-set-up-instance-portal.md). The instance should contain at least **two twins** that you want to send data between.
+To set up twin-to-twin handling, you'll need an Azure Digital Twins instance to work with. For instructions on how to create an instance, see [Set up an Azure Digital Twins instance and authentication](./how-to-set-up-instance-portal.md). The instance should contain at least two twins that you want to send data between.
Optionally, you may want to set up [automatic telemetry ingestion through IoT Hub](how-to-ingest-iot-hub-data.md) for your twins as well. This process isn't required to send data from twin to twin, but it's an important piece of a complete solution where the twin graph is driven by live telemetry. ## Send twin events to an endpoint
-To set up twin-to-twin event handling, start by creating an **endpoint** in Azure Digital Twins and a **route** to that endpoint. Twins undergoing an update will use the route to send information about their update events to the endpoint (where Event Grid can pick them up later and pass them to an Azure function for processing).
+To set up twin-to-twin event handling, start by creating an *endpoint* in Azure Digital Twins and a *route* to that endpoint. Twins undergoing an update will use the route to send information about their update events to the endpoint (where Event Grid can pick them up later and pass them to an Azure function for processing).
[!INCLUDE [digital-twins-twin-to-twin-resources.md](../../includes/digital-twins-twin-to-twin-resources.md)]
Next, create an Azure function that will listen on the endpoint and receive twin
### Configure the function app
-Before your function can access Azure Digital Twins, it needs some information about the instance and permission to access it. In this section, you'll **assign an access role** for the function and **configure the application settings** so that it can find and access the instance.
+Before your function can access Azure Digital Twins, it needs some information about the instance and permission to access it. In this section, you'll assign an access role for the function and configure the application settings so that it can find and access the instance.
[!INCLUDE [digital-twins-configure-function-app-cli.md](../../includes/digital-twins-configure-function-app-cli.md)]
Before your function can access Azure Digital Twins, it needs some information a
Next, subscribe your Azure function to the Event Grid endpoint you created earlier. Doing so will ensure that data can flow from an updated twin through the Event Grid topic to the function, which can use the event information to update other twins as needed.
-To subscribe your Azure function, you'll create an **Event Grid subscription** that sends data from the Event Grid topic that you created earlier to your Azure function.
+To subscribe your Azure function, you'll create an *Event Grid subscription* that sends data from the Event Grid topic that you created earlier to your Azure function.
Use the following CLI command, filling in placeholders for your subscription ID, resource group, function app, and function name.
digital-twins How To Set Up Instance Cli https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-set-up-instance-cli.md
description: See how to set up an instance of the Azure Digital Twins service using the CLI Previously updated : 10/13/2021 Last updated : 02/24/2022
ms.devlang: azurecli
[!INCLUDE [digital-twins-setup-selector.md](../../includes/digital-twins-setup-selector.md)]
-This article covers the steps to **set up a new Azure Digital Twins instance**, including creating the instance and setting up authentication. After completing this article, you'll have an Azure Digital Twins instance ready to start programming against.
+This article covers the steps to set up a new Azure Digital Twins instance, including creating the instance and setting up authentication. After completing this article, you'll have an Azure Digital Twins instance ready to start programming against.
[!INCLUDE [digital-twins-setup-steps.md](../../includes/digital-twins-setup-steps.md)]
This article covers the steps to **set up a new Azure Digital Twins instance**,
## Create the Azure Digital Twins instance
-In this section, you will **create a new instance of Azure Digital Twins** using the CLI command. You will need to provide:
+In this section, you will create a new instance of Azure Digital Twins using the CLI command. You will need to provide:
* A resource group where the instance will be deployed. If you do not already have an existing resource group in mind, you can create one now with this command: ```azurecli-interactive az group create --location <region> --name <name-for-your-resource-group>
The result of this command is outputted information about the role assignment th
> [!NOTE] > If this command returns an error saying that the CLI **cannot find user or service principal in graph database**: >
-> Assign the role using the user's *Object ID* instead. This may happen for users on personal [Microsoft accounts (MSAs)](https://account.microsoft.com/account).
+> Assign the role using the user's Object ID instead. This may happen for users on personal [Microsoft accounts (MSAs)](https://account.microsoft.com/account).
>
-> Use the [Azure portal page of Azure Active Directory users](https://portal.azure.com/#blade/Microsoft_AAD_IAM/UsersManagementMenuBlade/AllUsers) to select the user account and open its details. Copy the user's *ObjectID*:
+> Use the [Azure portal page of Azure Active Directory users](https://portal.azure.com/#blade/Microsoft_AAD_IAM/UsersManagementMenuBlade/AllUsers) to select the user account and open its details. Copy the user's **Object ID**:
> > :::image type="content" source="media/includes/user-id.png" alt-text="Screenshot of the user page in Azure portal highlighting the GUID in the 'Object ID' field." lightbox="media/includes/user-id.png"::: >
-> Then, repeat the role assignment list command using the user's *Object ID* for the `assignee` parameter above.
+> Then, repeat the role assignment list command using the user's Object ID for the `assignee` parameter above.
### Verify success
digital-twins How To Set Up Instance Portal https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-set-up-instance-portal.md
description: See how to set up an instance of the Azure Digital Twins service using the Azure portal Previously updated : 9/2/2021 Last updated : 02/24/2022
[!INCLUDE [digital-twins-setup-selector.md](../../includes/digital-twins-setup-selector.md)]
-This article covers the steps to **set up a new Azure Digital Twins instance**, including creating the instance and setting up authentication. After completing this article, you'll have an Azure Digital Twins instance ready to start programming against.
+This article covers the steps to set up a new Azure Digital Twins instance, including creating the instance and setting up authentication. After completing this article, you'll have an Azure Digital Twins instance ready to start programming against.
This version of this article goes through these steps manually, one by one, using the Azure portal. The Azure portal is a web-based, unified console that provides an alternative to command-line tools.
This version of this article goes through these steps manually, one by one, usin
3. On the following **Create Resource** page, fill in the values given below: * **Subscription**: The Azure subscription you're using
- - **Resource group**: A resource group in which to deploy the instance. If you don't already have an existing resource group in mind, you can create one here by selecting the *Create new* link and entering a name for a new resource group
+ - **Resource group**: A resource group in which to deploy the instance. If you don't already have an existing resource group in mind, you can create one here by selecting the **Create new** link and entering a name for a new resource group
* **Location**: An Azure Digital Twins-enabled region for the deployment. For more details on regional support, visit [Azure products available by region (Azure Digital Twins)](https://azure.microsoft.com/global-infrastructure/services/?products=digital-twins). * **Resource name**: A name for your Azure Digital Twins instance. If your subscription has another Azure Digital Twins instance in the region that's already using the specified name, you'll be asked to pick a different name.
Here are the additional options you can configure during setup, using the other
### Verify success and collect important values
-After finishing your instance setup by selecting **Create**, you can view the status of your instance's deployment in your Azure notifications along the portal icon bar. The notification will indicate when deployment has succeeded, at which point you can select the _Go to resource_ button to view your created instance.
+After finishing your instance setup by selecting **Create**, you can view the status of your instance's deployment in your Azure notifications along the portal icon bar. The notification will indicate when deployment has succeeded, at which point you can select the **Go to resource** button to view your created instance.
:::image type="content" source="media/how-to-set-up-instance/portal/notifications-deployment.png" alt-text="Screenshot of the Azure notifications showing a successful deployment and highlighting the 'Go to resource' button in the Azure portal.":::
If deployment fails, the notification will indicate why. Observe the advice from
>[!TIP] >Once your instance is created, you can return to its page at any time by searching for the name of your instance in the Azure portal search bar.
-From the instance's *Overview* page, note its **Name**, **Resource group**, and **Host name**. These values are all important and you may need to use them as you continue working with your Azure Digital Twins instance. If other users will be programming against the instance, you should share these values with them.
+From the instance's **Overview** page, note its **Name**, **Resource group**, and **Host name**. These values are all important and you may need to use them as you continue working with your Azure Digital Twins instance. If other users will be programming against the instance, you should share these values with them.
:::image type="content" source="media/how-to-set-up-instance/portal/instance-important-values.png" alt-text="Screenshot of the Azure portal, highlighting the important values from the Azure Digital Twins instance's Overview page.":::
You can also assign the **Azure Digital Twins Data Owner** role using the access
### Verify success
-You can view the role assignment you've set up under *Access control (IAM) > Role assignments*. The user should show up in the list with a role of *Azure Digital Twins Data Owner*.
+You can view the role assignment you've set up under **Access control (IAM) > Role assignments**. The user should show up in the list with a role of **Azure Digital Twins Data Owner**.
:::image type="content" source="media/how-to-set-up-instance/portal/verify-role-assignment.png" alt-text="Screenshot of the role assignments for an Azure Digital Twins instance in the Azure portal.":::
digital-twins How To Set Up Instance Powershell https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-set-up-instance-powershell.md
description: See how to set up an instance of the Azure Digital Twins service using Azure PowerShell Previously updated : 9/3/2021 Last updated : 02/24/2022
[!INCLUDE [digital-twins-setup-selector.md](../../includes/digital-twins-setup-selector.md)]
-This article covers the steps to **set up a new Azure Digital Twins instance**, including creating
-the instance and setting up authentication. After completing this article, you will have an Azure
-Digital Twins instance ready to start programming against.
+This article covers the steps to set up a new Azure Digital Twins instance, including creating the instance and setting up authentication. After completing this article, you'll have an Azure Digital Twins instance ready to start programming against.
This version of this article goes through these steps manually, one by one, using [Azure PowerShell](/powershell/azure/new-azureps-module-az).
This version of this article goes through these steps manually, one by one, usin
:::image type="content" source="media/how-to-set-up-instance/cloud-shell/cloud-shell-powershell.png" alt-text="Screenshot of the Cloud Shell window in the Azure portal showing selection of the PowerShell version.":::
-1. If you have multiple Azure subscriptions, choose the appropriate subscription in which the resources should be billed. Select a specific subscription using the
- [Set-AzContext](/powershell/module/az.accounts/set-azcontext) cmdlet.
+1. If you have multiple Azure subscriptions, choose the appropriate subscription in which the resources should be billed. Select a specific subscription using the [Set-AzContext](/powershell/module/az.accounts/set-azcontext) cmdlet.
```azurepowershell-interactive Set-AzContext -SubscriptionId 00000000-0000-0000-0000-000000000000 ```
-1. If this is your first time using Azure Digital Twins with this subscription, you must register the **Microsoft.DigitalTwins** resource provider. (If you're not sure, it's ok to run it again even if you've done it sometime in the past.)
+1. If this is your first time using Azure Digital Twins with this subscription, you must register the `Microsoft.DigitalTwins` resource provider. (If you're not sure, it's ok to run it again even if you've done it sometime in the past.)
```azurepowershell-interactive Register-AzResourceProvider -ProviderNamespace Microsoft.DigitalTwins ```
-1. Use the following command to install the **Az.DigitalTwins** PowerShell module.
+1. Use the following command to install the `Az.DigitalTwins` PowerShell module.
```azurepowershell-interactive Install-Module -Name Az.DigitalTwins ```
-> [!IMPORTANT]
-> While the **Az.DigitalTwins** PowerShell module is in preview, you must install it separately
-> using the `Install-Module` cmdlet as described above. After this PowerShell module becomes generally available, it
-> will be part of future Az PowerShell module releases and available by default from within Azure
-> Cloud Shell.
- ## Create the Azure Digital Twins instance
-In this section, you will **create a new instance of Azure Digital Twins** using Azure PowerShell.
-You'll need to provide:
+In this section, you'll create a new instance of Azure Digital Twins using Azure PowerShell. You'll need to provide:
-* An [Azure resource group](../azure-resource-manager/management/overview.md) where the instance will be deployed. If you don't
- already have an existing resource group, you can create one using the
- [New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup) cmdlet:
+* An [Azure resource group](../azure-resource-manager/management/overview.md) where the instance will be deployed. If you don't already have an existing resource group, you can create one using the [New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup) cmdlet:
```azurepowershell-interactive New-AzResourceGroup -Name <name-for-your-resource-group> -Location <region> ```
-* A region for the deployment. To see what regions support Azure Digital Twins, visit
- [Azure products available by region](https://azure.microsoft.com/global-infrastructure/services/?products=digital-twins).
-* A name for your instance. The name of the new instance must be unique within the region for your
- subscription. If your subscription has another Azure Digital Twins instance in the region that's
- already using the specified name, you'll be asked to pick a different name.
+* A region for the deployment. To see what regions support Azure Digital Twins, visit [Azure products available by region](https://azure.microsoft.com/global-infrastructure/services/?products=digital-twins).
+* A name for your instance. The name of the new instance must be unique within the region for your subscription. If your subscription has another Azure Digital Twins instance in the region that's already using the specified name, you'll be asked to pick a different name.
Use your values in the following command to create the instance:
New-AzDigitalTwinsInstance -ResourceGroupName <your-resource-group> -ResourceNam
### Verify success and collect important values
-If the instance was created successfully, the result looks similar to the following output
-containing information about the resource you've created:
+If the instance was created successfully, the result looks similar to the following output containing information about the resource you've created:
```Output Location Name Type
Get-AzDigitalTwinsInstance -ResourceGroupName <your-resource-group> -ResourceNam
> [!TIP] > You can use this command to see all the properties of your instance at any time.
-Note the Azure Digital Twins instance's **host name**, **name**, and **resource group**. These are
-important values that you may need as you continue working with your Azure Digital Twins instance,
-to set up authentication, and related Azure resources. If other users will be programming against
-the instance, you should share these values with them.
+Note the Azure Digital Twins instance's **host name**, **name**, and **resource group**. These are important values that you may need as you continue working with your Azure Digital Twins instance, to set up authentication, and related Azure resources. If other users will be programming against the instance, you should share these values with them.
-You now have an Azure Digital Twins instance ready to go. Next, you'll give the appropriate Azure
-user permissions to manage it.
+You now have an Azure Digital Twins instance ready to go. Next, you'll give the appropriate Azure user permissions to manage it.
## Set up user access permissions
user permissions to manage it.
### Assign the role
-To give a user permissions to manage an Azure Digital Twins instance, you must assign them the _**Azure Digital Twins Data Owner**_ role within the instance.
+To give a user permissions to manage an Azure Digital Twins instance, you must assign them the **Azure Digital Twins Data Owner** role within the instance.
-First, determine the **ObjectId** for the Azure AD account of the user that should be assigned the role. You can find this value using the [Get-AzAdUser](/powershell/module/az.resources/get-azaduser) cmdlet, by passing in the user principal name on the Azure AD account to retrieve their ObjectId (and other user information). In most cases, the user principal name will match the user's email on the Azure AD account.
+First, determine the Object Id for the Azure AD account of the user that should be assigned the role. You can find this value using the [Get-AzAdUser](/powershell/module/az.resources/get-azaduser) cmdlet, by passing in the user principal name on the Azure AD account to retrieve their Object Id (and other user information). In most cases, the user principal name will match the user's email on the Azure AD account.
```azurepowershell-interactive Get-AzADUser -UserPrincipalName <Azure-AD-user-principal-name-of-user-to-assign> ```
-Next, use the **ObjectId** in the following command to assign the role. The command also requires you to enter the same subscription ID, resource group name, and
-Azure Digital Twins instance name that you chose earlier when creating the instance. The command must be run by a user with
-[sufficient permissions](#prerequisites-permission-requirements) in the Azure subscription.
+Next, use the Object Id in the following command to assign the role. The command also requires you to enter the same subscription ID, resource group name, and Azure Digital Twins instance name that you chose earlier when creating the instance. The command must be run by a user with [sufficient permissions](#prerequisites-permission-requirements) in the Azure subscription.
```azurepowershell-interactive $Params = @{
digital-twins How To Use Azure Digital Twins Explorer https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-use-azure-digital-twins-explorer.md
description: Learn how to use the features of Azure Digital Twins Explorer Previously updated : 1/5/2022 Last updated : 02/24/2022
[Azure Digital Twins Explorer](concepts-azure-digital-twins-explorer.md) is a tool for visualizing and working with Azure Digital Twins. This article describes the features of Azure Digital Twins Explorer, and how to use them to manage the data in your Azure Digital Twins instance. You can interact with the Azure Digital Twins Explorer using clicks or [keyboard shortcuts](#accessibility-and-advanced-settings). >[!NOTE]
->This tool is currently in **public preview**.
+>This tool is currently in public preview.
## How to access
Once in the application, you're also able to change which instance is currently
:::image type="content" source="media/how-to-use-azure-digital-twins-explorer/instance-url-1.png" alt-text="Screenshot of Azure Digital Twins Explorer. The instance name in the top toolbar is highlighted." lightbox="media/how-to-use-azure-digital-twins-explorer/instance-url-1.png":::
-Doing so will bring up the **Azure Digital Twins URL modal**, where you can enter the host name of another Azure Digital Twins instance after the *https://* to connect to that instance.
+Doing so will bring up the **Azure Digital Twins URL modal**, where you can enter the host name of another Azure Digital Twins instance after the `https://` prefix to connect to that instance.
:::image type="content" source="media/how-to-use-azure-digital-twins-explorer/instance-url-2.png" alt-text="Screenshot of Azure Digital Twins Explorer. The Azure Digital Twins URL modal displays an editable box containing https:// and a host name." lightbox="media/how-to-use-azure-digital-twins-explorer/instance-url-2.png"::: >[!NOTE]
->At this time, the ability to switch contexts within the app is **not** available for personal Microsoft Accounts (MSA). MSA users will need to access the explorer from the chosen instance in the Azure portal, or may connect to a certain instance through a [direct link to the environment](#link-to-your-environment).
+>At this time, the ability to switch contexts within the app isn't available for personal Microsoft Accounts (MSA). MSA users will need to access the explorer from the chosen instance in the Azure portal, or may connect to a certain instance through a [direct link to the environment](#link-to-your-environment).
## Query your digital twin graph
To set the number of layers to expand, use the **Expansion Level** option. This
:::image type="content" source="media/how-to-use-azure-digital-twins-explorer/twin-graph-panel-expansion-level.png" alt-text="Screenshot of Azure Digital Twins Explorer Twin Graph panel. The Expansion Level button is highlighted." lightbox="media/how-to-use-azure-digital-twins-explorer/twin-graph-panel-expansion-level.png":::
-To indicate which types of relationships to follow when expanding, use the **Expansion Direction** button. Doing so allows you to select from incoming, outgoing, or *both* incoming and outgoing relationships.
+To indicate which types of relationships to follow when expanding, use the **Expansion Direction** button. Doing so allows you to select from incoming, outgoing, or both incoming and outgoing relationships.
:::image type="content" source="media/how-to-use-azure-digital-twins-explorer/twin-graph-panel-expansion-direction.png" alt-text="Screenshot of Azure Digital Twins Explorer Twin Graph panel. The Expansion Direction button is highlighted, showing a menu with the options In, Out, and In/Out." lightbox="media/how-to-use-azure-digital-twins-explorer/twin-graph-panel-expansion-direction.png":::
You can use the import feature to add twins, relationships, and models to your i
The first step in importing a graph is creating a file representing the twins and relationships you want to add. The import file can be in either of these two formats:
-* The **custom Excel-based format** described in the rest of this section. This format allows you to upload twins and relationships.
-* The **JSON-based format** generated on [graph export](#export-graph-and-models). This format can contain twins, relationships, and/or models.
+* The *custom Excel-based format* described in the rest of this section. This format allows you to upload twins and relationships.
+* The *JSON-based format* generated on [graph export](#export-graph-and-models). This format can contain twins, relationships, and/or models.
To create a custom graph in Excel, use the following format.
Use the following columns to structure the twin or relationship data. The column
| ModelID | ID | Relationship (source) | Relationship Name | Init Data | | | | | | |
-| *Optional*<br>The DTMI model ID for a twin that should be created.<br><br>You can leave this column blank for a row if you want that row to create only a relationship (no twins). | *Required*<br>The unique ID for a twin.<br><br>If a new twin is being created in this row, this value will be the ID of the new twin.<br>If there's relationship information in the row, this ID will be used as the **target** of the relationship. | *Optional*<br>The ID of a twin that should be the **source** twin for a new relationship.<br><br>You can leave this column blank for a row if you want that row to create only a twin (no relationships). | *Optional*<br>The name for the new relationship to create. The relationship direction will be **from** the twin in column C **to** the twin in column B. | *Optional*<br>A JSON string containing property settings for the twin to be created. The properties must match the ones defined in the model from column A. |
+| (Optional)<br>The DTMI model ID for a twin that should be created.<br><br>You can leave this column blank for a row if you want that row to create only a relationship (no twins). | (Required)<br>The unique ID for a twin.<br><br>If a new twin is being created in this row, this value will be the ID of the new twin.<br>If there's relationship information in the row, this ID will be used as the target of the relationship. | (Optional)<br>The ID of a twin that should be the source twin for a new relationship.<br><br>You can leave this column blank for a row if you want that row to create only a twin (no relationships). | (Optional)<br>The name for the new relationship to create. The relationship direction will be from the twin in column C to the twin in column B. | (Optional)<br>A JSON string containing property settings for the twin to be created. The properties must match the ones defined in the model from column A. |
Here's an example .xlsx file creating a small graph of two floors and two rooms.
This action enables a **Download** link in the Twin Graph box. Select it to down
You can share your Azure Digital Twins Explorer environment with others to collaborate on work. This section describes how to send your Azure Digital Twins Explorer environment to someone else and verify they have the permissions to access it.
-To share your environment, you can send a link to the recipient that will open an Azure Digital Twins Explorer window connected to your instance. Use the link below and replace the placeholders for your **tenant ID** and the **host name** of your Azure Digital Twins instance.
+To share your environment, you can send a link to the recipient that will open an Azure Digital Twins Explorer window connected to your instance. Use the link below and replace the placeholders for your *tenant ID* and the *host name* of your Azure Digital Twins instance.
`https://explorer.digitaltwins.azure.net/?tid=<tenant-ID>&eid=<Azure-Digital-Twins-host-name>` >[!NOTE]
-> The value for the host name placeholder is **not** preceded by *https://* here.
+> The value for the host name placeholder is not preceded by the `https://` prefix here.
Here's an example of a URL with the placeholder values filled in:
You can use the **Keyboard Shortcuts** icon in the top-right toolbar to view a l
:::image type="content" source="media/how-to-use-azure-digital-twins-explorer/keyboard-shortcuts.png" alt-text="Screenshot of Azure Digital Twins Explorer. The Keyboard Shortcuts icon is highlighted in the top toolbar." lightbox="media/how-to-use-azure-digital-twins-explorer/keyboard-shortcuts.png"::: There are several advanced features that can be accessed under the Settings cog in the top-right toolbar:
-* **Eager Loading**: When a query returns twins that have relationships to other twins that **are not** included in the query results, this feature will load the "missing" twins before rendering the graph.
+* **Eager Loading**: When a query returns twins that have relationships to other twins that aren't included in the query results, this feature will load the "missing" twins before rendering the graph.
* **Caching**: When this feature is enabled, Azure Digital Twins Explorer will keep a local cache of relationships and models in memory to improve query performance. These caches are cleared on any write operations on the relevant elements, as well as on browser refresh. This feature is off by default. * **Console**: This feature enables display of a console window, capable of using simple shell functions for working with the graph. * **Output**: This feature enables display of an output window, which shows a diagnostic trace of operations. * **High Contrast**: This feature changes the colors of the Azure Digital Twins Explorer so they appear with greater contrast.
-You can **customize panel layout** by editing the position of the panels that make up Azure Digital Twins Explorer (Query Explorer, Twins, Models, Twin Graph, Model Graph). To move a panel to a different location, click and hold the panel name, and drag it to its new desired position.
+You can customize the panel layout by editing the positions of the panels that make up Azure Digital Twins Explorer (Query Explorer, Twins, Models, Twin Graph, Model Graph). To move a panel to a different location, click and hold the panel name, and drag it to its new desired position.
:::image type="content" source="media/how-to-use-azure-digital-twins-explorer/panels.png" alt-text="Screenshot of Azure Digital Twins Explorer. The names of the Query Explorer, Models, Twin Graph, and Model Graph panels are highlighted." lightbox="media/how-to-use-azure-digital-twins-explorer/panels.png":::
digital-twins How To Use Postman https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-use-postman.md
Previously updated : 10/8/2021 Last updated : 02/24/2022
This article describes how to configure the [Postman REST client](https://www.ge
1. [Create your own collection from scratch](#create-your-own-collection). 1. [Add requests to your configured collection](#add-an-individual-request) and send them to the Azure Digital Twins APIs.
-Azure Digital Twins has two sets of APIs that you can work with: **data plane** and **control plane**. For more about the difference between these API sets, see [Azure Digital Twins APIs and SDKs](concepts-apis-sdks.md). This article contains information for both API sets.
+Azure Digital Twins has two sets of APIs that you can work with: data plane and control plane. For more about the difference between these API sets, see [Azure Digital Twins APIs and SDKs](concepts-apis-sdks.md). This article contains information for both API sets.
## Prerequisites
Otherwise, you can open an [Azure Cloud Shell](https://shell.azure.com) window i
# [Data plane](#tab/data-plane)
- To get a token to use with the **data plane** APIs, use the following static value for the token context: `0b07f429-9f4b-4714-9392-cc5e8e80c8b0`. This is the resource ID for the Azure Digital Twins service endpoint.
+ To get a token to use with the data plane APIs, use the following static value for the token context: `0b07f429-9f4b-4714-9392-cc5e8e80c8b0`. This is the resource ID for the Azure Digital Twins service endpoint.
```azurecli-interactive az account get-access-token --resource 0b07f429-9f4b-4714-9392-cc5e8e80c8b0
Otherwise, you can open an [Azure Cloud Shell](https://shell.azure.com) window i
# [Control plane](#tab/control-plane)
- To get a token to use with the **control plane** APIs, use the following value for the token context: `https://management.azure.com/`.
+ To get a token to use with the control plane APIs, use the following value for the token context: `https://management.azure.com/`.
```azurecli-interactive az account get-access-token --resource https://management.azure.com/
Otherwise, you can open an [Azure Cloud Shell](https://shell.azure.com) window i
>[!NOTE]
- > If you need to access your Azure Digital Twins instance using a service principal or user account that belongs to a different Azure Active Directory tenant from the instance, you'll need to request a **token** from the Azure Digital Twins instance's "home" tenant. For more information on this process, see [Write app authentication code](how-to-authenticate-client.md#authenticate-across-tenants).
+ > If you need to access your Azure Digital Twins instance using a service principal or user account that belongs to a different Azure Active Directory tenant from the instance, you'll need to request a token from the Azure Digital Twins instance's "home" tenant. For more information on this process, see [Write app authentication code](how-to-authenticate-client.md#authenticate-across-tenants).
3. Copy the value of `accessToken` in the result, and save it to use in the next section. This is your **token value** that you will provide to Postman to authorize your requests.
Next, you'll set up Postman to use this token to make API requests to Azure Digi
## About Postman collections
-Requests in Postman are saved in **collections** (groups of requests). When you create a collection to group your requests, you can apply common settings to many requests at once. This can greatly simplify authorization if you plan to create more than one request against the Azure Digital Twins APIs, as you only have to configure these details once for the entire collection.
+Requests in Postman are saved in *collections* (groups of requests). When you create a collection to group your requests, you can apply common settings to many requests at once. This can greatly simplify authorization if you plan to create more than one request against the Azure Digital Twins APIs, as you only have to configure these details once for the entire collection.
When working with Azure Digital Twins, you can get started by importing a [pre-built collection of all the Azure Digital Twins requests](#import-collection-of-azure-digital-twins-apis). You may want to do this if you're exploring the APIs and want to quickly set up a project with request examples.
Next, import the collection into Postman.
1. From the main Postman window, select the **Import** button. :::image type="content" source="media/how-to-use-postman/postman-import-collection.png" alt-text="Screenshot of a newly opened Postman window. The 'Import' button is highlighted." lightbox="media/how-to-use-postman/postman-import-collection.png":::
-1. In the Import window that follows, select **Upload Files** and navigate to the collection file on your machine that you created earlier. Select Open.
+1. In the **Import** window that follows, select **Upload Files** and navigate to the collection file on your machine that you created earlier. Select Open.
1. Select the **Import** button to confirm. :::image type="content" source="media/how-to-use-postman/postman-import-collection-2.png" alt-text="Screenshot of Postman's 'Import' window, showing the file to import as a collection and the Import button.":::
Next, edit the collection you've created to configure some access details. Highl
:::image type="content" source="media/how-to-use-postman/postman-edit-collection.png" alt-text="Screenshot of Postman. The 'View more actions' icon for the imported collection is highlighted, and 'Edit' is highlighted in the options." lightbox="media/how-to-use-postman/postman-edit-collection.png":::
-Follow these steps to add a bearer token to the collection for authorization. This is where you'll use the **token value** you gathered in the [Get bearer token](#get-bearer-token) section in order to use it for all API requests in your collection.
+Follow these steps to add a bearer token to the collection for authorization. This is where you'll use the token value you gathered in the [Get bearer token](#get-bearer-token) section in order to use it for all API requests in your collection.
1. In the edit dialog for your collection, make sure you're on the **Authorization** tab.
Follow these steps to add a bearer token to the collection for authorization. Th
# [Data plane](#tab/data-plane)
-If you're making a [data plane](concepts-apis-sdks.md#overview-data-plane-apis) collection, help the collection connect easily to your Azure Digital Twins resources by setting some **variables** provided with the collections. When many requests in a collection require the same value (like the host name of your Azure Digital Twins instance), you can store the value in a variable that applies to every request in the collection. Both of the downloadable collections for Azure Digital Twins come with pre-created variables that you can set at the collection level.
+If you're making a [data plane](concepts-apis-sdks.md#overview-data-plane-apis) collection, help the collection connect easily to your Azure Digital Twins resources by setting some variables provided with the collections. When many requests in a collection require the same value (like the host name of your Azure Digital Twins instance), you can store the value in a variable that applies to every request in the collection. Both of the downloadable collections for Azure Digital Twins come with pre-created variables that you can set at the collection level.
1. Still in the edit dialog for your collection, move to the **Variables** tab.
Next, continue on to the next section to add a bearer token to the collection fo
### Configure authorization
-Follow these steps to add a bearer token to the collection for authorization. This is where you'll use the **token value** you gathered in the [Get bearer token](#get-bearer-token) section in order to use it for all API requests in your collection.
+Follow these steps to add a bearer token to the collection for authorization. This is where you'll use the token value you gathered in the [Get bearer token](#get-bearer-token) section in order to use it for all API requests in your collection.
1. Still in the edit dialog for your new collection, move to the **Authorization** tab.
To make a Postman request to one of the Azure Digital Twins APIs, you'll need th
To proceed with an example query, this article will use the Query API (and its [reference documentation](/rest/api/digital-twins/dataplane/query/querytwins)) to query for all the digital twins in an instance. 1. Get the request URL and type from the reference documentation. For the Query API, this is currently *POST* `https://digitaltwins-host-name/query?api-version=2020-10-31`.
-1. In Postman, set the type for the request and enter the request URL, filling in placeholders in the URL as required. This is where you will use your instance's **host name** from the [Prerequisites section](#prerequisites).
+1. In Postman, set the type for the request and enter the request URL, filling in placeholders in the URL as required. This is where you will use your instance's host name from the [Prerequisites section](#prerequisites).
:::image type="content" source="media/how-to-use-postman/postman-request-url.png" alt-text="Screenshot of the new request's details in Postman. The query URL from the reference documentation has been filled into the request URL box." lightbox="media/how-to-use-postman/postman-request-url.png":::
digital-twins How To Use Tags https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/how-to-use-tags.md
description: Learn how to implement marker and value tags on models and digital twins Previously updated : 1/5/2022 Last updated : 02/24/2022
Tags are first added as properties within the [model](concepts-models.md) that d
## Marker tags
-A **marker tag** is a simple string that is used to mark or categorize a digital twin, such as "blue" or "red". This string is the tag's name, and marker tags have no meaningful valueΓÇöthe tag is significant just by its presence (or absence).
+A *marker tag* is a simple string that is used to mark or categorize a digital twin, such as "blue" or "red". This string is the tag's name, and marker tags have no meaningful valueΓÇöthe tag is significant just by its presence (or absence).
### Add marker tags to model
You can also combine tags for more complex queries. Here's a query to get all tw
## Value tags
-A **value tag** is a key-value pair that is used to give each tag a value, such as `"color": "blue"` or `"color": "red"`. Once a value tag is created, it can also be used as a marker tag by ignoring the tag's value.
+A *value tag* is a key-value pair that is used to give each tag a value, such as `"color": "blue"` or `"color": "red"`. Once a value tag is created, it can also be used as a marker tag by ignoring the tag's value.
### Add value tags to model
digital-twins Overview https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/overview.md
description: Overview of Azure Digital Twins, what the service comprises, and how it can be used in a wider cloud solution. Previously updated : 10/5/2021 Last updated : 02/24/2022
# What is Azure Digital Twins?
-**Azure Digital Twins** is a platform as a service (PaaS) offering that enables the creation of twin graphs based on digital models of entire environments, which could be buildings, factories, farms, energy networks, railways, stadiums, and moreΓÇöeven entire cities. These digital models can be used to gain insights that drive better products, optimized operations, reduced costs, and breakthrough customer experiences.
+*Azure Digital Twins* is a platform as a service (PaaS) offering that enables the creation of twin graphs based on digital models of entire environments, which could be buildings, factories, farms, energy networks, railways, stadiums, and moreΓÇöeven entire cities. These digital models can be used to gain insights that drive better products, optimized operations, reduced costs, and breakthrough customer experiences.
Azure Digital Twins can be used to design a digital twin architecture that represents actual IoT devices in a wider cloud solution, and which connects to IoT Hub device twins to send and receive live data. > [!NOTE]
-> *IoT Hub device twins* differ from *digital twins* in the Azure Digital Twins service. While *IoT Hub device twins* are maintained by your IoT hub for each IoT device that you connect to it, *digital twins* can be representations of anything defined by digital models and instantiated within Azure Digital Twins.
+> IoT Hub device twins differ from digital twins in the Azure Digital Twins service. While *IoT Hub device twins* are maintained by your IoT hub for each IoT device that you connect to it, *digital twins* can be representations of anything defined by digital models and instantiated within Azure Digital Twins.
Take advantage of your domain expertise on top of Azure Digital Twins to build customized, connected solutions that: * Model any environment, and bring digital twins to life in a scalable and secure manner
Here's a summary of the features provided by Azure Digital Twins.
In Azure Digital Twins, you define the digital entities that represent the people, places, and things in your physical environment using custom twin types called [models](concepts-models.md).
-You can think of these model definitions as a specialized vocabulary to describe your business. For a building management solution, for example, you might define models such as Building, Floor, and Elevator. You can then create **digital twins** based on these models to represent your specific environment.
+You can think of these model definitions as a specialized vocabulary to describe your business. For a building management solution, for example, you might define models such as Building, Floor, and Elevator. You can then create digital twins based on these models to represent your specific environment.
[!INCLUDE [digital-twins-versus-device-twins](../../includes/digital-twins-versus-device-twins.md)]
-Models are defined in a JSON-like language called [Digital Twins Definition Language (DTDL)](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md), and they describe twins by their state properties, telemetry events, commands, components, and relationships.
-* Models define semantic **relationships** between your entities so that you can connect your twins into a graph that reflects their interactions. You can think of the models as nouns in a description of your world, and the relationships as verbs.
-* You can also specialize twins using model inheritance. One model can inherit from another.
+*Models* are defined in a JSON-like language called [Digital Twins Definition Language (DTDL)](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md), and they describe twins by their state properties, telemetry events, commands, components, and relationships.
+* Models define semantic *relationships* between your entities so that you can connect your twins into a graph that reflects their interactions. You can think of the models as nouns in a description of your world, and the relationships as verbs.
+* You can also specialize twins using model *inheritance*. One model can inherit from another.
DTDL is used for data models throughout other Azure IoT services, including [IoT Plug and Play](../iot-develop/overview-iot-plug-and-play.md) and [Time Series Insights](../time-series-insights/overview-what-is-tsi.md). This type of commonality helps you keep your Azure Digital Twins solution connected and compatible with other parts of the Azure ecosystem. ### Live execution environment
-Digital models in Azure Digital Twins are live, up-to-date representations of the real world. Using the relationships in your custom DTDL models, you'll connect twins into a **live graph** representing your environment.
+Digital models in Azure Digital Twins are live, up-to-date representations of the real world. Using the relationships in your custom DTDL models, you'll connect twins into a live graph representing your environment.
You can visualize your Azure Digital Twins graph in [Azure Digital Twins Explorer](concepts-azure-digital-twins-explorer.md), which provides the following interface for interacting with your graph: :::image type="content" source="media/concepts-azure-digital-twins-explorer/azure-digital-twins-explorer-demo.png" alt-text="Screenshot of Azure Digital Twins Explorer, showing a graph of nodes representing digital twins." lightbox="media/concepts-azure-digital-twins-explorer/azure-digital-twins-explorer-demo.png":::
-Azure Digital Twins provides a rich **event system** to keep that graph current with data processing and business logic. You can connect external compute resources, such as [Azure Functions](../azure-functions/functions-overview.md), to drive this data processing in flexible, customized ways.
+Azure Digital Twins provides a rich event system to keep that graph current with data processing and business logic. You can connect external compute resources, such as [Azure Functions](../azure-functions/functions-overview.md), to drive this data processing in flexible, customized ways.
-You can also extract insights from the live execution environment, using Azure Digital Twins' powerful **query APIΓÇï**. The API lets you query with rich search conditions, including property values, relationships, relationship properties, model information, and more. You can also combine queries, gathering a broad range of insights about your environment and answering custom questions that are important to you.
+You can also extract insights from the live execution environment, using Azure Digital Twins' powerful *query APIΓÇï*. The API lets you query with extensive search conditions, including property values, relationships, relationship properties, model information, and more. You can also combine queries, gathering a broad range of insights about your environment and answering custom questions that are important to you.
### Input from IoT and business systems
You can also drive Azure Digital Twins from other data sources, using REST APIs
### Output to ADX, Time Series Insights, storage, and analytics
-The data in your Azure Digital Twins model can be routed to downstream Azure services for more analytics or storage. This functionality is provided through **event routes**, which use [Event Hubs](../event-hubs/event-hubs-about.md), [Event Grid](../event-grid/overview.md), or [Service Bus](../service-bus-messaging/service-bus-messaging-overview.md) to drive your data flows.
+The data in your Azure Digital Twins model can be routed to downstream Azure services for more analytics or storage. This functionality is provided through *event routes*, which use [Event Hubs](../event-hubs/event-hubs-about.md), [Event Grid](../event-grid/overview.md), or [Service Bus](../service-bus-messaging/service-bus-messaging-overview.md) to drive your data flows.
Some things you can do with event routes include: * Sending digital twin data to ADX for querying with the [Azure Digital Twins query plugin for Azure Data Explorer (ADX)](concepts-data-explorer-plugin.md)
The following diagram shows where Azure Digital Twins lies in the context of a l
## Service limits
-You can read about the **service limits** of Azure Digital Twins in the [Azure Digital Twins service limits article](reference-service-limits.md). This resource can be useful while working with the service to understand the service's functional and rate limitations, as well as which limits can be adjusted if necessary.
+You can read about the service limits of Azure Digital Twins in the [Azure Digital Twins service limits article](reference-service-limits.md). This resource can be useful while working with the service to understand the service's functional and rate limitations, as well as which limits can be adjusted if necessary.
## Terminology
-You can view a list of **common IoT terms** and their uses across the Azure IoT services, including Azure Digital Twins, in the [Azure IoT Glossary](../iot-fundamentals/iot-glossary.md?toc=/azure/digital-twins/toc.json&bc=/azure/digital-twins/breadcrumb/toc.json). This resource may be a useful reference while you get started with Azure Digital Twins and building an IoT solution.
+You can view a list of common IoT terms and their uses across the Azure IoT services, including Azure Digital Twins, in the [Azure IoT Glossary](../iot-fundamentals/iot-glossary.md?toc=/azure/digital-twins/toc.json&bc=/azure/digital-twins/breadcrumb/toc.json). This resource may be a useful reference while you get started with Azure Digital Twins and building an IoT solution.
## Next steps
digital-twins Quickstart Azure Digital Twins Explorer https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/quickstart-azure-digital-twins-explorer.md
description: Learn how to use the Azure Digital Twins Explorer by following this demo, where you'll be using models to instantiate twins and interacting with the twin graph. Previously updated : 10/4/2021 Last updated : 02/25/2022
In this quickstart, you'll explore a prebuilt Azure Digital Twins graph using the [Azure Digital Twins Explorer](concepts-azure-digital-twins-explorer.md). This tool allows you to visualize and interact with your Azure Digital Twins data within the Azure portal.
-With Azure Digital Twins, you can create and interact with live models of your real-world environments, which can be part of wider IoT solutions. First, you model individual elements as **digital twins**. Then you connect them into a knowledge **graph** that can respond to live events and be queried for information.
+With Azure Digital Twins, you can create and interact with live models of your real-world environments, which can be part of wider IoT solutions. First, you model individual elements as digital twins. Then you connect them into a knowledge graph that can respond to live events and be queried for information.
You'll complete the following steps:
The Azure Digital Twins example graph you'll be working with represents a buildi
You'll need an Azure subscription to complete this quickstart. If you don't have one already, [create one for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) now. You'll also need to download the materials for the sample graph used in the quickstart. Use the links and instructions below to download the three required files from the [digital-twins-explorer GitHub repository](https://github.com/Azure-Samples/digital-twins-explorer). Later, you'll follow more instructions to upload them to Azure Digital Twins.
-* [Room.json](https://raw.githubusercontent.com/Azure-Samples/digital-twins-explorer/main/client/examples/Room.json): This is a model file representing a room in a building. Navigate to the link, right-click anywhere on the screen, and select **Save as** in your browser's right-click menu. Use the following Save As window to save the file somewhere on your machine with the name **Room.json**.
-* [Floor.json](https://raw.githubusercontent.com/Azure-Samples/digital-twins-explorer/main/client/examples/Floor.json): This is a model file representing a floor in a building. Navigate to the link, right-click anywhere on the screen, and select **Save as** in your browser's right-click menu. Use the following Save As window to save the file to the same location as Room.json, under the name **Floor.json**.
-* [buildingScenario.xlsx](https://github.com/Azure-Samples/digital-twins-explorer/raw/main/client/examples/buildingScenario.xlsx): This file contains a graph of room and floor twins, and relationships between them. Depending on your browser settings, selecting this link may download the **buildingScenario.xlsx** file automatically to your default download location, or it may open the file in your browser with an option to download. Here is what that download option looks like in Microsoft Edge:
+* [Room.json](https://raw.githubusercontent.com/Azure-Samples/digital-twins-explorer/main/client/examples/Room.json): This is a model file representing a room in a building. Navigate to the link, right-click anywhere on the screen, and select **Save as** in your browser's right-click menu. Use the following Save As window to save the file somewhere on your machine with the name *Room.json*.
+* [Floor.json](https://raw.githubusercontent.com/Azure-Samples/digital-twins-explorer/main/client/examples/Floor.json): This is a model file representing a floor in a building. Navigate to the link, right-click anywhere on the screen, and select **Save as** in your browser's right-click menu. Use the following Save As window to save the file to the same location as Room.json, under the name *Floor.json*.
+* [buildingScenario.xlsx](https://github.com/Azure-Samples/digital-twins-explorer/raw/main/client/examples/buildingScenario.xlsx): This file contains a graph of room and floor twins, and relationships between them. Depending on your browser settings, selecting this link may download the *buildingScenario.xlsx* file automatically to your default download location, or it may open the file in your browser with an option to download. Here is what that download option looks like in Microsoft Edge:
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/download-building-scenario.png" alt-text="Screenshot of the buildingScenario.xlsx file viewed in a Microsoft Edge browser. A button saying Download is highlighted." lightbox="media/quickstart-azure-digital-twins-explorer/download-building-scenario.png":::
Next, you'll import the sample models and graph into Azure Digital Twins Explore
The first step in an Azure Digital Twins solution is to define the vocabulary for your environment. You'll create custom [models](concepts-models.md) that describe the types of entity that exist in your environment.
-Each model is written in a language like JSON-LD called Digital Twin Definition Language (DTDL). Each model describes a single type of entity in terms of its **properties**, **telemetry**, **relationships**, and **components**. Later, you'll use these models as the basis for digital twins that represent specific instances of these types.
+Each model is written in a language like JSON-LD called Digital Twin Definition Language (DTDL). Each model describes a single type of entity in terms of its properties, telemetry, relationships, and components. Later, you'll use these models as the basis for digital twins that represent specific instances of these types.
Typically, when you create a model, you'll complete three steps:
Follow these steps to upload models (the *.json* files you downloaded earlier).
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/upload-model.png" alt-text="Screenshot of the Azure Digital Twins Explorer, highlighting the Models panel and the 'Upload a Model' icon in it." lightbox="media/quickstart-azure-digital-twins-explorer/upload-model.png":::
-1. In the Open window that appears, navigate to the folder containing the **Room.json** and **Floor.json** files that you downloaded earlier.
-1. Select **Room.json** and **Floor.json**, and select **Open** to upload them both.
+1. In the Open window that appears, navigate to the folder containing the *Room.json* and *Floor.json* files that you downloaded earlier.
+1. Select *Room.json* and *Floor.json*, and select **Open** to upload them both.
Azure Digital Twins Explorer will upload these model files to your Azure Digital Twins instance. They should show up in the **Models** panel and display their friendly names and full model IDs. You can select **View Model** for either model to see the DTDL code behind it.
Azure Digital Twins Explorer will upload these model files to your Azure Digital
Now that some models have been uploaded to your Azure Digital Twins instance, you can add [digital twins](concepts-twins-graph.md) that follow the model definitions.
-Digital twins represent the actual entities within your business environment. They can be things like sensors on a farm, lights in a car, orΓÇöin this quickstartΓÇörooms on a building floor. You can create many twins of any given model type, such as multiple rooms that all use the Room model. You connect them with relationships into a **twin graph** that represents the full environment.
+Digital twins represent the actual entities within your business environment. They can be things like sensors on a farm, lights in a car, orΓÇöin this quickstartΓÇörooms on a building floor. You can create many twins of any given model type, such as multiple rooms that all use the Room model. You connect them with relationships into a *twin graph* that represents the full environment.
In this section, you'll upload pre-created twins that are connected into a pre-created graph. The graph contains two floors and two rooms, connected in the following layout:
Follow these steps to import the graph (the *.xlsx* file you downloaded earlier)
:::image type="content" source="media/how-to-use-azure-digital-twins-explorer/twin-graph-panel-import.png" alt-text="Screenshot of Azure Digital Twins Explorer Twin Graph panel. The Import Graph button is highlighted." lightbox="media/how-to-use-azure-digital-twins-explorer/twin-graph-panel-import.png":::
-2. In the Open window, navigate to the **buildingScenario.xlsx** file you downloaded earlier. This file contains a description of the sample graph. Select **Open**.
+2. In the Open window, navigate to the *buildingScenario.xlsx* file you downloaded earlier. This file contains a description of the sample graph. Select **Open**.
After a few seconds, Azure Digital Twins Explorer opens an **Import** view that shows a preview of the graph to be loaded.
Room1 has a temperature of 80.
A main feature of Azure Digital Twins is the ability to [query](concepts-query-language.md) your twin graph easily and efficiently to answer questions about your environment.
-One way to query the twins in your graph is by their **properties**. Querying based on properties can help answer a variety of questions. For example, you can find outliers in your environment that might need attention.
+One way to query the twins in your graph is by their properties. Querying based on properties can help answer a variety of questions. For example, you can find outliers in your environment that might need attention.
In this section, you'll run a query to answer the question of how many twins in your environment have a temperature above 75.
To start, rerun the following query to select all digital twins. This will displ
Select **Room0** to bring up its property list in the **Properties** panel.
-The properties in this list are editable. Select the temperature value of **70** to enable entering a new value. Enter **76**, and select the **Save** icon to update the temperature to **76**.
+The properties in this list are editable. Select the temperature value of **70** to enable entering a new value. Enter *76*, and select the **Save** icon to update the temperature to 76.
:::row::: :::column:::
In this quickstart, you made the temperature update manually. It's common in Azu
To clean up after this quickstart, choose which resources you want to remove based on what you want to do next.
-* **If you plan to continue to the Azure Digital Twins tutorials**, you can reuse the instance in this quickstart for those articles, and you don't need to remove it.
+* If you plan to continue to the Azure Digital Twins tutorials, you can reuse the instance in this quickstart for those articles, and you don't need to remove it.
[!INCLUDE [digital-twins-cleanup-clear-instance.md](../../includes/digital-twins-cleanup-clear-instance.md)]
digital-twins Reference Query Clause From https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/reference-query-clause-from.md
description: Reference documentation for the Azure Digital Twins query language FROM clause Previously updated : 03/31/2021 Last updated : 02/25/2022
# Azure Digital Twins query language reference: FROM clause
-This document contains reference information on the **FROM clause** for the [Azure Digital Twins query language](concepts-query-language.md).
+This document contains reference information on the *FROM clause* for the [Azure Digital Twins query language](concepts-query-language.md).
The FROM clause is the second part of a query. It specifies the collection and any joins that the query will act on.
No subqueries are supported within the `FROM` statement.
#### Example (negative)
-The following query shows an example of what **cannot** be done as per this limitation.
+The following query shows an example of what can't be done as per this limitation.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="FromNegativeExample":::
digital-twins Reference Query Clause Join https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/reference-query-clause-join.md
description: Reference documentation for the Azure Digital Twins query language JOIN clause Previously updated : 03/31/2021 Last updated : 02/25/2022
# Azure Digital Twins query language reference: JOIN clause
-This document contains reference information on the **JOIN clause** for the [Azure Digital Twins query language](concepts-query-language.md).
+This document contains reference information on the *JOIN clause* for the [Azure Digital Twins query language](concepts-query-language.md).
The `JOIN` clause is used in the Azure Digital Twins query language as part of the [FROM clause](reference-query-clause-from.md) when you want to query to traverse the Azure Digital Twins graph. This clause is optional while querying. ## Core syntax: JOIN ... RELATED
-Because relationships in Azure Digital Twins are part of digital twins, not independent entities, the `RELATED` keyword is used in `JOIN` queries to reference the set of relationships of a certain type from the twin collection (the type is specified using the relationship's **name** field from its [DTDL definition](concepts-models.md#basic-relationship-example)). The set of relationships can be assigned a collection name within the query.
+Because relationships in Azure Digital Twins are part of digital twins, not independent entities, the `RELATED` keyword is used in `JOIN` queries to reference the set of relationships of a certain type from the twin collection (the type is specified using the relationship's `name` field from its [DTDL definition](concepts-models.md#basic-relationship-example)). The set of relationships can be assigned a collection name within the query.
The query must then use the `WHERE` clause to specify which specific twin or twins are being used to support the relationship query, which is done by filtering on either the source or target twin's `$dtId` value.
The query must then use the `WHERE` clause to specify which specific twin or twi
### Example
-The following query selects all digital twins that are related to the twin with an ID of *ABC* through a *contains* relationship.
+The following query selects all digital twins that are related to the twin with an ID of `ABC` through a `contains` relationship.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="JoinExample":::
digital-twins Reference Query Clause Match https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/reference-query-clause-match.md
description: Reference documentation for the Azure Digital Twins query language MATCH clause Previously updated : 12/01/2021 Last updated : 02/25/2022
# Azure Digital Twins query language reference: MATCH clause (preview)
-This document contains reference information on the **MATCH clause** for the [Azure Digital Twins query language](concepts-query-language.md). This clause is currently in preview.
+This document contains reference information on the *MATCH clause* for the [Azure Digital Twins query language](concepts-query-language.md). This clause is currently in preview.
The `MATCH` clause is used in the Azure Digital Twins query language as part of the [FROM clause](reference-query-clause-from.md). `MATCH` allows you to specify which pattern should be followed while traversing relationships in the Azure Digital Twins graph (this is also known as a "variable hop" query pattern).
This clause is optional while querying.
`MATCH` supports any query that finds a path between twins with an unpredictable number of hops, based on certain relationship conditions.
-The **relationship condition** can include one or more of the following details:
+The relationship condition can include one or more of the following details:
* [Relationship direction](#specify-relationship-direction) (left-to-right, right-to-left, or non-directional) * [relationship name](#specify-relationship-name) (single name or a list of possibilities) * [Number of "hops"](#specify-number-of-hops) from one twin to another (exact number or range)
For more detail about each type of relationship condition and how to combine the
Here is an example query using `MATCH`.
-The query specifies a [relationship direction](#specify-relationship-direction), and searches for building and sensor twins where...
-* the sensor is targeted by any relationship from a building with a `$dtId` of Building21, and
-* the sensor has a temperature above 50.
-The building and sensor are both included in the query result.
+The query specifies a [relationship direction](#specify-relationship-direction), and searches for Building and Sensor twins where...
+* the Sensor is targeted by any relationship from a Building twin with a `$dtId` of Building21, and
+* the Sensor has a temperature above 50.
+The Building and Sensor are both included in the query result.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchExample":::
Directional relationship descriptions use a visual depiction of an arrow to indi
This section shows the syntax for different directions of relationships. The placeholder values that should be replaced with your values are `source_twin` and `target_twin`.
-For a **left-to-right** relationship, use the following syntax.
+For a *left-to-right* relationship, use the following syntax.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchDirectionLRSyntax":::
-For a **right-to-left** relationship, use the following syntax.
+For a *right-to-left* relationship, use the following syntax.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchDirectionRLSyntax":::
-For a **non-directional** relationship, use the following syntax. This will not specify a direction for the relationship, so relationships of any direction will be included in the result.
+For a *non-directional* relationship, use the following syntax. This will not specify a direction for the relationship, so relationships of any direction will be included in the result.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchDirectionNDSyntax":::
For a **non-directional** relationship, use the following syntax. This will not
### Examples
-The first example shows a **left-to-right** directional traversal. This query finds twins *room* and *factory* where...
-* *room* targets *factory* (with any name of relationship)
-* *room* has a temperature value that's greater than 50
-* *factory* has a `$dtId` of 'ABC'
+The first example shows a left-to-right directional traversal. This query finds twins Room and Factory where...
+* Room targets Factory (with any name of relationship)
+* Room has a temperature value that's greater than 50
+* Factory has a `$dtId` of 'ABC'
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchDirectionLRExample"::: >[!NOTE] > MATCH queries that contain `$dtId` filters on any twin other than the starting twin for the MATCH traversal may show empty results. This applies to `factory.$dtId` in the above example. For more information, see [Limitations](#limitations).
-The following example shows a **right-to-left** directional traversal. This query looks similar to the one above, but the direction of the relationship between *room* and *factory* is reversed. This query finds twins *room* and *factory* where...
-* *factory* targets *room* (with any name of relationship)
-* *factory* has a `$dtId` of 'ABC'
-* *room* has a temperature value that's greater than 50
+The following example shows a right-to-left directional traversal. This query looks similar to the one above, but the direction of the relationship between Room and Factory is reversed. This query finds twins Room and Factory where...
+* Factory targets Room (with any name of relationship)
+* Factory has a `$dtId` of 'ABC'
+* Room has a temperature value that's greater than 50
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchDirectionRLExample":::
-The following example shows a **non-directional** traversal. This query finds twins *room* and *factory* where...
-* *room* and *factory* share any name of relationship, going in either direction
-* *factory* has a `$dtId` of 'ABC'
-* *room* has a humidity value that's greater than 70
+The following example shows a non-directional traversal. This query finds twins Room and Factory where...
+* Room and Factory share any name of relationship, going in either direction
+* Factory has a `$dtId` of 'ABC'
+* Room has a humidity value that's greater than 70
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchDirectionNDExample":::
If you don't provide a relationship name, the query will include all relationshi
Specify the name of a relationship to traverse in the `MATCH` clause within square brackets (`[]`). This section shows the syntax of specifying named relationships.
-For a **single name**, use the following syntax. The placeholder values that should be replaced with your values are `twin_1`, `relationship_name`, and `twin_2`.
+For a single name, use the following syntax. The placeholder values that should be replaced with your values are `twin_1`, `relationship_name`, and `twin_2`.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchNameSingleSyntax":::
-For **multiple possible names**, use the following syntax. The placeholder values that should be replaced with your values are `twin_1`, `relationship_name_option_1`, `relationship_name_option_2`, `twin_2`, and the note to continue the pattern as needed for the number of relationship names you want to enter.
+For multiple possible names use the following syntax. The placeholder values that should be replaced with your values are `twin_1`, `relationship_name_option_1`, `relationship_name_option_2`, `twin_2`, and the note to continue the pattern as needed for the number of relationship names you want to enter.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchNameMultiSyntax":::
-(Default) To leave name **unspecified**, leave the brackets empty of name information, like this:
+(Default) To leave name unspecified, leave the brackets empty of name information, like this:
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchNameAllSyntax"::: ### Examples
-The following example shows a **single relationship name**. This query finds twins *building* and *sensor* where...
-* *building* has a 'contains' relationship to *sensor* (going in either direction)
-* *building* has a `$dtId` of 'Seattle21'
+The following example shows a single relationship name. This query finds twins Building and Sensor where...
+* Building has a 'contains' relationship to Sensor (going in either direction)
+* Building has a `$dtId` of 'Seattle21'
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchNameSingleExample":::
-The following example shows **multiple possible relationship names**. This query looks similar to the one above, but there are multiple possible relationship names that are included in the result. This query finds twins *building* and *sensor* where...
-* *building* has either a 'contains' or 'isAssociatedWith' relationship to *sensor* (going in either direction)
-* *building* has a `$dtId` of 'Seattle21'
+The following example shows multiple possible relationship names. This query looks similar to the one above, but there are multiple possible relationship names that are included in the result. This query finds twins Building and Sensor where...
+* Building has either a 'contains' or 'isAssociatedWith' relationship to Sensor (going in either direction)
+* Building has a `$dtId` of 'Seattle21'
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchNameMultiExample":::
-The following example has **no specified relationship name**. As a result, relationships with any name will be included in the query result. This query finds twins *building* and *sensor* where...
-* *building* has a relationship to *sensor* with any name (and going in either direction)
-* *building* has a `$dtId` of 'Seattle21'
+The following example has no specified relationship name. As a result, relationships with any name will be included in the query result. This query finds twins Building and Sensor where...
+* Building has a relationship to Sensor with any name (and going in either direction)
+* Building has a `$dtId` of 'Seattle21'
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchNameAllExample":::
If you don't provide a number of hops, the query will default to one hop.
Specify the number of hops to traverse in the `MATCH` clause within the square brackets (`[]`).
-To specify an **exact number of hops**, use the following syntax. The placeholder values that should be replaced with your values are `twin_1`, `number_of_hops`, and `twin_2`.
+To specify an exact number of hops, use the following syntax. The placeholder values that should be replaced with your values are `twin_1`, `number_of_hops`, and `twin_2`.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchHopsExactSyntax":::
-To specify a **range of hops**, use the following syntax. The placeholder values that should be replaced with your values are `twin_1`, `starting_limit`, `ending_limit` and `twin_2`. The starting limit **is not** included in the range, while the ending limit **is** included.
+To specify a range of hops, use the following syntax. The placeholder values that should be replaced with your values are `twin_1`, `starting_limit`, `ending_limit` and `twin_2`. The starting limit isn't included in the range, while the ending limit is included.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchHopsRangeSyntax":::
You can also leave out the starting limit to indicate "anything up to" (and incl
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchHopsRangeEndingSyntax":::
-(Default) To default to **one hop**, leave the brackets empty of hop information, like this:
+(Default) To default to one hop, leave the brackets empty of hop information, like this:
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchHopsOneSyntax"::: ### Examples
-The following example specifies an **exact number of hops**. The query will only return relationships between twins *floor* and *room* that are exactly 3 hops.
+The following example specifies an exact number of hops. The query will only return relationships between twins Floor and Room that are exactly 3 hops.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchHopsExactExample":::
-The following example specifies a **range of hops**. The query will return relationships between twins *floor* and *room* that are between 1 and 3 hops (meaning the number of hops is either 2 or 3).
+The following example specifies a range of hops. The query will return relationships between twins Floor and Room that are between 1 and 3 hops (meaning the number of hops is either 2 or 3).
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchHopsRangeExample1":::
-You can also show a range by providing only one boundary. In the following example, the query will return relationships between twins *floor* and *room* that are at most 2 hops (meaning the number of hops is either 1 or 2).
+You can also show a range by providing only one boundary. In the following example, the query will return relationships between twins Floor and Room that are at most 2 hops (meaning the number of hops is either 1 or 2).
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchHopsRangeEndingExample":::
-The following example has no specified number of hops, so will default to **one hop** between twins *floor* and *room*.
+The following example has no specified number of hops, so will default to one hop between twins Floor and Room.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchHopsOneExample":::
To assign a query variable to the relationship, put the variable name in the squ
### Examples
-The following example assigns a query variable 'r' to the relationship. Later, in the `WHERE` clause, it uses the variable to specify that the relationship *rel* should have a name property with a value of 'child'.
+The following example assigns a query variable 'r' to the relationship. Later, in the `WHERE` clause, it uses the variable to specify that the relationship Rel should have a name property with a value of 'child'.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchVariableExample":::
You can combine multiple relationship conditions in the same query. You can also
### Syntax
-In a single query, you can combine [relationship direction](#specify-relationship-direction), [relationship name](#specify-number-of-hops), and **one** of either [number of hops](#specify-number-of-hops) or [a query variable assignment](#assign-query-variable-to-relationship-and-specify-relationship-properties).
+In a single query, you can combine [relationship direction](#specify-relationship-direction), [relationship name](#specify-number-of-hops), and one of either [number of hops](#specify-number-of-hops) or [a query variable assignment](#assign-query-variable-to-relationship-and-specify-relationship-properties).
The following syntax examples show how these attributes can be combined. You can also leave out any of the optional details shown in placeholders to omit that part of the condition.
-To specify **relationship direction, relationship name, and number of hops** within a single query, use the following syntax within the relationship condition. The placeholder values that should be replaced with your values are `twin_1` and `twin_2`, `optional_left_angle_bracket` and `optional_right_angle_bracket`, `relationship_name(s)`, and `number_of_hops`.
+To specify relationship direction, relationship name, and number of hops within a single query, use the following syntax within the relationship condition. The placeholder values that should be replaced with your values are `twin_1` and `twin_2`, `optional_left_angle_bracket` and `optional_right_angle_bracket`, `relationship_name(s)`, and `number_of_hops`.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchCombinedHopsSyntax":::
-To specify **relationship direction, relationship name, and a query variable for the relationship** within a single query, use the following syntax within the relationship condition. The placeholder values that should be replaced with your values are `twin_1` and `twin_2`, `optional_left_angle_bracket` and `optional_right_angle_bracket`, `relationship_variable`, and `relationship_name(s)`.
+To specify relationship direction, relationship name, and a query variable for the relationship within a single query, use the following syntax within the relationship condition. The placeholder values that should be replaced with your values are `twin_1` and `twin_2`, `optional_left_angle_bracket` and `optional_right_angle_bracket`, `relationship_variable`, and `relationship_name(s)`.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchCombinedVariableSyntax"::: >[!NOTE] >As per the options for [specifying relationship direction](#specify-relationship-direction), you must pick between a left angle bracket for a left-to-right relationship or a right angle bracket for a right-to-left relationship. You can't include both on the same arrow, but can represent bi-directional relationships by chaining.
-You can **chain** multiple relationship conditions together, like this. The placeholder values that should be replaced with your values are `twin_1`, all instances of `relationship_condition`, and `twin_2`.
+You can chain multiple relationship conditions together, like this. The placeholder values that should be replaced with your values are `twin_1`, all instances of `relationship_condition`, and `twin_2`.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchChainSyntax"::: ### Examples
-Here's an example that combines **relationship direction, relationship name, and number of hops**. The following query finds twins *floor* and *room*, where the relationship between *floor* and *room* meets these conditions:
-* the relationship is left-to-right, with *floor* as the source and *room* as the target
+Here's an example that combines relationship direction, relationship name, and number of hops The following query finds twins Floor and Room where the relationship between Floor and Room meets these conditions:
+* the relationship is left-to-right, with Floor as the source and Room as the target
* the relationship has a name of either 'contains' or 'isAssociatedWith' * the relationship has either 4 or 5 hops
-The query also specifies that twin *floor* has a `$dtId` of 'thermostat-15'.
+The query also specifies that twin Floor has a `$dtId` of 'thermostat-15'.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchCombinedHopsExample":::
-Here is an example that combines **relationship direction, relationship name, and a named query variable for the relationship**. The following query finds twins *floor* and *room*, where the relationship between *floor* and *room* is assigned to a query variable *r* and meets these conditions:
-* the relationship is left-to-right, with *floor* as the source and *room* as the target
+Here's an example that combines relationship direction, relationship name, and a named query variable for the relationship. The following query finds twins Floor and Room where the relationship between Floor and Room is assigned to a query variable `r` and meets these conditions:
+* the relationship is left-to-right, with Floor as the source and Room as the target
* the relationship has a name of either 'contains' or 'isAssociatedWith'
-* the relationship, which is given a query variable *r*, has a length property equal to 10
+* the relationship, which is given a query variable `r`, has a length property equal to 10
-The query also specifies that twin *floor* has a `$dtId` of 'thermostat-15'.
+The query also specifies that twin Floor has a `$dtId` of 'thermostat-15'.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchCombinedVariableExample":::
-The following example illustrates **chained** relationship conditions. The query finds twins *floor*, *cafe*, and *room*, where...
-* the relationship between *floor* and *room* meets these conditions:
- - the relationship is left-to-right, with *floor* as the source and *cafe* as the target
+The following example illustrates *chained* relationship conditions. The query finds twins Floor, Cafe, and Room, where...
+* the relationship between Floor and Room meets these conditions:
+ - the relationship is left-to-right, with Floor as the source and Cafe as the target
- the relationship has a name of either 'contains' or 'isAssociatedWith'
- - the relationship, which is given query variable *r*, has a length property equal to 10
-* the relationship between *cafe* and *room* meets these conditions:
- - the relationship is right-to-left, with *room* as the source and *cafe* as the target
+ - the relationship, which is given query variable `r`, has a length property equal to 10
+* the relationship between Cafe and Room meets these conditions:
+ - the relationship is right-to-left, with Room as the source and Cafe as the target
- the relationship has a name of either 'has' or 'includes' - the relationship has up to 3 (so 1, 2, or 3) hops
-The query also specifies that twin *floor* has a `$dtId` of 'thermostat-15' and twin *cafe* has a temperature of 55.
+The query also specifies that twin Floor has a `$dtId` of 'thermostat-15' and twin Cafe has a temperature of 55.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchCombinedChainExample":::
-You can also use chained relationship conditions to express **bi-directional relationships**. The following query finds twins *floor*, *room*, and *building*, where...
-* the relationship between *building* and *floor* meets these conditions:
- - the relationship is left-to-right, with *building* as the source and *floor* as the target
+You can also use chained relationship conditions to express bi-directional relationships. The following query finds twins Floor, Room, and Building, where...
+* the relationship between Building and Floor meets these conditions:
+ - the relationship is left-to-right, with Building as the source and Floor as the target
- the relationship has a name of 'isAssociatedWith'
- - the relationship is given a query variable *r1*
-* the relationship between *floor* and *room* meets these conditions:
- - the relationship is right-to-left, with *room* as the source and *floor* as the target
+ - the relationship is given a query variable `r1`
+* the relationship between Floor and Room meets these conditions:
+ - the relationship is right-to-left, with Room as the source and Floor as the target
- the relationship has a name of 'isAssociatedWith'
- - the relationship is given a query variable *r2*'
+ - the relationship is given a query variable `r2`
-The query also specifies that twin *building* has a `$dtId` of 'building-3' and *room* has a temperature greater than 50.
+The query also specifies that twin Building has a `$dtId` of 'building-3' and Room has a temperature greater than 50.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchCombinedChainBDExample":::
digital-twins Reference Query Clause Select https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/reference-query-clause-select.md
description: Reference documentation for the Azure Digital Twins query language SELECT clause Previously updated : 03/31/2021 Last updated : 02/25/2022
# Azure Digital Twins query language reference: SELECT clause
-This document contains reference information on the **SELECT clause** for the [Azure Digital Twins query language](concepts-query-language.md).
+This document contains reference information on the *SELECT clause* for the [Azure Digital Twins query language](concepts-query-language.md).
The SELECT clause is the first part of a query. It specifies the list of columns that the query will return.
digital-twins Reference Query Clause Where https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/reference-query-clause-where.md
description: Reference documentation for the Azure Digital Twins query language WHERE clause Previously updated : 03/31/2021 Last updated : 02/25/2022
# Azure Digital Twins query language reference: WHERE clause
-This document contains reference information on the **WHERE clause** for the [Azure Digital Twins query language](concepts-query-language.md).
+This document contains reference information on the *WHERE clause* for the [Azure Digital Twins query language](concepts-query-language.md).
The WHERE clause is the last part of a query. It's used to filter the items that are returned based on specific conditions.
digital-twins Reference Query Functions https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/reference-query-functions.md
description: Reference documentation for the Azure Digital Twins query language functions Previously updated : 11/23/2021 Last updated : 02/25/2022
# Azure Digital Twins query language reference: Functions
-This document contains reference information on **functions** for the [Azure Digital Twins query language](concepts-query-language.md).
+This document contains reference information on *functions* for the [Azure Digital Twins query language](concepts-query-language.md).
## CONTAINS
A Boolean value indicating if the property has been assigned a value.
### Example
-The following query returns all digital twins who have a defined *Location* property.
+The following query returns all digital twins who have a defined `Location` property.
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" ID="IsDefinedExample":::
digital-twins Reference Query Operators https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/reference-query-operators.md
description: Reference documentation for the Azure Digital Twins query language operators Previously updated : 03/22/2021 Last updated : 02/25/2022
# Azure Digital Twins query language reference: Operators
-This document contains reference information on **operators** for the [Azure Digital Twins query language](concepts-query-language.md).
+This document contains reference information on *operators* for the [Azure Digital Twins query language](concepts-query-language.md).
## Comparison operators
digital-twins Reference Query Reserved https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/reference-query-reserved.md
description: Reference documentation for the Azure Digital Twins query language reserved keywords Previously updated : 9/1/2021 Last updated : 02/25/2022
# Azure Digital Twins query language reference: Reserved keywords
-This document contains the list of **reserved keywords** in the [Azure Digital Twins query language](concepts-query-language.md). These words cannot be used as identifiers in queries unless they are [escaped in double square brackets](#escaping-reserved-keywords-in-queries).
+This document contains the list of *reserved keywords* in the [Azure Digital Twins query language](concepts-query-language.md). These words cannot be used as identifiers in queries unless they are [escaped in double square brackets](#escaping-reserved-keywords-in-queries).
## List of reserved keywords
digital-twins Reference Service Limits https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/reference-service-limits.md
description: Chart showing the limits of the Azure Digital Twins service. Previously updated : 02/08/2022 Last updated : 02/25/2022
The following sections describe the service limits of Azure Digital Twins. > [!NOTE]
-> Some areas of this service have adjustable limits. This is represented in the tables below with the *Adjustable?* column. When the limit can be adjusted, the *Adjustable?* value is *Yes*.
+> Some areas of this service have adjustable limits. This is represented in the tables below with the **Adjustable?** column. When the limit can be adjusted, the **Adjustable?** value is **Yes**.
> > If your business requires raising an adjustable limit or quota above the default limit, you can request additional resources by [opening a support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/newsupportrequest).
The following sections describe the service limits of Azure Digital Twins.
When a limit is reached, any requests beyond it are throttled by the service, which will result in a 429 error response from these requests. To manage the throttling, here are some recommendations for working with limits.
-* **Use retry logic.** The [Azure Digital Twins SDKs](concepts-apis-sdks.md) implement retry logic for failed requests, so if you're working with a provided SDK, this functionality is already built-in. Otherwise, consider implementing retry logic in your own application. The service sends back a `Retry-After` header in the failure response, which you can use to determine how long to wait before retrying.
-* **Use thresholds and notifications to warn about approaching limits.** Some of the service limits for Azure Digital Twins have corresponding [metrics](troubleshoot-metrics.md) that can be used to track usage in these areas. To configure thresholds and set up an alert on any metric when a threshold is approached, see the instructions in [Troubleshooting: Alerts](troubleshoot-alerts.md). To set up notifications for other limits where metrics aren't provided, consider implementing this logic in your own application code.
-* **Deploy at scale across multiple instances.** Avoid having a single point of failure. Instead of one large graph for your entire deployment, consider sectioning out subsets of twins logically (like by region or tenant) across multiple instances.
+* Use retry logic. The [Azure Digital Twins SDKs](concepts-apis-sdks.md) implement retry logic for failed requests, so if you're working with a provided SDK, this functionality is already built-in. Otherwise, consider implementing retry logic in your own application. The service sends back a `Retry-After` header in the failure response, which you can use to determine how long to wait before retrying.
+* Use thresholds and notifications to warn about approaching limits. Some of the service limits for Azure Digital Twins have corresponding [metrics](troubleshoot-metrics.md) that can be used to track usage in these areas. To configure thresholds and set up an alert on any metric when a threshold is approached, see the instructions in [Troubleshooting: Alerts](troubleshoot-alerts.md). To set up notifications for other limits where metrics aren't provided, consider implementing this logic in your own application code.
+* Deploy at scale across multiple instances. Avoid having a single point of failure. Instead of one large graph for your entire deployment, consider sectioning out subsets of twins logically (like by region or tenant) across multiple instances.
>[!NOTE] >Azure Digital Twins will automatically scale resources to meet the rate limits described in this article. You may experience throttling before these limits are reached due to internal scaling to adapt to the incoming load. Internal scaling can take anywhere from 5 to 30 minutes, during which time your application may encounter 429 errors.
digital-twins Troubleshoot Alerts https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/troubleshoot-alerts.md
description: Learn how to troubleshoot Azure Digital Twins by setting up alerts based on service metrics. Previously updated : 10/5/2021 Last updated : 02/25/2022 # Troubleshooting Azure Digital Twins: Alerts
-In this article, you'll learn how to set up alerts in the [Azure portal](https://portal.azure.com). These alerts will notify you when configurable conditions you've defined based on the metrics of your Azure Digital Twins instance are met, allowing you to take important actions.
+In this article, you'll learn how to set up *alerts* in the [Azure portal](https://portal.azure.com). These alerts will notify you when configurable conditions you've defined based on the metrics of your Azure Digital Twins instance are met, allowing you to take important actions.
Azure Digital Twins collects [metrics](troubleshoot-metrics.md) for your service instance that give information about the state of your resources. You can use these metrics to assess the overall health of Azure Digital Twins service and the resources connected to it.
-**Alerts** proactively notify you when important conditions are found in your metrics data. They allow you to identify and address issues before the users of your system notice them. You can read more about alerts in [Overview of alerts in Microsoft Azure](../azure-monitor/alerts/alerts-overview.md).
+Alerts proactively notify you when important conditions are found in your metrics data. They allow you to identify and address issues before the users of your system notice them. You can read more about alerts in [Overview of alerts in Microsoft Azure](../azure-monitor/alerts/alerts-overview.md).
## Turn on alerts
Here's how to enable alerts for your Azure Digital Twins instance:
:::image type="content" source="media/troubleshoot-alerts/alerts-pre.png" alt-text="Screenshot of the Azure portal showing the button to create a new alert rule in the Alerts section of an Azure Digital Twin instance." lightbox="media/troubleshoot-alerts/alerts-pre.png":::
-3. On the *Create alert rule* page that follows, you can follow the prompts to define conditions, actions to be triggered, and alert details.
+3. On the **Create alert rule** page that follows, you can follow the prompts to define conditions, actions to be triggered, and alert details.
* **Scope** details should fill automatically with the details for your instance * You'll define **Condition** and **Action group** details to customize alert triggers and responses * In the **Alert rule details** section, enter a name and optional description for your rule.
- - You can select the _Enable alert rule upon creation_ checkbox if you want the alert to become active as soon as it's created.
- - You can select the _Automatically resolve alerts_ checkbox if you want to resolve the alert when the condition isn't met anymore.
- - This section is also where you select a _subscription_, _resource group_, and _Severity_ level.
+ - You can select the **Enable alert rule upon creation** checkbox if you want the alert to become active as soon as it's created.
+ - You can select the **Automatically resolve alerts** checkbox if you want to resolve the alert when the condition isn't met anymore.
+ - This section is also where you select a **subscription**, **resource group**, and **Severity** level.
-4. Select the _Create alert rule_ button to create your alert rule.
+4. Select the **Create alert rule** button to create your alert rule.
:::image type="content" source="media/troubleshoot-alerts/create-alert-rule.png" alt-text="Screenshot of the Azure portal showing the Create Alert Rule page with sections for scope, condition, action group, and alert rule details." lightbox="media/troubleshoot-alerts/create-alert-rule.png":::
For a guided walkthrough of filling out these fields, see [Overview of alerts in
### Select conditions
-Here's an excerpt from the *Select condition* process illustrating what types of alert signals are available for Azure Digital Twins. On this page you can filter the type of signal, and select the signal that you want from a list.
+Here's an excerpt from the **Select condition** process illustrating what types of alert signals are available for Azure Digital Twins. On this page you can filter the type of signal, and select the signal that you want from a list.
:::image type="content" source="media/troubleshoot-alerts/configure-signal-logic.png" alt-text="Screenshot of the Azure portal showing the first Configure Signal Logic page. There are highlights around the Signal type box and the list of metrics.":::
After selecting a signal, you'll be asked to configure the logic of the alert. Y
### Verify success
-After setting up alerts, they'll show up back on the *Alerts* page for your instance.
+After setting up alerts, they'll show up back on the **Alerts** page for your instance.
:::image type="content" source="media/troubleshoot-alerts/alerts-post.png" alt-text="Screenshot of the Azure portal showing the Alerts page and button to add. There's one alert configured." lightbox="media/troubleshoot-alerts/alerts-post.png":::
digital-twins Troubleshoot Diagnostics https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/troubleshoot-diagnostics.md
description: In this article, learn how to enable logging with diagnostics settings and query the logs for immediate viewing. Also, learn about the log categories and their schemas. Previously updated : 9/24/2021 Last updated : 02/25/2022
This article shows you how to configure diagnostic settings in the [Azure portal](https://portal.azure.com), including what types of logs to collect and where to store them (such as Log Analytics or a storage account of your choice). Then, you can query the logs to quickly gather custom insights.
-Azure Digital Twins can collect **logs** for your service instance to monitor its performance, access, and other data. You can use these logs to get an idea of what is happening in your Azure Digital Twins instance, and analyze root causes on issues without needing to contact Azure support.
+Azure Digital Twins can collect *logs* for your service instance to monitor its performance, access, and other data. You can use these logs to get an idea of what is happening in your Azure Digital Twins instance, and analyze root causes on issues without needing to contact Azure support.
-This article also contains information about all the **log categories** that Azure Digital Twins can collect, and their **schemas**.
+This article also contains information about all the log categories that Azure Digital Twins can collect, and their schemas.
## Turn on diagnostic settings
For more detailed information on diagnostic settings and their setup options, yo
## View and query logs
-After configuring storage details of your Azure Digital Twins logs, you can write **custom queries** for them to generate insights and troubleshoot issues. The service also provides a few example queries that can help you get started, by addressing common questions that customers may have about their instances.
+After configuring storage details of your Azure Digital Twins logs, you can write *custom queries* for them to generate insights and troubleshoot issues. The service also provides a few example queries that can help you get started, by addressing common questions that customers may have about their instances.
Here's how to query the logs for your instance. 1. Sign in to the [Azure portal](https://portal.azure.com) and navigate to your Azure Digital Twins instance. You can find it by typing its name into the portal search bar.
-2. Select **Logs** from the menu to open the log query page. The page opens to a window called *Queries*.
+2. Select **Logs** from the menu to open the log query page. The page opens to a window called **Queries**.
:::image type="content" source="media/troubleshoot-diagnostics/logs.png" alt-text="Screenshot showing the Logs page for an Azure Digital Twins instance in the Azure portal with the Queries window overlaid, showing prebuilt queries." lightbox="media/troubleshoot-diagnostics/logs.png"::: These queries are prebuilt examples written for various logs. You can select one of the queries to load it into the query editor and run it to see these logs for your instance.
- You can also close the *Queries* window without running anything to go straight to the query editor page, where you can write or edit custom query code.
+ You can also close the **Queries** window without running anything to go straight to the query editor page, where you can write or edit custom query code.
-3. After exiting the *Queries* window, you'll see the main query editor page. Here you can view and edit the text of the example queries, or write your own queries from scratch.
+3. After exiting the **Queries** window, you'll see the main query editor page. Here you can view and edit the text of the example queries, or write your own queries from scratch.
:::image type="content" source="media/troubleshoot-diagnostics/logs-query.png" alt-text="Screenshot showing the Logs page for an Azure Digital Twins instance in the Azure portal. It includes a list of logs, query code, and Queries History." lightbox="media/troubleshoot-diagnostics/logs-query.png"::: In the left pane,
- - The *Tables* tab shows the different Azure Digital Twins [log categories](#log-categories) that are available to use in your queries.
- - The *Queries* tab contains the example queries that you can load into the editor.
- - The *Filter* tab lets you customize a filtered view of the data that the query returns.
+ - The **Tables** tab shows the different Azure Digital Twins [log categories](#log-categories) that are available to use in your queries.
+ - The **Queries** tab contains the example queries that you can load into the editor.
+ - The **Filter** tab lets you customize a filtered view of the data that the query returns.
For more detailed information on log queries and how to write them, you can visit [Overview of log queries in Azure Monitor](../azure-monitor/logs/log-query-overview.md).
Each log category has a schema that defines how events in that category are repo
### API log schemas
-This log schema is consistent for `ADTDigitalTwinsOperation`, `ADTModelsOperation`, `ADTQueryOperation`. The same schema is also used for `ADTEventRoutesOperation`, **except** the `Microsoft.DigitalTwins/eventroutes/action` operation name (for more information about that schema, see the next section, [Egress log schemas](#egress-log-schemas)).
+This log schema is consistent for `ADTDigitalTwinsOperation`, `ADTModelsOperation`, `ADTQueryOperation`. The same schema is also used for `ADTEventRoutesOperation`, except the `Microsoft.DigitalTwins/eventroutes/action` operation name (for more information about that schema, see the next section, [Egress log schemas](#egress-log-schemas)).
The schema contains information pertinent to API calls to an Azure Digital Twins instance.
Below are example JSON bodies for these types of logs.
#### ADTEventRoutesOperation
-Here's an example JSON body for an `ADTEventRoutesOperation` that is **not** of `Microsoft.DigitalTwins/eventroutes/action` type (for more information about that schema, see the next section, [Egress log schemas](#egress-log-schemas)).
+Here's an example JSON body for an `ADTEventRoutesOperation` that isn't of `Microsoft.DigitalTwins/eventroutes/action` type (for more information about that schema, see the next section, [Egress log schemas](#egress-log-schemas)).
```json {
digital-twins Troubleshoot Error 403 https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/troubleshoot-error-403.md
Previously updated : 9/23/2021 Last updated : 02/24/2022 # Troubleshooting failed service request: Error 403 (Forbidden)
This error may occur on many types of service requests that require authenticati
### Cause #1
-Most often, this error indicates that your Azure role-based access control (Azure RBAC) permissions for the service aren't set up correctly. Many actions for an Azure Digital Twins instance require you to have the Azure Digital Twins Data Owner role **on the instance you are trying to manage**.
+Most often, this error indicates that your Azure role-based access control (Azure RBAC) permissions for the service aren't set up correctly. Many actions for an Azure Digital Twins instance require you to have the Azure Digital Twins Data Owner role on the instance you are trying to manage.
### Cause #2
This role is different from...
#### Fix issues
-If you don't have this role assignment, someone with an Owner role in your **Azure subscription** should run the following command to give your Azure user the Azure Digital Twins Data Owner role on the **Azure Digital Twins instance**.
+If you don't have this role assignment, someone with an Owner role in your Azure subscription should run the following command to give your Azure user the Azure Digital Twins Data Owner role on the Azure Digital Twins instance.
If you're an Owner on the subscription, you can run this command yourself. If you're not, contact an Owner to run this command on your behalf.
If you're an Owner on the subscription, you can run this command yourself. If yo
az dt role-assignment create --dt-name <your-Azure-Digital-Twins-instance> --assignee "<your-Azure-AD-email>" --role "Azure Digital Twins Data Owner" ```
-For more information about this role requirement and the assignment process, see the [Set up your user's access permissions section](how-to-set-up-instance-CLI.md#set-up-user-access-permissions) of *How-to: Set up an instance and authentication (CLI or portal)*.
+For more information about this role requirement and the assignment process, see [Set up your user's access permissions](how-to-set-up-instance-CLI.md#set-up-user-access-permissions).
-If you have this role assignment already **and** you're using an Azure AD app registration to authenticate a client app, you can continue to the next solution if this solution didn't resolve the 403 issue.
+If you have this role assignment already and you're using an Azure AD app registration to authenticate a client app, you can continue to the next solution if this solution didn't resolve the 403 issue.
### Solution #2
If you're using an Azure AD app registration to authenticate a client app, the s
#### Check current setup
-To check whether the permissions have been configured correctly, navigate to the [Azure AD app registration overview page](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps) in the Azure portal. You can get to this page yourself by searching for **App registrations** in the portal search bar.
+To check whether the permissions have been configured correctly, navigate to the [Azure AD app registration overview page](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps) in the Azure portal. You can get to this page yourself by searching for *app registrations* in the portal search bar.
Switch to the **All applications** tab to see all the app registrations that have been created in your subscription.
digital-twins Troubleshoot Error 404 https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/troubleshoot-error-404.md
Previously updated : 9/23/2021 Last updated : 02/22/2022 # Troubleshooting failed service request: Error 404 (Sub-Domain not found)
Azure Digital Twins requires that all authenticating users belong to the same Az
### Solution #1
-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.
+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.
[!INCLUDE [digital-twins-tenant-solution-1](../../includes/digital-twins-tenant-solution-1.md)]
digital-twins Troubleshoot Error Azure Digital Twins Explorer Authentication https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/troubleshoot-error-azure-digital-twins-explorer-authentication.md
Previously updated : 10/7/2021 Last updated : 02/23/2022 # Troubleshooting Azure Digital Twins Explorer: Authentication error
When setting up and running the Azure Digital Twins Explorer application, attemp
### Cause #1
-This error might occur if your Azure account does not have the required Azure role-based access control (Azure RBAC) permissions set on your Azure Digital Twins instance. In order to access data in your instance, you must have the **Azure Digital Twins Data Reader** or **Azure Digital Twins Data Owner** role on the instance you are trying to read or manage, respectively.
+This error might occur if your Azure account does not have the required Azure role-based access control (Azure RBAC) permissions set on your Azure Digital Twins instance. In order to access data in your instance, you must have the *Azure Digital Twins Data Reader* or *Azure Digital Twins Data Owner* role on the instance you are trying to read or manage, respectively.
For more information about security and roles in Azure Digital Twins, see [Security for Azure Digital Twins solutions](concepts-security.md).
For more information about security and roles in Azure Digital Twins, see [Secur
### Solution #1
-Verify that your Azure user has the **Azure Digital Twins Data Reader** role on the Azure Digital Twins instance if you're just trying to read its data, or the **Azure Digital Twins Data Owner** role on the instance if you're trying to manage its data.
+Verify that your Azure user has the *Azure Digital Twins Data Reader* role on the Azure Digital Twins instance if you're just trying to read its data, or the *Azure Digital Twins Data Owner* role on the instance if you're trying to manage its data.
Note that this role is different from... * the former name for this role during preview, *Azure Digital Twins Owner (Preview)* (the role is the same, but the name has changed)
Note that this role is different from...
#### Fix issues
-If you do not have this role assignment, someone with an Owner role in your **Azure subscription** should run the following command to give your Azure user the appropriate role on the **Azure Digital Twins instance**.
+If you do not have this role assignment, someone with an Owner role in your Azure subscription should run the following command to give your Azure user the appropriate role on the Azure Digital Twins instance.
-If you're an Owner on the subscription, you can run this command yourself. If you're not, contact an Owner to run this command on your behalf. The role name is either **Azure Digital Twins Data Owner** for edit access or **Azure Digital Twins Data Reader** for read access.
+If you're an Owner on the subscription, you can run this command yourself. If you're not, contact an Owner to run this command on your behalf. The role name is either *Azure Digital Twins Data Owner* for edit access or *Azure Digital Twins Data Reader* for read access.
```azurecli-interactive az dt role-assignment create --dt-name <your-Azure-Digital-Twins-instance> --assignee "<your-Azure-AD-email>" --role "<role-name>" ```
-For more details about this role requirement and the assignment process, see the [Set up your user's access permissions section](how-to-set-up-instance-CLI.md#set-up-user-access-permissions) of *How-to: Set up an instance and authentication (CLI or portal)*.
+For more details about this role requirement and the assignment process, see [Set up your user's access permissions](how-to-set-up-instance-CLI.md#set-up-user-access-permissions).
## Next steps
digital-twins Troubleshoot Known Issues https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/troubleshoot-known-issues.md
Previously updated : 10/6/2021 Last updated : 02/28/2022
This article provides information about known issues associated with Azure Digit
## "400 Client Error: Bad Request" in Cloud Shell
-**Issue description:** Commands in Cloud Shell running at *https://shell.azure.com* may intermittently fail with the error "400 Client Error: Bad Request for url: http://localhost:50342/oauth2/token", followed by full stack trace.
+**Issue description:** Commands in Cloud Shell running at *https://shell.azure.com* may intermittently fail with the error "400 Client Error: Bad Request for url: `http://localhost:50342/oauth2/token`", followed by full stack trace.
| Does this affect me? | Cause | Resolution | | | | |
This article provides information about known issues associated with Azure Digit
## Issue with interactive browser authentication on Azure.Identity 1.2.0
-**Issue description:** When writing authentication code in your Azure Digital Twins applications using version **1.2.0** of the [Azure.Identity](/dotnet/api/azure.identity?view=azure-dotnet&preserve-view=true) library, you may experience issues with the [InteractiveBrowserCredential](/dotnet/api/azure.identity.interactivebrowsercredential?view=azure-dotnet&preserve-view=true) method. This issue presents as an error response of "Azure.Identity.AuthenticationFailedException" when trying to authenticate in a browser window. The browser window may fail to start up completely, or appear to authenticate the user successfully, while the client application still fails with the error.
+**Issue description:** When writing authentication code in your Azure Digital Twins applications using version 1.2.0 of the [Azure.Identity](/dotnet/api/azure.identity?view=azure-dotnet&preserve-view=true) library, you may experience issues with the [InteractiveBrowserCredential](/dotnet/api/azure.identity.interactivebrowsercredential?view=azure-dotnet&preserve-view=true) method. This issue presents as an error response of "Azure.Identity.AuthenticationFailedException" when trying to authenticate in a browser window. The browser window may fail to start up completely, or appear to authenticate the user successfully, while the client application still fails with the error.
| Does this affect me? | Cause | Resolution | | | | |
-| The&nbsp;affected&nbsp;method&nbsp;is&nbsp;used&nbsp;in&nbsp;the&nbsp;following articles:<br><br>[Code a client app](tutorial-code.md)<br><br>[Write app authentication code](how-to-authenticate-client.md)<br><br>[Azure Digital Twins APIs and SDKs](concepts-apis-sdks.md) | Some users have had this issue with version **1.2.0** of the `Azure.Identity` library. | To resolve, update your applications to use a [later version](https://www.nuget.org/packages/Azure.Identity) of `Azure.Identity`. After updating the library version, the browser should load and authenticate as expected. |
+| The&nbsp;affected&nbsp;method&nbsp;is&nbsp;used&nbsp;in&nbsp;the&nbsp;following articles:<br><br>[Code a client app](tutorial-code.md)<br><br>[Write app authentication code](how-to-authenticate-client.md)<br><br>[Azure Digital Twins APIs and SDKs](concepts-apis-sdks.md) | Some users have had this issue with version 1.2.0 of the `Azure.Identity` library. | To resolve, update your applications to use a [later version](https://www.nuget.org/packages/Azure.Identity) of `Azure.Identity`. After updating the library version, the browser should load and authenticate as expected. |
## Issue with default Azure credential authentication on Azure.Identity 1.3.0
-**Issue description:** When writing authentication code using version **1.3.0** of the [Azure.Identity](/dotnet/api/azure.identity?view=azure-dotnet&preserve-view=true) library, some users have experienced issues with the [DefaultAzureCredential](/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet&preserve-view=true) method used in many samples throughout these Azure Digital Twins docs. This issue presents as an error response of "Azure.Identity.AuthenticationFailedException: SharedTokenCacheCredential authentication failed" when the code tries to authenticate.
+**Issue description:** When writing authentication code using version 1.3.0 of the [Azure.Identity](/dotnet/api/azure.identity?view=azure-dotnet&preserve-view=true) library, some users have experienced issues with the [DefaultAzureCredential](/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet&preserve-view=true) method used in many samples throughout these Azure Digital Twins docs. This issue presents as an error response of "Azure.Identity.AuthenticationFailedException: SharedTokenCacheCredential authentication failed" when the code tries to authenticate.
| Does this affect me? | Cause | Resolution | | | | |
-| `DefaultAzureCredential` is used in most of the documentation examples for this service that include authentication. If you're writing authentication code using `DefaultAzureCredential` with version 1.3.0 of the `Azure.Identity` library and seeing this error message, this issue affects you. | It's likely a result of some configuration issue with `Azure.Identity`. | One strategy to resolve this is to exclude `SharedTokenCacheCredential` from your credential, as described in this [DefaultAzureCredential issue](https://github.com/Azure/azure-sdk/issues/1970) that is currently open against `Azure.Identity`.<br>Another option is to change your application to use an earlier version of `Azure.Identity`, such as [version 1.2.3](https://www.nuget.org/packages/Azure.Identity/1.2.3). Using an earlier version has no functional impact to Azure Digital Twins, which makes it an accepted solution. |
+| `DefaultAzureCredential` is used in most of the documentation examples for this service that include authentication. If you're writing authentication code using `DefaultAzureCredential` with version 1.3.0 of the `Azure.Identity` library and seeing this error message, this issue affects you. | It's likely a result of some configuration issue with the `Azure.Identity` library and `DefaultAzureCredential`, its authentication class. This class is a wrapper containing several credential types that are tried in order. The issue may occur when the authentication flow reaches the `SharedTokenCacheCredential` type. | One strategy to resolve this is to exclude `SharedTokenCacheCredential` from your credential, as described in this [DefaultAzureCredential issue](https://github.com/Azure/azure-sdk/issues/1970) that is currently open against `Azure.Identity`. You can exclude `SharedTokenCacheCredential` from your credential by instantiating the `DefaultAzureCredential` class using the following optional parameter: `new DefaultAzureCredential(new DefaultAzureCredentialOptions { ExcludeSharedTokenCacheCredential = true });`<br>Another option is to change your application to use an earlier version of `Azure.Identity`, such as [version 1.2.3](https://www.nuget.org/packages/Azure.Identity/1.2.3). Using an earlier version has no functional impact to Azure Digital Twins, which makes it an accepted solution. |
## Next steps
digital-twins Troubleshoot Resource Health https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/troubleshoot-resource-health.md
description: Learn how to use Azure Resource Health to check the health of your Azure Digital Twins instance. Previously updated : 10/7/2021 Last updated : 02/28/2022
# Troubleshooting Azure Digital Twins: Resource health
-[Azure Service Health](../service-health/index.yml) is a suite of experiences that can help you diagnose and get support for service problems that affect your Azure resources. It contains **resource health**, **service health**, and **status** information, and reports on both current and past health information.
+[Azure Service Health](../service-health/index.yml) is a suite of experiences that can help you diagnose and get support for service problems that affect your Azure resources. It contains resource health, service health, and status information, and reports on both current and past health information.
## Use Azure Resource Health
digital-twins Tutorial Code https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/tutorial-code.md
description: Follow this tutorial to learn how to write the minimal code for an Azure Digital Twins client app, using the .NET (C#) SDK. Previously updated : 10/18/2021 Last updated : 02/24/2022
This Azure Digital Twins tutorial uses the command line for setup and project wo
What you need to begin: * Any code editor
-* **.NET Core 3.1** on your development machine. You can download this version of the .NET Core SDK for multiple platforms from [Download .NET Core 3.1](https://dotnet.microsoft.com/download/dotnet-core/3.1).
+* .NET Core 3.1 on your development machine. You can download this version of the .NET Core SDK for multiple platforms from [Download .NET Core 3.1](https://dotnet.microsoft.com/download/dotnet-core/3.1).
### Prepare an Azure Digital Twins instance
Open a command prompt or other console window on your machine, and create an emp
Navigate into the new directory.
-Once in the project directory, **create an empty .NET console app project**. In the command window, you can run the following command to create a minimal C# project for the console:
+Once in the project directory, create an empty .NET console app project. In the command window, you can run the following command to create a minimal C# project for the console:
```cmd/sh dotnet new console
This command will create several files inside your directory, including one call
Keep the command window open, as you'll continue to use it throughout the tutorial.
-Next, **add two dependencies to your project** that will be needed to work with Azure Digital Twins. The first is the package for the [Azure Digital Twins SDK for .NET](/dotnet/api/overview/azure/digitaltwins/client?view=azure-dotnet&preserve-view=true), the second provides tools to help with authentication against Azure.
+Next, add two dependencies to your project that will be needed to work with Azure Digital Twins. The first is the package for the [Azure Digital Twins SDK for .NET](/dotnet/api/overview/azure/digitaltwins/client?view=azure-dotnet&preserve-view=true), the second provides tools to help with authentication against Azure.
```cmd/sh dotnet add package Azure.DigitalTwins.Core
Next, you'll add code to this file to fill out some functionality.
The first thing your app will need to do is authenticate against the Azure Digital Twins service. Then, you can create a service client class to access the SDK functions.
-To authenticate, you need the *host name* of your Azure Digital Twins instance.
+To authenticate, you need the host name of your Azure Digital Twins instance.
In *Program.cs*, paste the following code below the "Hello, World!" printout line in the `Main` method.
-Set the value of `adtInstanceUrl` to your Azure Digital Twins instance *host name*.
+Set the value of `adtInstanceUrl` to your Azure Digital Twins instance host name.
:::code language="csharp" source="~/digital-twins-docs-samples/sdks/csharp/fullClientApp.cs" id="Authentication_code":::
dotnet run
``` This command will restore the dependencies on first run, and then execute the program.
-* If no error occurs, the program will print *Service client created - ready to go*.
+* If no error occurs, the program will print: "Service client created - ready to go".
* Since there isn't yet any error handling in this project, if there are any issues, you'll see an exception thrown by the code. + ### Upload a model
-Azure Digital Twins has no intrinsic domain vocabulary. The types of elements in your environment that you can represent in Azure Digital Twins are defined by you, using **models**. [Models](concepts-models.md) are similar to classes in object-oriented programming languages; they provide user-defined templates for [digital twins](concepts-twins-graph.md) to follow and instantiate later. They're written in a JSON-like language called **Digital Twins Definition Language (DTDL)**.
+Azure Digital Twins has no intrinsic domain vocabulary. The types of elements in your environment that you can represent in Azure Digital Twins are defined by you, using *models*. [Models](concepts-models.md) are similar to classes in object-oriented programming languages; they provide user-defined templates for [digital twins](concepts-twins-graph.md) to follow and instantiate later. They're written in a JSON-like language called *Digital Twins Definition Language (DTDL)*.
The first step in creating an Azure Digital Twins solution is defining at least one model in a DTDL file.
In the directory where you created your project, create a new .json file called
:::code language="json" source="~/digital-twins-docs-samples/models/SampleModel.json"::: > [!TIP]
-> If you're using Visual Studio for this tutorial, you may want to select the newly-created JSON file and set the *Copy to Output Directory* property in the Property inspector to *Copy if Newer* or *Copy Always*. This will enable Visual Studio to find the JSON file with the default path when you run the program with **F5** during the rest of the tutorial.
+> If you're using Visual Studio for this tutorial, you may want to select the newly-created JSON file and set the **Copy to Output Directory** property in the Property inspector to **Copy if Newer** or **Copy Always**. This will enable Visual Studio to find the JSON file with the default path when you run the program with F5 during the rest of the tutorial.
> [!TIP] > There is a language-agnostic [DTDL Validator sample](/samples/azure-samples/dtdl-validator/dtdl-validator) that you can use to check model documents to make sure the DTDL is valid. It is built on the DTDL parser library, which you can read more about in [Parse and validate models](how-to-parse-models.md).
To add a print statement showing all models that have been successfully uploaded
:::code language="csharp" source="~/digital-twins-docs-samples/sdks/csharp/fullClientApp.cs" id="Print_model":::
-**Before you run the program again to test this new code**, recall that the last time you ran the program, you uploaded your model already. Azure Digital Twins won't let you upload the same model twice, so if you attempt to upload the same model again, the program should throw an exception.
+Before you run the program again to test this new code, recall that the last time you ran the program, you uploaded your model already. Azure Digital Twins won't let you upload the same model twice, so if you attempt to upload the same model again, the program should throw an exception.
With this information in mind, run the program again with this command in your command window:
From this point forward, the tutorial will wrap all calls to service methods in
### Create digital twins
-Now that you've uploaded a model to Azure Digital Twins, you can use this model definition to create **digital twins**. [Digital twins](concepts-twins-graph.md) are instances of a model, and represent the entities within your business environmentΓÇöthings like sensors on a farm, rooms in a building, or lights in a car. This section creates a few digital twins based on the model you uploaded earlier.
+Now that you've uploaded a model to Azure Digital Twins, you can use this model definition to create *digital twins*. [Digital twins](concepts-twins-graph.md) are instances of a model, and represent the entities within your business environmentΓÇöthings like sensors on a farm, rooms in a building, or lights in a car. This section creates a few digital twins based on the model you uploaded earlier.
Add the following code to the end of the `Main` method to create and initialize three digital twins based on this model.
Notice that no error is thrown when the twins are created the second time, even
### Create relationships
-Next, you can create **relationships** between the twins you've created, to connect them into a **twin graph**. [Twin graphs](concepts-twins-graph.md) are used to represent your entire environment.
+Next, you can create *relationships* between the twins you've created, to connect them into a *twin graph*. [Twin graphs](concepts-twins-graph.md) are used to represent your entire environment.
-Add a **new static method** to the `Program` class, underneath the `Main` method (the code now has two methods):
+Add a new static method to the `Program` class, underneath the `Main` method (the code now has two methods):
:::code language="csharp" source="~/digital-twins-docs-samples/sdks/csharp/fullClientApp.cs" id="Create_relationship":::
Azure Digital Twins won't let you create a relationship if another relationship
The next code you'll add allows you to see the list of relationships you've created.
-Add the following **new method** to the `Program` class:
+Add the following new method to the `Program` class:
:::code language="csharp" source="~/digital-twins-docs-samples/sdks/csharp/fullClientApp.cs" id="List_relationships":::
At this point in the tutorial, you have a complete client app that can perform b
After completing this tutorial, you can choose which resources you want to remove, depending on what you want to do next.
-* **If you plan to continue to the next tutorial**, the instance used in this tutorial can be reused in the next one. You can keep the Azure Digital Twins resources you set up here and skip the rest of this section.
+* If you plan to continue to the next tutorial, the instance used in this tutorial can be reused in the next one. You can keep the Azure Digital Twins resources you set up here and skip the rest of this section.
[!INCLUDE [digital-twins-cleanup-clear-instance.md](../../includes/digital-twins-cleanup-clear-instance.md)]
digital-twins Tutorial Command Line App https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/tutorial-command-line-app.md
description: Tutorial to build an Azure Digital Twins scenario using a sample command-line application Previously updated : 9/1/2021 Last updated : 02/23/2022
[!INCLUDE [digital-twins-tutorial-selector.md](../../includes/digital-twins-tutorial-selector.md)]
-In this tutorial, you'll build a graph in Azure Digital Twins using models, twins, and relationships. The tool for this tutorial is the **sample command-line client application** for interacting with an Azure Digital Twins instance. The client app is similar to the one written in [Code a client app](tutorial-code.md).
+In this tutorial, you'll build a graph in Azure Digital Twins using models, twins, and relationships. The tool for this tutorial is the sample command-line client application for interacting with an Azure Digital Twins instance. The client app is similar to the one written in [Code a client app](tutorial-code.md).
You can use this sample to perform essential Azure Digital Twins actions such as uploading models, creating and modifying twins, and creating relationships. You can also look at the [code of the sample](https://github.com/Azure-Samples/digital-twins-samples/tree/master/) to learn about the Azure Digital Twins APIs, and practice implementing your own commands by modifying the sample project however you want.
Now that the Azure Digital Twins instance and sample app are set up, you can beg
The first step in creating an Azure Digital Twins solution is defining twin [models](concepts-models.md) for your environment.
-Models are similar to classes in object-oriented programming languages; they provide user-defined templates for [digital twins](concepts-twins-graph.md) to follow and instantiate later. They're written in a JSON-like language called **Digital Twins Definition Language (DTDL)**, and can define a twin's *properties*, *telemetry*, *relationships*, and *components*.
+Models are similar to classes in object-oriented programming languages; they provide user-defined templates for [digital twins](concepts-twins-graph.md) to follow and instantiate later. They're written in a JSON-like language called *Digital Twins Definition Language (DTDL)*, and can define a twin's properties, telemetry, relationships, and components.
> [!NOTE]
-> DTDL also allows for the definition of *commands* on digital twins. However, commands are not currently supported in the Azure Digital Twins service.
+> DTDL also allows for the definition of commands on digital twins. However, commands are not currently supported in the Azure Digital Twins service.
-In your Visual Studio window where the _**AdtE2ESample**_ project is open, use the *Solution Explorer* pane to navigate to the *AdtSampleApp\SampleClientApp\Models folder*. This folder contains sample models.
+In your Visual Studio window where the *AdtE2ESample.sln* project is open, use the **Solution Explorer** pane to navigate to the *AdtSampleApp\SampleClientApp\Models folder*. This folder contains sample models.
Select *Room.json* to open it in the editing window, and change it in the following ways:
You can also modify the properties of a twin you've created.
The output should indicate the twin was updated successfully.
-1. You can verify the update succeeded by running this command to see *room0*'s information:
+1. You can verify the update succeeded by running this command to see room0's information:
```cmd/sh GetDigitalTwin room0
You can also modify the properties of a twin you've created.
## Create a graph by adding relationships
-Next, you can create some **relationships** between these twins, to connect them into a [twin graph](concepts-twins-graph.md). Twin graphs are used to represent an entire environment.
+Next, you can create some relationships between these twins, to connect them into a [twin graph](concepts-twins-graph.md). Twin graphs are used to represent an entire environment.
-The types of relationships that you can create from one twin to another are defined within the [models](#model-a-physical-environment-with-dtdl) that you uploaded earlier. The [model definition for Floor](https://github.com/azure-Samples/digital-twins-samples/blob/master/AdtSampleApp/SampleClientApp/Models/Floor.json) specifies that floors can have a type of relationship called *contains*, which makes it possible to create a *contains*-type relationship from each Floor twin to the corresponding room that it contains.
+The types of relationships that you can create from one twin to another are defined within the [models](#model-a-physical-environment-with-dtdl) that you uploaded earlier. The [model definition for Floor](https://github.com/azure-Samples/digital-twins-samples/blob/master/AdtSampleApp/SampleClientApp/Models/Floor.json) specifies that floors can have a type of relationship called `contains`, which makes it possible to create a `contains`-type relationship from each Floor twin to the corresponding room that it contains.
To add a relationship, use the `CreateRelationship` command. Specify the twin that the relationship is coming from, the type of relationship, and the twin that the relationship is connecting to. Lastly, give the relationship a unique ID.
-1. Run the following code to add a "contains" relationship from each of the Floor twins you created earlier to a corresponding Room twin. The relationships are named relationship0 and relationship1.
+1. Run the following code to add a `contains` relationship from each of the Floor twins you created earlier to a corresponding Room twin. The relationships are named relationship0 and relationship1.
```cmd/sh CreateRelationship floor0 contains room0 relationship0
To add a relationship, use the `CreateRelationship` command. Specify the twin th
``` >[!TIP]
- >The *contains* relationship in the [Floor model](https://github.com/azure-Samples/digital-twins-samples/blob/master/AdtSampleApp/SampleClientApp/Models/Floor.json) was also defined with two string properties, `ownershipUser` and `ownershipDepartment`, so you can also provide arguments with the initial values for these when you create the relationships.
+ >The `contains` relationship in the [Floor model](https://github.com/azure-Samples/digital-twins-samples/blob/master/AdtSampleApp/SampleClientApp/Models/Floor.json) was also defined with two string properties, `ownershipUser` and `ownershipDepartment`, so you can also provide arguments with the initial values for these when you create the relationships.
> Here's an alternate version of the command above to create relationship0 that also specifies initial values for these properties: > ```cmd/sh > CreateRelationship floor0 contains room0 relationship0 ownershipUser string MyUser ownershipDepartment string myDepartment
A main feature of Azure Digital Twins is the ability to [query](concepts-query-l
Run the following commands in the running project console to answer some questions about the sample environment.
-1. **What are all the entities from my environment represented in Azure Digital Twins?** (query all)
+1. What are all the entities from my environment represented in Azure Digital Twins? (query all)
```cmd/sh Query
Run the following commands in the running project console to answer some questio
>[!TIP] >In the sample project, the command `Query` without any additional arguments is the equivalent of `Query SELECT * FROM DIGITALTWINS`. To query all the twins in your instance using the [Query APIs](/rest/api/digital-twins/dataplane/query) or the [CLI commands](/cli/azure/dt), use the longer (complete) query.
-1. **What are all the rooms in my environment?** (query by model)
+1. What are all the rooms in my environment? (query by model)
```cmd/sh Query SELECT * FROM DIGITALTWINS T WHERE IS_OF_MODEL(T, 'dtmi:example:Room;2') ```
- You can restrict your query to twins of a certain type, to get more specific information about what's represented. The result of this shows room0 and room1, but does **not** show floor0 or floor1 (since they're floors, not rooms).
+ You can restrict your query to twins of a certain type, to get more specific information about what's represented. The result of this shows room0 and room1, but doesn't show floor0 or floor1 (since they're floors, not rooms).
:::image type="content" source="media/tutorial-command-line/app/output-query-model.png" alt-text="Screenshot of the result from the model query, showing only room0 and room1.":::
-1. **What are all the rooms on *floor0*?** (query by relationship)
+1. What are all the rooms on floor0? (query by relationship)
```cmd/sh Query SELECT room FROM DIGITALTWINS floor JOIN room RELATED floor.contains where floor.$dtId = 'floor0'
Run the following commands in the running project console to answer some questio
:::image type="content" source="media/tutorial-command-line/app/output-query-relationship.png" alt-text="Screenshot of the result from the relationship query, showing room0.":::
-1. **What are all the twins in my environment with a temperature above 75?** (query by property)
+1. What are all the twins in my environment with a temperature above 75? (query by property)
```cmd/sh Query SELECT * FROM DigitalTwins T WHERE T.Temperature > 75
Run the following commands in the running project console to answer some questio
:::image type="content" source="media/tutorial-command-line/app/output-query-property.png" alt-text="Screenshot of the result from the property query, showing only room1.":::
-1. **What are all the rooms on *floor0* with a temperature above 75?** (compound query)
+1. What are all the rooms on floor0 with a temperature above 75? (compound query)
```cmd/sh Query SELECT room FROM DIGITALTWINS floor JOIN room RELATED floor.contains where floor.$dtId = 'floor0' AND IS_OF_MODEL(room, 'dtmi:example:Room;2') AND room.Temperature > 75
Run the following commands in the running project console to answer some questio
After completing this tutorial, you can choose which resources you want to remove, depending on what you want to do next.
-* **If you plan to continue to the next tutorial**, you can keep the resources you set up here to continue using this Azure Digital Twins instance and configured sample app for the next tutorial
+* If you plan to continue to the next tutorial, you can keep the resources you set up here to continue using this Azure Digital Twins instance and configured sample app for the next tutorial
-* **If you want to continue using the Azure Digital Twins instance, but clear out all of its models, twins, and relationships**, you can use the sample app's `DeleteAllTwins` and `DeleteAllModels` commands to clear the twins and models in your instance, respectively.
+* If you want to continue using the Azure Digital Twins instance, but clear out all of its models, twins, and relationships, you can use the sample app's `DeleteAllTwins` and `DeleteAllModels` commands to clear the twins and models in your instance, respectively.
[!INCLUDE [digital-twins-cleanup-basic.md](../../includes/digital-twins-cleanup-basic.md)]
digital-twins Tutorial Command Line Cli https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/tutorial-command-line-cli.md
description: Tutorial that shows how to build an Azure Digital Twins scenario using the Azure CLI Previously updated : 12/29/2021 Last updated : 02/25/2022
To get the files on your machine, use the navigation links above and copy the fi
### Prepare an Azure Digital Twins instance
-To work with Azure Digital Twins in this article, you first need to **set up an Azure Digital Twins instance** and the required permissions for using it. If you already have an Azure Digital Twins instance set up from previous work, you can use that instance.
+To work with Azure Digital Twins in this article, you first need to set up an Azure Digital Twins instance and the required permissions for using it. If you already have an Azure Digital Twins instance set up from previous work, you can use that instance.
Otherwise, follow the instructions in [Set up an instance and authentication](how-to-set-up-instance-cli.md#create-the-azure-digital-twins-instance). The instructions also contain steps to verify that you've completed each step successfully and are ready to move on to using your new instance. After you set up your Azure Digital Twins instance, make a note of the following values that you'll need to connect to the instance later:
-* The instance's **_host name_**
+* The instance's **host name**
* The **Azure subscription** that you used to create the instance. You can get both of these values for your instance in the output of the following Azure CLI command:
Now that the CLI and Azure Digital Twins instance are set up, you can begin buil
The first step in creating an Azure Digital Twins solution is defining twin [models](concepts-models.md) for your environment.
-Models are similar to classes in object-oriented programming languages; they provide user-defined templates for [digital twins](concepts-twins-graph.md) to follow and instantiate later. They're written in a JSON-like language called **Digital Twins Definition Language (DTDL)**, and can define a twin's *properties*, *telemetry*, *relationships*, and *components*.
+Models are similar to classes in object-oriented programming languages; they provide user-defined templates for [digital twins](concepts-twins-graph.md) to follow and instantiate later. They're written in a JSON-like language called *Digital Twins Definition Language (DTDL)*, and can define a twin's properties, telemetry, relationships, and components.
> [!NOTE]
-> DTDL also allows for the definition of *commands* on digital twins. However, commands are not currently supported in the Azure Digital Twins service.
+> DTDL also allows for the definition of commands on digital twins. However, commands are not currently supported in the Azure Digital Twins service.
Navigate on your machine to the *Room.json* file that you created in the [Prerequisites](#prerequisites) section. Open it in a code editor, and change it in the following ways:
To create a digital twin, you use the [az dt twin create](/cli/azure/dt/twin#az_
You can also modify the properties of a twin you've created.
-1. Run this [az dt twin update](/cli/azure/dt/twin#az_dt_twin_update) command to change *room0*'s RoomName from *Room0* to *PresidentialSuite*:
+1. Run this [az dt twin update](/cli/azure/dt/twin#az_dt_twin_update) command to change room0's RoomName from Room0 to PresidentialSuite:
```azurecli-interactive az dt twin update --dt-name <Azure-Digital-Twins-instance-name> --twin-id room0 --json-patch '{"op":"add", "path":"/RoomName", "value": "PresidentialSuite"}'
You can also modify the properties of a twin you've created.
## Create a graph by adding relationships
-Next, you can create some **relationships** between these twins, to connect them into a [twin graph](concepts-twins-graph.md). Twin graphs are used to represent an entire environment.
+Next, you can create some relationships between these twins, to connect them into a [twin graph](concepts-twins-graph.md). Twin graphs are used to represent an entire environment.
-The types of relationships that you can create from one twin to another are defined within the [models](#model-a-physical-environment-with-dtdl) that you uploaded earlier. The [model definition for Floor](https://github.com/azure-Samples/digital-twins-samples/blob/master/AdtSampleApp/SampleClientApp/Models/Floor.json) specifies that floors can have a type of relationship called *contains*. Since the model definition specifies this relationship, it's possible to create a *contains*-type relationship from each Floor twin to the corresponding room that it contains.
+The types of relationships that you can create from one twin to another are defined within the [models](#model-a-physical-environment-with-dtdl) that you uploaded earlier. The [model definition for Floor](https://github.com/azure-Samples/digital-twins-samples/blob/master/AdtSampleApp/SampleClientApp/Models/Floor.json) specifies that floors can have a type of relationship called `contains`. Since the model definition specifies this relationship, it's possible to create a `contains`-type relationship from each Floor twin to the corresponding room that it contains.
To add a relationship, use the [az dt twin relationship create](/cli/azure/dt/twin/relationship#az_dt_twin_relationship_create) command. Specify the twin that the relationship is coming from, the type of relationship, and the twin that the relationship is connecting to. Lastly, give the relationship a unique ID. If a relationship was defined to have properties, you can initialize the relationship properties in this command as well.
-1. Run the following code to add a *contains*-type relationship from each of the Floor twins you created earlier to the corresponding Room twin. The relationships are named relationship0 and relationship1.
+1. Run the following code to add a `contains`-type relationship from each of the Floor twins you created earlier to the corresponding Room twin. The relationships are named relationship0 and relationship1.
```azurecli-interactive az dt twin relationship create --dt-name <Azure-Digital-Twins-instance-name> --relationship-id relationship0 --relationship contains --twin-id floor0 --target room0
To add a relationship, use the [az dt twin relationship create](/cli/azure/dt/tw
``` >[!TIP]
- >The *contains* relationship in the [Floor model](https://github.com/azure-Samples/digital-twins-samples/blob/master/AdtSampleApp/SampleClientApp/Models/Floor.json) was also defined with two properties, `ownershipUser` and `ownershipDepartment`, so you can also provide arguments with the initial values for these when you create the relationships.
+ >The `contains` relationship in the [Floor model](https://github.com/azure-Samples/digital-twins-samples/blob/master/AdtSampleApp/SampleClientApp/Models/Floor.json) was also defined with two properties, `ownershipUser` and `ownershipDepartment`, so you can also provide arguments with the initial values for these when you create the relationships.
> To create a relationship with these properties initialized, add the `--properties` option to either of the above commands, like this: > ```azurecli-interactive > ... --properties '{"ownershipUser":"MyUser", "ownershipDepartment":"MyDepartment"}'
A main feature of Azure Digital Twins is the ability to [query](concepts-query-l
Run the following queries in the CLI to answer some questions about the sample environment.
-1. **What are all the entities from my environment represented in Azure Digital Twins?** (query all)
+1. What are all the entities from my environment represented in Azure Digital Twins? (query all)
```azurecli-interactive az dt twin query --dt-name <Azure-Digital-Twins-instance-name> --query-command "SELECT * FROM DIGITALTWINS"
Run the following queries in the CLI to answer some questions about the sample e
>[!TIP] >You may recognize that this is the same command you used in the [Create digital twins](#create-digital-twins) section earlier to find all the Azure Digital Twins in the instance.
-1. **What are all the rooms in my environment?** (query by model)
+1. What are all the rooms in my environment? (query by model)
```azurecli-interactive az dt twin query --dt-name <Azure-Digital-Twins-instance-name> --query-command "SELECT * FROM DIGITALTWINS T WHERE IS_OF_MODEL(T, 'dtmi:example:Room;2')" ```
- You can restrict your query to twins of a certain type, to get more specific information about what's represented. The result of this shows room0 and room1, but does **not** show floor0 or floor1 (since they're floors, not rooms).
+ You can restrict your query to twins of a certain type, to get more specific information about what's represented. The result of this shows room0 and room1, but doesn't show floor0 or floor1 (since they're floors, not rooms).
:::image type="content" source="media/tutorial-command-line/cli/output-query-model.png" alt-text="Screenshot of Cloud Shell showing result of model query, which includes only room0 and room1." lightbox="media/tutorial-command-line/cli/output-query-model.png":::
-1. **What are all the rooms on floor0?** (query by relationship)
+1. What are all the rooms on floor0? (query by relationship)
```azurecli-interactive az dt twin query --dt-name <Azure-Digital-Twins-instance-name> --query-command "SELECT room FROM DIGITALTWINS floor JOIN room RELATED floor.contains where floor.\$dtId = 'floor0'"
Run the following queries in the CLI to answer some questions about the sample e
> [!NOTE] >When using Cloud Shell to run a query with metadata fields like this one that begin with `$`, you should escape the `$` with a backslash to let Cloud Shell know it's not a variable and should be consumed as a literal in the query text. This is reflected in the screenshot above.
-1. **What are all the twins in my environment with a temperature above 75?** (query by property)
+1. What are all the twins in my environment with a temperature above 75? (query by property)
```azurecli-interactive az dt twin query --dt-name <Azure-Digital-Twins-instance-name> --query-command "SELECT * FROM DigitalTwins T WHERE T.Temperature > 75"
Run the following queries in the CLI to answer some questions about the sample e
:::image type="content" source="media/tutorial-command-line/cli/output-query-property.png" alt-text="Screenshot of Cloud Shell showing result of property query, which includes only room1." lightbox="media/tutorial-command-line/cli/output-query-property.png":::
-1. **What are all the rooms on *floor0* with a temperature above 75?** (compound query)
+1. What are all the rooms on floor0 with a temperature above 75? (compound query)
```azurecli-interactive az dt twin query --dt-name <Azure-Digital-Twins-instance-name> --query-command "SELECT room FROM DIGITALTWINS floor JOIN room RELATED floor.contains where floor.\$dtId = 'floor0' AND IS_OF_MODEL(room, 'dtmi:example:Room;2') AND room.Temperature > 75"
Run the following queries in the CLI to answer some questions about the sample e
After completing this tutorial, you can choose which resources you want to remove, depending on what you want to do next.
-* **If you plan to continue to the next tutorial**, you can keep the resources you set up here and reuse the Azure Digital Twins instance without clearing anything in between.
+* If you plan to continue to the next tutorial, you can keep the resources you set up here and reuse the Azure Digital Twins instance without clearing anything in between.
-* **If you want to continue using the Azure Digital Twins instance, but clear out all of its models, twins, and relationships**, you can use the [az dt twin relationship delete](/cli/azure/dt/twin/relationship#az_dt_twin_relationship_delete), [az dt twin delete](/cli/azure/dt/twin#az_dt_twin_delete), and [az dt model delete](/cli/azure/dt/model#az_dt_model_delete) commands to clear the relationships, twins, and models in your instance, respectively.
+* If you want to continue using the Azure Digital Twins instance, but clear out all of its models, twins, and relationships, you can use the [az dt twin relationship delete](/cli/azure/dt/twin/relationship#az_dt_twin_relationship_delete), [az dt twin delete](/cli/azure/dt/twin#az_dt_twin_delete), and [az dt model delete](/cli/azure/dt/model#az_dt_model_delete) commands to clear the relationships, twins, and models in your instance, respectively.
[!INCLUDE [digital-twins-cleanup-basic.md](../../includes/digital-twins-cleanup-basic.md)]
digital-twins Tutorial End To End https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/digital-twins/tutorial-end-to-end.md
description: Follow this tutorial to learn how to build out an end-to-end Azure Digital Twins solution that's driven by device data. Previously updated : 10/19/2021 Last updated : 02/25/2022
In this tutorial, you will...
> * Set up an Azure Digital Twins instance > * Learn about the sample building scenario and instantiate the pre-written components > * Use an [Azure Functions](../azure-functions/functions-overview.md) app to route simulated telemetry from an [IoT Hub](../iot-hub/about-iot-hub.md) device into digital twin properties
-> * Propagate changes through the **twin graph**, by processing digital twin notifications with Azure Functions, endpoints, and routes
+> * Propagate changes through the twin graph by processing digital twin notifications with Azure Functions, endpoints, and routes
[!INCLUDE [Azure Digital Twins tutorial: sample prerequisites](../../includes/digital-twins-tutorial-sample-prereqs.md)]
In this tutorial, you will...
## Get started with the building scenario
-The sample project used in this tutorial represents a real-world **building scenario**, containing a floor, a room, and a thermostat device. These components will be digitally represented in an Azure Digital Twins instance, which will then be connected to [IoT Hub](../iot-hub/about-iot-hub.md), [Event Grid](../event-grid/overview.md), and two [Azure functions](../azure-functions/functions-overview.md) to enable movement of data.
+The sample project used in this tutorial represents a real-world building scenario, containing a floor, a room, and a thermostat device. These components will be digitally represented in an Azure Digital Twins instance, which will then be connected to [IoT Hub](../iot-hub/about-iot-hub.md), [Event Grid](../event-grid/overview.md), and two [Azure functions](../azure-functions/functions-overview.md) to enable movement of data.
Below is a diagram representing the full scenario.
You'll first create the Azure Digital Twins instance (**section A** in the diagr
To work through the scenario, you'll interact with components of the pre-written sample app you downloaded earlier.
-Here are the components implemented by the building scenario *AdtSampleApp* sample app:
+Here are the components implemented by the building scenario AdtSampleApp sample app:
* Device authentication * [.NET (C#) SDK](/dotnet/api/overview/azure/digitaltwins/client?view=azure-dotnet&preserve-view=true) usage examples (found in *CommandLoop.cs*) * Console interface to call the Azure Digital Twins API
-* *SampleClientApp* - A sample Azure Digital Twins solution
-* *SampleFunctionsApp* - An Azure Functions app that updates your Azure Digital Twins graph based on telemetry from IoT Hub and Azure Digital Twins events
+* SampleClientApp - A sample Azure Digital Twins solution
+* SampleFunctionsApp - An Azure Functions app that updates your Azure Digital Twins graph based on telemetry from IoT Hub and Azure Digital Twins events
### Instantiate the pre-created twin graph
-First, you'll use the *AdtSampleApp* solution from the sample project to build the Azure Digital Twins piece of the end-to-end scenario (**section A**):
+First, you'll use the AdtSampleApp solution from the sample project to build the Azure Digital Twins piece of the end-to-end scenario (**section A**):
:::image type="content" source="media/tutorial-end-to-end/building-scenario-a.png" alt-text="Diagram of an excerpt from the full building scenario diagram highlighting the Azure Digital Twins instance section.":::
-In your Visual Studio window where the _**AdtE2ESample**_ project is open, run the project with this button in the toolbar:
+In your Visual Studio window where the *AdtE2ESample.sln* solution is open, run the SampleClientApp project with this button in the toolbar:
:::image type="content" source="media/tutorial-end-to-end/start-button-sample.png" alt-text="Screenshot of the Visual Studio start button with the SampleClientApp project open.":::
You can now stop running the project. Keep the solution open in Visual Studio, t
## Set up the sample function app
-The next step is setting up an [Azure Functions app](../azure-functions/functions-overview.md) that will be used throughout this tutorial to process data. The function app, *SampleFunctionsApp*, contains two functions:
+The next step is setting up an [Azure Functions app](../azure-functions/functions-overview.md) that will be used throughout this tutorial to process data. The function app, SampleFunctionsApp, contains two functions:
* *ProcessHubToDTEvents*: processes incoming IoT Hub data and updates Azure Digital Twins accordingly * *ProcessDTRoutedData*: processes data from digital twins, and updates the parent twins in Azure Digital Twins accordingly In this section, you'll publish the pre-written function app, and ensure the function app can access Azure Digital Twins by assigning it an Azure Active Directory (Azure AD) identity. Completing these steps will allow the rest of the tutorial to use the functions inside the function app.
-Back in your Visual Studio window where the _**AdtE2ESample**_ project is open, the function app is located in the _**SampleFunctionsApp**_ project file. You can view it in the *Solution Explorer* pane.
+Back in your Visual Studio window where the *AdtE2ESample.sln* solution is open, the function app is located in the SampleFunctionsApp project. You can view it in the **Solution Explorer** pane.
### Update dependencies Before publishing the app, it's a good idea to make sure your dependencies are up to date, making sure you have the latest version of all the included packages.
-In the *Solution Explorer* pane, expand _**SampleFunctionsApp** > Dependencies_. Right-select *Packages* and choose *Manage NuGet Packages...*.
+In the **Solution Explorer** pane, expand **SampleFunctionsApp > Dependencies**. Right-select **Packages** and choose **Manage NuGet Packages...**.
:::image type="content" source="media/tutorial-end-to-end/update-dependencies-1.png" alt-text="Screenshot of Visual Studio showing the 'Manage NuGet Packages' menu button for the SampleFunctionsApp project." border="false":::
-Doing so will open the NuGet Package Manager. Select the *Updates* tab and if there are any packages to be updated, check the box to *Select all packages*. Then select *Update*.
+Doing so will open the NuGet Package Manager. Select the **Updates** tab and if there are any packages to be updated, check the box to **Select all packages**. Then select **Update**.
:::image type="content" source="media/tutorial-end-to-end/update-dependencies-2.png" alt-text="Screenshot of Visual Studio showing how to selecting to update all packages in the NuGet Package Manager.":::
Doing so will open the NuGet Package Manager. Select the *Updates* tab and if th
To publish the function app to Azure, you'll first need to create a storage account, then create the function app in Azure, and finally publish the functions to the Azure function app. This section completes these actions using the Azure CLI.
-1. Create an **Azure storage account** by running the following command:
+1. Create an Azure storage account by running the following command:
```azurecli-interactive az storage account create --name <name-for-new-storage-account> --location <location> --resource-group <resource-group> --sku Standard_LRS ```
-1. Create an **Azure function app** by running the following command:
+1. Create an Azure function app by running the following command:
```azurecli-interactive az functionapp create --name <name-for-new-function-app> --storage-account <name-of-storage-account-from-previous-step> --consumption-plan-location <location> --runtime dotnet --resource-group <resource-group> ```
-1. Next, you'll **zip** up the functions and **publish** them to your new Azure function app.
+1. Next, you'll zip up the functions and publish them to your new Azure function app.
1. Open a terminal like PowerShell on your local machine, and navigate to the [Digital Twins samples repo](https://github.com/azure-samples/digital-twins-samples/tree/master/) you downloaded earlier in the tutorial. Inside the downloaded repo folder, navigate to *digital-twins-samples-master\AdtSampleApp\SampleFunctionsApp*.
To publish the function app to Azure, you'll first need to create a storage acco
Compress-Archive -Path <full-path-to-publish-directory>\* -DestinationPath .\publish.zip ```
- The cmdlet will create a **publish.zip** file in the directory location of your terminal that includes a *host.json* file, as well as *bin*, *ProcessDTRoutedData*, and *ProcessHubToDTEvents* directories.
+ The cmdlet will create a *publish.zip* file in the directory location of your terminal that includes a *host.json* file, as well as *bin*, *ProcessDTRoutedData*, and *ProcessHubToDTEvents* directories.
If you're not using PowerShell and don't have access to the `Compress-Archive` cmdlet, you'll need to zip up the files using the File Explorer or another method.
The result of this command is outputted information about the role assignment yo
#### Configure application settings
-The second setting creates an **environment variable** for the function with the URL of your Azure Digital Twins instance. The function code will use the value of this variable to refer to your instance. For more information about environment variables, see [Manage your function app](../azure-functions/functions-how-to-use-azure-function-app-settings.md?tabs=portal).
+The second setting creates an environment variable for the function with the URL of your Azure Digital Twins instance. The function code will use the value of this variable to refer to your instance. For more information about environment variables, see [Manage your function app](../azure-functions/functions-how-to-use-azure-function-app-settings.md?tabs=portal).
Run the command below, filling in the placeholders with the details of your resources.
Run the command below, filling in the placeholders with the details of your reso
az functionapp config appsettings set --resource-group <your-resource-group> --name <your-function-app-name> --settings "ADT_SERVICE_URL=https://<your-Azure-Digital-Twins-instance-host-name>" ```
-The output is the list of settings for the Azure Function, which should now contain an entry called **ADT_SERVICE_URL**.
+The output is the list of settings for the Azure Function, which should now contain an entry called `ADT_SERVICE_URL`.
## Process simulated telemetry from an IoT Hub device
Save the **name** that you gave to your IoT hub. You'll use it later.
Next, connect your IoT hub to the *ProcessHubToDTEvents* Azure function in the function app you published earlier, so that data can flow from the device in IoT Hub through the function, which updates Azure Digital Twins.
-To do so, you'll create an **Event Subscription** on your IoT Hub, with the Azure function as an endpoint. This "subscribes" the function to events happening in IoT Hub.
+To do so, you'll create an *Event Subscription* on your IoT Hub, with the Azure function as an endpoint. This "subscribes" the function to events happening in IoT Hub.
-In the [Azure portal](https://portal.azure.com/), navigate to your newly created IoT hub by searching for its name in the top search bar. Select *Events* from the hub menu, and select *+ Event Subscription*.
+In the [Azure portal](https://portal.azure.com/), navigate to your newly created IoT hub by searching for its name in the top search bar. Select **Events** from the hub menu, and select **+ Event Subscription**.
:::image type="content" source="media/tutorial-end-to-end/event-subscription-1.png" alt-text="Screenshot of the Azure portal showing the IoT Hub event subscription.":::
-Selecting this option will bring up the *Create Event Subscription* page.
+Selecting this option will bring up the **Create Event Subscription** page.
:::image type="content" source="media/tutorial-end-to-end/event-subscription-2.png" alt-text="Screenshot of the Azure portal showing how to create an event subscription."::: Fill in the fields as follows (fields filled by default aren't mentioned):
-* *EVENT SUBSCRIPTION DETAILS* > **Name**: Give a name to your event subscription.
-* *TOPIC DETAILS* > **System Topic Name**: Give a name to use for the system topic.
-* *EVENT TYPES* > **Filter to Event Types**: Select *Device Telemetry* from the menu options.
-* *ENDPOINT DETAILS* > **Endpoint Type**: Select *Azure Function* from the menu options.
-* *ENDPOINT DETAILS* > **Endpoint**: Select the *Select an endpoint* link, which will open a *Select Azure Function* window:
+* **EVENT SUBSCRIPTION DETAILS** > **Name**: Give a name to your event subscription.
+* **TOPIC DETAILS** > **System Topic Name**: Give a name to use for the system topic.
+* **EVENT TYPES** > **Filter to Event Types**: Select **Device Telemetry** from the menu options.
+* **ENDPOINT DETAILS** > **Endpoint Type**: Select **Azure Function** from the menu options.
+* **ENDPOINT DETAILS** > **Endpoint**: Select the **Select an endpoint** link, which will open a **Select Azure Function** window:
:::image type="content" source="media/tutorial-end-to-end/event-subscription-3.png" alt-text="Screenshot of the Azure portal event subscription showing the window to select an Azure function." border="false":::
- - Fill in your **Subscription**, **Resource group**, **Function app**, and **Function** (*ProcessHubToDTEvents*). Some of these values may auto-populate after selecting the subscription.
+ - Fill in your **Subscription**, **Resource group**, **Function app**, and **Function** (**ProcessHubToDTEvents**). Some of these values may auto-populate after selecting the subscription.
- Select **Confirm Selection**.
-Back on the *Create Event Subscription* page, select **Create**.
+Back on the **Create Event Subscription** page, select **Create**.
### Register the simulated device with IoT Hub
The output is information about the device that was created.
Next, configure the device simulator to send data to your IoT Hub instance.
-Begin by getting the *IoT hub connection string* with this command:
+Begin by getting the IoT hub connection string with this command:
```azurecli-interactive az iot hub connection-string show --hub-name <your-IoT-hub-name> ```
-Then, get the *device connection string* with this command:
+Then, get the device connection string with this command:
```azurecli-interactive az iot hub device-identity connection-string show --device-id thermostat67 --hub-name <your-IoT-hub-name>
az iot hub device-identity connection-string show --device-id thermostat67 --hub
You'll plug these values into the device simulator code in your local project to connect the simulator into this IoT hub and IoT hub device.
-In a new Visual Studio window, open (from the downloaded solution folder) _Device Simulator > **DeviceSimulator.sln**_.
+In a new Visual Studio window, open (from the downloaded solution folder) *DeviceSimulator* > **DeviceSimulator.sln**.
>[!NOTE]
-> You should now have two Visual Studio windows, one with _**DeviceSimulator.sln**_ and one from earlier with _**AdtE2ESample.sln**_.
+> You should now have two Visual Studio windows, one with *DeviceSimulator.sln* and one from earlier with *AdtE2ESample.sln*.
-From the *Solution Explorer* pane in this new Visual Studio window, select _DeviceSimulator/**AzureIoTHub.cs**_ to open it in the editing window. Change the following connection string values to the values you gathered above:
+From the **Solution Explorer** pane in this new Visual Studio window, select **DeviceSimulator > AzureIoTHub.cs** to open it in the editing window. Change the following connection string values to the values you gathered above:
```csharp iotHubConnectionString = <your-hub-connection-string>
You don't need to do anything else in this console, but leave it running while y
### See the results in Azure Digital Twins
-The *ProcessHubToDTEvents* function you published earlier listens to the IoT Hub data, and calls an Azure Digital Twins API to update the *Temperature* property on the thermostat67 twin.
+The *ProcessHubToDTEvents* function you published earlier listens to the IoT Hub data, and calls an Azure Digital Twins API to update the `Temperature` property on the thermostat67 twin.
-To see the data from the Azure Digital Twins side, go to your Visual Studio window where the _**AdtE2ESample**_ project is open and run the project.
+To see the data from the Azure Digital Twins side, go to your Visual Studio window where the *AdtE2ESample.sln* solution is open and run the SampleClientApp project.
In the project console window that opens, run the following command to get the temperatures being reported by the digital twin thermostat67:
In the project console window that opens, run the following command to get the t
ObserveProperties thermostat67 Temperature ```
-You should see the live updated temperatures *from your Azure Digital Twins instance* being logged to the console every two seconds.
+You should see the live updated temperatures from your Azure Digital Twins instance being logged to the console every two seconds.
>[!NOTE] > It may take a few seconds for the data from the device to propagate through to the twin. The first few temperature readings may show as 0 before data begins to arrive.
Here are the actions you'll complete to set up this data flow:
Next, subscribe the *ProcessDTRoutedData* Azure function to the event grid topic you created earlier, so that telemetry data can flow from the thermostat67 twin through the event grid topic to the function, which goes back into Azure Digital Twins and updates the room21 twin accordingly.
-To do so, you'll create an **Event Grid subscription** that sends data from the **event grid topic** that you created earlier to your *ProcessDTRoutedData* Azure function.
+To do so, you'll create an Event Grid subscription that sends data from the event grid topic that you created earlier to your *ProcessDTRoutedData* Azure function.
-In the [Azure portal](https://portal.azure.com/), navigate to your event grid topic by searching for its name in the top search bar. Select *+ Event Subscription*.
+In the [Azure portal](https://portal.azure.com/), navigate to your event grid topic by searching for its name in the top search bar. Select **+ Event Subscription**.
:::image type="content" source="media/tutorial-end-to-end/event-subscription-1b.png" alt-text="Screenshot of the Azure portal showing how to create an Event Grid event subscription.":::
-The steps to create this event subscription are similar to when you subscribed the first Azure function to IoT Hub earlier in this tutorial. This time, you don't need to specify *Device Telemetry* as the event type to listen for, and you'll connect to a different Azure function.
+The steps to create this event subscription are similar to when you subscribed the first Azure function to IoT Hub earlier in this tutorial. This time, you don't need to specify **Device Telemetry** as the event type to listen for, and you'll connect to a different Azure function.
-On the *Create Event Subscription* page, fill in the fields as follows (fields filled by default aren't mentioned):
-* *EVENT SUBSCRIPTION DETAILS* > **Name**: Give a name to your event subscription.
-* *ENDPOINT DETAILS* > **Endpoint Type**: Select *Azure Function* from the menu options.
-* *ENDPOINT DETAILS* > **Endpoint**: Select the *Select an endpoint* link, which will open a *Select Azure Function* window:
- - Fill in your **Subscription**, **Resource group**, **Function app**, and **Function** (*ProcessDTRoutedData*). Some of these values may auto-populate after selecting the subscription.
+On the **Create Event Subscription** page, fill in the fields as follows (fields filled by default aren't mentioned):
+* **EVENT SUBSCRIPTION DETAILS** > **Name**: Give a name to your event subscription.
+* **ENDPOINT DETAILS** > **Endpoint Type**: Select **Azure Function** from the menu options.
+* **ENDPOINT DETAILS** > **Endpoint**: Select the **Select an endpoint** link, which will open a **Select Azure Function** window:
+ - Fill in your **Subscription**, **Resource group**, **Function app**, and **Function** (**ProcessDTRoutedData**). Some of these values may auto-populate after selecting the subscription.
- Select **Confirm Selection**.
-Back on the *Create Event Subscription* page, select **Create**.
+Back on the **Create Event Subscription** page, select **Create**.
## Run the simulation and see the results Now, events should have the capability to flow from the simulated device into Azure Digital Twins, and through the Azure Digital Twins graph to update twins as appropriate. In this section, you'll run the device simulator again to kick off the full event flow you've set up, and query Azure Digital Twins to see the live results
-Go to your Visual Studio window where the _**DeviceSimulator**_ project is open, and run the project.
+Go to your Visual Studio window where the *DeviceSimulator.sln* solution is open, and run the DeviceSimulator project.
Like when you ran the device simulator earlier, a console window will open and display simulated temperature telemetry messages. These events are going through the flow you set up earlier to update the thermostat67 twin, and then going through the flow you set up recently to update the room21 twin to match.
Like when you ran the device simulator earlier, a console window will open and d
You don't need to do anything else in this console, but leave it running while you complete the next steps.
-To see the data from the Azure Digital Twins side, go to your Visual Studio window where the _**AdtE2ESample**_ project is open, and run the project.
+To see the data from the Azure Digital Twins side, go to your Visual Studio window where the *AdtE2ESample.sln* solution is open, and run the SampleClientApp project.
-In the project console window that opens, run the following command to get the temperatures being reported by **both** the digital twin thermostat67 and the digital twin room21.
+In the project console window that opens, run the following command to get the temperatures being reported by both the digital twin thermostat67 and the digital twin room21.
```cmd ObserveProperties thermostat67 Temperature room21 Temperature ```
-You should see the live updated temperatures *from your Azure Digital Twins instance* being logged to the console every two seconds. Notice that the temperature for room21 is being updated to match the updates to thermostat67.
+You should see the live updated temperatures from your Azure Digital Twins instance being logged to the console every two seconds. Notice that the temperature for room21 is being updated to match the updates to thermostat67.
:::image type="content" source="media/tutorial-end-to-end/console-digital-twins-telemetry-b.png" alt-text="Screenshot of the console output showing a log of temperature messages, from a thermostat and a room.":::
Once you've verified the live temperatures logging from your instance is working
Here's a review of the scenario that you built out in this tutorial. 1. An Azure Digital Twins instance digitally represents a floor, a room, and a thermostat (represented by **section A** in the diagram below)
-2. Simulated device telemetry is sent to IoT Hub, where the *ProcessHubToDTEvents* Azure function is listening for telemetry events. The *ProcessHubToDTEvents* Azure function uses the information in these events to set the *Temperature* property on thermostat67 (**arrow B** in the diagram).
-3. Property change events in Azure Digital Twins are routed to an event grid topic, where the *ProcessDTRoutedData* Azure function is listening for events. The *ProcessDTRoutedData* Azure function uses the information in these events to set the *Temperature* property on room21 (**arrow C** in the diagram).
+2. Simulated device telemetry is sent to IoT Hub, where the *ProcessHubToDTEvents* Azure function is listening for telemetry events. The *ProcessHubToDTEvents* Azure function uses the information in these events to set the `Temperature` property on thermostat67 (**arrow B** in the diagram).
+3. Property change events in Azure Digital Twins are routed to an event grid topic, where the *ProcessDTRoutedData* Azure function is listening for events. The *ProcessDTRoutedData* Azure function uses the information in these events to set the `Temperature` property on room21 (**arrow C** in the diagram).
:::image type="content" source="media/tutorial-end-to-end/building-scenario.png" alt-text="Diagram of the full building scenario, which shows the data flowing from a device into and out of Azure Digital Twins through various Azure services.":::
After completing this tutorial, you can choose which resources you want to remov
[!INCLUDE [digital-twins-cleanup-basic.md](../../includes/digital-twins-cleanup-basic.md)]
-* **If you want to continue using the Azure Digital Twins instance you set up in this article, but clear out some or all of its models, twins, and relationships**, you can use the [az dt](/cli/azure/dt) CLI commands to delete the elements you want to remove.
+* If you want to continue using the Azure Digital Twins instance you set up in this article, but clear out some or all of its models, twins, and relationships, you can use the [az dt](/cli/azure/dt) CLI commands to delete the elements you want to remove.
This option won't remove any of the other Azure resources created in this tutorial (IoT Hub, Azure Functions app, and so on). You can delete these individually using the [dt commands](/cli/azure/reference-index) appropriate for each resource type.
expressroute Expressroute Howto Macsec https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/expressroute/expressroute-howto-macsec.md
To start the configuration, sign in to your Azure account and select the subscri
```azurepowershell-interactive New-AzResourceGroup -Name "your_resource_group" -Location "resource_location"
- $keyVault = New-AzKeyVault -Name "your_key_vault_name" -ResourceGroupName "your_resource_group" -Location "resource_location" -EnableSoftDelete
+ $keyVault = New-AzKeyVault -Name "your_key_vault_name" -ResourceGroupName "your_resource_group" -Location "resource_location" -SoftDeleteRetentionInDays 90
``` If you already have a key vault or a resource group, you can reuse them. However, it is critical that you enable the [**soft-delete** feature](../key-vault/general/soft-delete-overview.md) on your existing key vault. If soft-delete is not enabled, you can use the following commands to enable it:
hdinsight Hdinsight Restrict Outbound Traffic https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/hdinsight/hdinsight-restrict-outbound-traffic.md
Create an application rule collection that allows the cluster to send and receiv
| Rule_2 | * | https:443 | login.windows.net | Allows Windows login activity | | Rule_3 | * | https:443 | login.microsoftonline.com | Allows Windows login activity | | Rule_4 | * | https:443 | storage_account_name.blob.core.windows.net | Replace `storage_account_name` with your actual storage account name. Make sure ["secure transfer required"](../storage/common/storage-require-secure-transfer.md) is enabled on the storage account. If you are using Private endpoint to access storage accounts, this step is not needed and storage traffic is not forwarded to the firewall.|
+ | Rule_5 | * | https:443 | azure.archive.ubuntu.com | Allows access to updates for security packages. |
:::image type="content" source="./media/hdinsight-restrict-outbound-traffic/hdinsight-restrict-outbound-traffic-add-app-rule-collection-details.png" alt-text="Title: Enter application rule collection details":::
Create the network rules to correctly configure your HDInsight cluster.
| Name | Protocol | Source Addresses | Service Tags | Destination Ports | Notes | | | | | | | |
- | Rule_5 | TCP | * | SQL | 1433 , 11000-11999 | If you are using the default sql servers provided by HDInsight, configure a network rule in the Service Tags section for SQL that will allow you to log and audit SQL traffic. Unless you configured Service Endpoints for SQL Server on the HDInsight subnet, which will bypass the firewall. If you are using custom SQL server for Ambari, Oozie, Ranger and Hive metastores then you only need to allow the traffic to your own custom SQL Servers. Refer to [Azure SQL Database and Azure Synapse Analytics connectivity architecture](../azure-sql/database/connectivity-architecture.md) to see why 11000-11999 port range is also needed in addition to 1433. |
- | Rule_6 | TCP | * | Azure Monitor | * | (optional) Customers who plan to use auto scale feature should add this rule. |
+ | Rule_6 | TCP | * | SQL | 1433 , 11000-11999 | If you are using the default sql servers provided by HDInsight, configure a network rule in the Service Tags section for SQL that will allow you to log and audit SQL traffic. Unless you configured Service Endpoints for SQL Server on the HDInsight subnet, which will bypass the firewall. If you are using custom SQL server for Ambari, Oozie, Ranger and Hive metastores then you only need to allow the traffic to your own custom SQL Servers. Refer to [Azure SQL Database and Azure Synapse Analytics connectivity architecture](../azure-sql/database/connectivity-architecture.md) to see why 11000-11999 port range is also needed in addition to 1433. |
+ | Rule_7 | TCP | * | Azure Monitor | * | (optional) Customers who plan to use auto scale feature should add this rule. |
:::image type="content" source="./media/hdinsight-restrict-outbound-traffic/hdinsight-restrict-outbound-traffic-add-network-rule-collection.png" alt-text="Title: Enter application rule collection":::
media-services Encode Recommended On Premises Live Encoders https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/media-services/latest/encode-recommended-on-premises-live-encoders.md
keywords: encoding;encoders;media
Previously updated : 02/17/2022 Last updated : 03/04/2022
When streaming via RTMPS, check firewall and/or proxy settings to confirm that o
- [GoPro](https://gopro.com/help/articles/block/getting-started-with-live-streaming) Hero 7 and Hero 8 - Haivision KB - Haivision Makito X HEVC-- [Restream.io](https://restream.io/)-- OBS Studio
+- [OBS Studio](https://obsproject.com/download)
- [Osprey Talon hardware encoders](https://www.ospreyvideo.com/talon-encoders), Talon 4K-SC, Talon UHD-SC-- [Streamlabs OBS](https://streamlabs.com/)
+- [Restream.io](https://restream.io/)
+- [Streamlabs](https://streamlabs.com/)
- [Switcher Studio (iOS)](https://www.switcherstudio.com/) - Telestream Wirecast (version 13.0.2 or higher due to the TLS 1.2 requirement) - Telestream Wirecast S (only RTMP is supported. No RTMPS support due to lack of TLS 1.2+)
purview Concept Best Practices Network https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/purview/concept-best-practices-network.md
Previously updated : 01/27/2022 Last updated : 03/04/2022 # Azure Purview network architecture and best practices
If you need to scan some data sources by using an ingestion private endpoint and
- You must create a credential in Azure Purview based on each secret that you create in Azure Key Vault. At minimum, assign _get_ and _list_ access for secrets for Azure Purview on the Key Vault resource in Azure. Otherwise, the credentials won't work in the Azure Purview account.
+## Self-hosted integration runtime network and proxy recommendations
+
+For scanning data sources across your on-premises and Azure networks, you may need to deploy and use one or multiple [self-hosted integration runtime virtual machines](manage-integration-runtimes.md) inside an Azure VNet or an on-premises network, for any of the scenarios mentioned earlier in this document.
+
+- To simplify management, when possible, use Azure runtime and [Azure Purview Managed runtime](catalog-managed-vnet.md) to scan Azure data sources.
+
+- The Self-hosted integration runtime service can communicate with Azure Purview through public or private network over port 443. For more information see, [self-hosted integration runtime networking requirements](manage-integration-runtimes.md#networking-requirements).
+
+- One self-hosted integration runtime VM can be used to scan one or multiple data sources in Azure Purview, however, self-hosted integration runtime must be only registered for Azure Purview and cannot be used for Azure Data Factory or Azure Synapse at the same time.
+
+- You can register and use one or multiple self-hosted integration runtime in one Azure Purview account. It is recommended to place at least one self-hosted integration runtime VM in each region or on-premises network where your data sources reside.
+
+- It is recommended to define a baseline for required capacity for each self-hosted integration runtime VM and scale the VM capacity based on demand.
+
+- It is recommended to setup network connection between self-hosted integration runtime VMs and Azure Purview and its managed resources through private network, when possible.
+
+- Allow outbound connectivity to download.microsoft.com, if auto-update is enabled.
+
+- The self-hosted integration runtime service does not require outbound internet connectivity, if self-hosted integration runtime VMs are deployed in an Azure VNet or in the on-premises network that is connected to Azure through an ExpressRoute or Site to Site VPN connection. In this case, the scan and metadata ingestion process can be done through private network.
+
+- Self-hosted integration runtime can communicate Azure Purview and its managed resources directly or through [a proxy server](manage-integration-runtimes.md#proxy-server-considerations). Avoid using proxy settings if self-hosted integration runtime VM is inside an Azure VNet or connected through ExpressRoute or Site to Site VPN connection.
+
+- Review supported scenarios, if you need to use self-hosted integration runtime with [proxy setting](manage-integration-runtimes.md#proxy-server-considerations).
+ ## Next steps - [Use private endpoints for secure access to Azure Purview](./catalog-private-link.md)
purview Register Scan Power Bi Tenant https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/purview/register-scan-power-bi-tenant.md
Previously updated : 02/02/2022 Last updated : 03/04/2022
This article outlines how to register a Power BI tenant, and how to authenticate
- You will need to be a Data Source Administrator and Data Reader to register a source and manage it in the Azure Purview Studio. See our [Azure Purview Permissions page](catalog-permissions.md) for details.
+- If delegated auth is used, make sure proper [Power BI license](/power-bi/admin/service-admin-licensing-organization#subscription-license-types) is assigned to Power BI admin user that is used for the scan.
+ - If self-hosted integration runtime is used: - Set up the latest [self-hosted integration runtime](https://www.microsoft.com/download/details.aspx?id=39717). The minimum required version is 5.14.8055.1. For more information, see[the create and configure a self-hosted integration runtime guide](manage-integration-runtimes.md). - Ensure [JDK 8 or later](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html), is installed on the virtual machine where the self-hosted integration runtime is installed.-
+
## Same Power BI tenant registration and scan ### Authentication options
To create and run a new scan, do the following:
1. Create a user account in Azure Active Directory tenant and assign the user to Azure Active Directory role, **Power BI Administrator**. Take note of username and login to change the password.
+3. Assign proper Power BI license to the user.
+ 2. Navigate to your Azure key vault. 3. Select **Settings** > **Secrets** and select **+ Generate/Import**.
To create and run a new scan, do the following:
5. If your key vault is not connected to Azure Purview yet, you will need to [create a new key vault connection](manage-credentials.md#create-azure-key-vaults-connections-in-your-azure-purview-account)
-6. Create an App Registration in your Azure Active Directory tenant. Take note of Client ID(App ID).
+6. Create an App Registration in your Azure Active Directory tenant. Provide a web URL in the **Redirect URI**. Take note of Client ID(App ID).
:::image type="content" source="media/setup-power-bi-scan-catalog-portal/power-bi-create-service-principle.png" alt-text="Screenshot how to create a Service principle.":::
-7. From Azure Active Directory dashboard, select newly created application and then select App registration. Assign the application the following delegated permissions and grant admin consent for the tenant:
+7. From Azure Active Directory dashboard, select newly created application and then select **App registration**. From **API Permissions**, assign the application the following delegated permissions and grant admin consent for the tenant:
- Power BI Service Tenant.Read.All - Microsoft Graph openid
+ - Microsoft Graph User.Read
:::image type="content" source="media/setup-power-bi-scan-catalog-portal/power-bi-delegated-permissions.png" alt-text="Screenshot of delegated permissions for Power BI Service and Microsoft Graph.":::
To create and run a new scan using Azure runtime, perform the following steps:
1. Create a user account in Azure Active Directory tenant where Power BI tenant is located and assign the user to Azure Active Directory role, **Power BI Administrator**. Take note of username and login to change the password.
+2. Assign proper Power BI license to the user.
+ 2. Navigate to your Azure key vault in the tenant where Azure Purview is created. 3. Select **Settings** > **Secrets** and select **+ Generate/Import**.
To create and run a new scan using Azure runtime, perform the following steps:
6. If your key vault is not connected to Azure Purview yet, you will need to [create a new key vault connection](manage-credentials.md#create-azure-key-vaults-connections-in-your-azure-purview-account)
-7. Create an App Registration in your Azure Active Directory tenant where Power BI is located. Take note of Client ID (App ID).
+7. Create an App Registration in your Azure Active Directory tenant where Power BI is located. Provide a web URL in the **Redirect URI**. Take note of Client ID(App ID).
:::image type="content" source="media/setup-power-bi-scan-catalog-portal/power-bi-create-service-principle.png" alt-text="Screenshot how to create a Service Principle.":::
To create and run a new scan using Azure runtime, perform the following steps:
- Power BI Service Tenant.Read.All - Microsoft Graph openid
+ - Microsoft Graph User.Read
:::image type="content" source="media/setup-power-bi-scan-catalog-portal/power-bi-delegated-permissions.png" alt-text="Screenshot of delegated permissions for Power BI Service and Microsoft Graph.":::
To create and run a new scan using Azure runtime, perform the following steps:
:::image type="content" source="media/setup-power-bi-scan-catalog-portal/power-bi-id-token-hybrid-flows.png" alt-text="Screenshot of ID token hybrid flows.":::
-In the Azure Purview Studio, navigate to the **Data map** in the left menu.
+11. Under **Advanced settings**, enable **Allow Public client flows**.
-9. Navigate to **Sources**.
+12. In the Azure Purview Studio, navigate to the **Data map** in the left menu. Navigate to **Sources**.
-10. Select the registered Power BI source from cross tenant.
+13. Select the registered Power BI source from cross tenant.
-11. Select **+ New scan**.
+14. Select **+ New scan**.
-12. Give your scan a name. Then select the option to include or exclude the personal workspaces.
+15. Give your scan a name. Then select the option to include or exclude the personal workspaces.
> [!Note] > Switching the configuration of a scan to include or exclude a personal workspace will trigger a full scan of PowerBI source.
-13. Select **Azure AutoResolveIntegrationRuntime** from the drop-down list.
+16. Select **Azure AutoResolveIntegrationRuntime** from the drop-down list.
:::image type="content" source="media/setup-power-bi-scan-catalog-portal/power-bi-scan-cross-tenant.png" alt-text="Image showing Power BI scan setup using Azure IR for cross tenant.":::
-14. For the **Credential**, select **Delegated authentication** and click **+ New** to create a new credential.
-
- :::image type="content" source="media/setup-power-bi-scan-catalog-portal/power-bi-scan-shir.png" alt-text="Image showing Power BI scan setup using SHIR.":::
-
-15. Create a new credential and provide required parameters:
+17. For the **Credential**, select **Delegated authentication** and click **+ New** to create a new credential.
+
+18. Create a new credential and provide required parameters:
- **Name**: Provide a unique name for credential.
In the Azure Purview Studio, navigate to the **Data map** in the left menu.
:::image type="content" source="media/setup-power-bi-scan-catalog-portal/power-bi-scan-delegated-authentication.png" alt-text="Image showing Power BI scan setup using Delegated authentication.":::
-16. Select **Test Connection** before continuing to next steps. If **Test Connection** failed, select **View Report** to see the detailed status and troubleshoot the problem
- 1. Access - Failed status means the user authentication failed. Scans using managed identity will always pass because no user authentication required.
- 2. Assets (+ lineage) - Failed status means the Azure Purview - Power BI authorization has failed. Make sure the Azure Purview managed identity is added to the security group associated in Power BI admin portal.
- 3. Detailed metadata (Enhanced) - Failed status means the Power BI admin portal is disabled for the following setting - **Enhance admin APIs responses with detailed metadata**
+19. Select **Test Connection** before continuing to next steps.
:::image type="content" source="media/setup-power-bi-scan-catalog-portal/power-bi-scan-cross-tenant-test.png" alt-text="Screenshot of test connection status.":::
-17. Set up a scan trigger. Your options are **Recurring**, and **Once**.
+ If **Test Connection** failed, select **View Report** to see the detailed status and troubleshoot the problem:
+
+ 1. Access - Failed status means the user authentication failed: Validate if username and password is correct. review if the Credential contains correct Client (App) ID from the App Registration.
+ 2. Assets (+ lineage) - Failed status means the Azure Purview - Power BI authorization has failed. Make sure the user is added to Power BI Administrator role and has proper Power BI license assigned to.
+ 3. Detailed metadata (Enhanced) - Failed status means the Power BI admin portal is disabled for the following setting - **Enhance admin APIs responses with detailed metadata**
+
+20. Set up a scan trigger. Your options are **Recurring**, and **Once**.
:::image type="content" source="media/setup-power-bi-scan-catalog-portal/scan-trigger.png" alt-text="Screenshot of the Azure Purview scan scheduler.":::
In the Azure Purview Studio, navigate to the **Data map** in the left menu.
:::image type="content" source="media/setup-power-bi-scan-catalog-portal/save-run-power-bi-scan.png" alt-text="Screenshot of Save and run Power BI source.":::
+## Troubleshooting tips
+
+If delegated auth is used:
+- Check your key vault. Make sure there are no typos in the password.
+- Assign proper [Power BI license](/power-bi/admin/service-admin-licensing-organization#subscription-license-types) to Power BI administrator user.
+- Validate if user is assigned to Power BI Administrator role.
+- If user is recently created, make sure password is reset successfully and user can successfully initiate the session.
+ ## Next steps Now that you have registered your source, follow the below guides to learn more about Azure Purview and your data.
security Ransomware Protection With Azure Firewall https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/security/fundamentals/ransomware-protection-with-azure-firewall.md
+
+ Title: Improve your security defenses for ransomware attacks with Azure Firewall Premium
+description: In this article, you learn how Azure Firewall Premium can help you protect against ransomware.
+
+documentationcenter: na
+++
+ms.assetid: 9dcb190e-e534-4787-bf82-8ce73bf47dba
+++
+ na
+ Last updated : 02/24/2022++
+# Improve your security defenses for ransomware attacks with Azure Firewall Premium
+In this article, you learn how Azure Firewall Premium can help you protect against ransomware.
+
+## What is ransomware?
+Ransomware is a type of malicious software designed to block access to your computer system until a sum of money is paid. The attacker usually exploits an existing vulnerability in your system to penetrate your network and execute the malicious software on the target host.
+
+Ransomware is often spread through phishing emails that contain malicious attachments or through drive-by downloading. Drive-by downloading occurs when a user unknowingly visits an infected website and then malware is downloaded and installed without the userΓÇÖs knowledge.
+
+## Protect from network malicious activity
+A network intrusion detection and prevention system (IDPS) allows you to monitor your network for malicious activity, log information about this activity, report it, and optionally attempt to block it.
+
+[Azure Firewall Premium](../../firewall/premium-features.md#idps) provides signature-based IDPS where every packet is inspected thoroughly, including all its headers and payload, to identify a malicious activity and to prevent it from penetrating into your network.
+
+The IDPS signatures are applicable for both application and network level traffic (Layers 4-7), fully managed, and contain more than 65,000 signatures in over 50 different categories. To keep them (the IDPS signatures?) up to date with the dynamic ever-changing attack landscape:
+
+- Azure Firewall has early access to vulnerability information from [Microsoft Active Protections Program](https://www.microsoft.com/msrc/mapp) (MAPP) and [Microsoft Security Response Center](https://www.microsoft.com/msrc/) (MSRC).
+- Azure Firewall releases 30 to 50 new signatures each day.
+
+Today, modern encryption (SSL/TLS) is used globally to secure Internet traffic. Attackers use encryption to carry their malicious software into the victimΓÇÖs network. Therefore, customers must inspect their encrypted traffic just like any other traffic.
+
+Azure Firewall Premium IDPS allows you to detect attacks in all ports and protocols for non-encrypted traffic. However, when HTTPS traffic needs to be inspected, Azure Firewall can use its TLS inspection capability to decrypt the traffic and accurately detect malicious activities.
+
+After the ransomware is installed on the target machine, it may try to encrypt the machineΓÇÖs data. The ransomware requires an encryption key and may use the Command and Control (C&C) to get the encryption key from the C&C server hosted by the attacker. CryptoLocker, WannaCry, TeslaCrypt, Cerber, and Locky are some of the ransomwares using C&C to fetch the required encryption keys.
+
+Azure Firewall Premium has hundreds of signatures that are designed to detect C&C connectivity and block it to prevent the attacker from encrypting your data. The following diagram shows Azure Firewall protection against a ransomware attack using the C&C channel.
+
+![Firewall protection against ransomware attack using command and control channel](./media/ransomware-protection-with-azure-firewall/ransomware-protection.png)
+
+## Fend off ransomware attacks
+A holistic approach to fend off ransomware attacks is recommended. Azure Firewall operates in a default deny mode and blocks access unless explicitly allowed by the administrator. Enabling the Threat Intelligence (TI) feature in alert/deny mode blocks access to known malicious IPs and domains. Microsoft Threat Intel feed is updated continuously based on new and emerging threats.
+
+Firewall Policy can be used for centralized configuration of firewalls. This helps with responding to threats rapidly. Customers can enable Threat Intel and IDPS across multiple firewalls with just a few clicks. Web categories lets administrators allow or deny user access to web categories such as gambling websites, social media websites, and others. URL filtering provides scoped access to external sites and can cut down risk even further. In other words, Azure Firewall has everything necessary for companies to defend comprehensively against malware and ransomware.
+
+Detection is equally important as prevention. Azure Firewall solution for Azure Sentinel gets you both detection and prevention in the form of an easy-to-deploy solution. Combining prevention and detection allows you to ensure that you both prevent sophisticated threats when you can, while also maintaining an ΓÇ£assume breach mentalityΓÇ¥ to detect and quickly respond to cyberattacks.
+
+## Next steps
+See [Ransomware protection in Azure](ransomware-protection.md) to learn more about defenses for ransomware attacks in Azure and for guidance on how to proactively protect your assets.
+
+To learn more about Azure Firewall Premium, see:
+
+- [Azure Firewall Premium features](../../firewall/premium-features.md)
+- [Optimize security with Azure Firewall solution for Azure Sentinel](https://www.microsoft.com/security/blog/2021/06/08/optimize-security-with-azure-firewall-solution-for-azure-sentinel/)
sentinel Normalization About Schemas https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/sentinel/normalization-about-schemas.md
Each schema field has a type. Some have built-in, Log Analytics types, such as `
|<a name="hostname"></a>**Hostname** | String | A hostname which is not an FQDN, includes up to 63 characters including letters, numbers and hyphens. For more information, see [The Device entity](#the-device-entity).| |<a name="domaintype"></a>**DomainType** | Enumerated | The type of domain stored in domain and FQDN fields. Supported values include `FQDN` and `Windows`. For more information, see [The Device entity](#the-device-entity). | |<a name="dvcidtype"></a>**DvcIdType** | Enumerated | The type of the device ID stored in DvcId fields. Supported values include `AzureResourceId`, `MDEid`, `MD4IoTid`, `VMConnectionId`, `AwsVpcId`, and `Other`. For more information, see [The Device entity](#the-device-entity). |
-|<a name="devicetype"></a>**DeviceType** | Enumerated | The type of the device stored in DeviceType fields. For a list of allowed values and further information refer to [DeviceType](#devicetype). |
+|<a name="devicetype"></a>**DeviceType** | Enumerated | The type of the device stored in DeviceType fields. Possible values include:<br>- `Computer`<br>- `Mobile Device`<br>- `IOT Device`<br>- `Other`. For more information, see [The Device entity](#the-device-entity). |
|<a name="username"></a>**Username** | String | A valid username in one of the supported [types](#usernametype). For more information, see [The User entity](#the-user-entity). | |<a name="usernametype"></a>**UsernameType** | Enumerated | The type of username stored in username fields. Supported values include `UPN`, `Windows`, `DN`, `Simple`, and `Unknown`. For more information, see [The User entity](#the-user-entity). | |<a name="useridtype"></a>**UserIdType** | Enumerated | The type of the ID stored in user ID fields. <br><br>Supported values are `SID`, `UIS`, `AADID`, `OktaId`, and `AWSId`. For more information, see [The User entity](#the-user-entity). |
The following fields are defined by ASIM for all schemas:
||-||--| | **EventMessage** | Optional | String | A general message or description, either included in or generated from the record. | | **EventCount** | Mandatory | Integer | The number of events described by the record. <br><br>This value is used when the source supports aggregation, and a single record might represent multiple events. <br><br>For other sources, set to `1`. |
-| **EventStartTime** | Mandatory | Date/time | If the source supports aggregation and the record represents multiple events, this field specifies the time that the first event was generated. <br><br>Otherwise, this field aliases the [TimeGenerated](#timegenerated) field. |
-| **EventEndTime** | Mandatory | Alias | Alias to the [TimeGenerated](#timegenerated) field. |
+| **EventStartTime** | Mandatory | Date/time | The time in which the event started. If the source supports aggregation and the record represents multiple events, the time that the first event was generated. If not provided by the source record, this field aliases the [TimeGenerated](#timegenerated) field. |
+| **EventEndTime** | Mandatory | Date/time | The time in which the event ended. If the source supports aggregation and the record represents multiple events, the time that the last event was generated. If not provided by the source record, this field aliases the [TimeGenerated](#timegenerated) field. |
| <a name="eventtype"></a>**EventType** | Mandatory | Enumerated | Describes the operation reported by the record. Each schema documents the list of values valid for this field. The original, source specific, value is stored in the [EventOriginalType](#eventoriginaltype) field. | | <a name="eventsubtype"></a>**EventSubType** | Optional | Enumerated | Describes a subdivision of the operation reported in the [EventType](#eventtype) field. Each schema documents the list of values valid for this field. The original, source specific, value is stored in the [EventOriginalSubType](#eventoriginalsubtype) field. | | <a name="eventresult"></a>**EventResult** | Mandatory | Enumerated | One of the following values: **Success**, **Partial**, **Failure**, **NA** (Not Applicable).<br> <br>The value might be provided in the source record by using different terms, which should be normalized to these values. Alternatively, the source might provide only the [EventResultDetails](#eventresultdetails) field, which should be analyzed to derive the EventResult value.<br><br>Example: `Success`|
site-recovery Azure To Azure Common Questions https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/site-recovery/azure-to-azure-common-questions.md
When you enable replication for a VM, you can add it to a new replication group,
### How do we ensure capacity in the target region?
-The Site Recovery team, and Azure capacity management team, plan for sufficient infrastructure capacity. When you start a failover, the teams also help ensure VM instances that are protected by Site Recovery can deploy to the target region.
+The Site Recovery team, and Azure capacity management team, plan for sufficient infrastructure capacity on a best-effort basis. When you start a failover, the teams also help ensure VM instances that are protected by Site Recovery can deploy to the target region.
### Is failover automatic?
After reprotection, failback takes about the same amount of time it took to fail
### How do we ensure capacity in the target region?
-The Site Recovery team and Azure capacity management team plan for sufficient infrastructure capacity. When you start a failover, the teams also help ensure VM instances that are protected by Site Recovery can deploy to the target region.
+The Site Recovery team and Azure capacity management team plan for sufficient infrastructure capacity on a best-effort basis. When you start a failover, the teams also help ensure VM instances that are protected by Site Recovery can deploy to the target region.
+
+### Does Site Recovery work with Capacity Reservation?
+
+Yes, you can create a Capacity Reservation for your VM SKU in the disaster recovery region and/or zone, and configure it in the Compute properties of the Target VM. Once done, site recovery will use the earmarked capacity for the failover. [Learn more](https://aka.ms/on-demand-capacity-reservations-docs).
+
+### Why should I reserve capacity using Capacity Reservation at the destination location?
+
+While Site Recovery team makes a best effort to ensure that capacity is available, we do not guarantee the same. Site Recovery's best effort is backed by a 2-hour RTO SLA. But if you require further assurance and _guaranteed compute capacity,_ then we recommend you to purchase [Capacity Reservations](https://aka.ms/on-demand-ca.pacity-reservations-docs)
### Does Site Recovery work with reserved instances?
storage Data Lake Storage Supported Azure Services https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/storage/blobs/data-lake-storage-supported-azure-services.md
Previously updated : 12/06/2021 Last updated : 03/04/2022
This table lists the Azure services that you can use with Azure Data Lake Storag
|SQL Server Integration Services (SSIS)|Generally available|Yes|Yes|<ul><li>[Azure Storage connection manager](/sql/integration-services/connection-manager/azure-storage-connection-manager)</li></ul>| |Azure Data Explorer|Generally available|Yes|Yes|<ul><li>[Query data in Azure Data Lake using Azure Data Explorer](/azure/data-explorer/data-lake-query-data)</li></ul>| |Azure Cognitive Search|Generally available|Yes|Yes|<ul><li>[Index and search Azure Data Lake Storage Gen2 documents](../../search/search-howto-index-azure-data-lake-storage.md)</li></ul>|
+|Azure SQL Managed Instance|Preview|No|Yes|<ul><li>[Data virtualization with Azure SQL Managed Instance (preview)](../../azure-sql/managed-instance/data-virtualization-overview.md)</li></ul>|
|Azure Content Delivery Network|Not yet supported|Not applicable|Not applicable|<ul><li>[Index and search Azure Data Lake Storage Gen2 documents (preview)](../../cdn/cdn-overview.md)</li></ul>| |Azure SQL Database|Not yet supported|Not applicable|Not applicable|<ul><li>[What is Azure SQL Database?](../../azure-sql/database/sql-database-paas-overview.md)</li></ul>|
This table lists the Azure services that you can use with Azure Data Lake Storag
- [Blob Storage feature support in Azure Storage accounts](storage-feature-support-in-storage-accounts.md) - [Open source platforms that support Azure Data Lake Storage Gen2](data-lake-storage-supported-open-source-platforms.md) - [Multi-protocol access on Azure Data Lake Storage](data-lake-storage-multi-protocol-access.md)-- [Best practices for using Azure Data Lake Storage Gen2](data-lake-storage-best-practices.md)
+- [Best practices for using Azure Data Lake Storage Gen2](data-lake-storage-best-practices.md)
virtual-desktop Compare Virtual Desktop Windows 365 https://github.com/MicrosoftDocs/azure-docs/commits/main/articles/virtual-desktop/compare-virtual-desktop-windows-365.md
- Title: Comparing Azure Virtual Desktop and Windows 365 - Azure
-description: Comparing technical features between Azure virtual Desktop and Windows 365.
-- Previously updated : 01/21/2022----
-# Comparing Azure Virtual Desktop and Windows 365
-
-Azure Virtual Desktop and Windows 365 are both great solutions for customers who want to have a seamless Windows experience while accessing their virtual desktop and apps remotely. In this article, we'll compare technical features between the two services.
-
-## Technical features
-
-The following table describes high-level differences in the technical features between Azure Virtual Desktop and Windows 365.
-
-| Feature | Azure Virtual Desktop (single-session)| Azure Virtual Desktop (multisession)| Windows 365 Enterprise | Windows 365 Business |
-|-|--|--|--|--|
-|Design|Designed to be flexible.|Designed to be flexible.|Designed to be simple and easy to use.|Designed to be simple and easy to use.|
-|Type of desktop|Personal desktop|Pooled (single and multi-session) desktop|Personal desktop|Personal desktop|
-|Pricing model|Based on your own resource usage|Based on your own resource usage|Fixed per-user pricing ([Windows 365 Enterprise pricing](https://www.microsoft.com/windows-365/enterprise/compare-plans-pricing))|Fixed per-user pricing ([Windows 365 Business pricing](https://www.microsoft.com/windows-365/business/compare-plans-pricing))|
-|Subscription|Customer-managed|Customer-managed|Microsoft-managed (except networking)|Fully Microsoft-managed|
-|VM stock-keeping units (SKUs)|Any Azure virtual machine (VM) including graphics processing unit (GPU)-enabled SKUs|Any Azure VM including GPU-enabled SKUs|Multiple optimized options for a range of use cases|Multiple optimized options for a range of use cases|
-|Backup|Azure backup services|Azure backup services|Local redundant storage for disaster recovery|Local redundant storage for disaster recovery|
-|Networking|Customer-managed|Microsoft-managed|Customer-managed|Microsoft-managed|
-|Identity|Domain join with Active Directory Domain Services (AD DS) or Azure AD DS, Hybrid Azure AD join, or Azure AD join |Domain join with AD DS or Azure AD DS, Hybrid Azure AD join, or Azure AD join |Hybrid Join, Azure AD join |Azure AD join (can't use AD DS)|
-|User profiles|Azure Files, Azure NetApp Files, or VM-based storage for FSLogix for pooled host pools, and an option for local profiles for personal desktops|Azure Files, Azure NetApp Files, VM-based storage for FSLogix for pooled host pools, and an option for local profiles for personal desktops|Local profiles, offered as software-as-a-service (SaaS)|Local profiles (offered as SaaS)|
-|Operating systems|Windows 10 Enterprise and Windows 11 Enterprise (single session and multi-session) <br>Windows Server 2012 R2, 2016, 2019 (single session and multi-session)<br>Windows 7 Enterprise (single session)|Windows 10 Enterprise and Windows 11 Enterprise (single session and multi-session) <br>Windows Server 2012 R2, 2016, 2019 (single session and multi-session)<br>Windows 7 Enterprise (single session)|Windows 10 Enterprise and Windows 11 Enterprise (single session)|Windows 10 Enterprise and Windows 11 Enterprise (single session)|
-|Base image|Custom and Microsoft-provided|Custom and Microsoft-provided|Custom and Microsoft-provided|Microsoft-provided only|
-|VM location|[Any Azure region](data-locations.md)|[Any Azure region](data-locations.md)|[Most geographies](/windows-365/enterprise/requirements#supported-azure-regions-for-cloud-pc-provisioning)|[Most geographies](/windows-365/enterprise/requirements#supported-azure-regions-for-cloud-pc-provisioning)|
-|Remote app streaming|Supported|Supported|Not supported|Not supported|
-
-## Deployment and management
-
-The following table describes differences when deploying and managing Azure Virtual Desktop and Windows 365.
-
-| Feature | Azure Virtual Desktop (single-session)| Azure Virtual Desktop (multisession)| Windows 365 Enterprise | Windows 365 Business |
-|-|--|--|--||
-|Hybrid (on-premises) or multi-cloud support|Supported with Azure Stack HCI (public preview), Citrix, and VMware|Supported with Azure Stack HCI (public preview), Citrix, and VMware|Unavailable|Unavailable|
-|On-premises connection|Supported by ExpressRoute, VPN, Azure Gateway, and SD-WAN|Supported by ExpressRoute, VPN, Azure Gateway, and SD-WAN|Supported by ExpressRoute, VPN, Azure Gateway, and SD-WAN|Supported by ExpressRoute, VPN, Azure Gateway, and SD-WAN|
-|Management portal|Azure portal (deploy and manage), Microsoft Endpoint Manager (manage only)|Azure portal (deploy and manage), Microsoft Endpoint Manager (manage only)|Microsoft Endpoint Manager|End-user portal|
-|Image management|Custom images and Microsoft-managed image management|Custom images and Microsoft-managed image management|Custom images and Microsoft-managed image management| Microsoft-managed image management only|
-|Screen capture protection|Yes (feature currently in preview)|Yes (feature currently in preview)|Yes (feature currently in preview)|Yes (feature currently in preview)|
-|Updating and patching process|Similar to physical PC|Similar to physical PC|Similar to physical PC|Similar to physical PC|
-|Autoscaling|N/A|Supported with the Autoscaling tool (preview)|N/A|N/A|
-|Application delivery|Microsoft Endpoint Manager, MSIX app attach, custom images, or Microsoft-approved partner solutions|Microsoft Endpoint Manager, MSIX app attach, custom images, or Microsoft-approved partner solutions|Same as physical PC|Same as physical PC|
-|Monitoring|Azure Virtual Desktop Insights, powered by Azure Monitor|Azure Virtual Desktop Insights, powered by Azure Monitor|Similar to physical PC|Similar to physical PC|
-|Environment validation|[Required URL check tool](safe-url-list.md)|[Required URL check tool](safe-url-list.md)|Offered as SaaS|Offered as SaaS|
-|App lifecycle management|MEM, SCCM, MSI, EXE, MSIX, App-V, and others with MSIX app attach or partner solutions|MEM, SCCM, MSI, EXE, MSIX, App-V, and others with MSIX app attach or partner solutions|Same as physical PC (MEM, SSCM, MSI, EXE, MSIX, App-V, and so on)|Same as physical PC (MEM, SSCM, MSI, EXE, MSIX, App-V, and so on)|
-
-## User experience
-
-The following table compares user experience when using Azure Virtual Desktop and Windows 365.
-
-| Feature | Azure Virtual Desktop (single-session)| Azure Virtual Desktop (multisession)| Windows 365 Enterprise | Windows 365 Business |
-|-|--|--|--||
-|Client|Windows, Mac, iOS, Android, HTML, Linux SDK|Windows, Mac, iOS, Android, HTML, Linux SDK|Windows, Mac, iOS, Android, HTML, Linux SDK|Windows, Mac, iOS, Android, HTML, Linux SDK|
-|Printing|Universal Print and print redirection support, network printers|Universal Print and print redirection support, network printers|Universal print and print redirection support|Universal print and print redirection support|
-|Protocol|Remote Desktop Protocol (RDP)|RDP|RDP|RDP|
-|End-user portal capabilities|IT uses the Azure portal to manage deployments|IT uses the Azure portal to manage deployments|User sign in, start VM, troubleshooting, restart, rename and profile reset, VM and disk resizing, OS choice|User sign in, start VM, troubleshooting, restart, rename and profile reset, VM and disk resizing, OS choice|
-
-## Licensing and pricing
-
-The following table describes the difference in licensing and pricing costs for both Azure Virtual Desktop and Windows 365.
-
-| Feature | Azure Virtual Desktop (single-session)| Azure Virtual Desktop (multisession)| Windows 365 Enterprise | Windows 365 Business |
-|-|--|--|--||
-|License costs|Use existing internal license (internal users only) or use monthly per-user access pricing (for commercial remote app streaming to external users only)|Use existing internal license (internal users only) or use monthly per-user access pricing (for commercial remote app streaming to external users only)|Monthly per-user pricing|Monthly per-user pricing|
-|Infrastructure costs|Based on consumption|Based on consumption|Included except for egress charges over base quota|Included|
-|Microsoft Endpoint Manager|Optional|Optional|Required|Optional|
-
-## Next steps
--- To learn more about Azure Virtual Desktop pricing, see [Azure Virtual Desktop pricing](https://azure.microsoft.com/pricing/details/virtual-desktop/).-- To learn more about Windows 365 pricing, see [Windows 365 plans and pricing](https://www.microsoft.com/windows-365/all-pricing).