Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Example GitHub action to upload file(s) to Azure Blob Storage

License

NotificationsYou must be signed in to change notification settings

github-developer/upload-azure-blob

Repository files navigation

typescript-action status

Upload Blob to Azure Storage

This is anexample GitHub action built in TypeScript that uploads file(s) toAzure Blob Storage, a "massively scalable and secure object storage for cloud-native workloads, archives, data lakes, high-performance computing, and machine learning".

Note: this action is meant solely for demonstration purposes. Best viewed together with the accompanyingblog post.

For more about GitHub Actions, refer tothe documentation.

Pre-reqs

az ad sp create-for-rbac   --name $SP_NAME  --sdk-auth  --role "Storage Blob Data Contributor"  --scopes /subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP_NAME
  • Finally, store these credentials as a secret namedAZURE_CREDENTIALS

Usage

Simple example:

# GitHub Actions repository workflow file, e.g .github/workflows/upload.yml# ...# previous steps to choose a runner type, prepare files, etc# ...-uses:azure/login@v1with:creds:${{ secrets.AZURE_CREDENTIALS }}# Upload `.png`s to Azure Blob Storage-name:Upload all PNGs to Azure Blob Storageid:uploaduses:github-developer/upload-azure-blob@v1with:account:octodexdestination:octocatssource:'**/*.png'# Print out the urls to uploaded files-name:Print URLsrun:echo $URLS# { ["filename":"hulatocat.png","url":"https://octodex.blob.core.windows.net/octocats/hulatocat.png"] }env:URLS:${{ steps.upload.outputs.urls }}# ...

Inputs

  • account (required): Storage account name, e.g.mystorageaccount
  • destination (required): Name of container to upload blob to, e.g.$web to upload a static website.
  • source (required): Path to file(s) to upload todestination, e.g.. to upload all files in the current directory. Supports globbing, e.g.images/**.png. For more information, please refer tohttps://www.npmjs.com/package/glob.

Outputs

  • urls: data structure with names and urls to uploaded files

License

MIT

Contributing

Pull requests are welcome! SeeCONTRIBUTING.md for more.

About

Example GitHub action to upload file(s) to Azure Blob Storage

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp