Code Versions - Create Or Update
Create or update version.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}?api-version=2025-09-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
name
|
path | True |
string pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$ |
Container name. This is case-sensitive. |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
|
subscription
|
path | True |
string minLength: 1 |
The ID of the target subscription. |
|
version
|
path | True |
string |
Version identifier. This is case-sensitive. |
|
workspace
|
path | True |
string pattern: ^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$ |
Name of Azure Machine Learning workspace. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Required | Type | Description |
|---|---|---|---|
| properties | True |
[Required] Additional attributes of the entity. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Create or update request is successful. |
|
| 201 Created |
Created |
|
| Other Status Codes |
Error |
Examples
CreateOrUpdate Workspace Code Version.
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/test-rg/providers/Microsoft.MachineLearningServices/workspaces/my-aml-workspace/codes/string/versions/string?api-version=2025-09-01
{
"properties": {
"description": "string",
"tags": {
"string": "string"
},
"properties": {
"string": "string"
},
"isAnonymous": false,
"codeUri": "https://blobStorage/folderName"
}
}
Sample response
{
"id": "string",
"name": "string",
"type": "string",
"properties": {
"description": "string",
"tags": {
"string": "string"
},
"properties": {
"string": "string"
},
"isAnonymous": false,
"codeUri": "https://blobStorage/folderName"
},
"systemData": {
"createdAt": "2020-01-01T12:34:56.999Z",
"createdBy": "string",
"createdByType": "User",
"lastModifiedAt": "2020-01-01T12:34:56.999Z",
"lastModifiedBy": "string",
"lastModifiedByType": "User"
}
}
{
"id": "string",
"name": "string",
"type": "string",
"properties": {
"description": "string",
"tags": {
"string": "string"
},
"properties": {
"string": "string"
},
"isAnonymous": false,
"codeUri": "https://blobStorage/folderName"
},
"systemData": {
"createdAt": "2020-01-01T12:34:56.999Z",
"createdBy": "string",
"createdByType": "User",
"lastModifiedAt": "2020-01-01T12:34:56.999Z",
"lastModifiedBy": "string",
"lastModifiedByType": "User"
}
}
Definitions
| Name | Description |
|---|---|
|
Asset |
Provisioning state of registry asset. |
|
Code |
Code asset version details. |
|
Code |
Azure Resource Manager resource envelope. |
|
created |
The type of identity that created the resource. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
system |
Metadata pertaining to creation and last modification of the resource. |
AssetProvisioningState
Provisioning state of registry asset.
| Value | Description |
|---|---|
| Succeeded | |
| Failed | |
| Canceled | |
| Creating | |
| Updating | |
| Deleting |
CodeVersion
Code asset version details.
| Name | Type | Default value | Description |
|---|---|---|---|
| codeUri |
string |
Uri where code is located |
|
| description |
string |
The asset description text. |
|
| isAnonymous |
boolean |
False |
If the name version are system generated (anonymous registration). |
| isArchived |
boolean |
False |
Is the asset archived? |
| properties |
object |
The asset property dictionary. |
|
| provisioningState |
Provisioning state for the code version. |
||
| tags |
object |
Tag dictionary. Tags can be added, removed, and updated. |
CodeVersionResource
Azure Resource Manager resource envelope.
| Name | Type | Description |
|---|---|---|
| id |
string |
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| name |
string |
The name of the resource |
| properties |
[Required] Additional attributes of the entity. |
|
| systemData |
Azure Resource Manager metadata containing createdBy and modifiedBy information. |
|
| type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
createdByType
The type of identity that created the resource.
| Value | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
systemData
Metadata pertaining to creation and last modification of the resource.
| Name | Type | Description |
|---|---|---|
| createdAt |
string (date-time) |
The timestamp of resource creation (UTC). |
| createdBy |
string |
The identity that created the resource. |
| createdByType |
The type of identity that created the resource. |
|
| lastModifiedAt |
string (date-time) |
The timestamp of resource last modification (UTC) |
| lastModifiedBy |
string |
The identity that last modified the resource. |
| lastModifiedByType |
The type of identity that last modified the resource. |