Azure / Intermediate: managed services and governance / Lesson 14
Scope Azure Storage shared access signatures
Review SAS type, delegated permissions, expiration and verification without exposing the token.
On this page
Lesson goals
- Explain the purpose and scope of a SAS.
- Distinguish user delegation from account-key signed SAS types.
- Test intended access and an adjacent denial safely.
- Compare SAS type, scope, signed permissions, validity and policy action for a concrete request.
- Plan sanitized positive and negative verification without exposing bearer tokens.
Model delegated access
An Azure Storage shared access signature delegates restricted access to specified resources, permissions and times. Treat the SAS URI and token as sensitive bearer material because a holder may use it within its scope. Microsoft recommends user delegation SAS where applicable; confirm support for the service and scenario. The records here are fictional and contain no usable SAS or credentials.
Choose a narrow contract
The first record describes a synthetic read-only object request with an approved short lifetime. Compare the SAS type, target, permissions and validity with the actual use case. User delegation SAS uses a delegation key obtained with Microsoft Entra credentials; service and account SAS use account-key based signing. These types have different constraints and revocation considerations, so consult the current documentation before adaptation.
sas_type: user-delegation
resource: synthetic-container/report.csv
permission: read
expiry: approved-short-window
The record is a scope checklist, not a signed URI or a command.
Protect the token and keys
A holder can share a SAS while it is valid. Do not place the URI in logs, tickets or telemetry; use an approved secure channel. Restrict signature creation and review signer permissions. Short expiry does not prove exclusive possession or data recovery.
Investigate request mismatch
Compare the resource, requested action, signed permissions, validity interval and actual endpoint when a request fails. Check the relevant authorization and account policies with the owner; a 403 can have more than one cause. The second record leaves the outcome unobserved and identifies a neighboring write that should remain denied. Do not widen permissions until the failing boundary is understood.
request: read-synthetic-object
credential: withheld
result: not-observed
neighboring-write: expected-denied
The record is not an actual request or service result.
Verify bounded access
In an authorized lab, issue a fresh SAS for a synthetic object and test the intended read and an approved denial. Check expiration under the actual SAS type and policies. Record sanitized results without retaining the token.
Define the delegated bearer contract
An Azure Storage shared access signature (SAS) delegates specified permissions to specified resources for a bounded validity interval and conditions. A holder of the SAS URI can attempt the permitted operations, so authorize the requester before issuance and protect the complete token and URI as sensitive bearer material. Record the intended service, resource, permission, signer, start and expiry without placing the token in logs or tickets. A read-only SAS for one blob is not a general write grant or proof of exclusive possession.
Microsoft recommends a user delegation SAS where applicable. It is signed with a user delegation key obtained using Microsoft Entra credentials; service and account SAS use the account key. Their scope, support and revocation paths differ. Select the type for the exact service and use case, and consult current documentation before adaptation. The records below contain no usable SAS or credentials and make no Azure request.
Bound time and signing authority
A SAS has start and expiry fields, and a user delegation SAS depends on its signing delegation key. When that key expires, SAS signed with it become invalid even if their requested expiry is later. An account SAS expiration policy can define a maximum validity interval calculated from signed start to signed expiry. Its configured action matters: the documented Log action observes out-of-policy use while Block denies it, subject to documented exceptions. Do not treat a warning or Log mode as a universal hard block.
Clock skew and the signed start can make a request fail before the intended use window, so document timing assumptions and test the selected type and policy. A short interval reduces the exposure window but does not make the capability single-use or guarantee successful access throughout it. The signer’s authorization, storage settings and other conditions still matter.
Match the request to the signed scope
Compare the requested resource, service, permission, protocol, endpoint and time with the SAS contract. A read-only token does not authorize a write, and a token for one blob should not be treated as permission for another. A failed 403 can have several causes, including time, permission, signature, network or account policy; preserve safe error class, target reference and time rather than widening access immediately.
For user delegation SAS, the principal obtaining the delegation key must have the documented authority, and the resulting access is bounded by both the SAS permissions and the principal’s applicable data permissions. Service SAS can use a stored access policy where supported, while user delegation and account SAS do not support stored access policies. Do not transfer a revocation assumption from one type to another.
Protect exposure and plan revocation
The complete SAS URI is a bearer capability and may be copied or forwarded while valid. A short expiry limits duration but does not bind the request to the original recipient or erase copies. Avoid logging query strings, taking screenshots containing tokens or pasting them into tickets. If exposure occurs, follow the organization’s incident process and assess the type, signer, scope, possible prior access and available authorized mitigation; deleting one log entry alone does not invalidate every copy.
Revocation has trade-offs and timing. A stored access policy can affect supported service SAS, while revoking user delegation keys affects SAS signed by those keys and can have propagation or caching delay. Account-key rotation can affect other dependent clients. Use the documented method for the actual SAS type and evaluate impact before an authorized action; these fixtures perform none of them.
Test positive and negative boundaries
A bounded lab plan uses a synthetic object, an approved signer, the selected SAS type, intended operation and short interval. Test the intended read and an approved neighboring denial such as write or another resource, then test timing and relevant network conditions. Record actual sanitized outcomes, time and safe request identifiers without retaining the token. A static plan is not evidence that an Azure request succeeded or was denied.
Recheck the requester’s current application authorization before issuing a fresh SAS after expiry. A previous capability is not a permanent entitlement or a backup. If a negative case unexpectedly succeeds, preserve evidence and stop expansion until the scope and credential path are understood. No SAS, key, storage account, policy or Azure operation is created or changed in these exercises.
20 worked examples
1. Read-only capability
Problem: Does this request match the intended SAS scope?
- The operation and resource match the stated read capability.
- It is a candidate allowed request subject to validity and other controls.
SAS type=user delegation
resource=container-a/report.csv
permissions=read
request=read report.csv
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: It is a candidate allowed request subject to validity and other controls.
Why this result follows: SAS scope, time and applicable authorization must all be satisfied. The conclusion is limited to the stated SAS type and conditions.
2. Write with read-only SAS
Problem: Does this SAS grant the requested write in this synthetic Azure SAS scenario?
- The write is outside the signed read permission.
- The write is not granted by this SAS.
SAS permission=read
resource=container-a/report.csv
request=write report.csv
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: The write is not granted by this SAS.
Why this result follows: A delegated permission cannot be expanded by the client request. The conclusion is limited to the stated SAS type and conditions.
3. Wrong blob
Problem: Does the SAS for report.csv cover payroll.csv in this synthetic Azure SAS scenario?
- The requested blob differs from the scoped resource. Compare the stated SAS type and request conditions.
- Do not infer authorization for payroll.csv.
SAS resource=container-a/report.csv
permission=read
request=read container-a/payroll.csv
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: Do not infer authorization for payroll.csv.
Why this result follows: Resource scope is part of the delegated capability. The conclusion is limited to the stated SAS type and conditions.
4. Delegation key expires first
Problem: Can the request rely on the later SAS expiry?
- The signing delegation key has expired before the request.
- The SAS is invalid at 10:15 under the stated timing.
user delegation SAS expiry=10:30
delegation key expiry=10:10
request=10:15
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: The SAS is invalid at 10:15 under the stated timing.
Why this result follows: A user delegation SAS depends on its delegation key’s validity. The conclusion is limited to the stated SAS type and conditions.
5. Start time in future
Problem: What timing issue should be investigated in this synthetic Azure SAS scenario?
- The request begins before the signed start in the fixture.
- The request is outside the stated validity interval.
signed start=10:05 UTC
request time=10:00 UTC
expiry=10:30 UTC
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: The request is outside the stated validity interval.
Why this result follows: A SAS validity window has both a start and an end. The conclusion is limited to the stated SAS type and conditions.
6. Expired SAS
Problem: Can this request rely on the SAS validity window?
- The request starts two minutes after the stated expiry.
- The request is outside the signed interval; reauthorize before reissue.
signed expiry=10:05 UTC
new request=10:07 UTC
other controls=not evaluated
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: The request is outside the signed interval; reauthorize before reissue.
Why this result follows: A time-limited capability does not remain valid indefinitely. The conclusion is limited to the stated SAS type and conditions.
7. Expiration policy Log
Problem: Does the policy action alone deny this out-of-policy request?
- The interval exceeds the limit, but the stated action is Log.
- Do not infer denial from the expiration policy alone; review other controls.
SAS validity interval=2 hours
account policy upper limit=1 hour
expiration action=Log
diagnostic logging=configured
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: Do not infer denial from the expiration policy alone; review other controls.
Why this result follows: Log and Block have different enforcement effects. The conclusion is limited to the stated SAS type and conditions.
8. Expiration policy Block
Problem: What does the stated policy imply for use?
- The interval exceeds the configured maximum and Block applies.
- The out-of-policy request is denied by this policy in the model.
SAS validity interval=2 hours
account policy upper limit=1 hour
expiration action=Block
exception=not applicable in fixture
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: The out-of-policy request is denied by this policy in the model.
Why this result follows: Block enforces the configured expiration-policy boundary. The conclusion is limited to the stated SAS type and conditions.
9. Missing signed start
Problem: What policy issue exists for this SAS in this synthetic Azure SAS scenario?
- The enabled policy requires a signed start for the validity interval check.
- The SAS is out of policy under the stated Block case.
expiration policy=enabled
signed start=absent
action=Block
exception=not applicable in fixture
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: The SAS is out of policy under the stated Block case.
Why this result follows: The policy needs start and expiry to evaluate its interval. The conclusion is limited to the stated SAS type and conditions.
10. User delegation signer
Problem: Which signing path does this record describe in this synthetic Azure SAS scenario?
- The SAS is signed using a delegation key obtained through Entra credentials.
- Classify it as a user delegation SAS, not an account-key SAS.
SAS type=user delegation
signing material=user delegation key
key obtained using=Microsoft Entra credentials
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: Classify it as a user delegation SAS, not an account-key SAS.
Why this result follows: The SAS type determines its signing and policy boundaries. The conclusion is limited to the stated SAS type and conditions.
11. Service SAS stored policy
Problem: What relationship should the review consider in this synthetic Azure SAS scenario?
- The service SAS is associated with a server-side stored access policy.
- Review the documented effect on that SAS and affected clients before action.
SAS type=service
stored access policy=associated where supported
policy access=revoked by authorized owner
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: Review the documented effect on that SAS and affected clients before action.
Why this result follows: A stored access policy can control supported service SAS access. The conclusion is limited to the stated SAS type and conditions.
12. User delegation and stored policy
Problem: Can the service-SAS stored-policy method be assumed to apply?
- Stored access policies are not supported for user delegation SAS.
- Use the documented user-delegation mitigation and assess scope.
SAS type=user delegation
proposed revocation method=stored access policy
support=not established
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: Use the documented user-delegation mitigation and assess scope.
Why this result follows: SAS types do not share every revocation mechanism. The conclusion is limited to the stated SAS type and conditions.
13. Bearer forwarding
Problem: Can B potentially attempt the signed read in this synthetic Azure SAS scenario?
- B possesses the bearer URI during its stated scope.
- B can attempt the read subject to validity and other controls.
recipient=A
SAS URI=forwarded to B
valid scope=read report.csv
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: B can attempt the read subject to validity and other controls.
Why this result follows: Possession of a SAS can confer the delegated capability. The conclusion is limited to the stated SAS type and conditions.
14. Repeated use
Problem: Does the first success automatically consume this SAS?
- The record contains no one-time redemption mechanism.
- Do not infer that the second use is automatically blocked.
SAS permission=read
first read=success
second read before expiry=attempted
single-use control=none
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: Do not infer that the second use is automatically blocked.
Why this result follows: Expiration and scope do not create single-use business semantics. The conclusion is limited to the stated SAS type and conditions.
15. Signer lacks data permission
Problem: Does the signed permission alone establish the read?
- The user-delegation path is bounded by the principal’s applicable permission as well as the SAS.
- The read is not established under the stated denial.
user delegation SAS permission=read
signing principal data read=not allowed
request=read blob
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: The read is not established under the stated denial.
Why this result follows: Delegated permissions cannot exceed the applicable authority of the signing principal. The conclusion is limited to the stated SAS type and conditions.
16. Network restriction
Problem: Does possession of the SAS override the network policy?
- The request has a matching capability but fails the stated network boundary.
- The request is denied under the fixture’s policy.
SAS scope=read blob
account network policy=denies client path
request=read
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: The request is denied under the fixture’s policy.
Why this result follows: A SAS remains subject to applicable storage and network controls. The conclusion is limited to the stated SAS type and conditions.
17. Wrong protocol
Problem: Does the request match the signed protocol condition?
- The client uses HTTP while the SAS requires HTTPS.
- The request does not satisfy the stated protocol restriction.
SAS allowed protocol=HTTPS only
client request=HTTP
other conditions=not evaluated
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: The request does not satisfy the stated protocol restriction.
Why this result follows: A delegated capability can be constrained by protocol. The conclusion is limited to the stated SAS type and conditions.
18. Token in ticket
Problem: What should the team do with this evidence?
- The ticket may have exposed a usable bearer capability.
- Follow the exposure process, contain the copy and assess SAS-specific mitigation.
complete SAS URI=posted in shared ticket
audience beyond intended recipient=unknown
response=not started
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: Follow the exposure process, contain the copy and assess SAS-specific mitigation.
Why this result follows: A shared token can be used by holders beyond the intended recipient. The conclusion is limited to the stated SAS type and conditions.
19. Revocation timing
Problem: Can immediate invalidation be claimed from initiation alone?
- The documented path can have a delay before existing SAS become invalid.
- Do not claim instantaneous containment without observing the actual result.
user delegation key revocation=initiated
storage caching delay=possible
new request immediately after=not tested
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: Do not claim instantaneous containment without observing the actual result.
Why this result follows: Revocation actions and their effective timing are distinct evidence. The conclusion is limited to the stated SAS type and conditions.
20. Reissue after access revoked
Problem: Should the application issue another SAS automatically in this synthetic Azure SAS scenario?
- The new issuance occurs after the user’s entitlement changed.
- Deny or hold issuance pending current authorization.
old SAS=expired
user application entitlement=revoked
user requests new SAS=yes
This fictional record contains no SAS URI or credential and makes no Azure request.
Expected result: Deny or hold issuance pending current authorization.
Why this result follows: Expiry recovery must not bypass current application access decisions. The conclusion is limited to the stated SAS type and conditions.
Common errors and fixes
A SAS URI is logged as ordinary text
- Why it happens
- The token grants scoped access to its holder.
- How to fix it
- Follow the incident process for exposed material.
- Prevent it next time
- Avoid storing full SAS URIs in logs.
An account-key SAS is assumed to be a user delegation SAS
- Why it happens
- The types use different signing and policy mechanisms.
- How to fix it
- Identify the actual SAS type and signer.
- Prevent it next time
- Document the approved type for each workflow.
A denied write is fixed by granting broad access
- Why it happens
- The intended contract may be read-only.
- How to fix it
- Check the requested action and approved scope.
- Prevent it next time
- Test both intended access and denial.
20 practice exercises
1. A read-only SAS is shared with another person while valid. Can the holder potentially read?
Show hint
A SAS is bearer material within its scoped validity.
Show worked solution
Yes, subject to its scope and conditions. Treat the URI as bearer material and follow the exposure procedure.
A second holder can attempt the signed read while the SAS and applicable controls remain valid. Treat the disclosure as an exposure and follow the approved response; a short interval does not prove exclusive possession.
Check your solution
- Recognize the second holder’s potential access.
- Require exposure assessment without logging the token.
2. A write fails with a read-only SAS. Is adding write permission automatically correct?
Show hint
Compare the requested write with the approved read-only contract.
Show worked solution
No. Confirm the authorized use case and resource before requesting any change.
A denied write may be the intended security boundary. Confirm the legitimate operation, resource and requester before any change; a broad write grant is not an automatic repair.
Check your solution
- Identify write as outside read scope.
- Require an authorized use case before widening.
3. A user delegation SAS expires at 10:30, but its signing delegation key expires at 10:10. Can a request at 10:15 rely on the SAS?
Show hint
Compare the key and SAS expiry.
Show worked solution
No. The delegation key expires first, so the user delegation SAS signed with it is invalid after that key expires even if the SAS requested a later end. Verify the actual type and current authorization before issuing a new capability.
Check your solution
- Identify the 10:10 key boundary.
- Reject reliance on the later SAS expiry.
4. A read-only SAS for report.csv is used for a write to that blob. Does it grant the write?
Show hint
Compare the signed permission with the requested action.
Show worked solution
No. The request is outside the read-only permission. Confirm the legitimate use case and object before requesting any change; do not widen a capability merely to remove a denial that reflects the intended contract.
Check your solution
- Identify write as outside read scope.
- Require an authorized use case before widening.
5. A SAS covers read of report.csv, but the client requests payroll.csv. Is the second object covered?
Show hint
Compare the exact resource scope.
Show worked solution
No. The requested blob differs from the stated SAS resource. Verify the requester’s current authorization and exact target before issuing a separate capability; a familiar container or similar filename does not grant another object.
Check your solution
- Identify the different blob.
- Require target-specific authorization.
6. A SAS starts at 10:05 UTC and a client requests access at 10:00 UTC. What timing issue exists?
Show hint
Compare request time with the signed interval.
Show worked solution
The request begins before the stated start time, so it is outside the validity window. Check clock assumptions and the actual SAS type and policy without exposing the token. Do not assume a future start has already taken effect.
Check your solution
- Identify the five-minute early request.
- Review clock and signed start.
7. A SAS expires at 11:05 and a new request begins at 11:10. Should the application issue another automatically?
Show hint
A new capability requires a current authorization decision.
Show worked solution
The new request is outside the stated interval. Recheck the user’s entitlement and intended object before issuing a fresh bounded SAS if appropriate; an expired token is not proof of continuing authorization.
Check your solution
- Identify the post-expiry request.
- Require reauthorization before reissue.
8. An expiration policy permits a one-hour interval in Log mode, while a SAS lasts two hours. Does this policy action alone block use?
Show hint
Log and Block have different effects.
Show worked solution
No. The SAS is out of policy, but the stated Log action does not itself deny the request. Check configured diagnostics and other controls; do not report a hard block without evidence of the actual action and applicable exceptions.
Check your solution
- Identify the out-of-policy interval.
- Do not equate Log with Block.
9. An expiration policy uses Block with a one-hour maximum; a two-hour SAS has no applicable exception. What is the modeled result?
Show hint
Compare the interval and configured action.
Show worked solution
The request is denied by the stated expiration policy because the validity interval exceeds the maximum and Block applies. Confirm the actual SAS type, signed start and documented exceptions in a real authorized review.
Check your solution
- Identify the two-hour interval.
- State denial under the modeled Block policy.
10. A SAS expiration policy is enabled in Block mode but the signed start is missing. What should be investigated?
Show hint
The policy computes an interval from start to expiry.
Show worked solution
The missing signed start makes the SAS out of policy under the stated Block case. Review the actual token type and supported exceptions without logging the token, then correct issuance only after authorization and a bounded test.
Check your solution
- Identify the missing start.
- Check policy action and exceptions.
11. A SAS is signed with a user delegation key obtained through Entra credentials. Is it an account-key SAS?
Show hint
Identify the signing material.
Show worked solution
No. The record describes a user delegation SAS, whose signing and revocation boundaries differ from service and account SAS signed with account keys. Confirm support for the specific storage service and permissions before issuing one.
Check your solution
- Classify the user delegation type.
- Distinguish the account-key types.
12. A service SAS is associated with a supported stored access policy. What should be reviewed before changing that policy?
Show hint
The policy can affect associated capabilities.
Show worked solution
Review the policy scope, dependent clients, permissions, timing and approved change or revocation procedure. A server-side policy can control supported service SAS, but its effects must be verified for the exact configuration and should not be generalized to every SAS type.
Check your solution
- Identify associated clients.
- Review impact and documented service-SAS behavior.
13. A team proposes a stored access policy to revoke a user delegation SAS. Is that method supported for this type?
Show hint
Stored-policy support differs by SAS type.
Show worked solution
No. Stored access policies are not supported for user delegation SAS. Review the documented delegation-key or authorization mitigation, affected capabilities and possible delay through the incident process; do not assume the service-SAS method applies.
Check your solution
- Identify the unsupported stored policy.
- Select a type-specific mitigation for review.
14. An authorized recipient forwards a valid read SAS URI to another person. Can the second holder potentially read?
Show hint
The URI is bearer material.
Show worked solution
Yes, the second holder can attempt the scoped request while the capability and applicable conditions remain valid. Treat the disclosure as an exposure, follow the approved incident process and avoid assuming the SAS is bound to its first recipient.
Check your solution
- Identify possession as the risk.
- Assess exposure and applicable conditions.
15. A read SAS succeeds once and remains valid; no one-time mechanism exists. Is another attempt automatically blocked?
Show hint
Expiry is not single-use redemption.
Show worked solution
No. The fixture has no mechanism that consumes the capability after one request. If the business needs one-time access, design and test a separate application-controlled state and authorization flow, including concurrency and recovery.
Check your solution
- Identify the missing one-time mechanism.
- Do not infer single use from expiry.
16. A user delegation SAS says read, but the signing principal lacks the required data permission. Is the read established?
Show hint
Both delegated scope and principal authority matter.
Show worked solution
No. The SAS permission alone cannot establish the read when the principal lacks the applicable authority in this fixture. Review the exact principal, role, scope and service rules; do not broaden access without a documented need.
Check your solution
- Identify the missing principal permission.
- Separate SAS scope from signer authority.
17. A SAS permits a read, but the storage network policy denies the client path. Does the token override it?
Show hint
A SAS remains subject to applicable controls.
Show worked solution
No. The stated network boundary denies the request despite the signed permission. Diagnose the intended client path and policy separately from the token, and avoid opening unrelated networks or exposing the SAS URI.
Check your solution
- Identify the network denial.
- Do not treat SAS as a network bypass.
18. A SAS requires HTTPS, but the client sends HTTP. Does the request satisfy the signed condition?
Show hint
Compare the actual and allowed protocol.
Show worked solution
No. The request does not match the stated HTTPS-only condition. Correct the client under the approved contract and retain only sanitized method, resource and error information; do not paste the bearer URI into diagnostics.
Check your solution
- Identify HTTP versus HTTPS.
- Reject the mismatched protocol.
19. A support ticket contains the complete SAS URI. What should be preserved and removed?
Show hint
The query token is sensitive bearer material.
Show worked solution
Follow the approved exposure response and remove or contain the URI. Preserve safe resource, operation, time and error references, assess who could access the ticket and review mitigation for the actual SAS type. Deleting one copy does not prove all copies are invalid.
Check your solution
- Remove the complete URI.
- Assess exposure and type-specific mitigation.
20. A user’s application entitlement is revoked after an old SAS expires. Should a new SAS be issued automatically?
Show hint
Reissuance is a new authorization decision.
Show worked solution
No. The fixture says current entitlement is revoked, so do not issue a new capability automatically. Follow the application’s denial and audit process and avoid storing either token in the record. A previous SAS is not permanent entitlement.
Check your solution
- Identify revoked entitlement.
- Do not automatically reissue.
Key takeaways
- A SAS delegates scoped, time-limited access.
- SAS types have different signing and policy boundaries.
- Protect tokens and test allowed and denied operations.
- A SAS URI is sensitive bearer material with a defined resource, permission and interval.
- User delegation, service and account SAS have different signing and revocation boundaries.
- A read-only denial can be intended and should not trigger automatic permission expansion.