Maak of werk de metagegevens van de inrichtingsservice bij. Het gebruikelijke patroon voor het wijzigen van een eigenschap is het ophalen van de metagegevens van de inrichtingsservice en de metagegevens van de beveiliging en deze vervolgens te combineren met de gewijzigde waarden in een nieuwe hoofdtekst om de inrichtingsservice bij te werken.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}?api-version=2026-11-01
URI-parameters
| Naam |
In |
Vereist |
Type |
Description |
|
provisioningServiceName
|
path |
True
|
string
|
Naam van de provisioning-dienst die opgehaald moet worden.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
De naam van de resource group. De naam is hoofdletterongevoelig.
|
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
De ID van het doelabonnement.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
De API-versie die voor deze bewerking moet worden gebruikt.
|
Aanvraagbody
| Naam |
Vereist |
Type |
Description |
|
location
|
True
|
string
|
De geografische locatie waar de resource zich bevindt
|
|
properties
|
True
|
IotDpsPropertiesDescription
|
Servicespecifieke eigenschappen voor een inrichtingsservice
|
|
sku
|
True
|
IotDpsSkuInfo
|
SKU-gegevens voor een inrichtingsservice.
|
|
etag
|
|
string
|
Het veld Etag is niet vereist. Als deze is opgegeven in de hoofdtekst van het antwoord, moet deze ook worden opgegeven als een header volgens de normale ETag-conventie.
|
|
identity
|
|
ManagedServiceIdentity
|
De beheerde service-identiteiten die zijn toegewezen aan deze resource.
|
|
resourcegroup
|
|
string
|
De resourcegroep van de resource.
|
|
subscriptionid
|
|
string
|
De abonnements-id van de resource.
|
|
tags
|
|
object
|
Resourcetags.
|
Antwoorden
Beveiliging
azure_auth
OAuth2-stroom voor Azure Active Directory.
Type:
oauth2
Stroom:
implicit
Autorisatie-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiken
| Naam |
Description |
|
user_impersonation
|
Uw gebruikersaccount imiteren
|
Voorbeelden
DPSCreate
Voorbeeldaanvraag
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
Voorbeeldrespons
{
"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
Voorbeeldaanvraag
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
Voorbeeldrespons
{
"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
Voorbeeldaanvraag
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
Voorbeeldrespons
{
"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
Voorbeeldaanvraag
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
Voorbeeldrespons
{
"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
Voorbeeldaanvraag
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
Voorbeeldrespons
{
"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
Voorbeeldaanvraag
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
Voorbeeldrespons
{
"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
Voorbeeldaanvraag
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
Voorbeeldrespons
{
"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": {}
}
Definities
AccessRightsDescription
Opsomming
Rechten die deze sleutel heeft.
| Waarde |
Description |
|
ServiceConfig
|
|
|
EnrollmentRead
|
|
|
EnrollmentWrite
|
|
|
DeviceConnect
|
|
|
RegistrationStatusRead
|
|
|
RegistrationStatusWrite
|
|
AllocationPolicy
Opsomming
Toewijzingsbeleid dat moet worden gebruikt door deze inrichtingsservice.
| Waarde |
Description |
|
Hashed
|
|
|
GeoLatency
|
|
|
Static
|
|
createdByType
Opsomming
Het identiteitstype dat de resource heeft gemaakt.
| Waarde |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
DeviceRegistryNamespaceAuthenticationType
Opsomming
Apparaat Register Naamruimte MI authenticatietype: UserAssigned, SystemAssigned.
| Waarde |
Description |
|
UserAssigned
|
Door de gebruiker toegewezen verificatietype.
|
|
SystemAssigned
|
Door het systeem toegewezen authenticatietype.
|
DeviceRegistryNamespaceDescription
Object
Beschrijving van de naamruimte van het apparaatregister die is gekoppeld aan de inrichtingsservice.
| Naam |
Type |
Description |
|
authenticationType
|
DeviceRegistryNamespaceAuthenticationType
|
Apparaat Register Naamruimte MI authenticatietype: UserAssigned, SystemAssigned.
|
|
dataAddress
|
string
|
Het dataplane-adres van de gekoppelde Azure Device Registry-naamruimte.
|
|
linkingState
|
LinkingState
|
De verbindingstoestand van deze naamruimte.
|
|
location
|
string
|
Azure-locatie van de gekoppelde Device Registry-naamruimte.
|
|
namespaceUuid
|
string
|
Unieke identificatie van de gekoppelde Device Registry-naamruimte.
|
|
resourceId
|
string
(arm-id)
|
De ARM-bron-id van de naamruimte van het apparaatregister.
|
|
selectedUserAssignedIdentityResourceId
|
string
(arm-id)
|
De geselecteerde door de gebruiker toegewezen identiteitsresource-id die is gekoppeld aan de naamruimte van het apparaatregister. Dit is vereist wanneer authenticationType UserAssigned is.
|
ErrorDetails
Object
Foutdetails.
| Naam |
Type |
Description |
|
code
|
integer
(int32)
|
De foutcode.
|
|
details
|
string
|
De foutgegevens.
|
|
httpStatusCode
|
string
|
De HTTP-statuscode.
|
|
message
|
string
|
Het foutbericht.
|
IotDpsPropertiesDescription
Object
de servicespecifieke eigenschappen van een inrichtingsservice, inclusief sleutels, gekoppelde iot-hubs, huidige status en door het systeem gegenereerde eigenschappen, zoals hostnaam en idScope
| Naam |
Type |
Default value |
Description |
|
allocationPolicy
|
AllocationPolicy
|
|
Toewijzingsbeleid dat moet worden gebruikt door deze inrichtingsservice.
|
|
authorizationPolicies
|
SharedAccessSignatureAuthorizationRuleAccessRightsDescription[]
|
|
Lijst met autorisatiesleutels voor een inrichtingsservice.
|
|
deviceProvisioningHostName
|
string
|
|
Apparaateindpunt voor deze inrichtingsservice.
|
|
deviceRegistryNamespaces
|
DeviceRegistryNamespaceDescription[]
|
|
De naamruimtes van het apparaatregister zijn gekoppeld aan de provisioningservice.
|
|
disableLocalAuth
|
boolean
|
False
|
Schakelt alle authenticatiemethoden uit behalve Azure RBAC.
|
|
enableDataResidency
|
boolean
|
|
Optional.
Geeft aan of voor het DPS-exemplaar Data Residency is ingeschakeld, waardoor het herstel na noodgevallen voor meerdere geografische paren wordt verwijderd.
|
|
idScope
|
string
|
|
Unieke id van deze inrichtingsservice.
|
|
iotHubs
|
IotHubDefinitionDescription[]
|
|
Lijst met IoT-hubs die zijn gekoppeld aan deze inrichtingsservice.
|
|
ipFilterRules
|
IpFilterRule[]
|
|
De IP-filterregels.
|
|
portalOperationsHostName
|
string
|
|
Portal-eindpunt om CORS in te schakelen voor deze inrichtingsservice.
|
|
privateEndpointConnections
|
PrivateEndpointConnection[]
|
|
Privé-eindpuntverbindingen die zijn gemaakt op deze IotHub
|
|
provisioningState
|
string
|
|
De ARM-inrichtingsstatus van de inrichtingsservice.
|
|
publicNetworkAccess
|
PublicNetworkAccess
|
|
Of aanvragen van openbaar netwerk zijn toegestaan
|
|
serviceOperationsHostName
|
string
|
|
Service-eindpunt voor inrichtingsservice.
|
|
state
|
State
|
|
Huidige status van de inrichtingsservice.
|
IotDpsSku
Opsomming
SKU-naam.
IotDpsSkuInfo
Object
Lijst met mogelijke SKU's voor de inrichtingsservice.
| Naam |
Type |
Description |
|
capacity
|
integer
(int64)
|
Het aantal eenheden dat moet worden ingericht
|
|
name
|
IotDpsSku
|
SKU-naam.
|
|
tier
|
string
|
Naam van de prijscategorie van de inrichtingsservice.
|
IotHubAuthenticationType
Opsomming
IotHub MI-authenticatietype: KeyBased, UserAssigned, SystemAssigned.
| Waarde |
Description |
|
KeyBased
|
Sleutelgebaseerd authenticatietype.
|
|
UserAssigned
|
Door de gebruiker toegewezen verificatietype.
|
|
SystemAssigned
|
Door het systeem toegewezen authenticatietype.
|
IotHubDefinitionDescription
Object
Beschrijving van de IoT-hub.
| Naam |
Type |
Description |
|
allocationWeight
|
integer
(int32)
|
gewicht om aan te vragen voor een bepaalde iot h.
|
|
applyAllocationPolicy
|
boolean
|
vlag voor het toepassen van allocationPolicy of niet voor een bepaalde iot-hub.
|
|
authenticationType
|
IotHubAuthenticationType
|
IotHub MI-authenticatietype: KeyBased, UserAssigned, SystemAssigned.
|
|
connectionString
|
string
|
Verbindingsreeks van de IoT-hub. Dit is vereist wanneer authenticatieType KeyBased is.
|
|
hostName
|
string
|
Hostnaam van de IoT-hub. Dit is vereist wanneer connectionString niet wordt geleverd.
|
|
location
|
string
|
ARM-regio van de IoT-hub.
|
|
name
|
string
|
Hostnaam van de IoT-hub.
|
|
selectedUserAssignedIdentityResourceId
|
string
(arm-id)
|
De geselecteerde door de gebruiker toegewezen identiteitsbron-ID die gekoppeld is aan de IoT-hub. Dit is vereist wanneer authenticationType UserAssigned is.
|
IpFilterActionType
Opsomming
De gewenste actie voor aanvragen die door deze regel zijn vastgelegd.
| Waarde |
Description |
|
Accept
|
|
|
Reject
|
|
IpFilterRule
Object
De IP-filterregels voor een inrichtingsservice.
| Naam |
Type |
Description |
|
action
|
IpFilterActionType
|
De gewenste actie voor aanvragen die door deze regel zijn vastgelegd.
|
|
filterName
|
string
|
De naam van de IP-filterregel.
|
|
ipMask
|
string
|
Een tekenreeks die het IP-adresbereik in CIDR-notatie voor de regel bevat.
|
|
target
|
IpFilterTargetType
|
Doel voor aanvragen die zijn vastgelegd door deze regel.
|
IpFilterTargetType
Opsomming
Doel voor aanvragen die zijn vastgelegd door deze regel.
| Waarde |
Description |
|
all
|
|
|
serviceApi
|
|
|
deviceApi
|
|
LinkingState
Opsomming
De staat van ADR-koppeling voor een provisioningdienst.
| Waarde |
Description |
|
NotLinked
|
De provisioningservice is niet gekoppeld aan een Device Registry-naamruimte.
|
|
InProgress
|
Het koppelproces is in volle gang.
|
|
Succeeded
|
Het koppelproces is geslaagd.
|
|
Orphaned
|
De gekoppelde Device Registry-naamruimte bestaat niet meer.
|
ManagedServiceIdentity
Object
Beheerde service-identiteit (door het systeem toegewezen en/of door de gebruiker toegewezen identiteiten)
| Naam |
Type |
Description |
|
principalId
|
string
(uuid)
|
De service-principal-id van de door het systeem toegewezen identiteit. Deze eigenschap wordt alleen verstrekt voor een door het systeem toegewezen identiteit.
|
|
tenantId
|
string
(uuid)
|
De tenant-id van de door het systeem toegewezen identiteit. Deze eigenschap wordt alleen verstrekt voor een door het systeem toegewezen identiteit.
|
|
type
|
ManagedServiceIdentityType
|
Type beheerde service-identiteit (waarbij zowel SystemAssigned- als UserAssigned-typen zijn toegestaan).
|
|
userAssignedIdentities
|
<string,
UserAssignedIdentity>
|
User-Assigned identiteiten
De set door de gebruiker toegewezen identiteiten die aan de resource zijn gekoppeld. De woordenboeksleutels van userAssignedIdentities zijn ARM-resource id's in de vorm: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft. BeheerdIdentiteit/gebruikerToegewezenIdentiteiten/{identiteitNaam}. De waarden van de woordenlijst kunnen lege objecten ({}) zijn in aanvragen.
|
ManagedServiceIdentityType
Opsomming
Type beheerde service-identiteit (waarbij zowel SystemAssigned- als UserAssigned-typen zijn toegestaan).
| Waarde |
Description |
|
None
|
|
|
SystemAssigned
|
|
|
UserAssigned
|
|
|
SystemAssigned,UserAssigned
|
|
PrivateEndpoint
Object
De eigenschap privé-eindpunt van een privé-eindpuntverbinding
| Naam |
Type |
Description |
|
id
|
string
|
De resource-id.
|
PrivateEndpointConnection
Object
De privé-eindpuntverbinding van een inrichtingsservice
| Naam |
Type |
Description |
|
id
|
string
|
Volledig gekwalificeerde resource-id voor de resource. Bijv. - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
name
|
string
|
De naam van de resource
|
|
properties
|
PrivateEndpointConnectionProperties
|
De eigenschappen van een privé-eindpuntverbinding
|
|
systemData
|
systemData
|
Azure Resource Manager-metagegevens met createdBy- en modifiedBy-gegevens.
|
|
type
|
string
|
Het type bron. Bijvoorbeeld 'Microsoft.Compute/virtualMachines' of 'Microsoft.Storage/storageAccounts'
|
PrivateEndpointConnectionProperties
Object
De eigenschappen van een privé-eindpuntverbinding
PrivateLinkServiceConnectionState
Object
De huidige status van een privé-eindpuntverbinding
| Naam |
Type |
Description |
|
actionsRequired
|
string
|
Acties die vereist zijn voor een privé-eindpuntverbinding
|
|
description
|
string
|
De beschrijving voor de huidige status van een privé-eindpuntverbinding
|
|
status
|
PrivateLinkServiceConnectionStatus
|
De status van een privé-eindpuntverbinding
|
PrivateLinkServiceConnectionStatus
Opsomming
De status van een privé-eindpuntverbinding
| Waarde |
Description |
|
Pending
|
|
|
Approved
|
|
|
Rejected
|
|
|
Disconnected
|
|
ProvisioningServiceDescription
Object
De beschrijving van de inrichtingsservice.
| Naam |
Type |
Description |
|
etag
|
string
|
Het veld Etag is niet vereist. Als deze is opgegeven in de hoofdtekst van het antwoord, moet deze ook worden opgegeven als een header volgens de normale ETag-conventie.
|
|
id
|
string
|
Volledig gekwalificeerde resource-id voor de resource. Bijv. - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
identity
|
ManagedServiceIdentity
|
De beheerde service-identiteiten die zijn toegewezen aan deze resource.
|
|
location
|
string
|
De geografische locatie waar de resource zich bevindt
|
|
name
|
string
|
De naam van de resource
|
|
properties
|
IotDpsPropertiesDescription
|
Servicespecifieke eigenschappen voor een inrichtingsservice
|
|
resourcegroup
|
string
|
De resourcegroep van de resource.
|
|
sku
|
IotDpsSkuInfo
|
SKU-gegevens voor een inrichtingsservice.
|
|
subscriptionid
|
string
|
De abonnements-id van de resource.
|
|
systemData
|
systemData
|
Azure Resource Manager-metagegevens met createdBy- en modifiedBy-gegevens.
|
|
tags
|
object
|
Resourcetags.
|
|
type
|
string
|
Het type bron. Bijvoorbeeld 'Microsoft.Compute/virtualMachines' of 'Microsoft.Storage/storageAccounts'
|
PublicNetworkAccess
Opsomming
Of aanvragen van openbaar netwerk zijn toegestaan
| Waarde |
Description |
|
Enabled
|
|
|
Disabled
|
|
SharedAccessSignatureAuthorizationRuleAccessRightsDescription
Object
Beschrijving van de gedeelde toegangssleutel.
| Naam |
Type |
Description |
|
keyName
|
string
|
Naam van de sleutel.
|
|
primaryKey
|
string
|
Primaire SAS-sleutelwaarde.
|
|
rights
|
AccessRightsDescription
|
Rechten die deze sleutel heeft.
|
|
secondaryKey
|
string
|
Secundaire SAS-sleutelwaarde.
|
State
Opsomming
Huidige status van de inrichtingsservice.
| Waarde |
Description |
|
Activating
|
|
|
Active
|
|
|
Deleting
|
|
|
Deleted
|
|
|
ActivationFailed
|
|
|
DeletionFailed
|
|
|
Transitioning
|
|
|
Suspending
|
|
|
Suspended
|
|
|
Resuming
|
|
|
FailingOver
|
|
|
FailoverFailed
|
|
systemData
Object
Metagegevens met betrekking tot het maken en de laatste wijziging van de resource.
| Naam |
Type |
Description |
|
createdAt
|
string
(date-time)
|
De tijdstempel van het aanmaken van resources (UTC).
|
|
createdBy
|
string
|
De identiteit die de resource heeft gemaakt.
|
|
createdByType
|
createdByType
|
Het identiteitstype dat de resource heeft gemaakt.
|
|
lastModifiedAt
|
string
(date-time)
|
De tijdstempel van de laatste wijziging van de resource (UTC)
|
|
lastModifiedBy
|
string
|
De identiteit die de resource voor het laatst heeft gewijzigd.
|
|
lastModifiedByType
|
createdByType
|
Het type identiteit dat de resource voor het laatst heeft gewijzigd.
|
UserAssignedIdentity
Object
Door de gebruiker toegewezen identiteitseigenschappen
| Naam |
Type |
Description |
|
clientId
|
string
(uuid)
|
De client-id van de toegewezen identiteit.
|
|
principalId
|
string
(uuid)
|
De principal-id van de toegewezen identiteit.
|