Users - Create Or Update
Create or replace an existing user profile. This operation can take a while to complete.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{name}?api-version=2018-09-15
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
lab
|
path | True |
string |
The name of the lab. |
name
|
path | True |
string |
The name of the user profile. |
resource
|
path | True |
string |
The name of the resource group. |
subscription
|
path | True |
string |
The subscription ID. |
api-version
|
query | True |
string |
Client API version. |
Request Body
Name | Type | Description |
---|---|---|
location |
string |
The location of the resource. |
properties.identity |
The identity of the user. |
|
properties.secretStore |
The secret store of the user. |
|
tags |
object |
The tags of the resource. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK |
|
201 Created |
Created |
|
Other Status Codes |
BadRequest |
Security
azure_auth
OAuth2 Implicit Grant
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | Access Microsoft Azure |
Examples
Users_CreateOrUpdate
Sample Request
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{devtestlabName}/users/{userName}?api-version=2018-09-15
{
"location": "{location}",
"tags": {
"tagName1": "tagValue1"
},
"properties": {
"identity": {
"principalName": "{principalName}",
"principalId": "{principalId}",
"tenantId": "{tenantId}",
"objectId": "{objectId}",
"appId": "{appId}"
},
"secretStore": {
"keyVaultUri": "{keyVaultUri}",
"keyVaultId": "{keyVaultId}"
}
}
}
Sample Response
{
"properties": {
"identity": {
"principalName": "{principalName}",
"principalId": "{principalId}",
"tenantId": "{tenantId}",
"objectId": "{objectId}",
"appId": "{appId}"
},
"secretStore": {
"keyVaultUri": "{keyVaultUri}",
"keyVaultId": "{keyVaultId}"
},
"createdDate": "2018-10-01T18:40:48.1739018-07:00",
"provisioningState": "Succeeded",
"uniqueIdentifier": "{uniqueIdentifier}"
},
"id": "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}",
"name": "{userName}",
"type": "Microsoft.DevTestLab/labs/users",
"location": "{location}",
"tags": {
"tagName1": "tagValue1"
}
}
{
"properties": {
"identity": {
"principalName": "{principalName}",
"principalId": "{principalId}",
"tenantId": "{tenantId}",
"objectId": "{objectId}",
"appId": "{appId}"
},
"secretStore": {
"keyVaultUri": "{keyVaultUri}",
"keyVaultId": "{keyVaultId}"
},
"createdDate": "2018-10-01T18:40:48.1739018-07:00",
"provisioningState": "Succeeded",
"uniqueIdentifier": "{uniqueIdentifier}"
},
"id": "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}",
"name": "{userName}",
"type": "Microsoft.DevTestLab/labs/users",
"location": "{location}",
"tags": {
"tagName1": "tagValue1"
}
}
Definitions
Name | Description |
---|---|
Cloud |
Error from a REST request. |
Cloud |
Body of an error from a REST request. |
User |
Profile of a lab user. |
User |
Identity attributes of a lab user. |
User |
Properties of a user's secret store. |
CloudError
Error from a REST request.
Name | Type | Description |
---|---|---|
error |
The cloud error that occurred |
CloudErrorBody
Body of an error from a REST request.
Name | Type | Description |
---|---|---|
code |
string |
The error code. |
details |
Inner errors. |
|
message |
string |
The error message. |
target |
string |
The error target. |
User
Profile of a lab user.
Name | Type | Description |
---|---|---|
id |
string |
The identifier of the resource. |
location |
string |
The location of the resource. |
name |
string |
The name of the resource. |
properties.createdDate |
string |
The creation date of the user profile. |
properties.identity |
The identity of the user. |
|
properties.provisioningState |
string |
The provisioning status of the resource. |
properties.secretStore |
The secret store of the user. |
|
properties.uniqueIdentifier |
string |
The unique immutable identifier of a resource (Guid). |
tags |
object |
The tags of the resource. |
type |
string |
The type of the resource. |
UserIdentity
Identity attributes of a lab user.
Name | Type | Description |
---|---|---|
appId |
string |
Set to the app Id of the client JWT making the request. |
objectId |
string |
Set to the object Id of the client JWT making the request. Not all users have object Id. For CSP (reseller) scenarios for example, object Id is not available. |
principalId |
string |
Set to the principal Id of the client JWT making the request. Service principal will not have the principal Id. |
principalName |
string |
Set to the principal name / UPN of the client JWT making the request. |
tenantId |
string |
Set to the tenant ID of the client JWT making the request. |
UserSecretStore
Properties of a user's secret store.
Name | Type | Description |
---|---|---|
keyVaultId |
string |
The ID of the user's Key vault. |
keyVaultUri |
string |
The URI of the user's Key vault. |