Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelschiff committed Jan 23, 2024
1 parent 79e7fc6 commit f43fc32
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion broker/fragment/store_azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ func (a *azureBackend) SignGet(endpoint *url.URL, fragment pb.Fragment, d time.D
if err != nil {
return "", err
}
// this step is needed to set the sharedkeyCredentials
_, err = a.getAzureServiceClient(endpoint)
if err != nil {
return "", err
}
blobName := cfg.rewritePath(cfg.prefix, fragment.ContentPath())

if endpoint.Scheme == "azure" {
Expand Down Expand Up @@ -314,14 +319,15 @@ func (a *azureBackend) getAzureServiceClient(endpoint *url.URL) (client *service
if err != nil {
return nil, err
}
a.sharedKeyCredentials = sharedKeyCred
serviceClient, err := service.NewClientWithSharedKeyCredential(cfg.serviceUrl(), sharedKeyCred, &service.ClientOptions{})
if err != nil {
return nil, err
}

a.mu.Lock()
a.clients[accountName] = serviceClient
a.mu.Lock()
a.mu.Unlock()
return serviceClient, nil
} else if endpoint.Scheme == "azure-ad" {
// Link to the Azure docs describing what fields are required for active directory auth
Expand Down

0 comments on commit f43fc32

Please sign in to comment.