Vytvořte nebo aktualizujte metadata služby zřizování. Obvyklým vzorem pro úpravu vlastnosti je načtení metadat služby zřizování a metadat zabezpečení a jejich následné zkombinování s upravenými hodnotami v novém těle za účelem aktualizace služby zřizování.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}?api-version=2026-11-01
Parametry identifikátoru URI
| Název |
V |
Vyžadováno |
Typ |
Description |
|
provisioningServiceName
|
path |
True
|
string
|
Název služby pro provisioning pro získání informací.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Název skupiny zdrojů. Název nerozlišuje velikost písmen.
|
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
ID cílového předplatného.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Verze rozhraní API, která se má použít pro tuto operaci.
|
Text požadavku
| Název |
Vyžadováno |
Typ |
Description |
|
location
|
True
|
string
|
Geografické umístění, ve kterém se nachází zdroj
|
|
properties
|
True
|
IotDpsPropertiesDescription
|
Vlastnosti specifické pro službu zřizování
|
|
sku
|
True
|
IotDpsSkuInfo
|
Informace o skladové pořizovací službě
|
|
etag
|
|
string
|
Pole Etag není povinné. Pokud je uvedený v textu odpovědi, musí se také poskytnout jako hlavička podle normální konvence značky ETag.
|
|
identity
|
|
ManagedServiceIdentity
|
Identity spravované služby přiřazené k tomuto prostředku.
|
|
resourcegroup
|
|
string
|
Skupina prostředků prostředku.
|
|
subscriptionid
|
|
string
|
ID předplatného prostředku.
|
|
tags
|
|
object
|
Štítky prostředků
|
Odpovědi
Zabezpečení
azure_auth
Tok OAuth2 služby Azure Active Directory.
Typ:
oauth2
Tok:
implicit
URL autorizace:
https://login.microsoftonline.com/common/oauth2/authorize
Rozsahy
| Název |
Description |
|
user_impersonation
|
vydávat se za svůj uživatelský účet
|
Příklady
DPSCreate
Ukázkový požadavek
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
Ukázková odpověď
{
"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
Ukázkový požadavek
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
Ukázková odpověď
{
"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
Ukázkový požadavek
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
Ukázková odpověď
{
"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
Ukázkový požadavek
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
Ukázková odpověď
{
"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
Ukázkový požadavek
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
Ukázková odpověď
{
"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
Ukázkový požadavek
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
Ukázková odpověď
{
"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
Ukázkový požadavek
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
Ukázková odpověď
{
"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": {}
}
Definice
| Název |
Description |
|
AccessRightsDescription
|
Práva, která tento klíč má.
|
|
AllocationPolicy
|
Zásady přidělování, které má tato služba zřizování používat.
|
|
createdByType
|
Typ identity, která prostředek vytvořila.
|
|
DeviceRegistryNamespaceAuthenticationType
|
Typ ověřování MI oboru názvů zařízení registru zařízení: UserAssigned, SystemAssigned.
|
|
DeviceRegistryNamespaceDescription
|
Popis oboru názvů registru zařízení, který je propojen se službou zřizování.
|
|
ErrorDetails
|
Podrobnosti o chybě
|
|
IotDpsPropertiesDescription
|
vlastnosti specifické pro službu zřizování, včetně klíčů, propojených iot Hubů, aktuálního stavu a systémem generovaných vlastností, jako je název hostitele a idScope
|
|
IotDpsSku
|
Název skladové položky.
|
|
IotDpsSkuInfo
|
Seznam možných skladových položek služby zřizování
|
|
IotHubAuthenticationType
|
Typ autentizace IotHub MI: KeyBased, UserAssigned, SystemAssigned.
|
|
IotHubDefinitionDescription
|
Popis centra IoT.
|
|
IpFilterActionType
|
Požadovaná akce pro požadavky zachycené tímto pravidlem.
|
|
IpFilterRule
|
Pravidla filtru IP adres pro službu zřizování
|
|
IpFilterTargetType
|
Cíl pro požadavky zachycené tímto pravidlem.
|
|
LinkingState
|
Stav ADR propojení pro provisioning službu.
|
|
ManagedServiceIdentity
|
Identita spravované služby (identita přiřazená systémem nebo identita přiřazená uživatelem)
|
|
ManagedServiceIdentityType
|
Typ identity spravované služby (kde jsou povolené typy SystemAssigned i UserAssigned).
|
|
PrivateEndpoint
|
Vlastnost privátního koncového bodu připojení privátního koncového bodu
|
|
PrivateEndpointConnection
|
Připojení privátního koncového bodu služby zřizování
|
|
PrivateEndpointConnectionProperties
|
Vlastnosti připojení privátního koncového bodu
|
|
PrivateLinkServiceConnectionState
|
Aktuální stav připojení privátního koncového bodu
|
|
PrivateLinkServiceConnectionStatus
|
Stav připojení privátního koncového bodu
|
|
ProvisioningServiceDescription
|
Popis služby zřizování
|
|
PublicNetworkAccess
|
Jestli jsou povolené požadavky z veřejné sítě
|
|
SharedAccessSignatureAuthorizationRuleAccessRightsDescription
|
Popis sdíleného přístupového klíče
|
|
State
|
Aktuální stav služby zřizování
|
|
systemData
|
Metadata týkající se vytvoření a poslední změny prostředku.
|
|
UserAssignedIdentity
|
Vlastnosti identity přiřazené uživatelem
|
AccessRightsDescription
Výčet
Práva, která tento klíč má.
| Hodnota |
Description |
|
ServiceConfig
|
|
|
EnrollmentRead
|
|
|
EnrollmentWrite
|
|
|
DeviceConnect
|
|
|
RegistrationStatusRead
|
|
|
RegistrationStatusWrite
|
|
AllocationPolicy
Výčet
Zásady přidělování, které má tato služba zřizování používat.
| Hodnota |
Description |
|
Hashed
|
|
|
GeoLatency
|
|
|
Static
|
|
createdByType
Výčet
Typ identity, která prostředek vytvořila.
| Hodnota |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
DeviceRegistryNamespaceAuthenticationType
Výčet
Typ ověřování MI oboru názvů zařízení registru zařízení: UserAssigned, SystemAssigned.
| Hodnota |
Description |
|
UserAssigned
|
Typ ověření přiřazený uživatelem.
|
|
SystemAssigned
|
Typ ověření přiřazený systémem.
|
DeviceRegistryNamespaceDescription
Objekt
Popis oboru názvů registru zařízení, který je propojen se službou zřizování.
| Název |
Typ |
Description |
|
authenticationType
|
DeviceRegistryNamespaceAuthenticationType
|
Typ ověřování MI oboru názvů zařízení registru zařízení: UserAssigned, SystemAssigned.
|
|
dataAddress
|
string
|
Adresa datové roviny propojeného jmenného prostoru Azure Device Registry.
|
|
linkingState
|
LinkingState
|
Stav propojení tohoto jmenného prostoru.
|
|
location
|
string
|
Azure umístění propojeného jmenného prostoru Device Registry.
|
|
namespaceUuid
|
string
|
Jedinečný identifikátor propojeného jmenného prostoru Device Registry.
|
|
resourceId
|
string
(arm-id)
|
ID prostředku ARM oboru názvů registru zařízení.
|
|
selectedUserAssignedIdentityResourceId
|
string
(arm-id)
|
ID vybraného prostředku identity přiřazené uživatelem přidružené k oboru názvů registru zařízení. To se vyžaduje, když je typ authenticationType přiřazený uživatelem.
|
ErrorDetails
Objekt
Podrobnosti o chybě
| Název |
Typ |
Description |
|
code
|
integer
(int32)
|
Kód chyby.
|
|
details
|
string
|
Podrobnosti o chybě.
|
|
httpStatusCode
|
string
|
Stavový kód HTTP.
|
|
message
|
string
|
Chybová zpráva.
|
IotDpsPropertiesDescription
Objekt
vlastnosti specifické pro službu zřizování, včetně klíčů, propojených iot Hubů, aktuálního stavu a systémem generovaných vlastností, jako je název hostitele a idScope
| Název |
Typ |
Default value |
Description |
|
allocationPolicy
|
AllocationPolicy
|
|
Zásady přidělování, které má tato služba zřizování používat.
|
|
authorizationPolicies
|
SharedAccessSignatureAuthorizationRuleAccessRightsDescription[]
|
|
Seznam autorizačních klíčů pro službu zřizování
|
|
deviceProvisioningHostName
|
string
|
|
Koncový bod zařízení pro tuto službu zřizování
|
|
deviceRegistryNamespaces
|
DeviceRegistryNamespaceDescription[]
|
|
Jmenné prostory Device Registry byly propojeny se službou provisioning.
|
|
disableLocalAuth
|
boolean
|
False
|
Vypíná všechny autentizační metody kromě Azure RBAC.
|
|
enableDataResidency
|
boolean
|
|
Optional.
Označuje, jestli má instance DPS povolenou rezidenci dat, odebrání zotavení po havárii mezi geografickou dvojicí.
|
|
idScope
|
string
|
|
Jedinečný identifikátor této služby zřizování
|
|
iotHubs
|
IotHubDefinitionDescription[]
|
|
Seznam center IoT přidružených k této službě zřizování
|
|
ipFilterRules
|
IpFilterRule[]
|
|
Pravidla filtru IP adres.
|
|
portalOperationsHostName
|
string
|
|
Koncový bod portálu pro povolení CORS pro tuto službu zřizování
|
|
privateEndpointConnections
|
PrivateEndpointConnection[]
|
|
Připojení privátního koncového bodu vytvořená na tomto IotHubu
|
|
provisioningState
|
string
|
|
Stav zřizování ARM služby zřizování.
|
|
publicNetworkAccess
|
PublicNetworkAccess
|
|
Jestli jsou povolené požadavky z veřejné sítě
|
|
serviceOperationsHostName
|
string
|
|
Koncový bod služby pro zřizování služby.
|
|
state
|
State
|
|
Aktuální stav služby zřizování
|
IotDpsSku
Výčet
Název skladové položky.
IotDpsSkuInfo
Objekt
Seznam možných skladových položek služby zřizování
| Název |
Typ |
Description |
|
capacity
|
integer
(int64)
|
Počet jednotek, které se mají zřídit
|
|
name
|
IotDpsSku
|
Název skladové položky.
|
|
tier
|
string
|
Název cenové úrovně služby zřizování
|
IotHubAuthenticationType
Výčet
Typ autentizace IotHub MI: KeyBased, UserAssigned, SystemAssigned.
| Hodnota |
Description |
|
KeyBased
|
Typ autentizace založený na klíči.
|
|
UserAssigned
|
Typ ověření přiřazený uživatelem.
|
|
SystemAssigned
|
Typ ověření přiřazený systémem.
|
IotHubDefinitionDescription
Objekt
Popis centra IoT.
| Název |
Typ |
Description |
|
allocationWeight
|
integer
(int32)
|
hmotnost, která se použije pro danou iot h.
|
|
applyAllocationPolicy
|
boolean
|
příznak pro použití allocationPolicy nebo ne pro dané centrum IoT.
|
|
authenticationType
|
IotHubAuthenticationType
|
Typ autentizace IotHub MI: KeyBased, UserAssigned, SystemAssigned.
|
|
connectionString
|
string
|
Připojovací řetězec centra IoT. To je vyžadováno, když je authenticationType založený na klíčích.
|
|
hostName
|
string
|
Název hostitele centra IoT. To je vyžadováno, pokud není k dispozici connectionString.
|
|
location
|
string
|
Oblast ARM centra IoT
|
|
name
|
string
|
Název hostitele centra IoT.
|
|
selectedUserAssignedIdentityResourceId
|
string
(arm-id)
|
Vybraný uživatelem přiřazený identifikační zdroj Id spojený s IoT hubem. To se vyžaduje, když je typ authenticationType přiřazený uživatelem.
|
IpFilterActionType
Výčet
Požadovaná akce pro požadavky zachycené tímto pravidlem.
| Hodnota |
Description |
|
Accept
|
|
|
Reject
|
|
IpFilterRule
Objekt
Pravidla filtru IP adres pro službu zřizování
| Název |
Typ |
Description |
|
action
|
IpFilterActionType
|
Požadovaná akce pro požadavky zachycené tímto pravidlem.
|
|
filterName
|
string
|
Název pravidla filtru IP adres.
|
|
ipMask
|
string
|
Řetězec, který obsahuje rozsah IP adres v zápisu CIDR pravidla.
|
|
target
|
IpFilterTargetType
|
Cíl pro požadavky zachycené tímto pravidlem.
|
IpFilterTargetType
Výčet
Cíl pro požadavky zachycené tímto pravidlem.
| Hodnota |
Description |
|
all
|
|
|
serviceApi
|
|
|
deviceApi
|
|
LinkingState
Výčet
Stav ADR propojení pro provisioning službu.
| Hodnota |
Description |
|
NotLinked
|
Provisioning služba není propojena s jmenným prostorem Device Registry.
|
|
InProgress
|
Proces propojení je v procesu.
|
|
Succeeded
|
Proces propojení byl úspěšný.
|
|
Orphaned
|
Propojený jmenný prostor Device Registry již neexistuje.
|
ManagedServiceIdentity
Objekt
Identita spravované služby (identita přiřazená systémem nebo identita přiřazená uživatelem)
| Název |
Typ |
Description |
|
principalId
|
string
(uuid)
|
ID instančního objektu identity přiřazené systémem. Tato vlastnost bude poskytována pouze pro identitu přiřazenou systémem.
|
|
tenantId
|
string
(uuid)
|
ID tenanta přiřazené identity systému. Tato vlastnost bude poskytována pouze pro identitu přiřazenou systémem.
|
|
type
|
ManagedServiceIdentityType
|
Typ identity spravované služby (kde jsou povolené typy SystemAssigned i UserAssigned).
|
|
userAssignedIdentities
|
<string,
UserAssignedIdentity>
|
identity User-Assigned
Sada identit přiřazených uživatelem přidružená k prostředku. Klíče slovníku userAssignedIdentities budou ARM resource id ve formě: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft. ManagedIdentity/userAssignedIdentities/{identityName}. Hodnoty slovníku můžou být prázdné objekty ({}) v požadavcích.
|
ManagedServiceIdentityType
Výčet
Typ identity spravované služby (kde jsou povolené typy SystemAssigned i UserAssigned).
| Hodnota |
Description |
|
None
|
|
|
SystemAssigned
|
|
|
UserAssigned
|
|
|
SystemAssigned,UserAssigned
|
|
PrivateEndpoint
Objekt
Vlastnost privátního koncového bodu připojení privátního koncového bodu
| Název |
Typ |
Description |
|
id
|
string
|
Identifikátor prostředku.
|
PrivateEndpointConnection
Objekt
Připojení privátního koncového bodu služby zřizování
| Název |
Typ |
Description |
|
id
|
string
|
Plně kvalifikované ID prostředku pro prostředek. Příklad : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
name
|
string
|
Název prostředku
|
|
properties
|
PrivateEndpointConnectionProperties
|
Vlastnosti připojení privátního koncového bodu
|
|
systemData
|
systemData
|
Metadata služby Azure Resource Manager obsahující informace o tom, kdo jej vytvořil a upravil.
|
|
type
|
string
|
Typ prostředku. Například Microsoft.Compute/virtualMachines nebo Microsoft.Storage/storageAccounts
|
PrivateEndpointConnectionProperties
Objekt
Vlastnosti připojení privátního koncového bodu
| Název |
Typ |
Description |
|
privateEndpoint
|
PrivateEndpoint
|
Vlastnost privátního koncového bodu připojení privátního koncového bodu
|
|
privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
Aktuální stav připojení privátního koncového bodu
|
PrivateLinkServiceConnectionState
Objekt
Aktuální stav připojení privátního koncového bodu
| Název |
Typ |
Description |
|
actionsRequired
|
string
|
Akce vyžadované pro připojení privátního koncového bodu
|
|
description
|
string
|
Popis aktuálního stavu připojení privátního koncového bodu
|
|
status
|
PrivateLinkServiceConnectionStatus
|
Stav připojení privátního koncového bodu
|
PrivateLinkServiceConnectionStatus
Výčet
Stav připojení privátního koncového bodu
| Hodnota |
Description |
|
Pending
|
|
|
Approved
|
|
|
Rejected
|
|
|
Disconnected
|
|
ProvisioningServiceDescription
Objekt
Popis služby zřizování
| Název |
Typ |
Description |
|
etag
|
string
|
Pole Etag není povinné. Pokud je uvedený v textu odpovědi, musí se také poskytnout jako hlavička podle normální konvence značky ETag.
|
|
id
|
string
|
Plně kvalifikované ID prostředku pro prostředek. Příklad : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
identity
|
ManagedServiceIdentity
|
Identity spravované služby přiřazené k tomuto prostředku.
|
|
location
|
string
|
Geografické umístění, ve kterém se nachází zdroj
|
|
name
|
string
|
Název prostředku
|
|
properties
|
IotDpsPropertiesDescription
|
Vlastnosti specifické pro službu zřizování
|
|
resourcegroup
|
string
|
Skupina prostředků prostředku.
|
|
sku
|
IotDpsSkuInfo
|
Informace o skladové pořizovací službě
|
|
subscriptionid
|
string
|
ID předplatného prostředku.
|
|
systemData
|
systemData
|
Metadata služby Azure Resource Manager obsahující informace o tom, kdo jej vytvořil a upravil.
|
|
tags
|
object
|
Štítky prostředků
|
|
type
|
string
|
Typ prostředku. Například Microsoft.Compute/virtualMachines nebo Microsoft.Storage/storageAccounts
|
PublicNetworkAccess
Výčet
Jestli jsou povolené požadavky z veřejné sítě
| Hodnota |
Description |
|
Enabled
|
|
|
Disabled
|
|
SharedAccessSignatureAuthorizationRuleAccessRightsDescription
Objekt
Popis sdíleného přístupového klíče
| Název |
Typ |
Description |
|
keyName
|
string
|
Název klíče.
|
|
primaryKey
|
string
|
Hodnota primárního klíče SAS
|
|
rights
|
AccessRightsDescription
|
Práva, která tento klíč má.
|
|
secondaryKey
|
string
|
Hodnota sekundárního klíče SAS
|
State
Výčet
Aktuální stav služby zřizování
| Hodnota |
Description |
|
Activating
|
|
|
Active
|
|
|
Deleting
|
|
|
Deleted
|
|
|
ActivationFailed
|
|
|
DeletionFailed
|
|
|
Transitioning
|
|
|
Suspending
|
|
|
Suspended
|
|
|
Resuming
|
|
|
FailingOver
|
|
|
FailoverFailed
|
|
systemData
Objekt
Metadata týkající se vytvoření a poslední změny prostředku.
| Název |
Typ |
Description |
|
createdAt
|
string
(date-time)
|
Časové razítko vytvoření prostředku (UTC).
|
|
createdBy
|
string
|
Identita, která prostředek vytvořila.
|
|
createdByType
|
createdByType
|
Typ identity, která prostředek vytvořila.
|
|
lastModifiedAt
|
string
(date-time)
|
Časové razítko poslední změny zdroje (UTC)
|
|
lastModifiedBy
|
string
|
Identita, která naposledy změnila prostředek.
|
|
lastModifiedByType
|
createdByType
|
Typ identity, která naposledy změnila prostředek.
|
UserAssignedIdentity
Objekt
Vlastnosti identity přiřazené uživatelem
| Název |
Typ |
Description |
|
clientId
|
string
(uuid)
|
ID klienta přiřazené identity.
|
|
principalId
|
string
(uuid)
|
ID objektu zabezpečení přiřazené identity.
|