Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Learn to create user delegation, shared access signature (SAS) tokens, using the Azure portal. User delegation SAS tokens are secured with Microsoft Entra credentials. SAS tokens provide secure, delegated access to resources in your Azure storage account.
Tip
Role-based access control (managed identities) provide an alternate method for granting access to your storage data without the need to include SAS tokens with your HTTP requests.
At a high level, here's how SAS tokens work:
Your application submits the SAS token to Azure Storage as part of a REST API request.
If the storage service verifies that the SAS is valid, the request is authorized.
If the SAS token is deemed invalid, the request is declined, and the error code 403 (Forbidden) is returned.
Azure Blob Storage offers three resource types:
Important
SAS tokens are used to grant permissions to storage resources, and should be protected in the same manner as an account key.
Operations that use SAS tokens should be performed only over an HTTPS connection, and SAS URIs should only be distributed on a secure connection such as HTTPS.
To get started, you need the following resources:
An active Azure account. If you don't have one, you can create a free account.
An Azure AI Language resource.
A standard performance Azure Blob Storage account. You also need to create containers to store and organize your files within your storage account. If you don't know how to create an Azure storage account with a storage container, follow these quickstarts:
Go to the Azure portal and navigate to your container or a specific file as follows and continue with these steps:
Workflow: Your storage account → containers → your container → your file
Right-click the container or file and select Generate SAS from the drop-down menu.
Select Signing method → User delegation key.
Define Permissions by checking and/or clearing the appropriate check box:
Your source file must designate read and list access.
Your target file must designate write and list access.
Specify the signed key Start and Expiry times.
The Allowed IP addresses field is optional and specifies an IP address or a range of IP addresses from which to accept requests. If the request IP address doesn't match the IP address or address range specified on the SAS token, authorization fails. The IP address or a range of IP addresses must be public IPs, not private. For more information,see, Specify an IP address or IP range.
The Allowed protocols field is optional and specifies the protocol permitted for a request made with the SAS. The default value is HTTPS.
Review then select Generate SAS token and URL.
The Blob SAS token query string and Blob SAS URL are displayed in the lower area of window.
Copy and paste the Blob SAS token and URL values in a secure location. They'll only be displayed once and cannot be retrieved once the window is closed.
To construct a SAS URL, append the SAS token (URI) to the URL for a storage service.
The SAS URL includes a special set of query parameters. Those parameters indicate how the client accesses the resources.
You can include your SAS URL with REST API requests in two ways:
Use the SAS URL as your sourceURL and targetURL values.
Append the SAS query string to your existing sourceURL and targetURL values.
Here's a sample REST API request:
{
"analysisInput": {
"documents": [
{
"id": "doc_0",
"language": "en",
"source": {
"location": "myaccount.blob.core.windows.net/sample-input/input.pdf?{SAS-Token}"
},
"target": {
"location": "https://myaccount.blob.core.windows.net/sample-output?{SAS-Token}"
}
}
]
}
}
That's it! You learned how to create SAS tokens to authorize how clients access your data.
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Configure Azure Storage security - Training
Learn how to configure common Azure Storage security features like storage access signatures.
Certification
Microsoft Certified: Azure Administrator Associate - Certifications
Demonstrate key skills to configure, manage, secure, and administer key professional functions in Microsoft Azure.