Skip to content

Golang tool that based on Azure Blob Storage Lease returns a leader

License

Notifications You must be signed in to change notification settings

paulomarquesc/azbloblease

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

azbloblease

Tool to be mainly used from a script to obtain an Azure Storage Blob lease.

For usage example on bash, please see sample script.

More examples

Custom Cloud

# Create blob to be lease
./azbloblease createleaseblob -accountname "<storage account name>" -container "azbloblease" -blobname "myblob" -resourcegroupname "<resource group name>" -subscriptionid "<subscription id>" -environment CUSTOMCLOUD

# Lease blob
LEASEID=$(./azbloblease acquire -accountname "<storage account name>" -container "azbloblease" -blobname "myblob" -resourcegroupname "pmarques-rg" -subscriptionid "<subscription id>" -environment CUSTOMCLOUD -leaseduration 60 -custom-cloudconfig-file /tmp/usgov.json | jq -r ".leaseId")

# Maintain lease
./azbloblease renew -accountname "<storage account name>" -container "azbloblease" -blobname "myblob" -resourcegroupname "pmarques-rg" -subscriptionid "<subscription id>" -environment CUSTOMCLOUD -iterations 10 -leaseid $LEASEID -custom-cloudconfig-file /tmp/usgov.json

Custom Cloud sample

Cloud information for well known clouds can can be obtained through the following command:

az cloud show -n <cloud name> -o json

This is the minimal file attributes that we use in this tool:

{
  "endpoints": {
    "activeDirectory": "https://login.microsoftonline.us",
    "activeDirectoryResourceId": "https://management.core.usgovcloudapi.net/",
    "resourceManager": "https://management.usgovcloudapi.net/"
  }
}

About

Golang tool that based on Azure Blob Storage Lease returns a leader

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages