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

"media" folder is not connecting to azure CDN, still points to app_data #7827

Closed
webmedia1012 opened this issue Dec 2, 2020 · 3 comments
Closed

Comments

@webmedia1012
Copy link

webmedia1012 commented Dec 2, 2020

Hi all,

Just a clarification, when I updated the appsettings to point to cdn, everything worked as far as uploading new media and creating a folder from cms admin, it gets replicated on ourcontainer, but now since our cms content has a relative url like "\media\slideshow\banner1.jpg" it's not displaying but when I go to https://ourcdn.azureedge.net/images/slideshow/banner1.jpg it shows up.

Did I miss something in the config file? how do I hook these up, so the media folder will not look at the cms media folder but the cdn setup.

"OrchardCore": {
    "OrchardCore_Media_Azure": {
      // Set to your Azure Storage account connection string.
      "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=appstorage;AccountKey=myaccountkey;EndpointSuffix=core.windows.net",
      // Set to the Azure Blob container name. A container name must be a valid DNS name and conform to Azure container naming rules eg. lowercase only.
      "ContainerName": "cms",
      // Optionally, set to a path to store media in a subdirectory inside your container.
      "BasePath": "",
      "CreateContainer": true
    }

Thank you as always.
Regards,
G

@webmedia1012 webmedia1012 changed the title "media" folder is not connecting to azure CDN after storage "media" folder is not connecting to azure CDN, still points to app_data Dec 2, 2020
@deanmarcussen
Copy link
Member

You maybe confusing the idea of blob storage with cdns?

I think maybe we've had this conversation already.

They're two different things

The configuration you maybe missing is listed here in the Media section
https://docs.orchardcore.net/en/dev/docs/reference/modules/Media/#configuration

CdnBaseUrl

To use a cdn with Orchard Core (unrelated to blob storage completely - though blob storage maybe a backing store)

  • Configure your cdn endpoint address to point at the OrchardCore website.
  • Don't configure the cdn to point at blob storage container directly.

@webmedia1012
Copy link
Author

webmedia1012 commented Dec 4, 2020

Thank you Dean, it might be helpful to run you to the steps I did.

  1. I setup the feature on CMS to enable Azure CDN (which is on the docs)
  2. I copied the configuration on your docs here :https://docs.orchardcore.net/en/dev/docs/reference/modules/Media.Azure/
  3. Modified the values

I am able to upload files from CMS media section (admin) all the way to my Storage using config on item #2

So I understand that I'm using storage and not CDN, coz on the config it didn't say CDN it just says container, my question is when the page loads the /media/whatever.jpg is not pointing to that storage.

So am I missing something, for now my work around is to inject the the CDN profile (mycdn.azureedge.net) as baseurl and attached to my "img src=baseurl/media/whatever;jpg" but I have to make the media text to capital M (Media) otherwise the storage will not recognize coz it's case sensitive.

Anyway, hope that makes sense.

Thank you as always, I know it worked before just using this setup, but now it's not for some reason. And yes I will try that solution you just sent me and keep you posted.

Warm regards,
g

@webmedia1012
Copy link
Author

Ok I finally figured out how this whole media to media azure works. Essentially I have to wait like what it says on the documentation for the cache to download the image back to cms. Thank you for all the help @deanmarcussen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants