I am trying to get cloud storage working with Azure on the 3.0 demo. What I've done aside from pulling the 3.0 repo and running yarn is:
yarn add
@967091941873426493/plugin-cloud-storage
yarn add @azure/storage-blob
yarn add sharp --ignore-engines
added configs to payload.config.ts for my test azure storage blob and corresponding .env values.
I've been reading through docs here:
https://www.npmjs.com/package/@payloadcms/plugin-cloud-storage&
but I'm not understanding the paths referenced in the plugin-cloud-storage docs and I'm not understanding this error I get when I run yarn dev to serve up the local:
PS C:\Dev\payload-3.0-demo> yarn dev
$ cross-env NODE_OPTIONS=--no-deprecation next dev
▲ Next.js 14.3.0-canary.28
- Local: http://localhost:3000
- Environments: .env
✓ Starting...
✓ Ready in 4.4s
○ Compiling /admin/[[...segments]] ...
✓ Compiled /admin/[[...segments]] in 25.7s (5771 modules)
[14:38:06] ERROR: There were 1 errors validating your Payload config
[14:38:06] ERROR: 1: "admin.webpack" is not allowed
Done in 91.04s.
PS C:\Dev\payload-3.0-demo> yarn dev
yarn run v1.22.22
$ cross-env NODE_OPTIONS=--no-deprecation next dev
▲ Next.js 14.3.0-canary.28
- Local: http://localhost:3000
- Environments: .env
✓ Starting...
✓ Ready in 5.4s
○ Compiling /admin/[[...segments]] ...
✓ Compiled /admin/[[...segments]] in 33s (6217 modules)
[14:40:36] ERROR: There were 1 errors validating your Payload config
[14:40:36] ERROR: 1: "admin.webpack" is not allowedYou likely have an older version of plugin-cloud-storage (the non beta packages for 2.x have webpack refs no longer valid for 3.0). Either way, you can completely remove that package. It is no longer needed, only the storage-* package is needed.
Can you elaborate on/link the "storage-*" package/docs? Or is it something baked into 3 that I just need to configure/know how to configure? I didn't see anything in the plugin-cloud-storage docs to indicate incompatibility with 3.0.
This plugin is compatible with 3.0, but you do not need it if you're using one of the listed storage options
thanks - I'll igve it a go
alright - I'm following along with
https://github.com/payloadcms/payload/tree/beta/packages/storage-azureI modified my build config as specified, added Media and MediaWithPrefix to my collections array, added the azureStorage plugin (didn't need to reconfigure my env since you kept those paths the same from plugin-cloud-storage) - but those imports don't point anywhere, there is no collections dir in my root (unless I'm not supposed to be modifying my root/payload.config.ts? Am I missing another dependency or just significant understanding? I have a media dir which contains the 1 png file I uploaded successfully.
Failed to compile
Next.js (14.3.0-canary.28) is outdated (learn more)
./payload.config.ts:30:1
Module not found: Can't resolve './collections/Media'
28 | // import { azureBlobStorageAdapter } from '@payloadcms/plugin-cloud-storage/azure'
29 | import { azureStorage } from '@payloadcms/storage-azure'
> 30 | import { Media } from './collections/Media'
| ^
31 | import { MediaWithPrefix } from './collections/MediaWithPrefix'
32 |
33 | // const adapter = azureBlobStorageAdapter({
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./src/app/(payload)/admin/[[...segments]]/page.tsxYou should be using a slug from your own media collection
Those are example collections
cool, I was just trying to get my media to sync up to azure blob storage - I ended up configuring the plugin like so:
plugins: [
azureStorage({
collections: {
'media': true,
// [mediaSlug]: true,
// [mediaWithPrefixSlug]: {
// prefix,
// },
},
allowContainerCreate: process.env.AZURE_STORAGE_ALLOW_CONTAINER_CREATE === 'true',
baseURL: process.env.AZURE_STORAGE_ACCOUNT_BASEURL,
connectionString: process.env.AZURE_STORAGE_CONNECTION_STRING,
containerName: process.env.AZURE_STORAGE_CONTAINER_NAME,
}),
],and after doing that I got some errors I could work with, tweaked the config a little and pictures are not saving/reading from Azure blob storage!
I will say that templating the [mediaSlug] in the documentation made me think it was some kind of object I had to reference and not just a string. We're getting the hang of this 😅
Star
Discord
online
Get dedicated engineering support directly from the Payload team.