Skip to content

Instantly share code, notes, and snippets.

View AnalyticJeremy's full-sized avatar
☁️
Cloud-Scale Data Analytics

Jeremy Peach AnalyticJeremy

☁️
Cloud-Scale Data Analytics
View GitHub Profile
# Create a User Delegated SAS Token (the hard way)
# If you need a user delegated SAS token, the easiest way to get one is to use:
# az storage container generate-sas
# However, the CLI does not currently support all of the features of user delegated
# SAS tokens (like signedUnauthorizedObjectId). If you want a SAS token with those
# features, you have to forge your own token. This PowerShell script may help you
# get started
@AnalyticJeremy
AnalyticJeremy / generate_user_delegated_sas.ps1
Created November 17, 2021 15:44
a PowerShell script that uses Azure CLI to create a user-delegated SAS token for the current user in the specified blob storage account
# Create a User Delegated SAS token
# Users who wishes to access a blob account must create a SAS token for themselves.
# The user must first be granted RBAC access to the files they need in the blob storage account.
# Then they can generate a SAS token that will represent their access.
# Note that the user must be a "Storage Blob Data Contributor" or a "Storage Blob Data Reader" at the storage account level (or higher)
# (After assigning a user to this role, it can take a few minutes for the permissions to propogate throughout the Azure backplane.)
# Reference: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-user-delegation-sas-create-cli
@AnalyticJeremy
AnalyticJeremy / cleanup_deployment.ps1
Created September 3, 2021 14:10
a script to remove Azure resources created when deploying Enterprise Scale Analytics
#------------------------------------------------------------------------------
# PowerShell commands that use Azure CLI to remove resource groups with a common
# prefix
#--------------------------------------------------------------------------------
# Make sure I'm in the right subscription...
az account show
# If I need to change subscriptions...
# az account set -s "<the right sub ID>"