The error message you are encountering indicates that the CORS policy is blocking your request due to permission issues with accessing the specified address space. Here are some steps you can take to troubleshoot and potentially resolve the issue:
- Verify CORS Settings: Ensure that you have correctly configured the CORS settings in your Azure Cosmos DB account. You need to specify the allowed origins in the
allowedOriginsheader. Make sure that the originhttps://cosmos.azure.comis included in your CORS configuration. - Check Browser Console: Use the browser's developer tools (F12) to check for any additional error messages or details in the console that might provide more context about the CORS issue.
- Preflight Requests: If your request is complex (e.g., it uses custom headers or methods), ensure that your server is correctly handling preflight requests. The server should respond to
OPTIONSrequests with the appropriate CORS headers. - Allowed Methods and Headers: Make sure that the CORS policy allows the HTTP methods (GET, POST, etc.) and headers that your application is trying to use. You may need to explicitly allow specific headers using the
WithHeadersmethod in your CORS policy configuration. - Testing with Different Browsers: Since you mentioned that the issue occurs in both Edge and Chrome, try testing in a different browser or in incognito mode to rule out any caching issues or extensions that might interfere with the request.
- Review Documentation: Consult the Azure Cosmos DB documentation on CORS to ensure that you have followed all necessary steps for configuration.
If these steps do not resolve the issue, consider reaching out to Azure support for further assistance.
References: