Share via


Code Versions - Create Or Get Start Pending Upload

Generate a storage location and credential for the client to upload a code asset to.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload?api-version=2025-09-01

URI Parameters

Name In Required Type Description
name
path True

string

Container name. This is case-sensitive.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

minLength: 1

The ID of the target subscription.

version
path True

string

Version identifier. This is case-sensitive.

workspaceName
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 Type Description
pendingUploadId

string

If PendingUploadId = null then random guid will be used.

pendingUploadType

PendingUploadType

TemporaryBlobReference is the only supported type

Responses

Name Type Description
200 OK

PendingUploadResponseDto

Success

Other Status Codes

ErrorResponse

Error

Examples

CreateOrGetStartPendingUpload Workspace Code Version.

Sample request

POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/test-rg/providers/Microsoft.MachineLearningServices/workspaces/my-aml-workspace/codes/string/versions/string/startPendingUpload?api-version=2025-09-01

{
  "pendingUploadId": "string",
  "pendingUploadType": "None"
}

Sample response

{
  "blobReferenceForConsumption": {
    "blobUri": "https://www.contoso.com/example",
    "storageAccountArmId": "string",
    "credential": {
      "credentialType": "SAS",
      "sasUri": "https://www.contoso.com/example"
    }
  },
  "pendingUploadId": "string",
  "pendingUploadType": "None"
}

Definitions

Name Description
BlobReferenceForConsumptionDto
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

PendingUploadCredentialType

Enum to determine the PendingUpload credentials type.

PendingUploadRequestDto
PendingUploadResponseDto
PendingUploadType

Type of storage to use for the pending upload location

SASCredentialDto

BlobReferenceForConsumptionDto

Name Type Description
blobUri

string (uri)

Blob URI path for client to upload data. Example: https://blob.windows.core.net/Container/Path

credential PendingUploadCredentialDto:

SASCredentialDto

Credential info to access storage account

storageAccountArmId

string

Arm ID of the storage account to use

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

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

PendingUploadCredentialType

Enum to determine the PendingUpload credentials type.

Value Description
SAS

PendingUploadRequestDto

Name Type Default value Description
pendingUploadId

string

If PendingUploadId = null then random guid will be used.

pendingUploadType

PendingUploadType

TemporaryBlobReference

TemporaryBlobReference is the only supported type

PendingUploadResponseDto

Name Type Default value Description
blobReferenceForConsumption

BlobReferenceForConsumptionDto

Container level read, write, list SAS

pendingUploadId

string

ID for this upload request

pendingUploadType

PendingUploadType

TemporaryBlobReference

TemporaryBlobReference is the only supported type

PendingUploadType

Type of storage to use for the pending upload location

Value Description
None
TemporaryBlobReference

SASCredentialDto

Name Type Description
credentialType string:

SAS

[Required] Credential type used to authentication with storage.

sasUri

string (uri)

Full SAS Uri, including the storage, container/blob path and SAS token