Based on the context provided, the user is having trouble turning on CORS while adding a data source in Azure OpenAI Studio. The user has already set up the storage resource and attempted to turn on CORS, but the option is disabled. As an admin for the account, the user needs to enable CORS to allow cross-origin requests from their Azure OpenAI Studio application.
To enable CORS for a storage account, follow these steps:
- Go to the Azure portal, open your storage account, and select Settings.
- Under "Resource sharing (CORS)", select the "+ Add" button.
- In the "Allowed origins" field, enter the origin for your OpenAI Studio application. This may be
https://*.openai.azure.com
orhttps://<your-app-name>.openai.azure.com
. - In the "Allowed methods" field, select "GET", "HEAD", "OPTIONS", "PUT", or "POST" as required by your application.
- In the "Allowed headers" field, enter any headers that your application needs to send with the request. It is recommended to use "*" for all headers, or to only include the headers necessary for your application.
- In the "Exposed headers" field, enter any headers that your application expects to receive in the response. Again, it is recommended to use "*" for all headers, or to only include the headers necessary for your application.
- In the "Max age" field, enter the number of seconds that the client should cache preflight requests. Typically, this value is set to 3600 or higher.
Note: Wildcards in the domain name, such as https://*.openai.azure.com
, are currently not supported by Azure Cosmos DB.
After enabling CORS, you can go back to Azure OpenAI Studio and try adding the data source again. The option to turn on CORS should now be enabled, allowing you to select the storage account as a data source. If you are still having issues, ensure that the correct security settings and credentials are in place to access the storage account.
References: