Iot Hub Resource - Import Devices
Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices?api-version=2023-06-30
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
resource
|
path | True |
string |
The name of the resource group that contains the IoT hub. |
resource
|
path | True |
string |
The name of the IoT hub. |
subscription
|
path | True |
string |
The subscription identifier. |
api-version
|
query | True |
string |
The version of the API. |
Request Body
Name | Required | Type | Description |
---|---|---|---|
inputBlobContainerUri | True |
string |
The input blob container URI. |
outputBlobContainerUri | True |
string |
The output blob container URI. |
authenticationType |
Specifies authentication type being used for connecting to the storage account. |
||
configurationsBlobName |
string |
The blob name to be used when importing configurations from the provided input blob container. |
|
identity |
Managed identity properties of storage endpoint for import devices. |
||
includeConfigurations |
boolean |
The value indicating whether configurations should be imported. |
|
inputBlobName |
string |
The blob name to be used when importing from the provided input blob container. |
|
outputBlobName |
string |
The blob name to use for storing the status of the import job. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK |
|
Other Status Codes |
DefaultErrorResponse |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
IotHubResource_ImportDevices
Sample request
POST https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/importDevices?api-version=2023-06-30
{
"inputBlobContainerUri": "testBlob",
"outputBlobContainerUri": "testBlob"
}
Sample response
{
"jobId": "test",
"startTimeUtc": "Thu, 15 Jun 2017 19:20:58 GMT",
"endTimeUtc": "Thu, 15 Jun 2017 19:20:58 GMT",
"type": "unknown",
"status": "unknown"
}
Definitions
Name | Description |
---|---|
Authentication |
Specifies authentication type being used for connecting to the storage account. |
Error |
Error details. |
Import |
Use to provide parameters when requesting an import of all devices in the hub. |
Job |
The properties of the Job Response object. |
Job |
The status of the job. |
Job |
The type of the job. |
Managed |
The properties of the Managed identity. |
AuthenticationType
Specifies authentication type being used for connecting to the storage account.
Name | Type | Description |
---|---|---|
identityBased |
string |
|
keyBased |
string |
ErrorDetails
Error details.
Name | Type | Description |
---|---|---|
code |
string |
The error code. |
details |
string |
The error details. |
httpStatusCode |
string |
The HTTP status code. |
message |
string |
The error message. |
ImportDevicesRequest
Use to provide parameters when requesting an import of all devices in the hub.
Name | Type | Description |
---|---|---|
authenticationType |
Specifies authentication type being used for connecting to the storage account. |
|
configurationsBlobName |
string |
The blob name to be used when importing configurations from the provided input blob container. |
identity |
Managed identity properties of storage endpoint for import devices. |
|
includeConfigurations |
boolean |
The value indicating whether configurations should be imported. |
inputBlobContainerUri |
string |
The input blob container URI. |
inputBlobName |
string |
The blob name to be used when importing from the provided input blob container. |
outputBlobContainerUri |
string |
The output blob container URI. |
outputBlobName |
string |
The blob name to use for storing the status of the import job. |
JobResponse
The properties of the Job Response object.
Name | Type | Description |
---|---|---|
endTimeUtc |
string |
The time the job stopped processing. |
failureReason |
string |
If status == failed, this string containing the reason for the failure. |
jobId |
string |
The job identifier. |
parentJobId |
string |
The job identifier of the parent job, if any. |
startTimeUtc |
string |
The start time of the job. |
status |
The status of the job. |
|
statusMessage |
string |
The status message for the job. |
type |
The type of the job. |
JobStatus
The status of the job.
Name | Type | Description |
---|---|---|
cancelled |
string |
|
completed |
string |
|
enqueued |
string |
|
failed |
string |
|
running |
string |
|
unknown |
string |
JobType
The type of the job.
Name | Type | Description |
---|---|---|
backup |
string |
|
export |
string |
|
factoryResetDevice |
string |
|
firmwareUpdate |
string |
|
import |
string |
|
readDeviceProperties |
string |
|
rebootDevice |
string |
|
unknown |
string |
|
updateDeviceConfiguration |
string |
|
writeDeviceProperties |
string |
ManagedIdentity
The properties of the Managed identity.
Name | Type | Description |
---|---|---|
userAssignedIdentity |
string |
The user assigned identity. |