services

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

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 CreateUserAssignedIdentity

func CreateUserAssignedIdentity(ctx context.Context, args CreateUserAssignedIdentityArgs) string

Creates a User Assigned Managed Identity, 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.

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 CreateUserAssignedIdentityArgs

type CreateUserAssignedIdentityArgs struct {
	UserAssignedIdentitiesClient *armmsi.UserAssignedIdentitiesClient
	RoleAssignmentsClient        *armauthorization.RoleAssignmentsClient
	ResourceGroupName,
	Name string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL