{"id":17902089,"url":"https://github.com/lancemccarthy/action-azureblobupload","last_synced_at":"2026-03-02T23:03:08.342Z","repository":{"id":38340244,"uuid":"285925974","full_name":"LanceMcCarthy/Action-AzureBlobUpload","owner":"LanceMcCarthy","description":"A GitHub action to upload files to Azure Blob storage, compatible with all Actions runner operating systems.","archived":false,"fork":false,"pushed_at":"2025-03-03T21:35:09.000Z","size":31385,"stargazers_count":16,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T20:48:35.789Z","etag":null,"topics":["actions","azure","azure-storage","ci-cd","github-actions"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LanceMcCarthy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-07T21:43:56.000Z","updated_at":"2025-03-03T21:31:11.000Z","dependencies_parsed_at":"2024-01-02T14:48:47.885Z","dependency_job_id":"683fb10b-560f-4f46-a176-437a71c1602a","html_url":"https://github.com/LanceMcCarthy/Action-AzureBlobUpload","commit_stats":{"total_commits":472,"total_committers":9,"mean_commits":52.44444444444444,"dds":0.3029661016949152,"last_synced_commit":"dd5f09f0007ef9408f633eb30b9e13daad6465e0"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanceMcCarthy%2FAction-AzureBlobUpload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanceMcCarthy%2FAction-AzureBlobUpload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanceMcCarthy%2FAction-AzureBlobUpload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanceMcCarthy%2FAction-AzureBlobUpload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LanceMcCarthy","download_url":"https://codeload.github.com/LanceMcCarthy/Action-AzureBlobUpload/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245108239,"owners_count":20562011,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","azure","azure-storage","ci-cd","github-actions"],"created_at":"2024-10-28T16:04:47.360Z","updated_at":"2026-03-02T23:03:08.335Z","avatar_url":"https://github.com/LanceMcCarthy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure Blob Upload\n\nThis GitHub Action a simple and easy way to upload any files to any blob container.\n\n* There are a few samples below to help you get started (under the Examples section).\n* Visit this repo's [main_release.yml workflow](https://github.com/LanceMcCarthy/Action-AzureBlobUpload/blob/main/.github/workflows/main_release.yml) to see the working tests for examples of different use cases.\n* To see a production app using this Action, visit [Media File Manager](https://github.com/LanceMcCarthy/MediaFileManager) repo's [cd_release_sideload.yml](https://github.com/LanceMcCarthy/MediaFileManager/blob/main/.github/workflows/cd_release_sideload.yml) workflow.\n\n| Workflow | Status |\n|----------|--------|\n| `main` | [![Main and Releases](https://github.com/LanceMcCarthy/Action-AzureBlobUpload/actions/workflows/main_release.yml/badge.svg)](https://github.com/LanceMcCarthy/Action-AzureBlobUpload/actions/workflows/main_release.yml) |\n\n## Inputs\n\nBelow are the action's inputs that need to be defined in the Action's `with` block.\n\n| Required | Inputs | Example | Summary |\n|----------|--------|---------|---------|\n| ✔ | [Authentication](#authentication-method) | See [basic use](#basic-use) examples | You can use a [ConnectionString](#option-1---connectionstring) or a [Service Principal](#option-2---service-principal) for authentication. |\n| ✔ | `container_name` | `my-container` | Name of the Blob container. |\n| ✔ | `source_folder` |  `src/LocalFolderName/` | Folder with the files to upload. Note that the path separators will be automatically normalized for you. |\n|  | `destination_folder` | `MyTargetFolder/Subfolder` | Folder to upload to (it will be created for you if it does not exist). |\n|  | `clean_destination_folder` |  `false` (default)| Delete all destination files before uploading new ones. |\n|  | `fail_if_source_empty` | `false` (default)| Set to `true` if you want action to fail if source folder has no files. |\n|  | `is_recursive` | `true` (default)| Set to `false` if you want all subfolders ignored. |\n|  | `delete_if_exists` | `false` (default)| Set to `true` if you want to overwrite an exiting blob with the same filename. |\n\n### Authentication Inputs\n\n#### Option 1 - ConnectionString\n\nThe most common and easy approach is to use a connection string for that blob storage. You can find them on your storage account's \"Access Keys\" blade in the Azure Portal.\n\n| Required | Inputs | Example | Summary |\n|----------|--------|---------|---------|\n| ✔ | `connection_string` | `${{secrets.AZURE_CONNECTION_STRING}}` | Azure Blob Storage conection string (for help, visit [View Account Access Keys](https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage#view-account-access-keys)). |\n\n#### Option 2 - Service Principal\n\nService principal, aka an Entra ID Application, uses a managed identity to authenticate access. This is helpful for more complex scenarios where the identity might be dynamic or an app identity only.\n\n| Required | Inputs | Example | Summary |\n|----------|--------|---------|---------|\n| ✔ | tenant_id | `${{secrets.AZURE_TENANT_ID}}` | The App Registration tenant ID used for Service Principal authentication. |\n| ✔ | client_id | `${{secrets.AZURE_CLIENT_ID}}` | The App Registration client (application) ID used for Service Principal authentication. |\n| ✔ | client_secret | `${{secrets.AZURE_CLIENT_SECRET}}` |The App Registration client secret used for Service Principal authentication. |\n| ✔ | storage_account | `storageaccount` | The name of the Azure Storage account to be accessed. Need for authenticating a Service Principal. |\n\n#### Overriding Auth type\n\nIf you do not know which auth type you need until the workflow is executed, you can optionally set the `auth_type` with either `connection_string` or `service_principal` to force the mode during build-time.\n\n| Required | Inputs | Example | Summary |\n|----------|--------|---------|---------|\n|  | `auth_type` | `connection_string` or `service_principal` | If omitted, the auth type is inferred from `connection_string`'s presence. |\n\n## Examples\n\nIf you copy-paste from the examples below, make sure the version number is current or use the major number `LanceMcCarthy/Action-AzureBlobUpload@v3` to get the latest release for that major version.\n\n### Basic Use\n\nIn the most basic form, the Action will upload all the files in the `source_folder` to the root of that blob container. Here's the same example using both authentication methods.\n\n### Using Connection String Authentication\n\n```yaml\n- uses: LanceMcCarthy/Action-AzureBlobUpload@v3\n  name: Uploading to Azure storage...\n  with:\n    connection_string: ${{secrets.YourAzureBlobConnectionString}}\n    container_name: your-container-name\n    source_folder: src/LocalFolderName/\n```\n\n### Using Service Prinicipal Authentication (App Registration)\n\n```yaml\n- uses: LanceMcCarthy/Action-AzureBlobUpload@v3\n  name: Uploading to Azure storage...\n  with:\n    tenant_id: ${{secrets.YourTenantID}}\n    client_id: ${{secrets.YourClientID}}\n    client_secret: ${{secrets.YourClientSecret}}\n    storage_account: your-storage-account\n    container_name: your-container-name\n    source_folder: src/LocalFolderName/\n```\n\u003e [!NOTE]\n\u003e The rest of the examples use the connection string authentication option for simplicity, but it is the same when using Service Principal.\n\n### Set a Destination Folder (most common)\n\nIf you want to upload the files to a folder in the blob container, you can set a `destination_folder`.\n\nIn this example, we use `clean_destination_folder`, which gives you a clean start for the entire operation.\n\n```yaml\n- uses: LanceMcCarthy/Action-AzureBlobUpload@v2\n  name: Azure Blob Upload with Destination folder defined\n  with:\n    connection_string: ${{secrets.YourAzureBlobConnectionString}}\n    container_name: your-container-name\n    source_folder: src/LocalFolderName/\n    destination_folder: FolderNameInAzureStorage\n    clean_destination_folder: true\n```\n\nAlternatively, you can use `delete_if_exists` if you only want to overwrite some files, but keep the rest.\n\n```yaml\n- uses: LanceMcCarthy/Action-AzureBlobUpload@v2\n  name: Azure Blob Upload with Destination folder defined\n  with:\n    connection_string: ${{secrets.YourAzureBlobConnectionString}}\n    container_name: your-container-name\n    source_folder: src/LocalFolderName/\n    destination_folder: FolderNameInAzureStorage\n    delete_if_exists: true\n```\n\n### Ignore Subfolder\n\nIf you want to upload *only* files in the `source_folder` and skip subfolders and subfolder files, set `is_recursive` to `false`.\n\n```yaml\n- name: Upload Text Files Non-recursive\n  uses: LanceMcCarthy/Action-AzureBlobUpload@v2\n  with:\n    connection_string: ${{secrets.AzureBlobConnectionString}}\n    container_name: your-container-name\n    source_folder: src/LocalFolderName/\n    destination_folder: FolderNameInAzureStorage\n    clean_destination_folder: true\n    is_recursive: false\n```\n\n### Single File Mode\n\nYou can set the `source_folder` to a single file path to upload only one file. For example, this one uploads *MySingleFileApplication.exe*.\n\n```yaml\n- uses: LanceMcCarthy/Action-AzureBlobUpload@v2\n  name: Azure Blob Upload with Destination folder defined\n  with:\n    connection_string: ${{secrets.YourAzureBlobConnectionString}}\n    container_name: your-container-name\n    source_folder: src/LocalFolderName/MySingleFileApplication.exe\n    destination_folder: FolderNameInAzureStorage\n```\n\n### Advanced - Full Control\n\nHere is an example that might represent a real-world Workflow that needs precise control over things.\n\n* The source folder uses an environment variable uses (see [Using Variables in Actions](https://docs.github.com/en/actions/configuring-and-managing-workflows/using-variables-and-secrets-in-a-workflow)).\n* The connection string uses a secrets variable.\n* The desination folder combines a name and the run number of the workflow (see [GitHub Context variables](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context)).\n* The action will fail and stop the Workflow if there are no files to upload.\n\n```yaml\n- uses: LanceMcCarthy/Action-AzureBlobUpload@v2\n  name: Azure Blob Upload with Destination folder defined\n  with:\n    connection_string: ${{secrets.DeploymentsBlobConnectionString}}\n    container_name: my-cd-container\n    source_folder: ${{env.BuildOutputFolder}}\n    destination_folder: Distributions/${{github.run_number}}\n    clean_destination_folder: true\n    fail_if_source_empty: true\n```\n\n## Important Notes\n\n### Environment Variables\n\nIf you need to use a environment variable for a `with` input, you must use the `${{env.Name}}` syntax and **not** `$env:Name`. See [Github Contexts](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#contexts) documentation for more help.\n\nFor example:\n\n```yaml\nwith:\n  source_folder: $env:MyVariable # Does NOT work\n  source_folder: ${{env.MyVariable}} # Works\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flancemccarthy%2Faction-azureblobupload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flancemccarthy%2Faction-azureblobupload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flancemccarthy%2Faction-azureblobupload/lists"}