question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The simplest way to setup new containers via http api?

See original GitHub issue

Which service(blob, file, queue, table) does this issue concern?

blob

Which version of the Azurite was used?

3.9.0

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

DockerHub

What’s the Node.js version?

What problem was encountered?

curl -XPUT http://localhost:10000/devstoreaccount1/proemion?restype=container -H "Authorization: AccountName=devstoreaccount1;AccountKey=foobar"

doesn’t work anymore

<Error>
  <Code>AuthorizationFailure</Code>
  <Message>Server failed to authenticate the request. Make sure the value of the Authorization header is formed correctly including the signature.
RequestId:17dc1230-47a1-4c6a-b607-28ee5ac6c536
Time:2020-10-23T15:26:56.486Z</Message>
</Error>

Steps to reproduce the issue?

Have you found a mitigation/solution?

No

We are using no longer maintained https://github.com/arafato/azurite v 2.6.5. Currently, decided to migrate to latest 3.9.0 but the request above not longer work. We use azurite in integration tests in a following way

  1. Start a Docker container with azurite
  2. Create several blob containers
  3. Run a test on service-under-development
  4. Check expected content of blob containers

What would be the best way to perform step 2 now with 3.9.0 (in an automated way of course)? Thanks in advance!

P.S. Didn’t found any google group or another way to ask questions like this 😦

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bluewwcommented, Oct 28, 2020

@longtimeago Good to know you get it work for you!

Azurite V3 will validate the credential from the input request, this is an enhancement from Azurite V2, make Azurite be more aligned with server.

To generate SAS, you can generate it with SDK or other tools. I use Powershell as following steps:

  1. Install Powershell Storage module with adminitrator priviliage (one time work) : Install-Module Az.Storage -Repository PSGallery -Force
  2. Open a new Powershell console, and run following script:
$ctx = New-AzStorageContext -ConnectionString "AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;DefaultEndpointsProtocol=http;BlobEndpoint=http://localhost.:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;"

New-AzStorageAccountSASToken -Service Blob -ResourceType Service,Container,Object -Permission wrdl -Context $ctx -ExpiryTime 2050-12-12
0reactions
longtimeagocommented, Oct 28, 2020

@blueww thank you! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to containerize a simple Rest API using Python Flask
This post demonstrates how to setup a simple Docker container to run an API using Python Flask. The code is avaliable in this...
Read more >
HTTP API V2 - Docker Documentation
The Docker Registry HTTP API is the protocol to facilitate distribution of images to the docker engine. It interacts with instances of the...
Read more >
Portainer HTTP API by example - gists · GitHub
Here is how you can create a container in a specific endpoint using the Portainer HTTP API as a gateway. This query will...
Read more >
Build a REST API from scratch with Go, Docker & Postgres
In this tutorial, we will learn how to create a simple trivia REST API from scratch, using Go and Docker. We will start...
Read more >
Docker Compose with two containers - Flask REST API ...
Define app's environment with a Dockerfile so it can be reproduced anywhere. · Define the services that make up an app in docker-compose....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found