Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating new sample - msgext-northwind-inventory-csharp #143

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0b3e934
Updating new sample - msgext-northwind-inventory-csharp
Jegadeesh-MSFT Jun 26, 2024
81d3540
.Teamsapp and .Vs folders deleted
Jegadeesh-MSFT Jul 2, 2024
a0bc384
TTK implemented and lab exercise edited
Jegadeesh-MSFT Jul 2, 2024
4eba098
TTK user file added
Jegadeesh-MSFT Jul 2, 2024
81d289a
TTK Solution file updated
Jegadeesh-MSFT Jul 2, 2024
9c52f77
Rename productSearchCommand.cs to ProductSearchCommand.cs
Jegadeesh-MSFT Jul 2, 2024
a153348
Rename utils.cs to Utils.cs
Jegadeesh-MSFT Jul 2, 2024
afde044
updating version history
Jegadeesh-MSFT Jul 2, 2024
9b18335
Merge branch 'v-jegadeesh/northwind-csharp' of https://github.com/Jeg…
Jegadeesh-MSFT Jul 2, 2024
306aed4
Fixing PR comments
Jegadeesh-MSFT Jul 2, 2024
0586d52
Updating adaptive cards edit and success
Jegadeesh-MSFT Jul 2, 2024
ffe2aed
Adding lab files 4 and 5
Jegadeesh-MSFT Jul 4, 2024
c98998d
Fixing PR comments
Jegadeesh-MSFT Jul 8, 2024
061db03
Fixind gitignore file as per PR comments
Jegadeesh-MSFT Jul 8, 2024
e80d508
Fixing PR comments for enable multi projects
Jegadeesh-MSFT Jul 8, 2024
b62903b
Fixing PR comments and addind Sample env file
Jegadeesh-MSFT Jul 8, 2024
e798ea6
Fixing PR comment of azurite
Jegadeesh-MSFT Jul 9, 2024
ce92227
Pr comments fix for trobleshoot page and M365 provision images added
Jegadeesh-MSFT Jul 9, 2024
f0299a4
Fixing PR comments ssl certificate and error in adaptive card
Jegadeesh-MSFT Jul 10, 2024
124743f
adding assets folder
Jegadeesh-MSFT Jul 10, 2024
c79c930
Fixing the SSL certificate placement
Jegadeesh-MSFT Jul 11, 2024
f90385b
Fixing image name for azurite
Jegadeesh-MSFT Jul 11, 2024
162b11a
Fixing PR comments
Jegadeesh-MSFT Jul 18, 2024
de5c125
Fixing PR comment for missing variable error
Jegadeesh-MSFT Jul 30, 2024
d0ec689
adding appsetting.sample file
Jegadeesh-MSFT Jul 30, 2024
b08bd5c
Fixing lab exercises links
Jegadeesh-MSFT Jul 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Welcome to Teams Toolkit!

## Quick Start
1. In the debug dropdown menu, select Dev Tunnels > Create A Tunnel (set authentication type to Public) or select an existing public dev tunnel
</br>![image](https://raw.githubusercontent.com/OfficeDev/TeamsFx/dev/docs/images/visualstudio/debug/create-devtunnel-button.png)
2. Right-click the 'TeamsApp' project in Solution Explorer and select Teams Toolkit > Prepare Teams App Dependencies
3. If prompted, sign in to Visual Studio with a Microsoft 365 work or school account
4. Press F5, or select Debug > Start Debugging menu in Visual Studio to start your app
</br>![image](https://raw.githubusercontent.com/OfficeDev/TeamsFx/dev/docs/images/visualstudio/debug/debug-button.png)
5. In the opened web browser, select Add button to test the app in Teams
6. In the message input field, type and send anything to your bot to get a response

## Run the app on other platforms

The Teams app can run in other platforms like Outlook and Microsoft 365 app. See https://aka.ms/vs-ttk-debug-multi-profiles for more details.

## Get more info

New to Teams app development or Teams Toolkit? Explore Teams app manifests, cloud deployment, and much more in the https://aka.ms/teams-toolkit-vs-docs.

## Report an issue

Select Visual Studio > Help > Send Feedback > Report a Problem.
Or, create an issue directly in our GitHub repository:
https://github.com/OfficeDev/TeamsFx/issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" Sdk="Microsoft.TeamsFx.Sdk">
<ItemGroup>
<ProjectCapability Include="ProjectConfigurationsDeclaredDimensions" />
</ItemGroup>
</Project>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json",
"manifestVersion": "1.16",
"version": "1.0.0",
"id": "${{TEAMS_APP_ID}}",
"packageName": "com.microsoft.teams.extension",
"developer": {
"name": "Teams App, Inc.",
"websiteUrl": "https://www.example.com",
"privacyUrl": "https://www.example.com/privacy",
"termsOfUseUrl": "https://www.example.com/termofuse"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "msgext-northwind-inventory-ts${{APP_NAME_SUFFIX}}",
"full": "full name for msgext-northwind-inventory-ts"
},
"description": {
"short": "Short description of msgext-northwind-inventory-ts",
"full": "Full description of msgext-northwind-inventory-ts"
},
"accentColor": "#FFFFFF",
"bots": [
{
"botId": "${{BOT_ID}}",
"scopes": [
"personal",
"team",
"groupchat"
],
"supportsFiles": false,
"isNotificationOnly": false
}
],
"composeExtensions": [
],
"configurableTabs": [],
"staticTabs": [],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": []
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions samples/msgext-northwind-inventory-csharp/.TeamsApp/env/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file includes environment variables that will be committed to git by default.

# Built-in environment variables
TEAMSFX_ENV=dev
APP_NAME_SUFFIX=dev

# Updating AZURE_SUBSCRIPTION_ID or AZURE_RESOURCE_GROUP_NAME after provision may also require an update to RESOURCE_SUFFIX, because some services require a globally unique name across subscriptions/resource groups.
AZURE_SUBSCRIPTION_ID=
AZURE_RESOURCE_GROUP_NAME=
RESOURCE_SUFFIX=

# Generated during provision, you can also add your own variables.
BOT_ID=
TEAMS_APP_ID=
BOT_AZURE_APP_SERVICE_RESOURCE_ID=
10 changes: 10 additions & 0 deletions samples/msgext-northwind-inventory-csharp/.TeamsApp/env/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file includes environment variables that can be committed to git. It's gitignored by default because it represents your local development environment.

# Built-in environment variables
TEAMSFX_ENV=local
APP_NAME_SUFFIX=local

# Generated during provision, you can also add your own variables.
BOT_ID=
TEAMS_APP_ID=
BOT_DOMAIN=
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
@maxLength(20)
@minLength(4)
@description('Used to generate names for all resources in this file')
param resourceBaseName string

@description('Required when create Azure Bot service')
param botAadAppClientId string

@secure()
@description('Required by Bot Framework package in your bot project')
param botAadAppClientSecret string

param webAppSKU string

@maxLength(42)
param botDisplayName string

param serverfarmsName string = resourceBaseName
param webAppName string = resourceBaseName
param location string = resourceGroup().location

// Compute resources for your Web App
resource serverfarm 'Microsoft.Web/serverfarms@2021-02-01' = {
kind: 'app'
location: location
name: serverfarmsName
sku: {
name: webAppSKU
}
}

// Web App that hosts your bot
resource webApp 'Microsoft.Web/sites@2021-02-01' = {
kind: 'app'
location: location
name: webAppName
properties: {
serverFarmId: serverfarm.id
httpsOnly: true
siteConfig: {
appSettings: [
{
name: 'WEBSITE_RUN_FROM_PACKAGE'
value: '1'
}
{
name: 'BOT_ID'
value: botAadAppClientId
}
{
name: 'BOT_PASSWORD'
value: botAadAppClientSecret
}
]
ftpsState: 'FtpsOnly'
}
}
}

// Register your web service as a bot with the Bot Framework
module azureBotRegistration './botRegistration/azurebot.bicep' = {
name: 'Azure-Bot-registration'
params: {
resourceBaseName: resourceBaseName
botAadAppClientId: botAadAppClientId
botAppDomain: webApp.properties.defaultHostName
botDisplayName: botDisplayName
}
}

// The output will be persisted in .env.{envName}. Visit https://aka.ms/teamsfx-actions/arm-deploy for more details.
output BOT_AZURE_APP_SERVICE_RESOURCE_ID string = webApp.id
output BOT_DOMAIN string = webApp.properties.defaultHostName
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourceBaseName": {
"value": "bot${{RESOURCE_SUFFIX}}"
},
"botAadAppClientId": {
"value": "${{BOT_ID}}"
},
"botAadAppClientSecret": {
"value": "${{SECRET_BOT_PASSWORD}}"
},
"webAppSKU": {
"value": "B1"
},
"botDisplayName": {
"value": "msgext-northwind-inventory-ts"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@maxLength(20)
@minLength(4)
@description('Used to generate names for all resources in this file')
param resourceBaseName string

@maxLength(42)
param botDisplayName string

param botServiceName string = resourceBaseName
param botServiceSku string = 'F0'
param botAadAppClientId string
param botAppDomain string

// Register your web service as a bot with the Bot Framework
resource botService 'Microsoft.BotService/botServices@2021-03-01' = {
kind: 'azurebot'
location: 'global'
name: botServiceName
properties: {
displayName: botDisplayName
endpoint: 'https://${botAppDomain}/api/messages'
msaAppId: botAadAppClientId
}
sku: {
name: botServiceSku
}
}

// Connect the bot service to Microsoft Teams
resource botServiceMsTeamsChannel 'Microsoft.BotService/botServices/channels@2021-03-01' = {
parent: botService
location: 'global'
name: 'MsTeamsChannel'
properties: {
channelName: 'MsTeamsChannel'
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The `azurebot.bicep` module is provided to help you create Azure Bot service when you don't use Azure to host your app. If you use Azure as infrastrcture for your app, `azure.bicep` under infra folder already leverages this module to create Azure Bot service for you. You don't need to deploy `azurebot.bicep` again.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"profiles": {
// Launch 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}}",
},
// Launch project within Teams App Test Tool
"Teams App Test Tool (browser)": {
"commandName": "Project",
"launchTestTool": true,
"launchUrl": "http://localhost:56150",
},
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/1.1.0/yaml.schema.json
# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file
# Visit https://aka.ms/teamsfx-actions for details on actions
version: 1.1.0

provision:
# Creates a Teams app
- uses: teamsApp/create
with:
# Teams app name
name: msgext-northwind-inventory-ts${{APP_NAME_SUFFIX}}
# Write the information of created resources into environment file for
# the specified environment variable(s).
writeToEnvironmentFile:
teamsAppId: TEAMS_APP_ID

# Create or reuse an existing Microsoft Entra application for bot.
- uses: botAadApp/create
with:
# The Microsoft Entra application's display name
name: msgext-northwind-inventory-ts${{APP_NAME_SUFFIX}}
writeToEnvironmentFile:
# The Microsoft Entra application's client id created for bot.
botId: BOT_ID
# The Microsoft Entra application's client secret created for bot.
botPassword: SECRET_BOT_PASSWORD

# Generate runtime appsettings to JSON file
- uses: file/createOrUpdateJsonFile
with:
target: ../msgext-northwind-inventory-ts/appsettings.Development.json
content:
BOT_ID: ${{BOT_ID}}
BOT_PASSWORD: ${{SECRET_BOT_PASSWORD}}

# Create or update the bot registration on dev.botframework.com
- uses: botFramework/create
with:
botId: ${{BOT_ID}}
name: msgext-northwind-inventory-ts
messagingEndpoint: ${{BOT_ENDPOINT}}/api/messages
description: ""
channels:
- name: msteams

# Validate using manifest schema
- uses: teamsApp/validateManifest
with:
# Path to manifest template
manifestPath: ./appPackage/manifest.json
# Build Teams app package with latest env value
- uses: teamsApp/zipAppPackage
with:
# Path to manifest template
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: ./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: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip
Loading