FileUpload not working in azure web app #15494
Unanswered
omenejoseph
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Package
Form builder
Package Version
v3.2
How can we help you?
I recently decided to move my project to azure. I deployed and created an instance of azure blob storage to store my files. I am using the azure laravel package that extends the laravel storage facade and provides the azure driver.. worked like a charm when I tried it locally.. I exposed the storage container to all ips and my local uploaded fine.. when I tried this on the azure web app, it failed giving a 401 unauthorised error.
I went into the tail spin thinking my azure instance does not allow connection to the bucket.. After hours of debugging, I successfully used tinker and a route to use the Azure driver to fetch and write files to the container. This proves the app can connect, read and write to the azure blob storage. For some reason, FileUpload still fails on my form returning 401 error even though I know that the app is authorised to write to the storage
Forms\Components\FileUpload::make('file_path') ->previewable() ->directory(function(Forms\Get $get){ $prefix = str_replace(' ', '_', strtolower(auth()->user()->company->name)); switch ($get('documentable_type')) { case Client::class: return "$prefix/documents/clients"; case User::class: return "$prefix/documents/carers"; default: return "$prefix/documents/other"; } }) ->disk(config('filesystems.default')) ->required() ->columnSpanFull(),
is the input that works locally but not on azure.... I have spent days trying to figure this out.. I am confused about how else I can debug this... I am not getting a cors error, its giving me unauthenticated 401 error. Any help will be greatly appreciated
Beta Was this translation helpful? Give feedback.
All reactions