Documentation
¶
Index ¶
- func CreateBlobContainer(ctx context.Context, args *CreateBlobContainerArgs)
- func CreateStorageAccount(ctx context.Context, args *CreateStorageAccountArgs)
- func CreateUAMI(ctx context.Context, args CreateUAMIArgs) (uamiID string, uamiClientID string)
- func DownloadBlobContainerContents(ctx context.Context, blobClient *azblob.Client, blobContainerName string)
- type CreateBlobContainerArgs
- type CreateStorageAccountArgs
- type CreateUAMIArgs
- type DownloadBlobContentArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBlobContainer ¶
func CreateBlobContainer(ctx context.Context, args *CreateBlobContainerArgs)
Creates a Blob Container in the given Storage Account, if one doesn't already exist.
Azure Blob Storage is Microsoft's object storage solution for the cloud. A container organizes a set of blobs, similar to a directory in a file system. A storage account can include an unlimited number of containers, and a container can store an unlimited number of blobs. REFERENCE : https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction#containers
func CreateStorageAccount ¶
func CreateStorageAccount(ctx context.Context, args *CreateStorageAccountArgs)
Creates an appropriate Azure Storage Account, if one doesn't already exist.
An Azure storage account contains all of your Azure Storage data objects: blobs, files, queues, and tables. The storage account provides a unique namespace for your Azure Storage data. REFERENCE : https://learn.microsoft.com/en-us/azure/storage/common/storage-account-overview.
func CreateUAMI ¶ added in v0.8.0
func CreateUAMI(ctx context.Context, args CreateUAMIArgs, ) (uamiID string, uamiClientID string)
Creates a User Assigned Managed Identity (UAMI), if it doesn't already exist. Returns its ID.
Managed identities for Azure resources eliminate the need to manage credentials in code. You can use them to get a Microsoft Entra token for your applications. The applications can use the token when accessing resources that support Microsoft Entra authentication. Azure manages the identity so you don't have to.
There are two types of managed identities :
(1) system assigned :
System-assigned managed identities have their lifecycle tied to the resource that created
them. This identity is restricted to only one resource, and you can grant permissions to
the managed identity by using Azure role-based access control (RBAC).
(2) user assigned :
User-assigned managed identities can be used on multiple resources.
REFERENCE : https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities.
func DownloadBlobContainerContents ¶ added in v0.9.0
func DownloadBlobContainerContents(ctx context.Context, blobClient *azblob.Client, blobContainerName string, )
Downloads contents of the given Azure Blob Container locally. If the contents are gZip encoded, then you can choose to gZip decode them after download. NOTE : The download path is decided by utils.GetDownloadedStorageBucketContentsDir( ).
Types ¶
type CreateBlobContainerArgs ¶
type CreateBlobContainerArgs struct {
BlobContainersClient *armstorage.BlobContainersClient
ResourceGroupName,
StorageAccountName,
BlobContainerName string
}
type CreateStorageAccountArgs ¶
type CreateStorageAccountArgs struct {
StorageAccountsClient *armstorage.AccountsClient
ResourceGroupName,
Name string // The Storage Account name must between 3-24 characters and unqiue within Azure.
}
type CreateUAMIArgs ¶ added in v0.8.0
type CreateUAMIArgs struct {
UAMIClient *armmsi.UserAssignedIdentitiesClient
RoleAssignmentsClient *armauthorization.RoleAssignmentsClient
SubscriptionID,
ResourceGroupName,
RoleID,
RoleAssignmentScope,
Name string
}