solliancenet / ai-in-a-day

Azure AI in a Day Labs
39 stars 88 forks source link

Lab 2 - Task 3 - step 10 Powershell fails #7

Open Floriszz opened 2 years ago

Floriszz commented 2 years ago

I see there has been 'toggling' with the Lab numbers and titles. To be clear;

This step 10 is not clear.

feaselkl commented 2 years ago

Azure Powershell is not possible as creating storage account is not allowed

There are setup instructions at https://github.com/solliancenet/ai-in-a-day/blob/main/setup/03-setup-workspace.md on which resources need to be created for the lab. It does look like the instructions could be clearer about needing to go through this setup process first assuming you are running this in your own home lab rather than someplace which has incorporated the setup instructions into a deployment process.

Tried powershell client on the lab vm with Connect-AzAccount, but the script is not ‘parsable’

I'm not sure what steps you used to do this, but you shouldn't need to connect to an Azure account. You should be able to copy the code exactly as it appears in the code block, paste it into a PowerShell prompt by right-clicking, strike Enter, and create the function. If you are getting an error, can you show a screenshot of what you're doing and the error?

Tried to Bing on “Azure PowerShell function Create-AzureSearchIndex”, but no good examples…

This is a custom function to do a specific task, so there won't be other examples of it.

Floriszz commented 2 years ago

I'm not sure what steps you used to do this, but you shouldn't need to connect to an Azure account. You should be able to copy the code exactly as it appears in the code block, paste it into a PowerShell prompt by right-clicking, strike Enter, and create the function. Where do you run the pwsh.exe? On the lab VM? The powershell commands need to do/create stuff in Azure. How is this done if not connected to Azure? I don't have a screenshot and my environment is gone. But the error comes when trying to run the commands in the step after running the function, where you have to point to the downloaded files for creating the indexes.

feaselkl commented 2 years ago

Run pwsh.exe on whatever machine you downloaded the files to in step 8. If that's the lab VM, then yes, you would open PowerShell on the lab VM; if you downloaded the six files to a local machine, then open PowerShell on the local machine.

The task is invoking web requests against your Azure Search service which has already been created. In step 11, you pass in the account name and API key as parameters (for ease of use; alternatively, they could come from environment variables or secure storage). That's why there's no requirement to use Azure PowerShell modules.

Floriszz commented 2 years ago

Thank you for your quick reply. What you are saying sounds good, but I could not follow these steps in step 10 and 11.