azure-storage-blob-go | Microsoft Azure Blob Storage Library for Go | Azure library
kandi X-RAY | azure-storage-blob-go Summary
kandi X-RAY | azure-storage-blob-go Summary
Microsoft Azure Blob Storage Library for Go
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of azure-storage-blob-go
azure-storage-blob-go Key Features
azure-storage-blob-go Examples and Code Snippets
Community Discussions
Trending Discussions on azure-storage-blob-go
QUESTION
It's my first question at such cool resource.
Description of a goal: I need to copy from one Azure storage account to another. ... Not only this, but this part doesn't work for me now.
Problem: If generate token with generate_blob_sas you will have in azcopy operation:
INFO: Authentication failed, it is either not correct, or expired, or does not have the correct permission -> github.com/Azure/azure-storage-blob-go/azblob.newStorageError, github.com/Azure/azure-storage-blob-go@v0.13.1-0.20210914164749-2d6cd3e07548/azblob/zc_storage_error.go:42 ===== RESPONSE ERROR (ServiceCode=AuthenticationFailed) ===== Description=Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
If insert manually created token on Azure portal - works fine.
Why I use azcopy inside of Python, because I have structure like this:
...ANSWER
Answered 2022-Apr-15 at 01:01The reason why your code is failing with the SAS token generated programmatically is because it is missing List
permission. If you look at the working SAS token, it has both Read
and List
permissions (sp=rl
) whereas the non-working SAS token only has Read
permission (sp=r
).
Another issue is that in your code you are generating SAS token for the blob (sr=b
) whereas the working SAS token is for the container (sr=c
). This is for both source and target SAS token.
To fix this:
- Create the SAS token with both
Read
andList
permissions. - Create the SAS token for the container instead of blob. For this, you will need to use
generate_container_sas
.
Once you do these two things, you should not get the error.
QUESTION
I am using the task Azure file copy
to upload the build artefacts to the blob container. But I am always getting an error as preceding.
ANSWER
Answered 2022-Mar-30 at 19:36After looking at this issue, I figured out what could be the reason. As you might have already known that a new service principal will be created whenever you create a service connection in the Azure DevOps, I have explained this in detail here. To make the AzureFileCopy@4
task work, we will have to add a role assignment under the Role Assignment in the resource group. You can see this when you click on the Access control (IAM). You can also click on the Manage service connection roles
in the service connection you had created for this purpose, which will redirect you to the IAM screen.
- Click on the +Add and select Add role assignment
- Select the role as either
Storage Blob Data Contributor
orStorage Blob Data Owner
- Click Next; on the next screen add the service principal as a member by searching for the name of the service principal. (You can get the name of the service principal from Azure DevOps, on the page for the Service Connection, by clicking on the
Manage Service Principal
link. My service principal looked like "AzureDevOps.userna.[guid]".)
- Click on Review + assign once everything is configured.
- Wait for a few minutes and run your pipeline again. Your pipeline should run successfully now.
You can follow the same fix when you get the error "Upload to container: '' in storage account: '' with blob prefix: ''"
QUESTION
I'm trying to compile kaniko on a raspberry pi.
I don't program in golang, but I was able to compile kaniko successfully a few weeks ago on the same raspberry pi, and even wrote myself a guide of the steps to follow, but now, following the same steps, something is broken.
kaiko requires go
, but a more recent version of go
then found in the raspberry pi repos, so I download and install go
from scratch. go
requires go
to compile, so I first install it (an older version) from the repos, and then remove it after it's done compiling a more recent version of itself:
Install go
:
ANSWER
Answered 2022-Feb-04 at 19:56Based on the comments, my suggestion is to add $HOME/go/bin
to the path and use the default GOPATH.
Go mod depends on the bin directory inside the GOPATH. It installs new packages there. The go binary itself can actually reside somewhere else. If you follow these install instruction https://go.dev/doc/install, go itself will actually be in /usr/local/go
but the GOPATH
is still $HOME/go
.
I would also recommend, not involving apt in this at all. This looks like trouble in the form of conflicts with different installations.
QUESTION
I would like to copy files with Azure File Copy with Azure Pipeline.
I'm following instruction of https://praveenkumarsreeram.com/2021/04/14/azure-devops-copy-files-from-git-repository-to-azure-storage-account/
I'm using automatically created Service Connection named "My Sandbox (a1111e1-d30e-4e02-b047-ef6a5e901111)"
I'm getting error with AzureBlob File Copy:
...ANSWER
Answered 2021-Nov-09 at 09:47I can also reproduce your issue on my side, as different Azure file copy task versions use different versions of AzCopy
in behind, then they use different auth ways to call the API to do the operations.
There are two ways to fix the issue.
If you use the automatically created service connection, it should have
Contributor
role in your storage account, you could use Azure file copy task version3.*
instead of4.*
, then it will work.If you want to use Azure file copy task version
4.*
, navigate to your storage account ->Access Control (IAM)
-> add your service principal used in the service connection as aStorage Blob Data Contributor
role, see detailed steps here. It will also work.
QUESTION
so, I have been trying for hours now to upload a VHD to Azure.
I downloaded a VHD by exporting on one Azure tenant on another domain, now I'm trying to upload it on another Azure account to attach it to a VM.
Steps (based on this article):
- Exported VHD on tenant 1 (T1)
- Logged into Azure CLI on PC with tenant 2 (T2)
- Created a disk through Azure CLI T2 with upload bytes parameter set (30GB - 32213303808 bytes)
- Granted access to disk on T2
- Started upload with
AzCopy.exe copy "D:\Downloads\disk.vhd "https://[sasurl]" --blob-type PageBlob
As soon as the upload starts, it gets stuck on 0.5 %, after about 55 minutes it just spits out that the upload has failed.
Log file:
...ANSWER
Answered 2021-Feb-13 at 22:13I stumbled upon a good solution myself:
Since I was uploading a VHD of a disk already on Azure, instead of using the downloaded VHD I used the original VHD export URL as the source of the disk.
QUESTION
I'm getting an error trying to copy all files from an Azure File Share to a Blob Container within the same Storage account.
...ANSWER
Answered 2020-Aug-11 at 12:14When you request the SAS token, you need to make sure you grant list permission as well, the correct syntax for this is rwdl
. I have included the reference for the command as well should you need it here.
QUESTION
I'm trying to upload a file to Azure Storage Account as Blob and I have a client provided by this "github.com/Azure/azure-storage-blob-go/azblob"
package. As I saw in documentation there should be possibility to communicate with Storage using SAS Token
creating anonymous credential with
ANSWER
Answered 2020-Feb-21 at 15:03So in the 1st case the problem was that SAS token is passed nowhere in this package. It should be added to URL later on during url creation like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install azure-storage-blob-go
Get the SDK, with any method you prefer: Go Get: go get github.com/Azure/azure-storage-blob-go/azblob Dep: add github.com/Azure/azure-storage-blob-go to Gopkg.toml: [[constraint]] version = "0.3.0" name = "github.com/Azure/azure-storage-blob-go" Module: simply import the SDK and Go will download it for you
Use the SDK: import "github.com/Azure/azure-storage-blob-go/azblob"
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page