Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support all blobstorage settings #658

Closed
wants to merge 2 commits into from

Conversation

nitely
Copy link
Contributor

@nitely nitely commented Jan 25, 2019

fixes #643

Changes:

  • Add support for all blostorage settings
  • Update docs

AZURE_CUSTOM_DOMAIN is important to fetch azurite from a linked container

@TheArtOfPour
Copy link

Great changes! Can you explain how to configure the CDN url with these new variables?

@nitely
Copy link
Contributor Author

nitely commented Jan 28, 2019

Yeah, use the custom_domain setting for that. The docs mention this can be used to set a cdn (sub)domain (quick start point 1) or a custom domain.

@malderete
Copy link

We should merge this PR. It improves the integration with Azure library's service.

@jschneier
Copy link
Owner

Hi this looks okay. My only question is about the required azure library bump, are there breaking changes from 3 to 4?

@nitely
Copy link
Contributor Author

nitely commented Feb 11, 2019

My only question is about the required azure library bump, are there breaking changes from 3 to 4?

I double checked, all settings are there[0], so the version bump is not required. I temporarily pinned the version and all tests pass as well.

Not sure why I bumped them, maybe it was required for CloudStorageAccount and I forget to revert that when switching to BlockBlobService or I had an old azure version 🤷‍♂️

[0] https://github.com/Azure/azure-storage-python/blob/v1.3.1-blob/azure-storage-blob/azure/storage/blob/blockblobservice.py#L96

@davidfischer
Copy link
Contributor

Firstly, this is great work.

I'm having some trouble getting this to work with an Azure CDN setup as opposed to a blob service custom domain. From what I can tell when I turned up debugging, it looks like the custom domain is used as an API endpoint.

However, when used with Azure CDN, the custom domain resolves to BUCKETNAME.azureedge.net. rather than BUCKETNAME.blob.core.windows.net and then the API calls seem to fail.

Am I misunderstanding what the custom_domain setting is supposed to do? Should it work with a CDN setup?

@nitely
Copy link
Contributor Author

nitely commented Feb 27, 2019

Interesting. No, it won't work, because as you said, it will try to upload the file to the custom domain (cdn) and fail. I think we should add two internal services, one to generate the URLs using the custom_domain (cdn) and another one to upload/download through blob.core. I've to try whether that plays nice with the endpoint_suffix, though. I'll try it tomorrow and ping you so you can try it as well @davidfischer

@nitely
Copy link
Contributor Author

nitely commented Feb 28, 2019

I made some changes and this has worked for me:

  • create a new file
  • read the new file
  • access the new file through CDN (using the file.url property)

Can you give this a try @davidfischer ?

@davidfischer
Copy link
Contributor

The changes worked for me. I tried:

  • listing directories
  • testing whether files exist
  • getting the URL of a file (using storage.url('path/to/file')) - the custom domain was used in this case

@Maxyme
Copy link

Maxyme commented Mar 19, 2019

Hi, what is the progress on this? This is really useful for using Azurite inside of docker-compose and setting the AZURE_CUSTOM_DOMAIN to point to that container.
Thank you for this PR.

@sww314 sww314 added the azure label May 10, 2019
@akshaybabloo
Copy link

Any update on this?

@nitely
Copy link
Contributor Author

nitely commented Jun 10, 2019

It's up to @jschneier to merge it. I'm guessing he's waiting for the next minor (v1.8) release. We have been using this for a few months now and it has worked well so far.

@jschneier
Copy link
Owner

Ugh I screwed up resolving the conflict in the GUI and now am not sure how to undo it.

@jschneier
Copy link
Owner

Moved this to #750. Sorry for that and thanks again @nitely. Would you be interested in helping to maintain the Azure backend?

@jschneier jschneier closed this Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

custom domain for azure
8 participants