I cant enable CORS in my storage account

Peri 20 Reputation points
2024-11-28T14:22:03.06+00:00

I have created an storage account and i want to use the search service, if says i should enable CORS and when i try that it throws an error saying cant enable CORS, guide me on how to do this.

Thanks

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,281 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,990 questions
0 comments No comments
{count} votes

Accepted answer
  1. Azar 24,035 Reputation points MVP
    2024-11-28T14:35:57.4866667+00:00

    Hi there Peri

    Try this got t to your storage account in the Azure Portal. Under the Settings section, select CORS under the Blob service. Click Add CORS rule to create a new rule. In the CORS settings, specify the allowed origins , select the HTTP methods you want to allow, and define the allowed and exposed headers and save.

    Else try recreating the same with a different region,

    If this helps kindly accept the answer thanks much.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. akinbade abiola 20,545 Reputation points
    2024-11-28T14:37:42.94+00:00

    Hello Peri,

    Thanks for your question.

    In Microsoft Azure, go to All Services, navigate to Storage, and select Storage accounts.

    Choose the storage account you created.

    In the storage account settings, click on CORS under the Blob service section.

    Configure the following settings:

    • Allowed origins: Use the wildcard character (*) to permit all domains.
    • Allowed methods: Select GET, POST, OPTIONS, and PUT.
    • Allowed headers: Include x-ms-blob-type and content-type.
    • Exposed headers: Add x-ms-blob-type.
    • Max age: Set to 0 seconds.
    • Click Save to apply the changes.

    See: https://learn.microsoft.com/en-us/cli/azure/storage/cors?view=azure-cli-latest

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola


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.