Share via

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
Azure Storage

Globally unique resources that provide access to data management services and serve as the parent namespace for the services.

Azure Blob Storage
Azure Blob Storage

An Azure service that stores unstructured data in the cloud as blobs.

0 comments No comments

Answer accepted by question author

  1. Azar 31,715 Reputation points MVP Volunteer Moderator
    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.

    Was this answer helpful?

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Abiola Akinbade 30,490 Reputation points Volunteer Moderator
    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

    Was this answer helpful?


Your answer

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