diff --git a/samples/bot-file-upload/csharp/.gitignore b/samples/bot-file-upload/csharp/.gitignore index d231a7a175..7466c01f9c 100644 --- a/samples/bot-file-upload/csharp/.gitignore +++ b/samples/bot-file-upload/csharp/.gitignore @@ -1,6 +1,6 @@ # TeamsFx files build -AppManifest/build +appPackage/build env/.env.*.user env/.env.local appsettings.Development.json diff --git a/samples/bot-file-upload/csharp/Properties/launchSettings.json b/samples/bot-file-upload/csharp/Properties/launchSettings.json index 068eff82a9..d985e43c6f 100644 --- a/samples/bot-file-upload/csharp/Properties/launchSettings.json +++ b/samples/bot-file-upload/csharp/Properties/launchSettings.json @@ -1,28 +1,13 @@ { "profiles": { - // Debug project within Teams - "Microsoft Teams (browser)": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "https://teams.microsoft.com/l/app/%TEAMSAPPID%?installAppPackage=true&webjoin=true&appTenantId=%TENANTID%&login_hint=%USERNAME%", - "applicationUrl": "http://localhost:5130", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "hotReloadProfile": "aspnetcore" + "Start Project": { + "commandName": "Project", + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:7130;http://localhost:5130", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "hotReloadProfile": "aspnetcore" } - //// Uncomment following profile to debug project only (without launching Teams) - //, - //"Start Project (not in Teams)": { - // "commandName": "Project", - // "dotnetRunMessages": true, - // "launchBrowser": true, - // "applicationUrl": "https://localhost:7130;http://localhost:5130", - // "environmentVariables": { - // "ASPNETCORE_ENVIRONMENT": "Development" - // }, - // "hotReloadProfile": "aspnetcore" - //} } } \ No newline at end of file diff --git a/samples/bot-file-upload/csharp/README.md b/samples/bot-file-upload/csharp/README.md index 837c865b8a..cd27f0c86f 100644 --- a/samples/bot-file-upload/csharp/README.md +++ b/samples/bot-file-upload/csharp/README.md @@ -42,10 +42,11 @@ Please find below demo manifest which is deployed on Microsoft Azure and you can ## Run the app (Using Teams Toolkit for Visual Studio) The simplest way to run this sample in Teams is to use Teams Toolkit for Visual Studio. -1. Install Visual Studio 2022 **Version 17.9 or higher** [Visual Studio](https://visualstudio.microsoft.com/downloads/) +1. Install Visual Studio 2022 **Version 17.10 Preview 4 or higher** [Visual Studio](https://visualstudio.microsoft.com/downloads/) 1. Install Teams Toolkit for Visual Studio [Teams Toolkit extension](https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/toolkit-v4/install-teams-toolkit-vs?pivots=visual-studio-v17-7) 1. In the debug dropdown menu of Visual Studio, select Dev Tunnels > Create A Tunnel (set authentication type to Public) or select an existing public dev tunnel. -1. In Visual Studio, right-click your project and **Select Teams Toolkit > Prepare Teams App Dependencies** +1. In the debug dropdown menu of Visual Studio, select default startup project > **Microsoft Teams (browser)** +1. In Visual Studio, right-click your **TeamsApp** project and **Select Teams Toolkit > Prepare Teams App Dependencies** 1. Using the extension, sign in with your Microsoft 365 account where you have permissions to upload custom apps. 1. Select **Debug > Start Debugging** or **F5** to run the menu in Visual Studio. 1. In the browser that launches, select the **Add** button to install the app to Teams. @@ -99,9 +100,9 @@ the Teams service needs to call into the bot. 1) Run your bot, either from Visual Studio with `F5` or using `dotnet run` in the appropriate folder. 1) __*This step is specific to Teams.*__ - - **Edit** the `manifest.json` contained in the `AppManifest` folder to replace your Microsoft App Id (that was created when you registered your bot earlier) *everywhere* you see the place holder string `<>` (depending on the scenario the Microsoft App Id may occur multiple times in the `manifest.json`) + - **Edit** the `manifest.json` contained in the `appPackage` folder to replace your Microsoft App Id (that was created when you registered your bot earlier) *everywhere* you see the place holder string `<>` (depending on the scenario the Microsoft App Id may occur multiple times in the `manifest.json`) - **Edit** the `manifest.json` for `validDomains` with base Url domain. E.g. if you are using ngrok it would be `https://1234.ngrok-free.app` then your domain-name will be `1234.ngrok-free.app` and if you are using dev tunnels then your domain will be like: `12345.devtunnels.ms`. - - **Zip** up the contents of the `AppManifest` folder to create a `manifest.zip` (Make sure that zip file does not contains any subfolder otherwise you will get error while uploading your .zip package) + - **Zip** up the contents of the `appPackage` folder to create a `manifest.zip` (Make sure that zip file does not contains any subfolder otherwise you will get error while uploading your .zip package) - **Upload** the `manifest.zip` to Teams (In Teams Apps/Manage your apps click "Upload an app". Browse to and Open the .zip file. At the next dialog, click the Add button.) - Add the app to personal scope (Supported app scope) diff --git a/samples/bot-file-upload/csharp/TeamsApp/TeamsApp.ttkproj b/samples/bot-file-upload/csharp/TeamsApp/TeamsApp.ttkproj new file mode 100644 index 0000000000..3fb60da121 --- /dev/null +++ b/samples/bot-file-upload/csharp/TeamsApp/TeamsApp.ttkproj @@ -0,0 +1,9 @@ + + + + c7fd0e24-2254-4184-bf12-6c75d2752f28 + + + + + \ No newline at end of file diff --git a/samples/bot-file-upload/csharp/AppManifest/icon-color.png b/samples/bot-file-upload/csharp/TeamsApp/appPackage/icon-color.png similarity index 100% rename from samples/bot-file-upload/csharp/AppManifest/icon-color.png rename to samples/bot-file-upload/csharp/TeamsApp/appPackage/icon-color.png diff --git a/samples/bot-file-upload/csharp/AppManifest/icon-outline.png b/samples/bot-file-upload/csharp/TeamsApp/appPackage/icon-outline.png similarity index 100% rename from samples/bot-file-upload/csharp/AppManifest/icon-outline.png rename to samples/bot-file-upload/csharp/TeamsApp/appPackage/icon-outline.png diff --git a/samples/bot-file-upload/csharp/AppManifest/manifest.json b/samples/bot-file-upload/csharp/TeamsApp/appPackage/manifest.json similarity index 100% rename from samples/bot-file-upload/csharp/AppManifest/manifest.json rename to samples/bot-file-upload/csharp/TeamsApp/appPackage/manifest.json diff --git a/samples/bot-file-upload/csharp/env/.env.local b/samples/bot-file-upload/csharp/TeamsApp/env/.env.local similarity index 85% rename from samples/bot-file-upload/csharp/env/.env.local rename to samples/bot-file-upload/csharp/TeamsApp/env/.env.local index f2775c4fc6..893eabd06f 100644 --- a/samples/bot-file-upload/csharp/env/.env.local +++ b/samples/bot-file-upload/csharp/TeamsApp/env/.env.local @@ -7,11 +7,6 @@ APP_NAME_SUFFIX=local # Generated during provision, you can also add your own variables. BOT_ID= TEAMS_APP_ID= -TEAMSFX_M365_USER_NAME= - -BOT_ENDPOINT= -BOT_DOMAIN= - RESOURCE_SUFFIX= AAD_APP_CLIENT_ID= AAD_APP_OBJECT_ID= @@ -20,4 +15,13 @@ AAD_APP_OAUTH_AUTHORITY= AAD_APP_OAUTH_AUTHORITY_HOST= TEAMS_APP_TENANT_ID= MICROSOFT_APP_TYPE= -MICROSOFT_APP_TENANT_ID= \ No newline at end of file +MICROSOFT_APP_TENANT_ID= +AZURE_SUBSCRIPTION_ID= +AZURE_RESOURCE_GROUP_NAME= + + + +TEAMSFX_M365_USER_NAME= + +BOT_ENDPOINT= +BOT_DOMAIN= \ No newline at end of file diff --git a/samples/bot-file-upload/csharp/infra/azure.bicep b/samples/bot-file-upload/csharp/TeamsApp/infra/azure.bicep similarity index 100% rename from samples/bot-file-upload/csharp/infra/azure.bicep rename to samples/bot-file-upload/csharp/TeamsApp/infra/azure.bicep diff --git a/samples/bot-file-upload/csharp/infra/azure.parameters.json b/samples/bot-file-upload/csharp/TeamsApp/infra/azure.parameters.json similarity index 100% rename from samples/bot-file-upload/csharp/infra/azure.parameters.json rename to samples/bot-file-upload/csharp/TeamsApp/infra/azure.parameters.json diff --git a/samples/bot-file-upload/csharp/TeamsApp/launchSettings.json b/samples/bot-file-upload/csharp/TeamsApp/launchSettings.json new file mode 100644 index 0000000000..5687410386 --- /dev/null +++ b/samples/bot-file-upload/csharp/TeamsApp/launchSettings.json @@ -0,0 +1,9 @@ +{ + "profiles": { + // Debug project within Teams + "Microsoft Teams (browser)": { + "commandName": "Project", + "launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}" + } + } +} \ No newline at end of file diff --git a/samples/bot-file-upload/csharp/teamsapp.local.yml b/samples/bot-file-upload/csharp/TeamsApp/teamsapp.local.yml similarity index 78% rename from samples/bot-file-upload/csharp/teamsapp.local.yml rename to samples/bot-file-upload/csharp/TeamsApp/teamsapp.local.yml index 909f827a30..904d91f6b9 100644 --- a/samples/bot-file-upload/csharp/teamsapp.local.yml +++ b/samples/bot-file-upload/csharp/TeamsApp/teamsapp.local.yml @@ -40,7 +40,7 @@ provision: # Generate runtime appsettings to JSON file - uses: file/createOrUpdateJsonFile with: - target: ./appsettings.json + target: ../appsettings.json content: MicrosoftAppId: ${{AAD_APP_CLIENT_ID}} MicrosoftAppPassword: ${{SECRET_AAD_APP_CLIENT_SECRET}} @@ -61,20 +61,20 @@ provision: - uses: teamsApp/validateManifest with: # Path to manifest template - manifestPath: ./AppManifest/manifest.json + manifestPath: ./appPackage/manifest.json # Build Teams app package with latest env value - uses: teamsApp/zipAppPackage with: # Path to manifest template - manifestPath: ./AppManifest/manifest.json - outputZipPath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip - outputJsonPath: ./AppManifest/build/manifest.${{TEAMSFX_ENV}}.json + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputJsonPath: ./appPackage/build/manifest.${{TEAMSFX_ENV}}.json # Validate app package using validation rules - uses: teamsApp/validateAppPackage with: # Relative path to this file. This is the path for built zip file. - appPackagePath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip # Apply the Teams app manifest to an existing Teams app in # Teams Developer Portal. @@ -82,20 +82,4 @@ provision: - uses: teamsApp/update with: # Relative path to this file. This is the path for built zip file. - appPackagePath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip - - # Create or update debug profile in lauchsettings file - - uses: file/createOrUpdateJsonFile - with: - target: ./Properties/launchSettings.json - content: - profiles: - Microsoft Teams (browser): - commandName: "Project" - dotnetRunMessages: true - launchBrowser: true - launchUrl: "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}" - applicationUrl: "http://localhost:5130" - environmentVariables: - ASPNETCORE_ENVIRONMENT: "Development" - hotReloadProfile: "aspnetcore" \ No newline at end of file + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip \ No newline at end of file diff --git a/samples/bot-file-upload/csharp/teamsapp.yml b/samples/bot-file-upload/csharp/TeamsApp/teamsapp.yml similarity index 100% rename from samples/bot-file-upload/csharp/teamsapp.yml rename to samples/bot-file-upload/csharp/TeamsApp/teamsapp.yml diff --git a/samples/bot-file-upload/csharp/TeamsFileUpload.csproj b/samples/bot-file-upload/csharp/TeamsFileUpload.csproj index 73bb04a9ae..34c2260e39 100644 --- a/samples/bot-file-upload/csharp/TeamsFileUpload.csproj +++ b/samples/bot-file-upload/csharp/TeamsFileUpload.csproj @@ -5,6 +5,13 @@ latest + + + + + + + diff --git a/samples/bot-file-upload/csharp/TeamsFileUpload.sln b/samples/bot-file-upload/csharp/TeamsFileUpload.sln index dd01b2479f..0c67d140fd 100644 --- a/samples/bot-file-upload/csharp/TeamsFileUpload.sln +++ b/samples/bot-file-upload/csharp/TeamsFileUpload.sln @@ -5,6 +5,13 @@ VisualStudioVersion = 17.3.32901.215 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeamsFileUpload", "TeamsFileUpload.csproj", "{446A5BE5-CDE7-485C-8E4B-21C5BC32300B}" EndProject +Project("{A9E3F50B-275E-4AF7-ADCE-8BE12D41E305}") = "TeamsApp", "TeamsApp\TeamsApp.ttkproj", "{C7FD0E24-2254-4184-BF12-6C75D2752F28}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{36AC51F0-88F5-4548-977B-A201316B8F84}" + ProjectSection(SolutionItems) = preProject + TeamsFileUpload.slnLaunch.user = TeamsFileUpload.slnLaunch.user + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +22,10 @@ Global {446A5BE5-CDE7-485C-8E4B-21C5BC32300B}.Debug|Any CPU.Build.0 = Debug|Any CPU {446A5BE5-CDE7-485C-8E4B-21C5BC32300B}.Release|Any CPU.ActiveCfg = Release|Any CPU {446A5BE5-CDE7-485C-8E4B-21C5BC32300B}.Release|Any CPU.Build.0 = Release|Any CPU + {C7FD0E24-2254-4184-BF12-6C75D2752F28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C7FD0E24-2254-4184-BF12-6C75D2752F28}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C7FD0E24-2254-4184-BF12-6C75D2752F28}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C7FD0E24-2254-4184-BF12-6C75D2752F28}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/samples/bot-file-upload/csharp/TeamsFileUpload.slnLaunch.user b/samples/bot-file-upload/csharp/TeamsFileUpload.slnLaunch.user new file mode 100644 index 0000000000..f52e540d05 --- /dev/null +++ b/samples/bot-file-upload/csharp/TeamsFileUpload.slnLaunch.user @@ -0,0 +1,17 @@ +[ + { + "Name": "Microsoft Teams (browser)", + "Projects": [ + { + "Path": "TeamsFileUpload.csproj", + "Action": "Start", + "DebugTarget": "Start Project" + }, + { + "Path": "TeamsApp\\TeamsApp.ttkproj", + "Action": "StartWithoutDebugging", + "DebugTarget": "Microsoft Teams (browser)" + } + ] + } +] \ No newline at end of file diff --git a/samples/tab-conversations/csharp/README.md b/samples/tab-conversations/csharp/README.md index 2e80d3b826..982fe787dc 100644 --- a/samples/tab-conversations/csharp/README.md +++ b/samples/tab-conversations/csharp/README.md @@ -42,9 +42,10 @@ Please find below demo manifest which is deployed on Microsoft Azure and you can ## Run the app (Using Teams Toolkit for Visual Studio) The simplest way to run this sample in Teams is to use Teams Toolkit for Visual Studio. -1. Install Visual Studio 2022 **Version 17.8 or higher** [Visual Studio](https://visualstudio.microsoft.com/downloads/) +1. Install Visual Studio 2022 **Version 17.10 Preview 4 or higher** [Visual Studio](https://visualstudio.microsoft.com/downloads/) 1. Install Teams Toolkit for Visual Studio [Teams Toolkit extension](https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/toolkit-v4/install-teams-toolkit-vs?pivots=visual-studio-v17-7) -1. In Visual Studio, right-click your project and **Select Teams Toolkit > Prepare Teams App Dependencies** +1. In the debug dropdown menu of Visual Studio, select default startup project > **Microsoft Teams (browser)** +1. In Visual Studio, right-click your **TeamsApp** project and **Select Teams Toolkit > Prepare Teams App Dependencies** 1. Using the extension, sign in with your Microsoft 365 account where you have permissions to upload custom apps. 1. Select **Debug > Start Debugging** or **F5** to run the menu in Visual Studio. 1. In the browser that launches, select the **Add** button to install the app to Teams. @@ -92,14 +93,14 @@ The simplest way to run this sample in Teams is to use Teams Toolkit for Visual 4. Setup Manifest for Teams - __*This step is specific to Teams.*__ - - **Edit** the `manifest.json` contained in the ./AppManifest folder to replace your Microsoft App Id (that was created when you registered your app registration earlier) *everywhere* you see the place holder string `{{Microsoft-App-Id}}` (depending on the scenario the Microsoft App Id may occur multiple times in the `manifest.json`) + - **Edit** the `manifest.json` contained in the ./appPackage folder to replace your Microsoft App Id (that was created when you registered your app registration earlier) *everywhere* you see the place holder string `{{Microsoft-App-Id}}` (depending on the scenario the Microsoft App Id may occur multiple times in the `manifest.json`) - **Edit** the `manifest.json` for `validDomains` and replace `{{domain-name}}` with base Url of your domain. E.g. if you are using ngrok it would be `https://1234.ngrok-free.app` then your domain-name will be `1234.ngrok-free.app` and if you are using dev tunnels then your domain will be like: `12345.devtunnels.ms`. - - **Zip** up the contents of the `AppManifest` folder to create a `manifest.zip` (Make sure that zip file does not contains any subfolder otherwise you will get error while uploading your .zip package) + - **Zip** up the contents of the `appPackage` folder to create a `manifest.zip` (Make sure that zip file does not contains any subfolder otherwise you will get error while uploading your .zip package) - Upload the manifest.zip to Teams (in the Apps view click "Upload a custom app") - Go to Microsoft Teams. From the lower left corner, select Apps - From the lower left corner, choose Upload a custom App - - Go to your project directory, the ./AppManifest folder, select the zip folder, and choose Open. + - Go to your project directory, the ./appPackage folder, select the zip folder, and choose Open. - Select Add in the pop-up dialog box. Your app is uploaded to Teams. ## Running the sample diff --git a/samples/tab-conversations/csharp/TabConversation.sln b/samples/tab-conversations/csharp/TabConversation.sln index 211d5f31e1..cb897529ab 100644 --- a/samples/tab-conversations/csharp/TabConversation.sln +++ b/samples/tab-conversations/csharp/TabConversation.sln @@ -1,9 +1,16 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31410.357 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.34814.14 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TabConversation", "TabConversation\TabConversation.csproj", "{801722A2-02B1-4A1E-9639-4358D5D87D98}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TabConversation", "TabConversation\TabConversation.csproj", "{801722A2-02B1-4A1E-9639-4358D5D87D98}" +EndProject +Project("{A9E3F50B-275E-4AF7-ADCE-8BE12D41E305}") = "TeamsApp", "TeamsApp\TeamsApp.ttkproj", "{696F2F0A-C3AA-4FF8-8D35-98A5F4CE4960}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3EB8E93C-B90F-4921-9826-F80C58F428B9}" + ProjectSection(SolutionItems) = preProject + TabConversation.slnLaunch.user = TabConversation.slnLaunch.user + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +22,10 @@ Global {801722A2-02B1-4A1E-9639-4358D5D87D98}.Debug|Any CPU.Build.0 = Debug|Any CPU {801722A2-02B1-4A1E-9639-4358D5D87D98}.Release|Any CPU.ActiveCfg = Release|Any CPU {801722A2-02B1-4A1E-9639-4358D5D87D98}.Release|Any CPU.Build.0 = Release|Any CPU + {696F2F0A-C3AA-4FF8-8D35-98A5F4CE4960}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {696F2F0A-C3AA-4FF8-8D35-98A5F4CE4960}.Debug|Any CPU.Build.0 = Debug|Any CPU + {696F2F0A-C3AA-4FF8-8D35-98A5F4CE4960}.Release|Any CPU.ActiveCfg = Release|Any CPU + {696F2F0A-C3AA-4FF8-8D35-98A5F4CE4960}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/samples/tab-conversations/csharp/TabConversation.slnLaunch.user b/samples/tab-conversations/csharp/TabConversation.slnLaunch.user new file mode 100644 index 0000000000..0d16a88a62 --- /dev/null +++ b/samples/tab-conversations/csharp/TabConversation.slnLaunch.user @@ -0,0 +1,17 @@ +[ + { + "Name": "Microsoft Teams (browser)", + "Projects": [ + { + "Path": "TabConversation\\TabConversation.csproj", + "Action": "Start", + "DebugTarget": "Start Project" + }, + { + "Path": "TeamsApp\\TeamsApp.ttkproj", + "Action": "StartWithoutDebugging", + "DebugTarget": "Microsoft Teams (browser)" + } + ] + } +] \ No newline at end of file diff --git a/samples/tab-conversations/csharp/TabConversation/.gitignore b/samples/tab-conversations/csharp/TabConversation/.gitignore index 9324f35f59..4596bae4d8 100644 --- a/samples/tab-conversations/csharp/TabConversation/.gitignore +++ b/samples/tab-conversations/csharp/TabConversation/.gitignore @@ -1,6 +1,6 @@ # TeamsFx files build -AppManifest/build +appPackage/build env/.env.*.user env/.env.local appsettings.Development.json diff --git a/samples/tab-conversations/csharp/TabConversation/Properties/launchSettings.json b/samples/tab-conversations/csharp/TabConversation/Properties/launchSettings.json index 8eefd9188e..9b9feeee56 100644 --- a/samples/tab-conversations/csharp/TabConversation/Properties/launchSettings.json +++ b/samples/tab-conversations/csharp/TabConversation/Properties/launchSettings.json @@ -1,28 +1,13 @@ { "profiles": { - // Debug project within Teams - "Microsoft Teams (browser)": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "https://teams.microsoft.com/l/app/294d0749-3209-4cfe-9f85-2d0c99684e8d?installAppPackage=true&webjoin=true&appTenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&login_hint=v-hrajandira@microsoft.com", - "applicationUrl": "https://localhost:44302;http://localhost:2544", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "hotReloadProfile": "aspnetcore" + "Start Project": { + "commandName": "Project", + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:44302;http://localhost:2544", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "hotReloadProfile": "aspnetcore" } - //// Uncomment following profile to debug project only (without launching Teams) - //, - //"Start Project (not in Teams)": { - // "commandName": "Project", - // "dotnetRunMessages": true, - // "launchBrowser": true, - // "applicationUrl": "https://localhost:44302;http://localhost:2544", - // "environmentVariables": { - // "ASPNETCORE_ENVIRONMENT": "Development" - // }, - // "hotReloadProfile": "aspnetcore" - //} } } \ No newline at end of file diff --git a/samples/tab-conversations/csharp/TeamsApp/TeamsApp.ttkproj b/samples/tab-conversations/csharp/TeamsApp/TeamsApp.ttkproj new file mode 100644 index 0000000000..226a9b06a1 --- /dev/null +++ b/samples/tab-conversations/csharp/TeamsApp/TeamsApp.ttkproj @@ -0,0 +1,9 @@ + + + + 696f2f0a-c3aa-4ff8-8d35-98a5f4ce4960 + + + + + \ No newline at end of file diff --git a/samples/tab-conversations/csharp/TabConversation/AppManifest/color.png b/samples/tab-conversations/csharp/TeamsApp/appPackage/color.png similarity index 100% rename from samples/tab-conversations/csharp/TabConversation/AppManifest/color.png rename to samples/tab-conversations/csharp/TeamsApp/appPackage/color.png diff --git a/samples/tab-conversations/csharp/TabConversation/AppManifest/manifest.json b/samples/tab-conversations/csharp/TeamsApp/appPackage/manifest.json similarity index 87% rename from samples/tab-conversations/csharp/TabConversation/AppManifest/manifest.json rename to samples/tab-conversations/csharp/TeamsApp/appPackage/manifest.json index 8ea7609b53..683bccc553 100644 --- a/samples/tab-conversations/csharp/TabConversation/AppManifest/manifest.json +++ b/samples/tab-conversations/csharp/TeamsApp/appPackage/manifest.json @@ -1,6 +1,6 @@ { - "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.12/MicrosoftTeams.schema.json", - "manifestVersion": "1.12", + "$schema": "https://developer.microsoft.com/json-schemas/teams/v1.16/MicrosoftTeams.schema.json", + "manifestVersion": "1.16", "version": "1.0.0", "id": "${{TEAMS_APP_ID}}", "packageName": "com.microsoft.tabconversations", diff --git a/samples/tab-conversations/csharp/TabConversation/AppManifest/outline.png b/samples/tab-conversations/csharp/TeamsApp/appPackage/outline.png similarity index 100% rename from samples/tab-conversations/csharp/TabConversation/AppManifest/outline.png rename to samples/tab-conversations/csharp/TeamsApp/appPackage/outline.png diff --git a/samples/tab-conversations/csharp/TabConversation/env/.env.local b/samples/tab-conversations/csharp/TeamsApp/env/.env.local similarity index 99% rename from samples/tab-conversations/csharp/TabConversation/env/.env.local rename to samples/tab-conversations/csharp/TeamsApp/env/.env.local index e4709f290f..6dad421765 100644 --- a/samples/tab-conversations/csharp/TabConversation/env/.env.local +++ b/samples/tab-conversations/csharp/TeamsApp/env/.env.local @@ -10,4 +10,7 @@ TAB_ENDPOINT= APP_NAME_SUFFIX= TAB_DOMAIN= TEAMS_APP_TENANT_ID= + + + TEAMSFX_M365_USER_NAME= \ No newline at end of file diff --git a/samples/tab-conversations/csharp/TeamsApp/launchSettings.json b/samples/tab-conversations/csharp/TeamsApp/launchSettings.json new file mode 100644 index 0000000000..5687410386 --- /dev/null +++ b/samples/tab-conversations/csharp/TeamsApp/launchSettings.json @@ -0,0 +1,9 @@ +{ + "profiles": { + // Debug project within Teams + "Microsoft Teams (browser)": { + "commandName": "Project", + "launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}" + } + } +} \ No newline at end of file diff --git a/samples/tab-conversations/csharp/TabConversation/teamsapp.local.yml b/samples/tab-conversations/csharp/TeamsApp/teamsapp.local.yml similarity index 58% rename from samples/tab-conversations/csharp/TabConversation/teamsapp.local.yml rename to samples/tab-conversations/csharp/TeamsApp/teamsapp.local.yml index cb19a48843..45134c69c8 100644 --- a/samples/tab-conversations/csharp/TabConversation/teamsapp.local.yml +++ b/samples/tab-conversations/csharp/TeamsApp/teamsapp.local.yml @@ -28,39 +28,23 @@ provision: - uses: teamsApp/validateManifest with: # Path to manifest template - manifestPath: ./AppManifest/manifest.json + manifestPath: ./appPackage/manifest.json # Build Teams app package with latest env value - uses: teamsApp/zipAppPackage with: # Path to manifest template - manifestPath: ./AppManifest/manifest.json - outputZipPath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip - outputJsonPath: ./AppManifest/build/manifest.${{TEAMSFX_ENV}}.json + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputJsonPath: ./appPackage/build/manifest.${{TEAMSFX_ENV}}.json # Validate app package using validation rules - uses: teamsApp/validateAppPackage with: # Relative path to this file. This is the path for built zip file. - appPackagePath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip # Apply the Teams app manifest to an existing Teams app in # Teams Developer Portal. # Will use the app id in manifest file to determine which Teams app to update. - uses: teamsApp/update with: # Relative path to this file. This is the path for built zip file. - appPackagePath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip - - # Create or update debug profile in lauchsettings file - - uses: file/createOrUpdateJsonFile - with: - target: ./Properties/launchSettings.json - content: - profiles: - Microsoft Teams (browser): - commandName: "Project" - dotnetRunMessages: true - launchBrowser: true - launchUrl: "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}" - applicationUrl: "https://localhost:44302;http://localhost:2544" - environmentVariables: - ASPNETCORE_ENVIRONMENT: "Development" - hotReloadProfile: "aspnetcore" \ No newline at end of file + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip \ No newline at end of file diff --git a/samples/tab-conversations/csharp/TabConversation/teamsapp.yml b/samples/tab-conversations/csharp/TeamsApp/teamsapp.yml similarity index 100% rename from samples/tab-conversations/csharp/TabConversation/teamsapp.yml rename to samples/tab-conversations/csharp/TeamsApp/teamsapp.yml diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/.gitignore b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/.gitignore index 9324f35f59..4596bae4d8 100644 --- a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/.gitignore +++ b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/.gitignore @@ -1,6 +1,6 @@ # TeamsFx files build -AppManifest/build +appPackage/build env/.env.*.user env/.env.local appsettings.Development.json diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/PersonalTabSSO.csproj b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/PersonalTabSSO.csproj index e45c14f22c..c3cbd368c5 100644 --- a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/PersonalTabSSO.csproj +++ b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/PersonalTabSSO.csproj @@ -6,9 +6,13 @@ + + + + diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/PersonalTabSSO.sln b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/PersonalTabSSO.sln index 88dda203d9..a67ee48512 100644 --- a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/PersonalTabSSO.sln +++ b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/PersonalTabSSO.sln @@ -5,6 +5,13 @@ VisualStudioVersion = 17.3.32901.215 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PersonalTabSSO", "PersonalTabSSO.csproj", "{69EFF229-8D1B-4652-A300-0EBF0D6705E0}" EndProject +Project("{A9E3F50B-275E-4AF7-ADCE-8BE12D41E305}") = "TeamsApp", "TeamsApp\TeamsApp.ttkproj", "{0BBFAB38-325B-45BF-9E6D-38BE35A60C57}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DBF4F25A-75D4-4A0E-B982-10734101A919}" + ProjectSection(SolutionItems) = preProject + PersonalTabSSO.slnLaunch.user = PersonalTabSSO.slnLaunch.user + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +22,10 @@ Global {69EFF229-8D1B-4652-A300-0EBF0D6705E0}.Debug|Any CPU.Build.0 = Debug|Any CPU {69EFF229-8D1B-4652-A300-0EBF0D6705E0}.Release|Any CPU.ActiveCfg = Release|Any CPU {69EFF229-8D1B-4652-A300-0EBF0D6705E0}.Release|Any CPU.Build.0 = Release|Any CPU + {0BBFAB38-325B-45BF-9E6D-38BE35A60C57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0BBFAB38-325B-45BF-9E6D-38BE35A60C57}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0BBFAB38-325B-45BF-9E6D-38BE35A60C57}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0BBFAB38-325B-45BF-9E6D-38BE35A60C57}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/PersonalTabSSO.slnLaunch.user b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/PersonalTabSSO.slnLaunch.user new file mode 100644 index 0000000000..b9e9275e60 --- /dev/null +++ b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/PersonalTabSSO.slnLaunch.user @@ -0,0 +1,32 @@ +[ + { + "Name": "Microsoft Teams (browser)", + "Projects": [ + { + "Path": "PersonalTabSSO.csproj", + "Action": "Start", + "DebugTarget": "Start Project" + }, + { + "Path": "TeamsApp\\TeamsApp.ttkproj", + "Action": "StartWithoutDebugging", + "DebugTarget": "Microsoft Teams (browser)" + } + ] + }, + { + "Name": "Outlook (browser)", + "Projects": [ + { + "Path": "PersonalTabSSO.csproj", + "Action": "Start", + "DebugTarget": "Start Project" + }, + { + "Path": "TeamsApp\\TeamsApp.ttkproj", + "Action": "StartWithoutDebugging", + "DebugTarget": "Outlook (browser)" + } + ] + } +] \ No newline at end of file diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/Properties/launchSettings.json b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/Properties/launchSettings.json index ddc26edfee..b59b6baf54 100644 --- a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/Properties/launchSettings.json +++ b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/Properties/launchSettings.json @@ -1,28 +1,13 @@ { "profiles": { - // Debug project within Teams - "Microsoft Teams (browser)": { + "Start Project": { "commandName": "Project", "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "https://teams.microsoft.com/l/app/%TEAMSAPPID%?installAppPackage=true&webjoin=true&appTenantId=%TENANTID%&login_hint=%USERNAME%", "applicationUrl": "https://localhost:44302;http://localhost:2544", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, "hotReloadProfile": "aspnetcore" } - //// Uncomment following profile to debug project only (without launching Teams) - //, - //"Start Project (not in Teams)": { - // "commandName": "Project", - // "dotnetRunMessages": true, - // "launchBrowser": true, - // "applicationUrl": "https://localhost:44302;http://localhost:2544", - // "environmentVariables": { - // "ASPNETCORE_ENVIRONMENT": "Development" - // }, - // "hotReloadProfile": "aspnetcore" - //} } } \ No newline at end of file diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/README.md b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/README.md index 2fa04090d2..809659dfa2 100644 --- a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/README.md +++ b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/README.md @@ -43,14 +43,15 @@ This sample illustrates how to implement SSO authentication for Teams Tab. ## Run the app (Using Teams Toolkit for Visual Studio) The simplest way to run this sample in Teams is to use Teams Toolkit for Visual Studio. -1. Install Visual Studio 2022 **Version 17.8 or higher** [Visual Studio](https://visualstudio.microsoft.com/downloads/) +1. Install Visual Studio 2022 **Version 17.10 Preview 4 or higher** [Visual Studio](https://visualstudio.microsoft.com/downloads/) 1. Install Teams Toolkit for Visual Studio [Teams Toolkit extension](https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/toolkit-v4/install-teams-toolkit-vs?pivots=visual-studio-v17-7) -1. In Visual Studio, right-click your project and **Select Teams Toolkit > Prepare Teams App Dependencies** +1. In the debug dropdown menu of Visual Studio, select default startup project > **Microsoft Teams (browser)** +1. In Visual Studio, right-click your **TeamsApp** project and **Select Teams Toolkit > Prepare Teams App Dependencies** 1. Using the extension, sign in with your Microsoft 365 account where you have permissions to upload custom apps. 1. Select **Debug > Start Debugging** or **F5** to run the menu in Visual Studio. 1. In the browser that launches, select the **Add** button to install the app to Teams. > If you do not have permission to upload custom apps (sideloading), Teams Toolkit will recommend creating and using a Microsoft 365 Developer Program account - a free program to get your own dev environment sandbox that includes Teams. - + ## Setup ### Register your Teams Auth SSO with Azure AD @@ -135,7 +136,7 @@ The simplest way to run this sample in Teams is to use Teams Toolkit for Visual 4. Setup Manifest for Teams - __*This step is specific to Teams.*__ - **Edit** the `manifest.json` contained in the ./AppManifest folder to replace your Microsoft App Id (that was created when you registered your app registration earlier) *everywhere* you see the place holder string `<>` (depending on the scenario the Microsoft App Id may occur multiple times in the `manifest.json`) + **Edit** the `manifest.json` contained in the ./appPackage folder to replace your Microsoft App Id (that was created when you registered your app registration earlier) *everywhere* you see the place holder string `<>` (depending on the scenario the Microsoft App Id may occur multiple times in the `manifest.json`) **Edit** the `manifest.json` for `validDomains` and replace `{{domain-name}}` with base Url of your domain. E.g. if you are using ngrok it would be `https://1234.ngrok-free.app` then your domain-name will be `1234.ngrok-free.app` and if you are using dev tunnels then your domain will be like: `12345.devtunnels.ms`. **Edit** the `manifest.json` for `webApplicationInfo` resource `"api://{{domain-name}}/<>"` with MicrosoftAppId. E.g. `"api://1234.ngrok-free.app/00000000-0000-0000-0000-000000000000"`. **Note:** If you want to test your app across multi hub like: Outlook/Office.com, please update the `manifest.json` in the `tab-personal-sso-quickstart\csharp_dotnetcore\AppManifest_Hub` folder with the required values. @@ -144,7 +145,7 @@ The simplest way to run this sample in Teams is to use Teams Toolkit for Visual - Upload the manifest.zip to Teams (in the Apps view click "Upload a custom app") - Go to Microsoft Teams. From the lower left corner, select Apps - From the lower left corner, choose Upload a custom App - - Go to your project directory, the ./AppManifest folder, select the zip folder, and choose Open. + - Go to your project directory, the ./appPackage folder, select the zip folder, and choose Open. - Select Add in the pop-up dialog box. Your app is uploaded to Teams. 1) Run your app, either from Visual Studio with `F5` or using `dotnet run` in the appropriate folder. diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/TeamsApp.ttkproj b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/TeamsApp.ttkproj new file mode 100644 index 0000000000..3bbf86b07b --- /dev/null +++ b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/TeamsApp.ttkproj @@ -0,0 +1,9 @@ + + + + 0bbfab38-325b-45bf-9e6d-38be35a60c57 + + + + + \ No newline at end of file diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/aad.manifest.json b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/aad.manifest.json similarity index 100% rename from samples/tab-personal-sso-quickstart/csharp_dotnetcore/aad.manifest.json rename to samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/aad.manifest.json diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/AppManifest/color.png b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/appPackage/color.png similarity index 100% rename from samples/tab-personal-sso-quickstart/csharp_dotnetcore/AppManifest/color.png rename to samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/appPackage/color.png diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/AppManifest/manifest.json b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/appPackage/manifest.json similarity index 100% rename from samples/tab-personal-sso-quickstart/csharp_dotnetcore/AppManifest/manifest.json rename to samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/appPackage/manifest.json diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/AppManifest/outline.png b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/appPackage/outline.png similarity index 100% rename from samples/tab-personal-sso-quickstart/csharp_dotnetcore/AppManifest/outline.png rename to samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/appPackage/outline.png diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/env/.env.local b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/env/.env.local similarity index 100% rename from samples/tab-personal-sso-quickstart/csharp_dotnetcore/env/.env.local rename to samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/env/.env.local diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/launchSettings.json b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/launchSettings.json new file mode 100644 index 0000000000..6b0952e5ce --- /dev/null +++ b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/launchSettings.json @@ -0,0 +1,13 @@ +{ + "profiles": { + // Debug project within Teams + "Microsoft Teams (browser)": { + "commandName": "Project", + "launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}" + }, + "Outlook (browser)": { + "commandName": "Project", + "launchUrl": "https://outlook.office.com/host/${{M365_APP_ID}}?login_hint=${{TEAMSFX_M365_USER_NAME}}" + } + } +} \ No newline at end of file diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/teamsapp.local.yml b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/teamsapp.local.yml similarity index 75% rename from samples/tab-personal-sso-quickstart/csharp_dotnetcore/teamsapp.local.yml rename to samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/teamsapp.local.yml index 084523d0f7..7f4e0cd429 100644 --- a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/teamsapp.local.yml +++ b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/teamsapp.local.yml @@ -53,7 +53,7 @@ provision: # Generate runtime appsettings to JSON file - uses: file/createOrUpdateJsonFile with: - target: ./appsettings.json + target: ../appsettings.json content: AzureAd: ClientId: ${{AAD_APP_CLIENT_ID}} @@ -73,39 +73,33 @@ provision: - uses: teamsApp/validateManifest with: # Path to manifest template - manifestPath: ./AppManifest/manifest.json + manifestPath: ./appPackage/manifest.json # Build Teams app package with latest env value - uses: teamsApp/zipAppPackage with: # Path to manifest template - manifestPath: ./AppManifest/manifest.json - outputZipPath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip - outputJsonPath: ./AppManifest/build/manifest.${{TEAMSFX_ENV}}.json + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputJsonPath: ./appPackage/build/manifest.${{TEAMSFX_ENV}}.json # Validate app package using validation rules - uses: teamsApp/validateAppPackage with: # Relative path to this file. This is the path for built zip file. - appPackagePath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip # Apply the Teams app manifest to an existing Teams app in # Teams Developer Portal. # Will use the app id in manifest file to determine which Teams app to update. - uses: teamsApp/update with: # Relative path to this file. This is the path for built zip file. - appPackagePath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip - - # Create or update debug profile in lauchsettings file - - uses: file/createOrUpdateJsonFile + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Extend your Teams app to Outlook and the Microsoft 365 app + - uses: teamsApp/extendToM365 with: - target: ./Properties/launchSettings.json - content: - profiles: - Microsoft Teams (browser): - commandName: "Project" - dotnetRunMessages: true - launchBrowser: true - launchUrl: "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}" - applicationUrl: "https://localhost:44302;http://localhost:2544" - environmentVariables: - ASPNETCORE_ENVIRONMENT: "Development" - hotReloadProfile: "aspnetcore" \ No newline at end of file + # Relative path to the build app package. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + titleId: M365_TITLE_ID + appId: M365_APP_ID \ No newline at end of file diff --git a/samples/tab-personal-sso-quickstart/csharp_dotnetcore/teamsapp.yml b/samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/teamsapp.yml similarity index 100% rename from samples/tab-personal-sso-quickstart/csharp_dotnetcore/teamsapp.yml rename to samples/tab-personal-sso-quickstart/csharp_dotnetcore/TeamsApp/teamsapp.yml diff --git a/samples/tab-product-inspection/csharp/ProductInspection.sln b/samples/tab-product-inspection/csharp/ProductInspection.sln index c804ee618b..603258780f 100644 --- a/samples/tab-product-inspection/csharp/ProductInspection.sln +++ b/samples/tab-product-inspection/csharp/ProductInspection.sln @@ -1,10 +1,17 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29123.88 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.34814.14 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductInspection", "ProductInspection\ProductInspection.csproj", "{B18CD866-7E29-498F-88EA-C3B48C96CA7C}" EndProject +Project("{A9E3F50B-275E-4AF7-ADCE-8BE12D41E305}") = "TeamsApp", "TeamsApp\TeamsApp.ttkproj", "{B3621053-C201-45C6-A673-4C3FAD059E51}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F0F08103-5922-4F17-A8CF-2D0A182879A8}" + ProjectSection(SolutionItems) = preProject + ProductInspection.slnLaunch.user = ProductInspection.slnLaunch.user + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +22,10 @@ Global {B18CD866-7E29-498F-88EA-C3B48C96CA7C}.Debug|Any CPU.Build.0 = Debug|Any CPU {B18CD866-7E29-498F-88EA-C3B48C96CA7C}.Release|Any CPU.ActiveCfg = Release|Any CPU {B18CD866-7E29-498F-88EA-C3B48C96CA7C}.Release|Any CPU.Build.0 = Release|Any CPU + {B3621053-C201-45C6-A673-4C3FAD059E51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B3621053-C201-45C6-A673-4C3FAD059E51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B3621053-C201-45C6-A673-4C3FAD059E51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B3621053-C201-45C6-A673-4C3FAD059E51}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/samples/tab-product-inspection/csharp/ProductInspection.slnLaunch.user b/samples/tab-product-inspection/csharp/ProductInspection.slnLaunch.user new file mode 100644 index 0000000000..73e15e42c8 --- /dev/null +++ b/samples/tab-product-inspection/csharp/ProductInspection.slnLaunch.user @@ -0,0 +1,32 @@ +[ + { + "Name": "Microsoft Teams (browser)", + "Projects": [ + { + "Path": "ProductInspection\\ProductInspection.csproj", + "Action": "Start", + "DebugTarget": "Start Project" + }, + { + "Path": "TeamsApp\\TeamsApp.ttkproj", + "Action": "StartWithoutDebugging", + "DebugTarget": "Microsoft Teams (browser)" + } + ] + }, + { + "Name": "Outlook (browser)", + "Projects": [ + { + "Path": "ProductInspection\\ProductInspection.csproj", + "Action": "Start", + "DebugTarget": "Start Project" + }, + { + "Path": "TeamsApp\\TeamsApp.ttkproj", + "Action": "StartWithoutDebugging", + "DebugTarget": "Outlook (browser)" + } + ] + } +] \ No newline at end of file diff --git a/samples/tab-product-inspection/csharp/ProductInspection/.gitignore b/samples/tab-product-inspection/csharp/ProductInspection/.gitignore index 9324f35f59..4596bae4d8 100644 --- a/samples/tab-product-inspection/csharp/ProductInspection/.gitignore +++ b/samples/tab-product-inspection/csharp/ProductInspection/.gitignore @@ -1,6 +1,6 @@ # TeamsFx files build -AppManifest/build +appPackage/build env/.env.*.user env/.env.local appsettings.Development.json diff --git a/samples/tab-product-inspection/csharp/ProductInspection/Properties/launchSettings.json b/samples/tab-product-inspection/csharp/ProductInspection/Properties/launchSettings.json index ab57801b19..9b9feeee56 100644 --- a/samples/tab-product-inspection/csharp/ProductInspection/Properties/launchSettings.json +++ b/samples/tab-product-inspection/csharp/ProductInspection/Properties/launchSettings.json @@ -1,28 +1,13 @@ { "profiles": { - // Debug project within Teams - "Microsoft Teams (browser)": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "https://teams.microsoft.com/l/app/%TEAMSAPPID%?installAppPackage=true&webjoin=true&appTenantId=%TENANTID%&login_hint=%USERNAME%", - "applicationUrl": "https://localhost:44302;http://localhost:2544", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "hotReloadProfile": "aspnetcore" + "Start Project": { + "commandName": "Project", + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:44302;http://localhost:2544", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "hotReloadProfile": "aspnetcore" } - //// Uncomment following profile to debug project only (without launching Teams) - //, - //"Start Project (not in Teams)": { - // "commandName": "Project", - // "dotnetRunMessages": true, - // "launchBrowser": true, - // "applicationUrl": "https://localhost:44302;http://localhost:2544", - // "environmentVariables": { - // "ASPNETCORE_ENVIRONMENT": "Development" - // }, - // "hotReloadProfile": "aspnetcore" - //} } } \ No newline at end of file diff --git a/samples/tab-product-inspection/csharp/README.md b/samples/tab-product-inspection/csharp/README.md index e387766bea..3f918645a6 100644 --- a/samples/tab-product-inspection/csharp/README.md +++ b/samples/tab-product-inspection/csharp/README.md @@ -40,9 +40,10 @@ Please find below demo manifest which is deployed on Microsoft Azure and you can ## Run the app (Using Teams Toolkit for Visual Studio) The simplest way to run this sample in Teams is to use Teams Toolkit for Visual Studio. -1. Install Visual Studio 2022 **Version 17.8 or higher** [Visual Studio](https://visualstudio.microsoft.com/downloads/) +1. Install Visual Studio 2022 **Version 17.10 Preview 4 or higher** [Visual Studio](https://visualstudio.microsoft.com/downloads/) 1. Install Teams Toolkit for Visual Studio [Teams Toolkit extension](https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/toolkit-v4/install-teams-toolkit-vs?pivots=visual-studio-v17-7) -1. In Visual Studio, right-click your project and **Select Teams Toolkit > Prepare Teams App Dependencies** +1. In the debug dropdown menu of Visual Studio, select default startup project > **Microsoft Teams (browser)** +1. In Visual Studio, right-click your **TeamsApp** project and **Select Teams Toolkit > Prepare Teams App Dependencies** 1. Using the extension, sign in with your Microsoft 365 account where you have permissions to upload custom apps. 1. Select **Debug > Start Debugging** or **F5** to run the menu in Visual Studio. 1. In the browser that launches, select the **Add** button to install the app to Teams. @@ -89,7 +90,7 @@ The simplest way to run this sample in Teams is to use Teams Toolkit for Visual 4. Setup Manifest for Teams - __*This step is specific to Teams.*__ - - **Edit** the `manifest.json` contained in the ./AppManifest folder to replace your Microsoft App Id (that was created when you registered your app registration earlier) *everywhere* you see the place holder string `{{Microsoft-App-Id}}` (depending on the scenario the Microsoft App Id may occur multiple times in the `manifest.json`) + - **Edit** the `manifest.json` contained in the ./appPackage folder to replace your Microsoft App Id (that was created when you registered your app registration earlier) *everywhere* you see the place holder string `{{Microsoft-App-Id}}` (depending on the scenario the Microsoft App Id may occur multiple times in the `manifest.json`) - **Edit** the `manifest.json` for `validDomains` and replace `{{domain-name}}` with base Url of your domain. E.g. if you are using ngrok it would be `https://1234.ngrok-free.app` then your domain-name will be `1234.ngrok-free.app` and if you are using dev tunnels then your domain will be like: `12345.devtunnels.ms`. **Note:** If you want to test your app across multi hub like: Outlook/Office.com, please update the `manifest.json` in the `tab-product-inspection\csharp\ProductInspection\AppManifest_Hub` folder with the required values. - **Zip** up the contents of the `Manifest` folder to create a `Manifest.zip` or `AppManifest_Hub` folder to create a `AppManifest_Hub.zip` (Make sure that zip file does not contains any subfolder otherwise you will get error while uploading your .zip package) @@ -97,7 +98,7 @@ The simplest way to run this sample in Teams is to use Teams Toolkit for Visual - Upload the manifest.zip to Teams (in the Apps view click "Upload a custom app") - Go to Microsoft Teams. From the lower left corner, select Apps - From the lower left corner, choose Upload a custom App - - Go to your project directory, the ./AppManifest folder, select the zip folder, and choose Open. + - Go to your project directory, the ./appPackage folder, select the zip folder, and choose Open. - Select Add in the pop-up dialog box. Your app is uploaded to Teams. ## Running the sample. diff --git a/samples/tab-product-inspection/csharp/TeamsApp/TeamsApp.ttkproj b/samples/tab-product-inspection/csharp/TeamsApp/TeamsApp.ttkproj new file mode 100644 index 0000000000..3a9f15455a --- /dev/null +++ b/samples/tab-product-inspection/csharp/TeamsApp/TeamsApp.ttkproj @@ -0,0 +1,9 @@ + + + + b3621053-c201-45c6-a673-4c3fad059e51 + + + + + \ No newline at end of file diff --git a/samples/tab-product-inspection/csharp/ProductInspection/AppManifest/color.png b/samples/tab-product-inspection/csharp/TeamsApp/appPackage/color.png similarity index 100% rename from samples/tab-product-inspection/csharp/ProductInspection/AppManifest/color.png rename to samples/tab-product-inspection/csharp/TeamsApp/appPackage/color.png diff --git a/samples/tab-product-inspection/csharp/ProductInspection/AppManifest/manifest.json b/samples/tab-product-inspection/csharp/TeamsApp/appPackage/manifest.json similarity index 100% rename from samples/tab-product-inspection/csharp/ProductInspection/AppManifest/manifest.json rename to samples/tab-product-inspection/csharp/TeamsApp/appPackage/manifest.json diff --git a/samples/tab-product-inspection/csharp/ProductInspection/AppManifest/outline.png b/samples/tab-product-inspection/csharp/TeamsApp/appPackage/outline.png similarity index 100% rename from samples/tab-product-inspection/csharp/ProductInspection/AppManifest/outline.png rename to samples/tab-product-inspection/csharp/TeamsApp/appPackage/outline.png diff --git a/samples/tab-product-inspection/csharp/ProductInspection/env/.env.local b/samples/tab-product-inspection/csharp/TeamsApp/env/.env.local similarity index 88% rename from samples/tab-product-inspection/csharp/ProductInspection/env/.env.local rename to samples/tab-product-inspection/csharp/TeamsApp/env/.env.local index b36807f000..ed2c67387c 100644 --- a/samples/tab-product-inspection/csharp/ProductInspection/env/.env.local +++ b/samples/tab-product-inspection/csharp/TeamsApp/env/.env.local @@ -7,8 +7,10 @@ TEAMSFX_ENV=local TEAMS_APP_ID= TAB_ENDPOINT= -TEAMSFX_M365_USER_NAME= - APP_NAME_SUFFIX= TAB_DOMAIN= -TEAMS_APP_TENANT_ID= \ No newline at end of file +TEAMS_APP_TENANT_ID= +TEAMSFX_M365_USER_NAME= + +M365_TITLE_ID= +M365_APP_ID= \ No newline at end of file diff --git a/samples/tab-product-inspection/csharp/TeamsApp/launchSettings.json b/samples/tab-product-inspection/csharp/TeamsApp/launchSettings.json new file mode 100644 index 0000000000..6b0952e5ce --- /dev/null +++ b/samples/tab-product-inspection/csharp/TeamsApp/launchSettings.json @@ -0,0 +1,13 @@ +{ + "profiles": { + // Debug project within Teams + "Microsoft Teams (browser)": { + "commandName": "Project", + "launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}" + }, + "Outlook (browser)": { + "commandName": "Project", + "launchUrl": "https://outlook.office.com/host/${{M365_APP_ID}}?login_hint=${{TEAMSFX_M365_USER_NAME}}" + } + } +} \ No newline at end of file diff --git a/samples/tab-product-inspection/csharp/ProductInspection/teamsapp.local.yml b/samples/tab-product-inspection/csharp/TeamsApp/teamsapp.local.yml similarity index 58% rename from samples/tab-product-inspection/csharp/ProductInspection/teamsapp.local.yml rename to samples/tab-product-inspection/csharp/TeamsApp/teamsapp.local.yml index f076e05503..9b3bc76869 100644 --- a/samples/tab-product-inspection/csharp/ProductInspection/teamsapp.local.yml +++ b/samples/tab-product-inspection/csharp/TeamsApp/teamsapp.local.yml @@ -28,39 +28,33 @@ provision: - uses: teamsApp/validateManifest with: # Path to manifest template - manifestPath: ./AppManifest/manifest.json + manifestPath: ./appPackage/manifest.json # Build Teams app package with latest env value - uses: teamsApp/zipAppPackage with: # Path to manifest template - manifestPath: ./AppManifest/manifest.json - outputZipPath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip - outputJsonPath: ./AppManifest/build/manifest.${{TEAMSFX_ENV}}.json + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputJsonPath: ./appPackage/build/manifest.${{TEAMSFX_ENV}}.json # Validate app package using validation rules - uses: teamsApp/validateAppPackage with: # Relative path to this file. This is the path for built zip file. - appPackagePath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip # Apply the Teams app manifest to an existing Teams app in # Teams Developer Portal. # Will use the app id in manifest file to determine which Teams app to update. - uses: teamsApp/update with: # Relative path to this file. This is the path for built zip file. - appPackagePath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip - - # Create or update debug profile in lauchsettings file - - uses: file/createOrUpdateJsonFile + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Extend your Teams app to Outlook and the Microsoft 365 app + - uses: teamsApp/extendToM365 with: - target: ./Properties/launchSettings.json - content: - profiles: - Microsoft Teams (browser): - commandName: "Project" - dotnetRunMessages: true - launchBrowser: true - launchUrl: "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}" - applicationUrl: "https://localhost:44302;http://localhost:2544" - environmentVariables: - ASPNETCORE_ENVIRONMENT: "Development" - hotReloadProfile: "aspnetcore" \ No newline at end of file + # Relative path to the build app package. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + titleId: M365_TITLE_ID + appId: M365_APP_ID \ No newline at end of file diff --git a/samples/tab-product-inspection/csharp/ProductInspection/teamsapp.yml b/samples/tab-product-inspection/csharp/TeamsApp/teamsapp.yml similarity index 100% rename from samples/tab-product-inspection/csharp/ProductInspection/teamsapp.yml rename to samples/tab-product-inspection/csharp/TeamsApp/teamsapp.yml diff --git a/samples/tab-staggered-permission/csharp/README.md b/samples/tab-staggered-permission/csharp/README.md index d95381c65f..fde9e670b5 100644 --- a/samples/tab-staggered-permission/csharp/README.md +++ b/samples/tab-staggered-permission/csharp/README.md @@ -48,9 +48,10 @@ Please find below demo manifest which is deployed on Microsoft Azure and you can ## Run the app (Using Teams Toolkit for Visual Studio) The simplest way to run this sample in Teams is to use Teams Toolkit for Visual Studio. -1. Install Visual Studio 2022 **Version 17.8 or higher** [Visual Studio](https://visualstudio.microsoft.com/downloads/) +1. Install Visual Studio 2022 **Version 17.10 Preview 4 or higher** [Visual Studio](https://visualstudio.microsoft.com/downloads/) 1. Install Teams Toolkit for Visual Studio [Teams Toolkit extension](https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/toolkit-v4/install-teams-toolkit-vs?pivots=visual-studio-v17-7) -1. In Visual Studio, right-click your project and **Select Teams Toolkit > Prepare Teams App Dependencies** +1. In the debug dropdown menu of Visual Studio, select default startup project > **Microsoft Teams (browser)** +1. In Visual Studio, right-click your **TeamsApp** project and **Select Teams Toolkit > Prepare Teams App Dependencies** 1. Using the extension, sign in with your Microsoft 365 account where you have permissions to upload custom apps. 1. Select **Debug > Start Debugging** or **F5** to run the menu in Visual Studio. 1. In the browser that launches, select the **Add** button to install the app to Teams. @@ -136,7 +137,7 @@ The simplest way to run this sample in Teams is to use Teams Toolkit for Visual 4. Setup Manifest for Teams - __*This step is specific to Teams.*__ - - **Edit** the `manifest.json` contained in the ./AppManifest folder to replace your Microsoft App Id (that was created when you registered your app registration earlier) *everywhere* you see the place holder string `{{Microsoft-App-Id}}` (depending on the scenario the Microsoft App Id may occur multiple times in the `manifest.json`) + - **Edit** the `manifest.json` contained in the ./appPackage folder to replace your Microsoft App Id (that was created when you registered your app registration earlier) *everywhere* you see the place holder string `{{Microsoft-App-Id}}` (depending on the scenario the Microsoft App Id may occur multiple times in the `manifest.json`) - **Edit** the `manifest.json` for `validDomains` and replace `{{domain-name}}` with base Url of your domain. E.g. if you are using ngrok it would be `https://1234.ngrok-free.app` then your domain-name will be `1234.ngrok-free.app` and if you are using dev tunnels then your domain will be like: `12345.devtunnels.ms`. - **Edit** the `manifest.json` for `webApplicationInfo` resource `"api://{{domain-name}}/{{Microsoft-App-Id}}"` with MicrosoftAppId. E.g. `"api://ngrok-free.app/00000000-0000-0000-0000-000000000000"` - **Note:** If you want to test your app across multi hub like: Outlook/Office.com, please update the `manifest.json` in the `tab-staggered-permission\csharp\StaggeredPermission\AppManifest_Hub` folder with the required values. @@ -145,7 +146,7 @@ The simplest way to run this sample in Teams is to use Teams Toolkit for Visual - Upload the manifest.zip to Teams (in the Apps view click "Upload a custom app") - Go to Microsoft Teams. From the lower left corner, select Apps - From the lower left corner, choose Upload a custom App - - Go to your project directory, the ./AppManifest folder, select the zip folder, and choose Open. + - Go to your project directory, the ./appPackage folder, select the zip folder, and choose Open. - Select Add in the pop-up dialog box. Your app is uploaded to Teams. ## Running the sample diff --git a/samples/tab-staggered-permission/csharp/StaggeredPermission.sln b/samples/tab-staggered-permission/csharp/StaggeredPermission.sln index a9f89d21d9..e86ed69dce 100644 --- a/samples/tab-staggered-permission/csharp/StaggeredPermission.sln +++ b/samples/tab-staggered-permission/csharp/StaggeredPermission.sln @@ -1,10 +1,17 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31410.357 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.34814.14 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StaggeredPermission", "StaggeredPermission\StaggeredPermission.csproj", "{BEE3FB6B-5F07-491F-9669-23B0C1CA4A30}" EndProject +Project("{A9E3F50B-275E-4AF7-ADCE-8BE12D41E305}") = "TeamsApp", "TeamsApp\TeamsApp.ttkproj", "{BEB78E4A-BEA1-4C26-953C-A3F8AC413232}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{472FC046-929F-4413-B64A-BA177C23C0A8}" + ProjectSection(SolutionItems) = preProject + StaggeredPermission.slnLaunch.user = StaggeredPermission.slnLaunch.user + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +22,10 @@ Global {BEE3FB6B-5F07-491F-9669-23B0C1CA4A30}.Debug|Any CPU.Build.0 = Debug|Any CPU {BEE3FB6B-5F07-491F-9669-23B0C1CA4A30}.Release|Any CPU.ActiveCfg = Release|Any CPU {BEE3FB6B-5F07-491F-9669-23B0C1CA4A30}.Release|Any CPU.Build.0 = Release|Any CPU + {BEB78E4A-BEA1-4C26-953C-A3F8AC413232}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BEB78E4A-BEA1-4C26-953C-A3F8AC413232}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BEB78E4A-BEA1-4C26-953C-A3F8AC413232}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BEB78E4A-BEA1-4C26-953C-A3F8AC413232}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/samples/tab-staggered-permission/csharp/StaggeredPermission.slnLaunch.user b/samples/tab-staggered-permission/csharp/StaggeredPermission.slnLaunch.user new file mode 100644 index 0000000000..5a87f3dcdd --- /dev/null +++ b/samples/tab-staggered-permission/csharp/StaggeredPermission.slnLaunch.user @@ -0,0 +1,32 @@ +[ + { + "Name": "Microsoft Teams (browser)", + "Projects": [ + { + "Path": "StaggeredPermission\\StaggeredPermission.csproj", + "Action": "Start", + "DebugTarget": "Start Project" + }, + { + "Path": "TeamsApp\\TeamsApp.ttkproj", + "Action": "StartWithoutDebugging", + "DebugTarget": "Microsoft Teams (browser)" + } + ] + }, + { + "Name": "Outlook (browser)", + "Projects": [ + { + "Path": "StaggeredPermission\\StaggeredPermission.csproj", + "Action": "Start", + "DebugTarget": "Start Project" + }, + { + "Path": "TeamsApp\\TeamsApp.ttkproj", + "Action": "StartWithoutDebugging", + "DebugTarget": "Outlook (browser)" + } + ] + } +] \ No newline at end of file diff --git a/samples/tab-staggered-permission/csharp/StaggeredPermission/.gitignore b/samples/tab-staggered-permission/csharp/StaggeredPermission/.gitignore index 9324f35f59..4596bae4d8 100644 --- a/samples/tab-staggered-permission/csharp/StaggeredPermission/.gitignore +++ b/samples/tab-staggered-permission/csharp/StaggeredPermission/.gitignore @@ -1,6 +1,6 @@ # TeamsFx files build -AppManifest/build +appPackage/build env/.env.*.user env/.env.local appsettings.Development.json diff --git a/samples/tab-staggered-permission/csharp/StaggeredPermission/Properties/launchSettings.json b/samples/tab-staggered-permission/csharp/StaggeredPermission/Properties/launchSettings.json index ab57801b19..9b9feeee56 100644 --- a/samples/tab-staggered-permission/csharp/StaggeredPermission/Properties/launchSettings.json +++ b/samples/tab-staggered-permission/csharp/StaggeredPermission/Properties/launchSettings.json @@ -1,28 +1,13 @@ { "profiles": { - // Debug project within Teams - "Microsoft Teams (browser)": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "https://teams.microsoft.com/l/app/%TEAMSAPPID%?installAppPackage=true&webjoin=true&appTenantId=%TENANTID%&login_hint=%USERNAME%", - "applicationUrl": "https://localhost:44302;http://localhost:2544", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "hotReloadProfile": "aspnetcore" + "Start Project": { + "commandName": "Project", + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:44302;http://localhost:2544", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "hotReloadProfile": "aspnetcore" } - //// Uncomment following profile to debug project only (without launching Teams) - //, - //"Start Project (not in Teams)": { - // "commandName": "Project", - // "dotnetRunMessages": true, - // "launchBrowser": true, - // "applicationUrl": "https://localhost:44302;http://localhost:2544", - // "environmentVariables": { - // "ASPNETCORE_ENVIRONMENT": "Development" - // }, - // "hotReloadProfile": "aspnetcore" - //} } } \ No newline at end of file diff --git a/samples/tab-staggered-permission/csharp/TeamsApp/TeamsApp.ttkproj b/samples/tab-staggered-permission/csharp/TeamsApp/TeamsApp.ttkproj new file mode 100644 index 0000000000..6592f6e262 --- /dev/null +++ b/samples/tab-staggered-permission/csharp/TeamsApp/TeamsApp.ttkproj @@ -0,0 +1,9 @@ + + + + beb78e4a-bea1-4c26-953c-a3f8ac413232 + + + + + \ No newline at end of file diff --git a/samples/tab-staggered-permission/csharp/StaggeredPermission/aad.manifest.json b/samples/tab-staggered-permission/csharp/TeamsApp/aad.manifest.json similarity index 100% rename from samples/tab-staggered-permission/csharp/StaggeredPermission/aad.manifest.json rename to samples/tab-staggered-permission/csharp/TeamsApp/aad.manifest.json diff --git a/samples/tab-staggered-permission/csharp/StaggeredPermission/AppManifest/color.png b/samples/tab-staggered-permission/csharp/TeamsApp/appPackage/color.png similarity index 100% rename from samples/tab-staggered-permission/csharp/StaggeredPermission/AppManifest/color.png rename to samples/tab-staggered-permission/csharp/TeamsApp/appPackage/color.png diff --git a/samples/tab-staggered-permission/csharp/StaggeredPermission/AppManifest/manifest.json b/samples/tab-staggered-permission/csharp/TeamsApp/appPackage/manifest.json similarity index 100% rename from samples/tab-staggered-permission/csharp/StaggeredPermission/AppManifest/manifest.json rename to samples/tab-staggered-permission/csharp/TeamsApp/appPackage/manifest.json diff --git a/samples/tab-staggered-permission/csharp/StaggeredPermission/AppManifest/outline.png b/samples/tab-staggered-permission/csharp/TeamsApp/appPackage/outline.png similarity index 100% rename from samples/tab-staggered-permission/csharp/StaggeredPermission/AppManifest/outline.png rename to samples/tab-staggered-permission/csharp/TeamsApp/appPackage/outline.png diff --git a/samples/tab-staggered-permission/csharp/StaggeredPermission/env/.env.local b/samples/tab-staggered-permission/csharp/TeamsApp/env/.env.local similarity index 95% rename from samples/tab-staggered-permission/csharp/StaggeredPermission/env/.env.local rename to samples/tab-staggered-permission/csharp/TeamsApp/env/.env.local index 84c497d21f..0e6f5e4163 100644 --- a/samples/tab-staggered-permission/csharp/StaggeredPermission/env/.env.local +++ b/samples/tab-staggered-permission/csharp/TeamsApp/env/.env.local @@ -18,4 +18,7 @@ TAB_DOMAIN= TEAMS_APP_TENANT_ID= AAD_APP_ACCESS_AS_USER_PERMISSION_ID= + +M365_TITLE_ID= +M365_APP_ID= TEAMSFX_M365_USER_NAME= \ No newline at end of file diff --git a/samples/tab-staggered-permission/csharp/TeamsApp/launchSettings.json b/samples/tab-staggered-permission/csharp/TeamsApp/launchSettings.json new file mode 100644 index 0000000000..6b0952e5ce --- /dev/null +++ b/samples/tab-staggered-permission/csharp/TeamsApp/launchSettings.json @@ -0,0 +1,13 @@ +{ + "profiles": { + // Debug project within Teams + "Microsoft Teams (browser)": { + "commandName": "Project", + "launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}" + }, + "Outlook (browser)": { + "commandName": "Project", + "launchUrl": "https://outlook.office.com/host/${{M365_APP_ID}}?login_hint=${{TEAMSFX_M365_USER_NAME}}" + } + } +} \ No newline at end of file diff --git a/samples/tab-staggered-permission/csharp/StaggeredPermission/teamsapp.local.yml b/samples/tab-staggered-permission/csharp/TeamsApp/teamsapp.local.yml similarity index 75% rename from samples/tab-staggered-permission/csharp/StaggeredPermission/teamsapp.local.yml rename to samples/tab-staggered-permission/csharp/TeamsApp/teamsapp.local.yml index 0834734f7a..d3c3baa1e9 100644 --- a/samples/tab-staggered-permission/csharp/StaggeredPermission/teamsapp.local.yml +++ b/samples/tab-staggered-permission/csharp/TeamsApp/teamsapp.local.yml @@ -53,7 +53,7 @@ provision: # Generate runtime appsettings to JSON file - uses: file/createOrUpdateJsonFile with: - target: ./appsettings.json + target: ../StaggeredPermission/appsettings.json content: AzureAd: ClientId: ${{AAD_APP_CLIENT_ID}} @@ -73,39 +73,33 @@ provision: - uses: teamsApp/validateManifest with: # Path to manifest template - manifestPath: ./AppManifest/manifest.json + manifestPath: ./appPackage/manifest.json # Build Teams app package with latest env value - uses: teamsApp/zipAppPackage with: # Path to manifest template - manifestPath: ./AppManifest/manifest.json - outputZipPath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip - outputJsonPath: ./AppManifest/build/manifest.${{TEAMSFX_ENV}}.json + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputJsonPath: ./appPackage/build/manifest.${{TEAMSFX_ENV}}.json # Validate app package using validation rules - uses: teamsApp/validateAppPackage with: # Relative path to this file. This is the path for built zip file. - appPackagePath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip # Apply the Teams app manifest to an existing Teams app in # Teams Developer Portal. # Will use the app id in manifest file to determine which Teams app to update. - uses: teamsApp/update with: # Relative path to this file. This is the path for built zip file. - appPackagePath: ./AppManifest/build/AppManifest.${{TEAMSFX_ENV}}.zip - - # Create or update debug profile in lauchsettings file - - uses: file/createOrUpdateJsonFile + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Extend your Teams app to Outlook and the Microsoft 365 app + - uses: teamsApp/extendToM365 with: - target: ./Properties/launchSettings.json - content: - profiles: - Microsoft Teams (browser): - commandName: "Project" - dotnetRunMessages: true - launchBrowser: true - launchUrl: "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}" - applicationUrl: "https://localhost:44302;http://localhost:2544" - environmentVariables: - ASPNETCORE_ENVIRONMENT: "Development" - hotReloadProfile: "aspnetcore" \ No newline at end of file + # Relative path to the build app package. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + titleId: M365_TITLE_ID + appId: M365_APP_ID \ No newline at end of file diff --git a/samples/tab-staggered-permission/csharp/StaggeredPermission/teamsapp.yml b/samples/tab-staggered-permission/csharp/TeamsApp/teamsapp.yml similarity index 100% rename from samples/tab-staggered-permission/csharp/StaggeredPermission/teamsapp.yml rename to samples/tab-staggered-permission/csharp/TeamsApp/teamsapp.yml