プロビジョニング サービスのメタデータを作成または更新します。 プロパティを変更する通常のパターンは、プロビジョニング サービスのメタデータとセキュリティ メタデータを取得し、それらを新しい本文で変更した値と組み合わせてプロビジョニング サービスを更新することです。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}?api-version=2026-11-01
URI パラメーター
| Name |
/ |
必須 |
型 |
説明 |
|
provisioningServiceName
|
path |
True
|
string
|
取得すべきプロビジョニングサービスの名前。
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
リソース グループの名前。 名前は大文字と小文字を区別しません。
|
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
ターゲット サブスクリプションの ID。
|
|
api-version
|
query |
True
|
string
minLength: 1
|
この操作に使用する API バージョン。
|
要求本文
| Name |
必須 |
型 |
説明 |
|
location
|
True
|
string
|
リソースが存在する地理的な場所
|
|
properties
|
True
|
IotDpsPropertiesDescription
|
プロビジョニング サービスのサービス固有のプロパティ
|
|
sku
|
True
|
IotDpsSkuInfo
|
プロビジョニング サービスの SKU 情報。
|
|
etag
|
|
string
|
Etag フィールドは 必要ありません。 応答本文で指定する場合は、通常の ETag 規則に従ってヘッダーとしても指定する必要があります。
|
|
identity
|
|
ManagedServiceIdentity
|
このリソースに割り当てられているマネージド サービス ID。
|
|
resourcegroup
|
|
string
|
リソースのリソース グループ。
|
|
subscriptionid
|
|
string
|
リソースのサブスクリプション ID。
|
|
tags
|
|
object
|
リソース タグ。
|
応答
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー。
型:
oauth2
フロー:
implicit
Authorization URL (承認 URL):
https://login.microsoftonline.com/common/oauth2/authorize
スコープ
| Name |
説明 |
|
user_impersonation
|
あなたのユーザー アカウントになりすます
|
例
DPSCreate
要求のサンプル
PUT https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/provisioningServices/myFirstProvisioningService?api-version=2026-11-01
{
"location": "East US",
"properties": {
"enableDataResidency": false
},
"sku": {
"name": "S1",
"capacity": 1
},
"tags": {}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.iothubprovisioningservices import IotDpsClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-iothubprovisioningservices
# USAGE
python dps_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = IotDpsClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.iot_dps_resource.begin_create_or_update(
resource_group_name="myResourceGroup",
provisioning_service_name="myFirstProvisioningService",
iot_dps_description={
"location": "East US",
"properties": {"enableDataResidency": False},
"sku": {"capacity": 1, "name": "S1"},
"tags": {},
},
).result()
print(response)
# x-ms-original-file: 2026-11-01/DPSCreate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdeviceprovisioningservices_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices"
)
// Generated from example definition: 2026-11-01/DPSCreate.json
func ExampleIotDpsResourceClient_BeginCreateOrUpdate_dpsCreate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdeviceprovisioningservices.NewClientFactory("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewIotDpsResourceClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myFirstProvisioningService", armdeviceprovisioningservices.ProvisioningServiceDescription{
Location: to.Ptr("East US"),
Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{
EnableDataResidency: to.Ptr(false),
},
SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{
Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1),
Capacity: to.Ptr[int64](1),
},
Tags: map[string]*string{},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armdeviceprovisioningservices.IotDpsResourceClientCreateOrUpdateResponse{
// ProvisioningServiceDescription: armdeviceprovisioningservices.ProvisioningServiceDescription{
// Name: to.Ptr("myFirstProvisioningService"),
// Type: to.Ptr("Microsoft.Devices/ProvisioningServices"),
// Etag: to.Ptr("AAAAAAAADGk="),
// ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups//providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService"),
// Location: to.Ptr("eastus"),
// Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{
// AllocationPolicy: to.Ptr(armdeviceprovisioningservices.AllocationPolicyHashed),
// AuthorizationPolicies: []*armdeviceprovisioningservices.SharedAccessSignatureAuthorizationRuleAccessRightsDescription{
// },
// DeviceProvisioningHostName: to.Ptr("global.azure-devices-provisioning.net"),
// EnableDataResidency: to.Ptr(false),
// IDScope: to.Ptr("0ne00000012"),
// PortalOperationsHostName: to.Ptr("myFirstProvisioningService.services.azure-devices-provisioning.net"),
// ServiceOperationsHostName: to.Ptr("myFirstProvisioningService.azure-devices-provisioning.net"),
// State: to.Ptr(armdeviceprovisioningservices.StateActive),
// },
// Resourcegroup: to.Ptr("myResourceGroup"),
// SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{
// Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1),
// Capacity: to.Ptr[int64](1),
// Tier: to.Ptr("Standard"),
// },
// Subscriptionid: to.Ptr("91d12660-3dec-467a-be2a-213b5544ddc0"),
// Tags: map[string]*string{
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { IotDpsClient } = require("@azure/arm-deviceprovisioningservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.
*
* @summary create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.
* x-ms-original-file: 2026-11-01/DPSCreate.json
*/
async function dpsCreate() {
const credential = new DefaultAzureCredential();
const subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0";
const client = new IotDpsClient(credential, subscriptionId);
const result = await client.iotDpsResource.createOrUpdate(
"myResourceGroup",
"myFirstProvisioningService",
{
location: "East US",
properties: { enableDataResidency: false },
sku: { name: "S1", capacity: 1 },
tags: {},
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "myFirstProvisioningService",
"type": "Microsoft.Devices/ProvisioningServices",
"etag": "AAAAAAAADGk=",
"id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups//providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
"location": "eastus",
"properties": {
"allocationPolicy": "Hashed",
"authorizationPolicies": [],
"deviceProvisioningHostName": "global.azure-devices-provisioning.net",
"enableDataResidency": false,
"idScope": "0ne00000012",
"portalOperationsHostName": "myFirstProvisioningService.services.azure-devices-provisioning.net",
"serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
"state": "Active"
},
"resourcegroup": "myResourceGroup",
"sku": {
"name": "S1",
"capacity": 1,
"tier": "Standard"
},
"subscriptionid": "91d12660-3dec-467a-be2a-213b5544ddc0",
"tags": {}
}
{
"name": "myFirstProvisioningService",
"type": "Microsoft.Devices/ProvisioningServices",
"etag": "AAAAAAAADGk=",
"id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups//providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
"location": "eastus",
"properties": {
"allocationPolicy": "Hashed",
"authorizationPolicies": [],
"deviceProvisioningHostName": "global.azure-devices-provisioning.net",
"enableDataResidency": false,
"idScope": "0ne00000012",
"portalOperationsHostName": "myFirstProvisioningService.services.azure-devices-provisioning.net",
"serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
"state": "Active"
},
"resourcegroup": "myResourceGroup",
"sku": {
"name": "S1",
"capacity": 1,
"tier": "Standard"
},
"subscriptionid": "91d12660-3dec-467a-be2a-213b5544ddc0",
"tags": {}
}
DPSCreate_DisableLocalAuthFalse
要求のサンプル
PUT https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/provisioningServices/myFirstProvisioningService?api-version=2026-11-01
{
"location": "East US",
"properties": {
"publicNetworkAccess": "Enabled",
"disableLocalAuth": false
},
"sku": {
"name": "S1",
"capacity": 1
},
"tags": {
"key1": "value1"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.iothubprovisioningservices import IotDpsClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-iothubprovisioningservices
# USAGE
python dps_create_disable_local_auth_false.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = IotDpsClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.iot_dps_resource.begin_create_or_update(
resource_group_name="myResourceGroup",
provisioning_service_name="myFirstProvisioningService",
iot_dps_description={
"location": "East US",
"properties": {"disableLocalAuth": False, "publicNetworkAccess": "Enabled"},
"sku": {"capacity": 1, "name": "S1"},
"tags": {"key1": "value1"},
},
).result()
print(response)
# x-ms-original-file: 2026-11-01/DPSCreate_DisableLocalAuthFalse.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdeviceprovisioningservices_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices"
)
// Generated from example definition: 2026-11-01/DPSCreate_DisableLocalAuthFalse.json
func ExampleIotDpsResourceClient_BeginCreateOrUpdate_dpsCreateDisableLocalAuthFalse() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdeviceprovisioningservices.NewClientFactory("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewIotDpsResourceClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myFirstProvisioningService", armdeviceprovisioningservices.ProvisioningServiceDescription{
Location: to.Ptr("East US"),
Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{
PublicNetworkAccess: to.Ptr(armdeviceprovisioningservices.PublicNetworkAccessEnabled),
DisableLocalAuth: to.Ptr(false),
},
SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{
Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1),
Capacity: to.Ptr[int64](1),
},
Tags: map[string]*string{
"key1": to.Ptr("value1"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armdeviceprovisioningservices.IotDpsResourceClientCreateOrUpdateResponse{
// ProvisioningServiceDescription: armdeviceprovisioningservices.ProvisioningServiceDescription{
// Name: to.Ptr("myFirstProvisioningService"),
// Type: to.Ptr("Microsoft.Devices/ProvisioningServices"),
// Etag: to.Ptr("AAAAAAAADGk="),
// ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService"),
// Location: to.Ptr("eastus"),
// Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{
// AllocationPolicy: to.Ptr(armdeviceprovisioningservices.AllocationPolicyHashed),
// AuthorizationPolicies: []*armdeviceprovisioningservices.SharedAccessSignatureAuthorizationRuleAccessRightsDescription{
// },
// DeviceProvisioningHostName: to.Ptr("global.azure-devices-provisioning.net"),
// IDScope: to.Ptr("0ne00000012"),
// PortalOperationsHostName: to.Ptr("myFirstProvisioningService.services.azure-devices-provisioning.net"),
// ServiceOperationsHostName: to.Ptr("myFirstProvisioningService.azure-devices-provisioning.net"),
// State: to.Ptr(armdeviceprovisioningservices.StateActive),
// DisableLocalAuth: to.Ptr(false),
// },
// Resourcegroup: to.Ptr("myResourceGroup"),
// SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{
// Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1),
// Capacity: to.Ptr[int64](1),
// Tier: to.Ptr("Standard"),
// },
// Subscriptionid: to.Ptr("91d12660-3dec-467a-be2a-213b5544ddc0"),
// Tags: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { IotDpsClient } = require("@azure/arm-deviceprovisioningservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.
*
* @summary create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.
* x-ms-original-file: 2026-11-01/DPSCreate_DisableLocalAuthFalse.json
*/
async function dpsCreateDisableLocalAuthFalse() {
const credential = new DefaultAzureCredential();
const subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0";
const client = new IotDpsClient(credential, subscriptionId);
const result = await client.iotDpsResource.createOrUpdate(
"myResourceGroup",
"myFirstProvisioningService",
{
location: "East US",
properties: { publicNetworkAccess: "Enabled", disableLocalAuth: false },
sku: { name: "S1", capacity: 1 },
tags: { key1: "value1" },
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "myFirstProvisioningService",
"type": "Microsoft.Devices/ProvisioningServices",
"etag": "AAAAAAAADGk=",
"id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
"location": "eastus",
"properties": {
"allocationPolicy": "Hashed",
"authorizationPolicies": [],
"deviceProvisioningHostName": "global.azure-devices-provisioning.net",
"idScope": "0ne00000012",
"portalOperationsHostName": "myFirstProvisioningService.services.azure-devices-provisioning.net",
"serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
"state": "Active",
"disableLocalAuth": false
},
"resourcegroup": "myResourceGroup",
"sku": {
"name": "S1",
"capacity": 1,
"tier": "Standard"
},
"subscriptionid": "91d12660-3dec-467a-be2a-213b5544ddc0",
"tags": {
"key1": "value1"
}
}
{
"name": "myFirstProvisioningService",
"type": "Microsoft.Devices/ProvisioningServices",
"etag": "AAAAAAAADGk=",
"id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
"location": "eastus",
"properties": {
"allocationPolicy": "Hashed",
"authorizationPolicies": [],
"deviceProvisioningHostName": "global.azure-devices-provisioning.net",
"idScope": "0ne00000012",
"portalOperationsHostName": "myFirstProvisioningService.services.azure-devices-provisioning.net",
"serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
"state": "Active",
"disableLocalAuth": false
},
"resourcegroup": "myResourceGroup",
"sku": {
"name": "S1",
"capacity": 1,
"tier": "Standard"
},
"subscriptionid": "91d12660-3dec-467a-be2a-213b5544ddc0",
"tags": {
"key1": "value1"
}
}
DPSCreate_DisableLocalAuthTrue
要求のサンプル
PUT https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/provisioningServices/myFirstProvisioningService?api-version=2026-11-01
{
"location": "East US",
"properties": {
"publicNetworkAccess": "Enabled",
"disableLocalAuth": true
},
"sku": {
"name": "S1",
"capacity": 1
},
"tags": {
"key1": "value1",
"key2": "value2"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.iothubprovisioningservices import IotDpsClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-iothubprovisioningservices
# USAGE
python dps_create_disable_local_auth_true.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = IotDpsClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.iot_dps_resource.begin_create_or_update(
resource_group_name="myResourceGroup",
provisioning_service_name="myFirstProvisioningService",
iot_dps_description={
"location": "East US",
"properties": {"disableLocalAuth": True, "publicNetworkAccess": "Enabled"},
"sku": {"capacity": 1, "name": "S1"},
"tags": {"key1": "value1", "key2": "value2"},
},
).result()
print(response)
# x-ms-original-file: 2026-11-01/DPSCreate_DisableLocalAuthTrue.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdeviceprovisioningservices_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices"
)
// Generated from example definition: 2026-11-01/DPSCreate_DisableLocalAuthTrue.json
func ExampleIotDpsResourceClient_BeginCreateOrUpdate_dpsCreateDisableLocalAuthTrue() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdeviceprovisioningservices.NewClientFactory("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewIotDpsResourceClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myFirstProvisioningService", armdeviceprovisioningservices.ProvisioningServiceDescription{
Location: to.Ptr("East US"),
Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{
PublicNetworkAccess: to.Ptr(armdeviceprovisioningservices.PublicNetworkAccessEnabled),
DisableLocalAuth: to.Ptr(true),
},
SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{
Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1),
Capacity: to.Ptr[int64](1),
},
Tags: map[string]*string{
"key1": to.Ptr("value1"),
"key2": to.Ptr("value2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armdeviceprovisioningservices.IotDpsResourceClientCreateOrUpdateResponse{
// ProvisioningServiceDescription: armdeviceprovisioningservices.ProvisioningServiceDescription{
// Name: to.Ptr("myFirstProvisioningService"),
// Type: to.Ptr("Microsoft.Devices/ProvisioningServices"),
// Etag: to.Ptr("AAAAAAAADGk="),
// ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService"),
// Location: to.Ptr("eastus"),
// Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{
// AllocationPolicy: to.Ptr(armdeviceprovisioningservices.AllocationPolicyHashed),
// AuthorizationPolicies: []*armdeviceprovisioningservices.SharedAccessSignatureAuthorizationRuleAccessRightsDescription{
// },
// DeviceProvisioningHostName: to.Ptr("global.azure-devices-provisioning.net"),
// IDScope: to.Ptr("0ne00000012"),
// PortalOperationsHostName: to.Ptr("myFirstProvisioningService.services.azure-devices-provisioning.net"),
// ServiceOperationsHostName: to.Ptr("myFirstProvisioningService.azure-devices-provisioning.net"),
// State: to.Ptr(armdeviceprovisioningservices.StateActive),
// DisableLocalAuth: to.Ptr(true),
// },
// Resourcegroup: to.Ptr("myResourceGroup"),
// SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{
// Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1),
// Capacity: to.Ptr[int64](1),
// Tier: to.Ptr("Standard"),
// },
// Subscriptionid: to.Ptr("91d12660-3dec-467a-be2a-213b5544ddc0"),
// Tags: map[string]*string{
// "key1": to.Ptr("value1"),
// "key2": to.Ptr("value2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { IotDpsClient } = require("@azure/arm-deviceprovisioningservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.
*
* @summary create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.
* x-ms-original-file: 2026-11-01/DPSCreate_DisableLocalAuthTrue.json
*/
async function dpsCreateDisableLocalAuthTrue() {
const credential = new DefaultAzureCredential();
const subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0";
const client = new IotDpsClient(credential, subscriptionId);
const result = await client.iotDpsResource.createOrUpdate(
"myResourceGroup",
"myFirstProvisioningService",
{
location: "East US",
properties: { publicNetworkAccess: "Enabled", disableLocalAuth: true },
sku: { name: "S1", capacity: 1 },
tags: { key1: "value1", key2: "value2" },
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "myFirstProvisioningService",
"type": "Microsoft.Devices/ProvisioningServices",
"etag": "AAAAAAAADGk=",
"id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
"location": "eastus",
"properties": {
"allocationPolicy": "Hashed",
"authorizationPolicies": [],
"deviceProvisioningHostName": "global.azure-devices-provisioning.net",
"idScope": "0ne00000012",
"portalOperationsHostName": "myFirstProvisioningService.services.azure-devices-provisioning.net",
"serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
"state": "Active",
"disableLocalAuth": true
},
"resourcegroup": "myResourceGroup",
"sku": {
"name": "S1",
"capacity": 1,
"tier": "Standard"
},
"subscriptionid": "91d12660-3dec-467a-be2a-213b5544ddc0",
"tags": {
"key1": "value1",
"key2": "value2"
}
}
{
"name": "myFirstProvisioningService",
"type": "Microsoft.Devices/ProvisioningServices",
"etag": "AAAAAAAADGk=",
"id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
"location": "eastus",
"properties": {
"allocationPolicy": "Hashed",
"authorizationPolicies": [],
"deviceProvisioningHostName": "global.azure-devices-provisioning.net",
"idScope": "0ne00000012",
"portalOperationsHostName": "myFirstProvisioningService.services.azure-devices-provisioning.net",
"serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
"state": "Active",
"disableLocalAuth": true
},
"resourcegroup": "myResourceGroup",
"sku": {
"name": "S1",
"capacity": 1,
"tier": "Standard"
},
"subscriptionid": "91d12660-3dec-467a-be2a-213b5544ddc0",
"tags": {
"key1": "value1",
"key2": "value2"
}
}
DPSCreateWithIotHub
要求のサンプル
PUT https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/provisioningServices/myFirstProvisioningService?api-version=2026-11-01
{
"location": "East US",
"properties": {
"enableDataResidency": false,
"iotHubs": [
{
"applyAllocationPolicy": true,
"allocationWeight": 1,
"hostName": "myFirstIoTHub.azure-devices.net",
"authenticationType": "UserAssigned",
"selectedUserAssignedIdentityResourceId": "/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1",
"location": "eastus"
}
]
},
"sku": {
"name": "S1",
"capacity": 1
},
"identity": {
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
"/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1": {}
}
},
"tags": {}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.iothubprovisioningservices import IotDpsClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-iothubprovisioningservices
# USAGE
python dps_create_with_iot_hub.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = IotDpsClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.iot_dps_resource.begin_create_or_update(
resource_group_name="myResourceGroup",
provisioning_service_name="myFirstProvisioningService",
iot_dps_description={
"identity": {
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
"/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1": {}
},
},
"location": "East US",
"properties": {
"enableDataResidency": False,
"iotHubs": [
{
"allocationWeight": 1,
"applyAllocationPolicy": True,
"authenticationType": "UserAssigned",
"hostName": "myFirstIoTHub.azure-devices.net",
"location": "eastus",
"selectedUserAssignedIdentityResourceId": "/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1",
}
],
},
"sku": {"capacity": 1, "name": "S1"},
"tags": {},
},
).result()
print(response)
# x-ms-original-file: 2026-11-01/DPSCreateWithIotHub.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdeviceprovisioningservices_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices"
)
// Generated from example definition: 2026-11-01/DPSCreateWithIotHub.json
func ExampleIotDpsResourceClient_BeginCreateOrUpdate_dpsCreateWithIotHub() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdeviceprovisioningservices.NewClientFactory("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewIotDpsResourceClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myFirstProvisioningService", armdeviceprovisioningservices.ProvisioningServiceDescription{
Location: to.Ptr("East US"),
Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{
EnableDataResidency: to.Ptr(false),
IotHubs: []*armdeviceprovisioningservices.IotHubDefinitionDescription{
{
ApplyAllocationPolicy: to.Ptr(true),
AllocationWeight: to.Ptr[int32](1),
HostName: to.Ptr("myFirstIoTHub.azure-devices.net"),
AuthenticationType: to.Ptr(armdeviceprovisioningservices.IotHubAuthenticationTypeUserAssigned),
SelectedUserAssignedIdentityResourceID: to.Ptr("/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1"),
Location: to.Ptr("eastus"),
},
},
},
SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{
Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1),
Capacity: to.Ptr[int64](1),
},
Identity: &armdeviceprovisioningservices.ManagedServiceIdentity{
Type: to.Ptr(armdeviceprovisioningservices.ManagedServiceIdentityType("SystemAssigned, UserAssigned")),
UserAssignedIdentities: map[string]*armdeviceprovisioningservices.UserAssignedIdentity{
"/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1": {},
},
},
Tags: map[string]*string{},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armdeviceprovisioningservices.IotDpsResourceClientCreateOrUpdateResponse{
// ProvisioningServiceDescription: armdeviceprovisioningservices.ProvisioningServiceDescription{
// Name: to.Ptr("myFirstProvisioningService"),
// Type: to.Ptr("Microsoft.Devices/ProvisioningServices"),
// Etag: to.Ptr("AAAAAAAADGk="),
// ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService"),
// Location: to.Ptr("eastus"),
// Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{
// AllocationPolicy: to.Ptr(armdeviceprovisioningservices.AllocationPolicyHashed),
// AuthorizationPolicies: []*armdeviceprovisioningservices.SharedAccessSignatureAuthorizationRuleAccessRightsDescription{
// },
// DeviceProvisioningHostName: to.Ptr("global.azure-devices-provisioning.net"),
// EnableDataResidency: to.Ptr(false),
// IDScope: to.Ptr("0ne00000012"),
// IotHubs: []*armdeviceprovisioningservices.IotHubDefinitionDescription{
// {
// ApplyAllocationPolicy: to.Ptr(true),
// AllocationWeight: to.Ptr[int32](1),
// Name: to.Ptr("myFirstIoTHub.azure-devices.net"),
// HostName: to.Ptr("myFirstIoTHub.azure-devices.net"),
// AuthenticationType: to.Ptr(armdeviceprovisioningservices.IotHubAuthenticationTypeUserAssigned),
// SelectedUserAssignedIdentityResourceID: to.Ptr("/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1"),
// Location: to.Ptr("eastus"),
// },
// },
// PortalOperationsHostName: to.Ptr("myFirstProvisioningService.services.azure-devices-provisioning.net"),
// ServiceOperationsHostName: to.Ptr("myFirstProvisioningService.azure-devices-provisioning.net"),
// State: to.Ptr(armdeviceprovisioningservices.StateActive),
// },
// Resourcegroup: to.Ptr("myResourceGroup"),
// SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{
// Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1),
// Capacity: to.Ptr[int64](1),
// Tier: to.Ptr("Standard"),
// },
// Identity: &armdeviceprovisioningservices.ManagedServiceIdentity{
// Type: to.Ptr(armdeviceprovisioningservices.ManagedServiceIdentityType("SystemAssigned, UserAssigned")),
// UserAssignedIdentities: map[string]*armdeviceprovisioningservices.UserAssignedIdentity{
// "/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1": &armdeviceprovisioningservices.UserAssignedIdentity{
// },
// },
// },
// Subscriptionid: to.Ptr("91d12660-3dec-467a-be2a-213b5544ddc0"),
// Tags: map[string]*string{
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { IotDpsClient } = require("@azure/arm-deviceprovisioningservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.
*
* @summary create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.
* x-ms-original-file: 2026-11-01/DPSCreateWithIotHub.json
*/
async function dpsCreateWithIotHub() {
const credential = new DefaultAzureCredential();
const subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0";
const client = new IotDpsClient(credential, subscriptionId);
const result = await client.iotDpsResource.createOrUpdate(
"myResourceGroup",
"myFirstProvisioningService",
{
location: "East US",
properties: {
enableDataResidency: false,
iotHubs: [
{
applyAllocationPolicy: true,
allocationWeight: 1,
hostName: "myFirstIoTHub.azure-devices.net",
authenticationType: "UserAssigned",
selectedUserAssignedIdentityResourceId:
"/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1",
location: "eastus",
},
],
},
sku: { name: "S1", capacity: 1 },
identity: {
type: "SystemAssigned, UserAssigned",
userAssignedIdentities: {
"/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1":
{},
},
},
tags: {},
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "myFirstProvisioningService",
"type": "Microsoft.Devices/ProvisioningServices",
"etag": "AAAAAAAADGk=",
"id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
"location": "eastus",
"properties": {
"allocationPolicy": "Hashed",
"authorizationPolicies": [],
"deviceProvisioningHostName": "global.azure-devices-provisioning.net",
"enableDataResidency": false,
"idScope": "0ne00000012",
"iotHubs": [
{
"applyAllocationPolicy": true,
"allocationWeight": 1,
"name": "myFirstIoTHub.azure-devices.net",
"hostName": "myFirstIoTHub.azure-devices.net",
"authenticationType": "UserAssigned",
"selectedUserAssignedIdentityResourceId": "/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1",
"location": "eastus"
}
],
"portalOperationsHostName": "myFirstProvisioningService.services.azure-devices-provisioning.net",
"serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
"state": "Active"
},
"resourcegroup": "myResourceGroup",
"sku": {
"name": "S1",
"capacity": 1,
"tier": "Standard"
},
"identity": {
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
"/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1": {}
}
},
"subscriptionid": "91d12660-3dec-467a-be2a-213b5544ddc0",
"tags": {}
}
{
"name": "myFirstProvisioningService",
"type": "Microsoft.Devices/ProvisioningServices",
"etag": "AAAAAAAADGk=",
"id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
"location": "eastus",
"properties": {
"allocationPolicy": "Hashed",
"authorizationPolicies": [],
"deviceProvisioningHostName": "global.azure-devices-provisioning.net",
"enableDataResidency": false,
"idScope": "0ne00000012",
"iotHubs": [
{
"applyAllocationPolicy": true,
"allocationWeight": 1,
"name": "myFirstIoTHub.azure-devices.net",
"hostName": "myFirstIoTHub.azure-devices.net",
"authenticationType": "UserAssigned",
"selectedUserAssignedIdentityResourceId": "/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1",
"location": "eastus"
}
],
"portalOperationsHostName": "myFirstProvisioningService.services.azure-devices-provisioning.net",
"serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
"state": "Active"
},
"resourcegroup": "myResourceGroup",
"sku": {
"name": "S1",
"capacity": 1,
"tier": "Standard"
},
"identity": {
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
"/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1": {}
}
},
"subscriptionid": "91d12660-3dec-467a-be2a-213b5544ddc0",
"tags": {}
}
DPSCreateWithNamespace
要求のサンプル
PUT https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/provisioningServices/myFirstProvisioningService?api-version=2026-11-01
{
"location": "East US",
"properties": {
"enableDataResidency": false
},
"sku": {
"name": "S1",
"capacity": 1
},
"tags": {}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.iothubprovisioningservices import IotDpsClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-iothubprovisioningservices
# USAGE
python dps_create_with_namespace.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = IotDpsClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.iot_dps_resource.begin_create_or_update(
resource_group_name="myResourceGroup",
provisioning_service_name="myFirstProvisioningService",
iot_dps_description={
"location": "East US",
"properties": {"enableDataResidency": False},
"sku": {"capacity": 1, "name": "S1"},
"tags": {},
},
).result()
print(response)
# x-ms-original-file: 2026-11-01/DPSCreateWithNamespace.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdeviceprovisioningservices_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices"
)
// Generated from example definition: 2026-11-01/DPSCreateWithNamespace.json
func ExampleIotDpsResourceClient_BeginCreateOrUpdate_dpsCreateWithNamespace() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdeviceprovisioningservices.NewClientFactory("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewIotDpsResourceClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myFirstProvisioningService", armdeviceprovisioningservices.ProvisioningServiceDescription{
Location: to.Ptr("East US"),
Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{
EnableDataResidency: to.Ptr(false),
},
SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{
Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1),
Capacity: to.Ptr[int64](1),
},
Tags: map[string]*string{},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armdeviceprovisioningservices.IotDpsResourceClientCreateOrUpdateResponse{
// ProvisioningServiceDescription: armdeviceprovisioningservices.ProvisioningServiceDescription{
// Name: to.Ptr("myFirstProvisioningService"),
// Type: to.Ptr("Microsoft.Devices/ProvisioningServices"),
// Etag: to.Ptr("AAAAAAAADGk="),
// ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups//providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService"),
// Location: to.Ptr("eastus"),
// Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{
// AllocationPolicy: to.Ptr(armdeviceprovisioningservices.AllocationPolicyHashed),
// AuthorizationPolicies: []*armdeviceprovisioningservices.SharedAccessSignatureAuthorizationRuleAccessRightsDescription{
// },
// DeviceProvisioningHostName: to.Ptr("global.azure-devices-provisioning.net"),
// EnableDataResidency: to.Ptr(false),
// IDScope: to.Ptr("0ne00000012"),
// PortalOperationsHostName: to.Ptr("myFirstProvisioningService.services.azure-devices-provisioning.net"),
// ServiceOperationsHostName: to.Ptr("myFirstProvisioningService.azure-devices-provisioning.net"),
// State: to.Ptr(armdeviceprovisioningservices.StateActive),
// },
// Resourcegroup: to.Ptr("myResourceGroup"),
// SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{
// Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1),
// Capacity: to.Ptr[int64](1),
// Tier: to.Ptr("Standard"),
// },
// Identity: &armdeviceprovisioningservices.ManagedServiceIdentity{
// Type: to.Ptr(armdeviceprovisioningservices.ManagedServiceIdentityType("SystemAssigned, UserAssigned")),
// UserAssignedIdentities: map[string]*armdeviceprovisioningservices.UserAssignedIdentity{
// "/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1": &armdeviceprovisioningservices.UserAssignedIdentity{
// },
// "/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-2": &armdeviceprovisioningservices.UserAssignedIdentity{
// },
// },
// },
// Subscriptionid: to.Ptr("91d12660-3dec-467a-be2a-213b5544ddc0"),
// Tags: map[string]*string{
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { IotDpsClient } = require("@azure/arm-deviceprovisioningservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.
*
* @summary create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.
* x-ms-original-file: 2026-11-01/DPSCreateWithNamespace.json
*/
async function dpsCreateWithNamespace() {
const credential = new DefaultAzureCredential();
const subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0";
const client = new IotDpsClient(credential, subscriptionId);
const result = await client.iotDpsResource.createOrUpdate(
"myResourceGroup",
"myFirstProvisioningService",
{
location: "East US",
properties: { enableDataResidency: false },
sku: { name: "S1", capacity: 1 },
tags: {},
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "myFirstProvisioningService",
"type": "Microsoft.Devices/ProvisioningServices",
"etag": "AAAAAAAADGk=",
"id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups//providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
"location": "eastus",
"properties": {
"allocationPolicy": "Hashed",
"authorizationPolicies": [],
"deviceProvisioningHostName": "global.azure-devices-provisioning.net",
"enableDataResidency": false,
"idScope": "0ne00000012",
"portalOperationsHostName": "myFirstProvisioningService.services.azure-devices-provisioning.net",
"serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
"state": "Active"
},
"resourcegroup": "myResourceGroup",
"sku": {
"name": "S1",
"capacity": 1,
"tier": "Standard"
},
"identity": {
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
"/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1": {},
"/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-2": {}
}
},
"subscriptionid": "91d12660-3dec-467a-be2a-213b5544ddc0",
"tags": {}
}
{
"name": "myFirstProvisioningService",
"type": "Microsoft.Devices/ProvisioningServices",
"etag": "AAAAAAAADGk=",
"id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups//providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
"location": "eastus",
"properties": {
"allocationPolicy": "Hashed",
"authorizationPolicies": [],
"deviceProvisioningHostName": "global.azure-devices-provisioning.net",
"enableDataResidency": false,
"idScope": "0ne00000012",
"portalOperationsHostName": "myFirstProvisioningService.services.azure-devices-provisioning.net",
"serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
"state": "Active"
},
"resourcegroup": "myResourceGroup",
"sku": {
"name": "S1",
"capacity": 1,
"tier": "Standard"
},
"identity": {
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
"/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-1": {},
"/subscriptions/abcf2d55-764f-419f-974d-f77a55c2ce55/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-mi-2": {}
}
},
"subscriptionid": "91d12660-3dec-467a-be2a-213b5544ddc0",
"tags": {}
}
DPSUpdate
要求のサンプル
PUT https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/provisioningServices/myFirstProvisioningService?api-version=2026-11-01
{
"identity": {
"type": "SystemAssigned,UserAssigned",
"userAssignedIdentities": {
"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity": {}
}
},
"location": "East US",
"properties": {
"enableDataResidency": false
},
"sku": {
"name": "S1",
"capacity": 1
},
"tags": {}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.iothubprovisioningservices import IotDpsClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-iothubprovisioningservices
# USAGE
python dps_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = IotDpsClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.iot_dps_resource.begin_create_or_update(
resource_group_name="myResourceGroup",
provisioning_service_name="myFirstProvisioningService",
iot_dps_description={
"identity": {
"type": "SystemAssigned,UserAssigned",
"userAssignedIdentities": {
"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity": {}
},
},
"location": "East US",
"properties": {"enableDataResidency": False},
"sku": {"capacity": 1, "name": "S1"},
"tags": {},
},
).result()
print(response)
# x-ms-original-file: 2026-11-01/DPSUpdate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdeviceprovisioningservices_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices"
)
// Generated from example definition: 2026-11-01/DPSUpdate.json
func ExampleIotDpsResourceClient_BeginCreateOrUpdate_dpsUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdeviceprovisioningservices.NewClientFactory("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewIotDpsResourceClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myFirstProvisioningService", armdeviceprovisioningservices.ProvisioningServiceDescription{
Identity: &armdeviceprovisioningservices.ManagedServiceIdentity{
Type: to.Ptr(armdeviceprovisioningservices.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
UserAssignedIdentities: map[string]*armdeviceprovisioningservices.UserAssignedIdentity{
"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity": {},
},
},
Location: to.Ptr("East US"),
Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{
EnableDataResidency: to.Ptr(false),
},
SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{
Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1),
Capacity: to.Ptr[int64](1),
},
Tags: map[string]*string{},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armdeviceprovisioningservices.IotDpsResourceClientCreateOrUpdateResponse{
// ProvisioningServiceDescription: armdeviceprovisioningservices.ProvisioningServiceDescription{
// Name: to.Ptr("myFirstProvisioningService"),
// Type: to.Ptr("Microsoft.Devices/ProvisioningServices"),
// Etag: to.Ptr("AAAAAAAADGk="),
// ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups//providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService"),
// Identity: &armdeviceprovisioningservices.ManagedServiceIdentity{
// Type: to.Ptr(armdeviceprovisioningservices.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
// PrincipalID: to.Ptr("aa80bd74-a3f0-4f14-b9da-99c5351cf9d5"),
// TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"),
// UserAssignedIdentities: map[string]*armdeviceprovisioningservices.UserAssignedIdentity{
// "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity": &armdeviceprovisioningservices.UserAssignedIdentity{
// ClientID: to.Ptr("c38f618d-47f6-4260-8b3d-1dd8c130f323"),
// PrincipalID: to.Ptr("f1b0b133-10dc-4985-966f-a98a04675fe9"),
// },
// },
// },
// Location: to.Ptr("eastus"),
// Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{
// AllocationPolicy: to.Ptr(armdeviceprovisioningservices.AllocationPolicyHashed),
// AuthorizationPolicies: []*armdeviceprovisioningservices.SharedAccessSignatureAuthorizationRuleAccessRightsDescription{
// },
// DeviceProvisioningHostName: to.Ptr("global.azure-devices-provisioning.net"),
// EnableDataResidency: to.Ptr(false),
// IDScope: to.Ptr("0ne00000012"),
// PortalOperationsHostName: to.Ptr("myFirstProvisioningService.services.azure-devices-provisioning.net"),
// ServiceOperationsHostName: to.Ptr("myFirstProvisioningService.azure-devices-provisioning.net"),
// State: to.Ptr(armdeviceprovisioningservices.StateActive),
// },
// Resourcegroup: to.Ptr("myResourceGroup"),
// SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{
// Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1),
// Capacity: to.Ptr[int64](1),
// Tier: to.Ptr("Standard"),
// },
// Subscriptionid: to.Ptr("91d12660-3dec-467a-be2a-213b5544ddc0"),
// Tags: map[string]*string{
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { IotDpsClient } = require("@azure/arm-deviceprovisioningservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.
*
* @summary create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.
* x-ms-original-file: 2026-11-01/DPSUpdate.json
*/
async function dpsUpdate() {
const credential = new DefaultAzureCredential();
const subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0";
const client = new IotDpsClient(credential, subscriptionId);
const result = await client.iotDpsResource.createOrUpdate(
"myResourceGroup",
"myFirstProvisioningService",
{
identity: {
type: "SystemAssigned,UserAssigned",
userAssignedIdentities: {
"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity":
{},
},
},
location: "East US",
properties: { enableDataResidency: false },
sku: { name: "S1", capacity: 1 },
tags: {},
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "myFirstProvisioningService",
"type": "Microsoft.Devices/ProvisioningServices",
"etag": "AAAAAAAADGk=",
"id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups//providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
"identity": {
"type": "SystemAssigned,UserAssigned",
"principalId": "aa80bd74-a3f0-4f14-b9da-99c5351cf9d5",
"tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd",
"userAssignedIdentities": {
"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity": {
"clientId": "c38f618d-47f6-4260-8b3d-1dd8c130f323",
"principalId": "f1b0b133-10dc-4985-966f-a98a04675fe9"
}
}
},
"location": "eastus",
"properties": {
"allocationPolicy": "Hashed",
"authorizationPolicies": [],
"deviceProvisioningHostName": "global.azure-devices-provisioning.net",
"enableDataResidency": false,
"idScope": "0ne00000012",
"portalOperationsHostName": "myFirstProvisioningService.services.azure-devices-provisioning.net",
"serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
"state": "Active"
},
"resourcegroup": "myResourceGroup",
"sku": {
"name": "S1",
"capacity": 1,
"tier": "Standard"
},
"subscriptionid": "91d12660-3dec-467a-be2a-213b5544ddc0",
"tags": {}
}
{
"name": "myFirstProvisioningService",
"type": "Microsoft.Devices/ProvisioningServices",
"etag": "AAAAAAAADGk=",
"id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups//providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
"identity": {
"type": "SystemAssigned,UserAssigned",
"principalId": "aa80bd74-a3f0-4f14-b9da-99c5351cf9d5",
"tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd",
"userAssignedIdentities": {
"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourcegroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity": {
"clientId": "c38f618d-47f6-4260-8b3d-1dd8c130f323",
"principalId": "f1b0b133-10dc-4985-966f-a98a04675fe9"
}
}
},
"location": "eastus",
"properties": {
"allocationPolicy": "Hashed",
"authorizationPolicies": [],
"deviceProvisioningHostName": "global.azure-devices-provisioning.net",
"enableDataResidency": false,
"idScope": "0ne00000012",
"portalOperationsHostName": "myFirstProvisioningService.services.azure-devices-provisioning.net",
"serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
"state": "Active"
},
"resourcegroup": "myResourceGroup",
"sku": {
"name": "S1",
"capacity": 1,
"tier": "Standard"
},
"subscriptionid": "91d12660-3dec-467a-be2a-213b5544ddc0",
"tags": {}
}
DPSUpdate_DisableLocalAuth
要求のサンプル
PUT https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/provisioningServices/myFirstProvisioningService?api-version=2026-11-01
{
"location": "East US",
"properties": {
"disableLocalAuth": true
},
"sku": {
"name": "S1",
"capacity": 1
},
"tags": {}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.iothubprovisioningservices import IotDpsClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-iothubprovisioningservices
# USAGE
python dps_update_disable_local_auth.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = IotDpsClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.iot_dps_resource.begin_create_or_update(
resource_group_name="myResourceGroup",
provisioning_service_name="myFirstProvisioningService",
iot_dps_description={
"location": "East US",
"properties": {"disableLocalAuth": True},
"sku": {"capacity": 1, "name": "S1"},
"tags": {},
},
).result()
print(response)
# x-ms-original-file: 2026-11-01/DPSUpdate_DisableLocalAuth.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdeviceprovisioningservices_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices"
)
// Generated from example definition: 2026-11-01/DPSUpdate_DisableLocalAuth.json
func ExampleIotDpsResourceClient_BeginCreateOrUpdate_dpsUpdateDisableLocalAuth() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdeviceprovisioningservices.NewClientFactory("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewIotDpsResourceClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myFirstProvisioningService", armdeviceprovisioningservices.ProvisioningServiceDescription{
Location: to.Ptr("East US"),
Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{
DisableLocalAuth: to.Ptr(true),
},
SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{
Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1),
Capacity: to.Ptr[int64](1),
},
Tags: map[string]*string{},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armdeviceprovisioningservices.IotDpsResourceClientCreateOrUpdateResponse{
// ProvisioningServiceDescription: armdeviceprovisioningservices.ProvisioningServiceDescription{
// Name: to.Ptr("myFirstProvisioningService"),
// Type: to.Ptr("Microsoft.Devices/ProvisioningServices"),
// Etag: to.Ptr("AAAAAAAADGk="),
// ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService"),
// Location: to.Ptr("eastus"),
// Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{
// AllocationPolicy: to.Ptr(armdeviceprovisioningservices.AllocationPolicyHashed),
// AuthorizationPolicies: []*armdeviceprovisioningservices.SharedAccessSignatureAuthorizationRuleAccessRightsDescription{
// },
// DeviceProvisioningHostName: to.Ptr("global.azure-devices-provisioning.net"),
// IDScope: to.Ptr("0ne00000012"),
// PortalOperationsHostName: to.Ptr("myFirstProvisioningService.services.azure-devices-provisioning.net"),
// ServiceOperationsHostName: to.Ptr("myFirstProvisioningService.azure-devices-provisioning.net"),
// State: to.Ptr(armdeviceprovisioningservices.StateActive),
// DisableLocalAuth: to.Ptr(true),
// },
// Resourcegroup: to.Ptr("myResourceGroup"),
// SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{
// Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1),
// Capacity: to.Ptr[int64](1),
// Tier: to.Ptr("Standard"),
// },
// Subscriptionid: to.Ptr("91d12660-3dec-467a-be2a-213b5544ddc0"),
// Tags: map[string]*string{
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { IotDpsClient } = require("@azure/arm-deviceprovisioningservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.
*
* @summary create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.
* x-ms-original-file: 2026-11-01/DPSUpdate_DisableLocalAuth.json
*/
async function dpsUpdateDisableLocalAuth() {
const credential = new DefaultAzureCredential();
const subscriptionId = "91d12660-3dec-467a-be2a-213b5544ddc0";
const client = new IotDpsClient(credential, subscriptionId);
const result = await client.iotDpsResource.createOrUpdate(
"myResourceGroup",
"myFirstProvisioningService",
{
location: "East US",
properties: { disableLocalAuth: true },
sku: { name: "S1", capacity: 1 },
tags: {},
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "myFirstProvisioningService",
"type": "Microsoft.Devices/ProvisioningServices",
"etag": "AAAAAAAADGk=",
"id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
"location": "eastus",
"properties": {
"allocationPolicy": "Hashed",
"authorizationPolicies": [],
"deviceProvisioningHostName": "global.azure-devices-provisioning.net",
"idScope": "0ne00000012",
"portalOperationsHostName": "myFirstProvisioningService.services.azure-devices-provisioning.net",
"serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
"state": "Active",
"disableLocalAuth": true
},
"resourcegroup": "myResourceGroup",
"sku": {
"name": "S1",
"capacity": 1,
"tier": "Standard"
},
"subscriptionid": "91d12660-3dec-467a-be2a-213b5544ddc0",
"tags": {}
}
{
"name": "myFirstProvisioningService",
"type": "Microsoft.Devices/ProvisioningServices",
"etag": "AAAAAAAADGk=",
"id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
"location": "eastus",
"properties": {
"allocationPolicy": "Hashed",
"authorizationPolicies": [],
"deviceProvisioningHostName": "global.azure-devices-provisioning.net",
"idScope": "0ne00000012",
"portalOperationsHostName": "myFirstProvisioningService.services.azure-devices-provisioning.net",
"serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
"state": "Active",
"disableLocalAuth": true
},
"resourcegroup": "myResourceGroup",
"sku": {
"name": "S1",
"capacity": 1,
"tier": "Standard"
},
"subscriptionid": "91d12660-3dec-467a-be2a-213b5544ddc0",
"tags": {}
}
定義
AccessRightsDescription
列挙
このキーが持つ権限。
| 値 |
説明 |
|
ServiceConfig
|
|
|
EnrollmentRead
|
|
|
EnrollmentWrite
|
|
|
DeviceConnect
|
|
|
RegistrationStatusRead
|
|
|
RegistrationStatusWrite
|
|
AllocationPolicy
列挙
このプロビジョニング サービスで使用される割り当てポリシー。
| 値 |
説明 |
|
Hashed
|
|
|
GeoLatency
|
|
|
Static
|
|
createdByType
列挙
リソースを作成した ID の種類。
| 値 |
説明 |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
DeviceRegistryNamespaceAuthenticationType
列挙
デバイス レジストリ名前空間 MI 認証の種類: UserAssigned、SystemAssigned。
| 値 |
説明 |
|
UserAssigned
|
ユーザーが割り当てた認証タイプ。
|
|
SystemAssigned
|
システム割り当ての認証タイプ。
|
DeviceRegistryNamespaceDescription
Object
プロビジョニングサービスにリンクされているデバイスレジストリ名前空間の説明。
| Name |
型 |
説明 |
|
authenticationType
|
DeviceRegistryNamespaceAuthenticationType
|
デバイス レジストリ名前空間 MI 認証の種類: UserAssigned、SystemAssigned。
|
|
dataAddress
|
string
|
リンクされたAzureデバイスレジストリ名前空間のデータプレーンアドレス。
|
|
linkingState
|
LinkingState
|
この名前空間のリンク状態。
|
|
location
|
string
|
Azureでリンクされたデバイスレジストリ名前空間の位置。
|
|
namespaceUuid
|
string
|
リンクされたデバイスレジストリ名前空間の一意識別子。
|
|
resourceId
|
string
(arm-id)
|
Device Registry 名前空間の ARM リソース ID。
|
|
selectedUserAssignedIdentityResourceId
|
string
(arm-id)
|
Device Registry 名前空間に関連付けられている、選択したユーザー割り当て ID リソース ID。 これは、authenticationType が UserAssigned の場合に必要です。
|
ErrorDetails
Object
エラーの詳細。
| Name |
型 |
説明 |
|
code
|
integer
(int32)
|
エラー コード。
|
|
details
|
string
|
エラーの詳細。
|
|
httpStatusCode
|
string
|
HTTP 状態コード。
|
|
message
|
string
|
エラー メッセージ。
|
IotDpsPropertiesDescription
Object
キー、リンクされた IoT ハブ、現在の状態、およびホスト名や idScope などのシステム生成プロパティを含む、プロビジョニング サービスのサービス固有のプロパティ
| Name |
型 |
規定値 |
説明 |
|
allocationPolicy
|
AllocationPolicy
|
|
このプロビジョニング サービスで使用される割り当てポリシー。
|
|
authorizationPolicies
|
SharedAccessSignatureAuthorizationRuleAccessRightsDescription[]
|
|
プロビジョニング サービスの承認キーの一覧。
|
|
deviceProvisioningHostName
|
string
|
|
このプロビジョニング サービスのデバイス エンドポイント。
|
|
deviceRegistryNamespaces
|
DeviceRegistryNamespaceDescription[]
|
|
プロビジョニングサービスにリンクされたデバイスレジストリの名前空間。
|
|
disableLocalAuth
|
boolean
|
False
|
Azure RBAC以外のすべての認証方法を無効にします。
|
|
enableDataResidency
|
boolean
|
|
Optional.
DPS インスタンスで Data Residency が有効になっているかどうかを示し、geo ペア間のディザスター リカバリーを削除します。
|
|
idScope
|
string
|
|
このプロビジョニング サービスの一意識別子。
|
|
iotHubs
|
IotHubDefinitionDescription[]
|
|
このプロビジョニング サービスに関連付けられている IoT ハブの一覧。
|
|
ipFilterRules
|
IpFilterRule[]
|
|
IP フィルター規則。
|
|
portalOperationsHostName
|
string
|
|
このプロビジョニング サービスに対して CORS を有効にするポータル エンドポイント。
|
|
privateEndpointConnections
|
PrivateEndpointConnection[]
|
|
この IotHub で作成されたプライベート エンドポイント接続
|
|
provisioningState
|
string
|
|
プロビジョニング サービスの ARM プロビジョニング状態。
|
|
publicNetworkAccess
|
PublicNetworkAccess
|
|
パブリック ネットワークからの要求が許可されるかどうか
|
|
serviceOperationsHostName
|
string
|
|
プロビジョニング サービスのサービス エンドポイント。
|
|
state
|
State
|
|
プロビジョニング サービスの現在の状態。
|
IotDpsSku
列挙
SKU 名。
IotDpsSkuInfo
Object
使用可能なプロビジョニング サービス SKU の一覧。
| Name |
型 |
説明 |
|
capacity
|
integer
(int64)
|
プロビジョニングするユニット数
|
|
name
|
IotDpsSku
|
SKU 名。
|
|
tier
|
string
|
プロビジョニング サービスの価格レベル名。
|
IotHubAuthenticationType
列挙
IotHub MI認証タイプ:KeyBased、UserAssigned、SystemAssigned。
| 値 |
説明 |
|
KeyBased
|
鍵ベースの認証タイプ。
|
|
UserAssigned
|
ユーザーが割り当てた認証タイプ。
|
|
SystemAssigned
|
システム割り当ての認証タイプ。
|
IotHubDefinitionDescription
Object
IoT ハブの説明。
| Name |
型 |
説明 |
|
allocationWeight
|
integer
(int32)
|
特定の IoT h に適用する重み。
|
|
applyAllocationPolicy
|
boolean
|
特定の IoT ハブに対して allocationPolicy を適用するかどうかを示すフラグ。
|
|
authenticationType
|
IotHubAuthenticationType
|
IotHub MI認証タイプ:KeyBased、UserAssigned、SystemAssigned。
|
|
connectionString
|
string
|
IoT ハブの接続文字列。 これはAuthenticationTypeがKeyBasedの場合に必要です。
|
|
hostName
|
string
|
IoT ハブのホスト名。 これはconnectionStringが提供されていない場合に必要です。
|
|
location
|
string
|
IoT ハブの ARM リージョン。
|
|
name
|
string
|
IoT ハブのホスト名。
|
|
selectedUserAssignedIdentityResourceId
|
string
(arm-id)
|
選択したユーザー割り当てのIDリソースはIoTハブに関連付けられています。 これは、authenticationType が UserAssigned の場合に必要です。
|
IpFilterActionType
列挙
このルールによってキャプチャされた要求に対して必要なアクション。
IpFilterRule
Object
プロビジョニング サービスの IP フィルター規則。
| Name |
型 |
説明 |
|
action
|
IpFilterActionType
|
このルールによってキャプチャされた要求に対して必要なアクション。
|
|
filterName
|
string
|
IP フィルター規則の名前。
|
|
ipMask
|
string
|
規則の IP アドレス範囲を CIDR 表記で含む文字列。
|
|
target
|
IpFilterTargetType
|
このルールによってキャプチャされた要求のターゲット。
|
IpFilterTargetType
列挙
このルールによってキャプチャされた要求のターゲット。
| 値 |
説明 |
|
all
|
|
|
serviceApi
|
|
|
deviceApi
|
|
LinkingState
列挙
プロビジョニングサービスのADRリンクの状態。
| 値 |
説明 |
|
NotLinked
|
プロビジョニングサービスはデバイスレジストリの名前空間にリンクされていません。
|
|
InProgress
|
リンクの手続きは進行中です。
|
|
Succeeded
|
リンクのプロセスは成功しました。
|
|
Orphaned
|
リンクされたデバイスレジストリ名前空間はもはや存在しません。
|
ManagedServiceIdentity
Object
マネージド サービス ID (システム割り当て ID またはユーザー割り当て ID)
| Name |
型 |
説明 |
|
principalId
|
string
(uuid)
|
システム割り当て ID のサービス プリンシパル ID。 このプロパティは、システム割り当て ID にのみ提供されます。
|
|
tenantId
|
string
(uuid)
|
システム割り当て ID のテナント ID。 このプロパティは、システム割り当て ID にのみ提供されます。
|
|
type
|
ManagedServiceIdentityType
|
マネージド サービス ID の種類 (SystemAssigned 型と UserAssigned 型の両方が許可されます)。
|
|
userAssignedIdentities
|
<string,
UserAssignedIdentity>
|
User-Assigned ID
リソースに関連付けられているユーザー割り当て ID のセット。 userAssignedIdentitiesの辞書キーは、次の形でARMリソースIDとなります:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. ディクショナリ値は、要求内の空のオブジェクト ({}) にすることができます。
|
ManagedServiceIdentityType
列挙
マネージド サービス ID の種類 (SystemAssigned 型と UserAssigned 型の両方が許可されます)。
| 値 |
説明 |
|
None
|
|
|
SystemAssigned
|
|
|
UserAssigned
|
|
|
SystemAssigned,UserAssigned
|
|
PrivateEndpoint
Object
プライベート エンドポイント接続のプライベート エンドポイント プロパティ
| Name |
型 |
説明 |
|
id
|
string
|
リソース識別子。
|
PrivateEndpointConnection
Object
プロビジョニング サービスのプライベート エンドポイント接続
| Name |
型 |
説明 |
|
id
|
string
|
リソースの完全修飾リソース ID。 例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
name
|
string
|
リソースの名前
|
|
properties
|
PrivateEndpointConnectionProperties
|
プライベート エンドポイント接続のプロパティ
|
|
systemData
|
systemData
|
createdBy および modifiedBy 情報を含む Azure Resource Manager メタデータ。
|
|
type
|
string
|
リソースの種類。 例: "Microsoft.Compute/virtualMachines" または "Microsoft.Storage/storageAccounts"
|
PrivateEndpointConnectionProperties
Object
プライベート エンドポイント接続のプロパティ
PrivateLinkServiceConnectionState
Object
プライベート エンドポイント接続の現在の状態
PrivateLinkServiceConnectionStatus
列挙
プライベート エンドポイント接続の状態
| 値 |
説明 |
|
Pending
|
|
|
Approved
|
|
|
Rejected
|
|
|
Disconnected
|
|
ProvisioningServiceDescription
Object
プロビジョニング サービスの説明。
| Name |
型 |
説明 |
|
etag
|
string
|
Etag フィールドは 必要ありません。 応答本文で指定する場合は、通常の ETag 規則に従ってヘッダーとしても指定する必要があります。
|
|
id
|
string
|
リソースの完全修飾リソース ID。 例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
identity
|
ManagedServiceIdentity
|
このリソースに割り当てられているマネージド サービス ID。
|
|
location
|
string
|
リソースが存在する地理的な場所
|
|
name
|
string
|
リソースの名前
|
|
properties
|
IotDpsPropertiesDescription
|
プロビジョニング サービスのサービス固有のプロパティ
|
|
resourcegroup
|
string
|
リソースのリソース グループ。
|
|
sku
|
IotDpsSkuInfo
|
プロビジョニング サービスの SKU 情報。
|
|
subscriptionid
|
string
|
リソースのサブスクリプション ID。
|
|
systemData
|
systemData
|
createdBy および modifiedBy 情報を含む Azure Resource Manager メタデータ。
|
|
tags
|
object
|
リソース タグ。
|
|
type
|
string
|
リソースの種類。 例: "Microsoft.Compute/virtualMachines" または "Microsoft.Storage/storageAccounts"
|
PublicNetworkAccess
列挙
パブリック ネットワークからの要求が許可されるかどうか
SharedAccessSignatureAuthorizationRuleAccessRightsDescription
Object
共有アクセス キーの説明。
| Name |
型 |
説明 |
|
keyName
|
string
|
キーの名前。
|
|
primaryKey
|
string
|
プライマリ SAS キーの値。
|
|
rights
|
AccessRightsDescription
|
このキーが持つ権限。
|
|
secondaryKey
|
string
|
セカンダリ SAS キー値。
|
State
列挙
プロビジョニング サービスの現在の状態。
| 値 |
説明 |
|
Activating
|
|
|
Active
|
|
|
Deleting
|
|
|
Deleted
|
|
|
ActivationFailed
|
|
|
DeletionFailed
|
|
|
Transitioning
|
|
|
Suspending
|
|
|
Suspended
|
|
|
Resuming
|
|
|
FailingOver
|
|
|
FailoverFailed
|
|
systemData
Object
リソースの作成と最後の変更に関連するメタデータ。
| Name |
型 |
説明 |
|
createdAt
|
string
(date-time)
|
リソース作成のタイムスタンプ (UTC)。
|
|
createdBy
|
string
|
リソースを作成した ID。
|
|
createdByType
|
createdByType
|
リソースを作成した ID の種類。
|
|
lastModifiedAt
|
string
(date-time)
|
リソースの最終変更のタイムスタンプ (UTC)
|
|
lastModifiedBy
|
string
|
リソースを最後に変更した ID。
|
|
lastModifiedByType
|
createdByType
|
リソースを最後に変更した ID の種類。
|
UserAssignedIdentity
Object
ユーザー割り当て ID プロパティ
| Name |
型 |
説明 |
|
clientId
|
string
(uuid)
|
割り当てられた ID のクライアント ID。
|
|
principalId
|
string
(uuid)
|
割り当てられた ID のプリンシパル ID。
|