Skip to content

Commit

Permalink
Move back to one solution file and updated docs. (microsoft#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenj authored Oct 6, 2018
1 parent 6e406e3 commit e6e2223
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,10 @@ Once the Solution has been cloned you will see the following folder structure.
| - Assistant-WebTest
| - Microsoft.Bot.Solutions
| - VirtualAssistant.sln
| - Skills.sln

### Build the Solution

Once cloned the next step it to build the VirtualAssistant and Skills solutions within Visual Studio. The Virtual Assistant and Skills solutions are separated for clarity with the Skills solution pushing binaries into a shared output folder enabling easy referencing from the Virtual Assistant.

> Build the Skills project before the Virtual Assistant project.
Once cloned the next step it to build the VirtualAssistant solution within Visual Studio. Deployment must have been completed before you can run the project due to this stage creating key dependencies in Azure along with your configured .bot file.

### Deployment

Expand Down Expand Up @@ -133,11 +130,11 @@ If you wish to make use of the Calendar, Email and Task Skills you need to confi

The [Add Authentication to your bot](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-tutorial-authentication?view=azure-bot-service-3.0) section in the Azure Bot Service documentation covers more detail on how to configure Authentication. However in this scenario, the automated deployment step has already created the Azure AD v2 Application for your Bot. Therefore you only need to perform the following steps from the above documentation page:

- Navigate to https://apps.dev.microsoft.com/
- Navigate to https://apps.dev.microsoft.com/ and find the application created in the previous step which should match your Bot name.
- Under Platforms, click Add Platform.
- In the Add Platform pop-up, click Web.
- Leave Allow Implicit Flow checked.
- For Redirect URL, enter https://token.botframework.com/.auth/web/redirect.
- For Redirect URL, enter https://token.botframework.com/.auth/web/redirect
- Leave Logout URL blank.
- Under Microsoft Graph Permissions, you can need to add additional *delegated* permissions.
- Each of the Skills require a specific set of Scopes, refer to the documentation for each skill or use the following list of Scopes that contain the scopes needed for all skills.
Expand All @@ -150,13 +147,13 @@ The commands shown below assume you have used the deployment process and your re
```shell
msbot get production --secret YOUR_SECRET

az bot authsetting create --resource-group YOUR_BOT_NAME --name YOUR_BOT_NAME --setting-name YOU_AUTH_CONNECTION_NAME --client-id YOUR_APPLICATION_ID --client-secret YOUR_APPLICATION_PASSWORD --provider-scope-string "Calendars.ReadWrite Mail.Read Mail.Send Notes.ReadWrite People.Read User.Read" --service Aadv2
az bot authsetting create --resource-group YOUR_BOT_NAME --name YOUR_BOT_NAME --setting-name "YOUR_AUTH_CONNECTION_NAME" --client-id "YOUR_APPLICATION_ID" --client-secret "YOUR_APPLICATION_PASSWORD" --provider-scope-string "Calendars.ReadWrite Mail.Read Mail.Send Notes.ReadWrite People.Read User.Read" --service Aadv2
```

The final step is to update your .bot file and associated Skills (in appSettings.config) with the Authentication connection name, this is used by the Assistant to enable Authentication prompts or use of Linked Accounts.

```shell
msbot connect generic --name "Authentication" --keys "{\"Azure Active Directory v2\":\"YOUR_AUTH_CONNECTION_NAME\"}" --secret "YOUR_BOT_SECRET" --url "portal.azure.net"
msbot connect generic --name "Authentication" --keys "{\"Azure Active Directory v2\":\"YOUR_AUTH_CONNECTION_NAME\"}" --bot YOURBOTFILE.bot --secret "YOUR_BOT_SECRET" --url "portal.azure.net"
```

Then in the appSettings.config updated the `authConnectionName` for each skill as appropriate.
Expand Down
55 changes: 0 additions & 55 deletions solutions/Virtual-Assistant/src/csharp/Skills.sln

This file was deleted.

38 changes: 38 additions & 0 deletions solutions/Virtual-Assistant/src/csharp/VirtualAssistant.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,25 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 15.0.28010.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VirtualAssistant", "assistant\VirtualAssistant.csproj", "{D207238E-C1C2-4449-9984-1BE1F15B9B35}"
ProjectSection(ProjectDependencies) = postProject
{6BD03130-4931-410F-83EB-03E37E17E2B9} = {6BD03130-4931-410F-83EB-03E37E17E2B9}
{2DF1C042-7544-4885-AFE4-E7010369A519} = {2DF1C042-7544-4885-AFE4-E7010369A519}
{ACB52D46-6553-44EF-89AE-D3038406FA1E} = {ACB52D46-6553-44EF-89AE-D3038406FA1E}
{3DE6A4B2-9241-4605-9E8C-BD17A1F71502} = {3DE6A4B2-9241-4605-9E8C-BD17A1F71502}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Solutions", "Microsoft.Bot.Solutions\Microsoft.Bot.Solutions.csproj", "{0106AD2E-C570-42DF-B54B-3ACA50D58D80}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CalendarSkill", "skills\calendarskill\CalendarSkill.csproj", "{2DF1C042-7544-4885-AFE4-E7010369A519}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EmailSkill", "skills\emailskill\EmailSkill.csproj", "{ACB52D46-6553-44EF-89AE-D3038406FA1E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PointOfInterestSkill", "skills\pointofinterestskill\PointOfInterestSkill.csproj", "{6BD03130-4931-410F-83EB-03E37E17E2B9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ToDoSkill", "skills\ToDoSkill\ToDoSkill.csproj", "{3DE6A4B2-9241-4605-9E8C-BD17A1F71502}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Skills", "Skills", "{5613E456-DD6D-4A16-AB48-D2F51CAC0526}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -21,10 +37,32 @@ Global
{0106AD2E-C570-42DF-B54B-3ACA50D58D80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0106AD2E-C570-42DF-B54B-3ACA50D58D80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0106AD2E-C570-42DF-B54B-3ACA50D58D80}.Release|Any CPU.Build.0 = Release|Any CPU
{2DF1C042-7544-4885-AFE4-E7010369A519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2DF1C042-7544-4885-AFE4-E7010369A519}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2DF1C042-7544-4885-AFE4-E7010369A519}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2DF1C042-7544-4885-AFE4-E7010369A519}.Release|Any CPU.Build.0 = Release|Any CPU
{ACB52D46-6553-44EF-89AE-D3038406FA1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ACB52D46-6553-44EF-89AE-D3038406FA1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ACB52D46-6553-44EF-89AE-D3038406FA1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ACB52D46-6553-44EF-89AE-D3038406FA1E}.Release|Any CPU.Build.0 = Release|Any CPU
{6BD03130-4931-410F-83EB-03E37E17E2B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6BD03130-4931-410F-83EB-03E37E17E2B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6BD03130-4931-410F-83EB-03E37E17E2B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6BD03130-4931-410F-83EB-03E37E17E2B9}.Release|Any CPU.Build.0 = Release|Any CPU
{3DE6A4B2-9241-4605-9E8C-BD17A1F71502}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3DE6A4B2-9241-4605-9E8C-BD17A1F71502}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3DE6A4B2-9241-4605-9E8C-BD17A1F71502}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3DE6A4B2-9241-4605-9E8C-BD17A1F71502}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{2DF1C042-7544-4885-AFE4-E7010369A519} = {5613E456-DD6D-4A16-AB48-D2F51CAC0526}
{ACB52D46-6553-44EF-89AE-D3038406FA1E} = {5613E456-DD6D-4A16-AB48-D2F51CAC0526}
{6BD03130-4931-410F-83EB-03E37E17E2B9} = {5613E456-DD6D-4A16-AB48-D2F51CAC0526}
{3DE6A4B2-9241-4605-9E8C-BD17A1F71502} = {5613E456-DD6D-4A16-AB48-D2F51CAC0526}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7569C2D0-1323-45B5-8CFF-3ECACD9E0B82}
EndGlobalSection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Google.Apis.Calendar.v3" Version="1.35.2.1354" />
<PackageReference Include="Google.Apis.Calendar.v3" Version="1.35.2.1363" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.4.1" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.4" />
<PackageReference Include="Microsoft.Azure.CognitiveServices.ContentModerator" Version="1.0.0" />
Expand Down Expand Up @@ -109,10 +109,16 @@
</Reference>
</ItemGroup>

<ProjectExtensions><VisualStudio><UserProperties /></VisualStudio></ProjectExtensions>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy &quot;$(SolutionDir)skills\$(OutDir)Dialogs&quot; &quot;$(TargetDir)Dialogs&quot; /s /y /i&#xD;&#xA;xcopy &quot;$(SolutionDir)skills\$(OutDir)Resources&quot; &quot;$(TargetDir)Resources&quot; /s /y /i" />
</Target>

<ProjectExtensions><VisualStudio><UserProperties appsettings_1development_1json__JSONSchema="" /></VisualStudio></ProjectExtensions>
<ItemGroup>
<None Update="*.bot">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>

0 comments on commit e6e2223

Please sign in to comment.