microsoft / vscode-azurecognitivesearch

Azure Cognitive Search extension for VS Code (Preview)
MIT License
14 stars 13 forks source link

Azure Government Support #15

Closed shmack01 closed 3 years ago

shmack01 commented 3 years ago

This is a great extension, but it doesn't pick up the current Azure Account environment setting, such as APIM, Function Apps, etc. In VS Code, when you are signed in with the "Azure Account" extension for Azure Government the following error occurs:

Error: The access token has been obtained for wrong audience or resource 'https://management.core.windows.net/". It should exactly match with one of the allowed audiences 'https://management.core.usgovclientapi.net"....

image

dereklegenzoff commented 3 years ago

Hi @shmack01 - thanks for reporting this.

I've attached an updated version of the extension (gov-friendly-vscode-azurecognitivesearch.zip) for you with a small tweak that will make this work for gov cloud. To install it:

  1. Download the file and open VS Code
  2. Unzip the folder
  3. Press Cntrl + Shift + P to open up the command palette
  4. Type "Install from VSIX" and select that command. Navigate to the VSIX file and select it

After installing the extension, please make sure the settings of the Azure Account extension look like this: image

And that the settings for the Azure Cognitive Seach extension (Settings -> Extensions -> Azure Cognitive Search) look like this: image

Could you let me know if that works for you?

dereklegenzoff commented 3 years ago

In case you're wondering, the updated extension I attached changes the value of this line to point to search.azure.us from search.windows.net.

I will try to get an update in so this is a better experience and doesn't require a separate version of the extension.

shmack01 commented 3 years ago

Works perfectly! Thank you for adding the update for the US Gov endpoint.

dereklegenzoff commented 3 years ago

Awesome, glad to hear it :)