Exercise – Set up copilot template for store operations

Completed

In this exercise, you assume the role of Oscar and perform the following tasks.

Task - Set up Microsoft Azure Cognitive Search connection

Microsoft Azure Cognitive Search is a cloud service that helps you create a search index from your data sources. As Oscar, you need to connect your data sources to Azure Cognitive Search to turn on the Q&A feature of copilot template for store operations.

To set up this connection, follow these steps:

  1. Sign in to Azure OpenAI Studio by using your admin account.

  2. On the Welcome pop-up window, select your subscription and then enter mcropen-ai (East US, S0) as your Resource. Select Use resource.

    Screenshot of the Subscription and Resource fields with the Use resource button.

  3. Under Playground, on the right panel, select Chat.

    Screenshot of the Playground menu with Chat selected.

  4. When the Chat playground is open, select the Add your data (preview) tab. Select Add a data source.

    Screenshot of the Add a data source button.

  5. In the Data source workflow, fill in the fields with the following information, select the acknowledgment checkbox, and then select Next.

    • Select data source - Azure Blob Storage

    • Subscription - Select your subscription

    • Select Azure Blob storage resource - mcrqnastorage

    • Select storage container - mcrqnafiles

    • Select Azure AI Search resource - mcrcognitivesearch

    • Enter the index name - mcrindex

    • Indexer schedule - Once

    • Select the Add vector search to this resource checkbox to turn on vector embeddings.

    • Select an embedding model - Azure OpenAI - mcrtext-embeddings

    Screenshot of the Data source workflow details.

  6. In the Data management workflow, fill in the fields with the following information and then select Next.

    • Search type - Hybrid + semantic

    • Acknowledgment checkboxes - Select both checkboxes to give your consent to account usage.

    Screenshot of the Data management workflow details.

  7. In the Review and finish workflow, select Save and close.

    Screenshot of the Review and finish workflow details.

    Important

    Note the index name. You need this value to link Store Operations Assist with Azure OpenAI accounts.

Data should show as being added on the Add your data (preview) page.

Screenshot of the Add your data screen with data being added.

Task - Create an app registration

As Oscar, you create an app registration, which allows you to create an identity for your app and generate a client secret. You need these credentials to authenticate your app with Azure OpenAI.

To create an app registration, follow these steps:

  1. Go to Microsoft Azure portal.

  2. In Azure portal, search for and select App registrations.

    Screenshot of the App registrations option.

  3. Select New registration.

    Screenshot of the New registration option.

  4. Enter mcrapp* in the Name field. Under Supported account types, select the Accounts in this organizational directory only (Contoso only - Single tenant) option. Select Register to create a new app registration.

    Screenshot of the register an application details.

    The successful app registration message should display.

    Screenshot of the app registration success message.

  5. The program redirects you to the overview of mcrapp. From the left pane, select Certificates & secrets. On the Client secrets tab, select + New client secret.

    Screenshot of the New client secret option on the Client secrets tab.

  6. Fill in the following information and then select Add.

    • Description - AI Assistant Client Secret

    • Expires - 180 days

    Screenshot of the Add a client secret details.

  7. Save the client secret value because it's required for a later configuration.

    Screenshot of the client secret value.

    Caution

    Note the client secret value. You need this value to link Store Operations Assist with Azure OpenAI accounts. After you refresh the tab or screen, the client secret value no longer displays, and you can't copy it later. Therefore, we recommend that you save the client secret value during app registration.

  8. Select App registrations. The newly registered app mcrapp now shows on the All applications tab. Save the Application (client) ID because it's required for a later configuration.

    Screenshot of the All applications tab.

    Important

    Note the Application ID. You need this value to link Store Operations Assist with Azure OpenAI accounts.

Task - Assign the contributor role to an app registration instance

Acting as Oscar, you need to assign the contributor role to the app registration instance that you previously created. This role is necessary to use the OpenAI and Cognitive Search resources that you established during the deployment process. Follow these steps to assign the appropriate role to OpenAI and Cognitive Search resources:

  1. Sign in to Microsoft Azure portal.

  2. Select the mcriadRG resource group and then select the mcropen-ai OpenAI resource.

    1. Select Access control (IAM). Select Add > Add role assignment.

      Screenshot of the Add role assignment button.

    2. On the Role > Privileged administrator roles tab, select the Contributor role. Select Next.

      Screenshot of the Contributor role selected.

    3. On the Members tab, select User, group, or service principal and + Select members. Select the mcrapp app registration instance that you previously created and then select Select > Next.

      Screenshot of the selected members.

    4. On the Review + assign tab, review the role assignment settings. Select Review + assign to assign the role.

      Screenshot of the Review and assign tab.

  3. Go to the mcriadRG resource group and select the mcrcognitivesearch Cognitive Search resource.

    1. Select Access control (IAM). Select Add > Add role assignment.

      Screenshot of the Add role assignment option selected.

    2. On the Role > Privileged administrator roles tab, select the Contributor role. Select Next.

      Screenshot of adding the contributor role.

    3. On the Members tab, select User, group, or service principal and + Select members. Select the mcrapp app registration instance that you previously created and then select Select > Next.

      Screenshot of the Add role assignment page with options selected.

    4. On the Review + assign tab, review the role assignment settings. Select Review + assign to assign the role.

      Screenshot of the Review and assign role option highlighted.

Task - Assign the Storage Blob Data Reader role to the app registration instance

You need to assign the Storage Blob Data Reader role to the app registration instance that you previously created. Then, you can use the storage account that you created during deployment. Follow these steps to assign the appropriate role to the storage account resource:

  1. Sign in to Microsoft Azure portal.

  2. Select the mcriadRG resource group and then select the mcrqnastorage storage account resource.

  3. Select Access control (IAM) and then select Add > Add role assignment.

    Screenshot of adding the role for storage resource.

  4. On the Role > Job function roles tab, select the Storage Blob Data Reader role. Select Next.

    Screenshot of adding the Storage Blob Data Reader role.

  5. On the Members tab, select User, group, or service principal and + Select members. Select the mcrapp app registration instance that you previously created and then select Select > Next.

    Screenshot of the select members list for storage.

  6. On the Review + assign tab, review the role assignment settings. Select Review + assign to assign the role.

    Screenshot of the Review and assign option to assign the Storage Blob Data Reader role.

For detailed steps, see Assign Azure roles using the Azure portal.

Task - Enable AI store operations

As Oscar, you need to enable the AI store operations flag to activate the AI store operations feature. To do so, follow these steps:

  1. Sign in to Power Apps maker portal and select the MCRIAD environment.

  2. Go to Solutions. Under Unmanaged, select Default Solution.

    Screenshot of the Default Solution option selected.

  3. From the left pane, select Settings > Setting definitions.

  4. Select the Enable AI store operations setting definition. Select Edit.

    Screenshot of the edit setting definitions screen.

  5. In the Edit properties panel, select + Add existing value.

    Screenshot of the Add existing value button.

  6. Set the environment value to Yes. Select Save.

    Screenshot of the environment value set to Yes.

Task - Assign user permissions in Power Platform admin center

In this task, you act as Oscar and provide the Retail AI store operations User role to the MCR IAD Manager.

To assign user permissions, follow these steps:

  1. Go to Power Platform admin center and select Environments in the left pane. Select the MCRIAD environment.

    Screenshot of the environment selected.

  2. Go to Settings in your environment.

    Screenshot of the environment settings.

  3. Select Users + permissions > Users.

    Screenshot of the Users button.

  4. Select MCR IAD Manager. From the More user actions menu, select Manage security roles.

    Screenshot of the manager role with Manage security roles selected.

  5. Select the Retail AI store operations User role to assign to the selected user. Select Save.

    Screenshot of the role assigned to the selected user.

  6. Repeat steps 4 and 5 to assign the Retail AI store operations User role to Monica Rodríguez and MCR IAD FLW users.

  7. If you sign in to Store Operations Assist Mobile by using MCR IAD Manager and then go to the home page, the AI store operations icon displays in the upper-right corner.

    Screenshot of the AI store operations icon.