Share via


Storage - Get Sas Uri

Gets a URL with SAS token for a container/blob in the storage account associated with the workspace. The SAS URL can be used to upload job input and/or download job output.

POST https://{region}.{serviceBaseUrl}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/storage/sasUri?api-version=2024-10-01-preview

URI Parameters

Name In Required Type Description
region
path True

string

The Azure region where the Azure Quantum Workspace is located.

resourceGroupName
path True

string

minLength: 1
maxLength: 90
pattern: ^[a-zA-Z][a-zA-Z0-9\-_\.]*$

Name of the Azure resource group.

serviceBaseUrl
path True

string

The Azure Quantum service base url.

subscriptionId
path True

string

minLength: 36
maxLength: 36
pattern: ^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$

The Azure subscription ID.

workspaceName
path True

string

minLength: 2
maxLength: 50
pattern: ^[a-zA-Z][a-zA-Z0-9\-_]*$

Name of the Azure Quantum workspace.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Required Type Description
containerName True

string

The container name.

blobName

string

The blob name.

Responses

Name Type Description
200 OK

SasUriResponse

The request has succeeded.

Other Status Codes

Azure.Core.Foundations.ErrorResponse

An unexpected error response.

Headers

x-ms-error-code: string

Security

AzureEntraAuth

Azure Entra OAuth2 Authentication

Type: oauth2
Flow: application
Token URL: https://login.microsoftonline.com/common/oauth2/v2.0/token

Scopes

Name Description
https://quantum.microsoft.com/.default

x-ms-quantum-api-key

Azure Api-Key Authentication

Type: apiKey
In: header

Examples

Gets a URL with SAS token for a container/blob.

Sample request

POST https://{region}.{serviceBaseUrl}/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Quantum/workspaces/my-workspace/storage/sasUri?api-version=2024-10-01-preview

{
  "containerName": "some_container",
  "blobName": "input_blob"
}

Sample response

{
  "sasUri": "https://storage.blob.core.windows.net/some_container/input_blob?sv=2019-02-02&sr=b&sig=SANITIZED&se=2020-10-17T10%3A03%3A01Z&sp=rcw"
}

Definitions

Name Description
Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors.

BlobDetails

The details (name and container) of the blob to store or download data.

SasUriResponse

SAS URI operation response.

Azure.Core.Foundations.Error

The error object.

Name Type Description
code

string

One of a server-defined set of error codes.

details

Azure.Core.Foundations.Error[]

An array of details about specific errors that led to this reported error.

innererror

Azure.Core.Foundations.InnerError

An object containing more specific information than the current object about the error.

message

string

A human-readable representation of the error.

target

string

The target of the error.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Name Type Description
error

Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors.

Name Type Description
code

string

One of a server-defined set of error codes.

innererror

Azure.Core.Foundations.InnerError

Inner error.

BlobDetails

The details (name and container) of the blob to store or download data.

Name Type Description
blobName

string

The blob name.

containerName

string

The container name.

SasUriResponse

SAS URI operation response.

Name Type Description
sasUri

string

A URL with a SAS token to upload a blob for execution in the given workspace.