Getting 403 when upload image to WAF webapp

Robert Lucena 5 Reputation points
2023-02-20T01:03:55.1833333+00:00

I'm trying to send a post request to a webapp hosted on azure using WAF and I'm getting a 403 for all requests with files. This is the code that I'm using:


public insertForm(endpoint: string, model: INews, file: File): Observable {        
        let fileToUpload = file;
        const headers = new HttpHeaders().set('Content-Type', 'multipart/form-data');
        const formData = new FormData();
        formData.append('file', fileToUpload, fileToUpload.name);
        formData.append('News', JSON.stringify(model));            
        var path = `${environment.apiUrl}` + endpoint;
        return this.http.post(path, formData, {}).pipe(
            catchError((error: HttpErrorResponse) => this.instanceHandleError.handleError(error))
        );;
    }

Any idea about what is wrong?

Azure Web Application Firewall
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,758 questions
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.