0
0
Azurecloud~10 mins

Storage access keys and SAS tokens in Azure - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a SAS token with read permission.

Azure
sas_token = generate_sas(account_name, account_key, permission='[1]')
Drag options to blanks, or click blank then click option'
Awrite
Bread
Cdelete
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'write' permission when only reading is needed.
Confusing 'list' permission with 'read'.
2fill in blank
medium

Complete the code to specify the expiry time for the SAS token.

Azure
expiry_time = datetime.utcnow() + timedelta(hours=[1])
Drag options to blanks, or click blank then click option'
A1
B24
C0
D48
Attempts:
3 left
💡 Hint
Common Mistakes
Setting expiry to 0 hours which means immediate expiry.
Setting expiry too long, increasing risk.
3fill in blank
hard

Fix the error in the code to generate a SAS token for a blob container.

Azure
sas_token = generate_container_sas(account_name, account_key, container_name, permission='[1]')
Drag options to blanks, or click blank then click option'
Adelete
Bcreate
Cexecute
Dread
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid permission 'execute' causing errors.
Confusing 'create' with 'read' permission.
4fill in blank
hard

Fill both blanks to create a SAS token with write permission and expiry in 2 hours.

Azure
sas_token = generate_sas(account_name, account_key, permission='[1]', expiry=datetime.utcnow() + timedelta(hours=[2]))
Drag options to blanks, or click blank then click option'
Awrite
Bread
C2
D24
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'read' permission instead of 'write'.
Setting expiry to 24 hours instead of 2.
5fill in blank
hard

Fill all three blanks to generate a SAS token with read permission, expiry in 4 hours, and resource type 'b'.

Azure
sas_token = generate_sas(account_name, account_key, permission='[1]', expiry=datetime.utcnow() + timedelta(hours=[2]), resource='[3]')
Drag options to blanks, or click blank then click option'
Awrite
Bread
C4
Db
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong resource type like 'c' instead of 'b'.
Setting permission to 'write' instead of 'read'.