In this lab, you will gain experience using C#, the Azure Search SDK, and Visual Studio to connect to and use Azure Search.
You will use RDP to connect to a Windows VM and update a pre-built Visual Studio solution with the appropriate C# code to connect to your search service, create a search index, index sample JSON data, and search your index. When you’re finished, you will run the console application to see everything working. Finally, you will verify documents are indexed using the Azure Portal.
Upon completion of the lab, you will have gained the experience required to work with Azure Search using C#.
Successfully complete this lab by achieving the following learning objectives:
- RDP into the VM and open the VS solution.
UserName : "azureuser" Password : "LA!2018!Lab"
PowerShell to run:
Add-Type -Path "C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFrameworkv4.5System.IO.Compression.FileSystem.dll" $url = "https://github.com/linuxacademy/content-azure-labs/blob/master/zips/azure-search.zip?raw=true" $zipfile = "C:UsersazureuserDesktopazure-search.zip" $folder = "C:UsersazureuserDesktop" [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 Invoke-WebRequest -UseBasicParsing -OutFile $zipfile $url [System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $folder) Remove-Item -Path $zipfile #
- Update Visual Studio solution and run the console app.
In this step, we’ll update our Visual Studio solution with the appropriate C# code to connect to and interact with Azure Search.
When we’re finished, we’ll run our completed console app to create an index, index sample JSON data, and search the index.
We’ll also verify the data was indexed using the Azure Portal.