Disks - Grant Access
Grants access to a disk.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess?api-version=2025-01-02
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
disk
|
path | True |
string |
The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. |
|
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. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Required | Type | Description |
|---|---|---|---|
| access | True |
The Access Level, accepted values include None, Read, Write. |
|
| durationInSeconds | True |
integer (int32) |
Time duration in seconds until the SAS access expires. |
| fileFormat |
Used to specify the file format when making request for SAS on a VHDX file format snapshot |
||
| getSecureVMGuestStateSAS |
boolean |
Set this flag to true to get additional SAS for VM guest state |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Azure operation completed successfully. |
|
| 202 Accepted |
Resource operation accepted. Headers
|
|
| Other Status Codes |
An unexpected error response. |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| user_impersonation | impersonate your user account |
Examples
| get a sas on a managed disk. |
| get sas on managed disk, VM guest state and VM metadata for Confidential VM. |
| get sas on managed disk and VM guest state |
get a sas on a managed disk.
Sample request
Sample response
{
"accessSAS": "https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/abcd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2021-05-24T18:02:34Z&se=2021-05-24T18:19:14Z&sp=r"
}
Location: https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/operations/{operationId}&monitor=true&api-version=2025-01-02
get sas on managed disk, VM guest state and VM metadata for Confidential VM.
Sample request
Sample response
{
"accessSAS": "https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/abcd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2025-05-29T18:02:34Z&se=2025-05-29T18:19:14Z&sp=r",
"securityDataAccessSAS": "https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/b9bf5824-6122-49e0-ba22-042f76ccd8a1_vmgs?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2025-05-29T18:02:34Z&se=2025-05-29T18:19:14Z&sp=r",
"securityMetadataAccessSAS": "https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/ghm3kwd5jzbn/2be55b76-f471-4f6b-bff0-4dcea6cbca7f_vmmd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2025-05-29T18:02:34Z&se=2025-05-29T18:19:14Z&sp=r"
}
Location: https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/operations/{operationId}&monitor=true&api-version=2025-01-02
get sas on managed disk and VM guest state
Sample request
Sample response
{
"accessSAS": "https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/abcd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2021-05-24T18:02:34Z&se=2021-05-24T18:19:14Z&sp=r",
"securityDataAccessSAS": "https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/b9bf5824-6122-49e0-ba22-042f76ccd8a1_vmgs?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2021-05-24T18:02:34Z&se=2021-05-24T18:19:14Z&sp=r"
}
Location: https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/operations/{operationId}&monitor=true&api-version=2025-01-02
Definitions
| Name | Description |
|---|---|
|
Access |
The Access Level, accepted values include None, Read, Write. |
|
Access |
A disk access SAS uri. |
|
Api |
Api error. |
|
Api |
Api error base. |
|
Cloud |
An error response from the Compute service. |
|
File |
Used to specify the file format when making request for SAS on a VHDX file format snapshot |
|
Grant |
Data used for requesting a SAS. |
|
Inner |
Inner error details. |
AccessLevel
The Access Level, accepted values include None, Read, Write.
| Value | Description |
|---|---|
| None | |
| Read | |
| Write |
AccessUri
A disk access SAS uri.
| Name | Type | Description |
|---|---|---|
| accessSAS |
string |
A SAS uri for accessing a disk. |
| securityDataAccessSAS |
string |
A SAS uri for accessing a VM guest state. |
| securityMetadataAccessSAS |
string |
A SAS uri for accessing a VM metadata. |
ApiError
Api error.
| Name | Type | Description |
|---|---|---|
| code |
string |
The error code. |
| details |
The Api error details |
|
| innererror |
The Api inner error |
|
| message |
string |
The error message. |
| target |
string |
The target of the particular error. |
ApiErrorBase
Api error base.
| Name | Type | Description |
|---|---|---|
| code |
string |
The error code. |
| message |
string |
The error message. |
| target |
string |
The target of the particular error. |
CloudError
An error response from the Compute service.
| Name | Type | Description |
|---|---|---|
| error |
Api error. |
FileFormat
Used to specify the file format when making request for SAS on a VHDX file format snapshot
| Value | Description |
|---|---|
| VHD |
A VHD file is a disk image file in the Virtual Hard Disk file format. |
| VHDX |
A VHDX file is a disk image file in the Virtual Hard Disk v2 file format. |
GrantAccessData
Data used for requesting a SAS.
| Name | Type | Description |
|---|---|---|
| access |
The Access Level, accepted values include None, Read, Write. |
|
| durationInSeconds |
integer (int32) |
Time duration in seconds until the SAS access expires. |
| fileFormat |
Used to specify the file format when making request for SAS on a VHDX file format snapshot |
|
| getSecureVMGuestStateSAS |
boolean |
Set this flag to true to get additional SAS for VM guest state |
InnerError
Inner error details.
| Name | Type | Description |
|---|---|---|
| errordetail |
string |
The internal error message or exception dump. |
| exceptiontype |
string |
The exception type. |