Configuring Azure Search Index CORS through the Azure Portal

By default (and for good reason), Azure Search API doesn’t allow cross-origin requests. If you are getting something like the following, then you have to configure CORS requests for your application.

Azure Search (search.windows.net) No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin is therefore not allowed access. The response had HTTP status code 400.
choose index
Click on the index you are trying to query

This is extremely easy, however a bit less-than-obvious, especially if you miss it the first time you set it up. If you’ve configured Azure Search and have it returning the results you expect in Search Explorer, but then on your machine get a origin error, you still need to set up CORS on your Index. It takes just a few clicks – but if you missed this step when setting up your Index, it isn’t obvious to find it. I keep saying ‘index’ because if you’re like me, you’ll go look on the search service to set up origins, but you need to do this on the index itself. Open your search service in the Azure Portal. Choose the index you are aiming to query.

Scroll down to the bottom of the column. Note that your index is probably set to ‘none’. We’re just going to allow all – but you can restrict it to your required hosts later using basically the same steps.

Taco Bell drive-thru

Everything I know about viral video, I learned from Taco Bell.

I caught this video at lunchtime on a Monday. That afternoon I posted it to YouTube for 5 teammates, who I had Slack messaged while this was happening. “I’m getting the craziest sh!t on my dash cam right now” is all my message said. I followed up with the video.

Since it was published on YouTube, I threw the link on to Facebook, for no particular reason. I didn’t think anything of it again, until my phone, email, Facebook messages were all blowing up with inquiries about licensing for the video.

[to be continued]…

Right place at the right time, I guess. My dash cam captured this confused driver struggling to back out of a Taco Bell drive through after he mistakenly went in the wrong way.