Skip to content

Commit 9a0fa9e

Browse files
authored
Merge branch 'main' into mehak/ts-cli
2 parents 346a6cf + b846ce8 commit 9a0fa9e

File tree

4 files changed

+142
-1
lines changed

4 files changed

+142
-1
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Built-in environment variables
2+
TEAMSFX_ENV=dev
3+
APP_NAME_SUFFIX=dev
4+
5+
# 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.
6+
AZURE_SUBSCRIPTION_ID=
7+
AZURE_RESOURCE_GROUP_NAME=
8+
RESOURCE_SUFFIX=
9+
10+
TEAMS_APP_ID=
11+
TEAMS_APP_TENANT_ID=
12+
BOT_ID=
13+
AAD_APP_OBJECT_ID=
14+
AAD_APP_TENANT_ID=
15+
BOT_AZURE_APP_SERVICE_RESOURCE_ID=
16+
BOT_DOMAIN=
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
@maxLength(20)
2+
@minLength(4)
3+
@description('Used to generate names for all resources in this file')
4+
param resourceBaseName string
5+
6+
@description('Required when create Azure Bot service')
7+
param botAadAppClientId string
8+
9+
@secure()
10+
@description('Required by Bot Framework package in your bot project')
11+
param botAadAppClientSecret string
12+
13+
@maxLength(42)
14+
param botDisplayName string
15+
16+
param webAppSKU string
17+
param linuxFxVersion string
18+
param oauthConnectionName string
19+
param tenantId string
20+
21+
param serverfarmsName string = resourceBaseName
22+
param webAppName string = resourceBaseName
23+
param location string = resourceGroup().location
24+
param pythonVersion string = linuxFxVersion
25+
26+
// Compute resources for your Web App
27+
resource serverfarm 'Microsoft.Web/serverfarms@2021-02-01' = {
28+
kind: 'app,linux'
29+
location: location
30+
name: serverfarmsName
31+
sku: {
32+
name: webAppSKU
33+
}
34+
properties:{
35+
reserved: true
36+
}
37+
}
38+
39+
// Web App that hosts your agent
40+
// Web App that hosts your bot
41+
resource webApp 'Microsoft.Web/sites@2021-02-01' = {
42+
kind: 'app,linux'
43+
location: location
44+
name: webAppName
45+
properties: {
46+
serverFarmId: serverfarm.id
47+
siteConfig: {
48+
alwaysOn: true
49+
appCommandLine: 'python main.py'
50+
linuxFxVersion: pythonVersion
51+
appSettings: [
52+
{
53+
name: 'SCM_DO_BUILD_DURING_DEPLOYMENT'
54+
value: 'true'
55+
}
56+
{
57+
name: 'CLIENT_ID'
58+
value: botAadAppClientId
59+
}
60+
{
61+
name: 'CLIENT_SECRET'
62+
value: botAadAppClientSecret
63+
}
64+
{
65+
name: 'TENANT_ID'
66+
value: tenantId
67+
}
68+
]
69+
ftpsState: 'FtpsOnly'
70+
}
71+
}
72+
}
73+
74+
// Register your web service as a bot with the Bot Framework
75+
module azureBotRegistration './botRegistration/azurebot.bicep' = {
76+
name: 'Azure-Bot-registration'
77+
params: {
78+
resourceBaseName: resourceBaseName
79+
botAadAppClientId: botAadAppClientId
80+
botAddAppClientSecret: botAadAppClientSecret
81+
botAppDomain: webApp.properties.defaultHostName
82+
botDisplayName: botDisplayName
83+
oauthConnectionName: oauthConnectionName
84+
tenantId: tenantId
85+
}
86+
}
87+
88+
output BOT_AZURE_APP_SERVICE_RESOURCE_ID string = webApp.id
89+
output BOT_DOMAIN string = webApp.properties.defaultHostName
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"resourceBaseName": {
6+
"value": "bot-$\{{RESOURCE_SUFFIX}}-$\{{TEAMSFX_ENV}}"
7+
},
8+
"webAppSKU": {
9+
"value": "B1"
10+
},
11+
"botAadAppClientId": {
12+
"value": "$\{{BOT_ID}}"
13+
},
14+
"botAadAppClientSecret": {
15+
"value": "$\{{SECRET_BOT_PASSWORD}}"
16+
},
17+
"oauthConnectionName": {
18+
"value": "$\{{OAUTH_CONNECTION_NAME}}"
19+
},
20+
"tenantId": {
21+
"value": "$\{{AAD_APP_TENANT_ID}}"
22+
},
23+
"linuxFxVersion": {
24+
"value": "PYTHON|3.12"
25+
},
26+
"botDisplayName": {
27+
"value": "{{ toPascalCase name }}Infra"
28+
}
29+
30+
}
31+
}

packages/cli/configs/atk/oauth/python/teamsapp.yml.hbs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,14 @@ provision:
103103

104104
deploy:
105105
# Deploy to an Azure App Service using the zip file created in the provision step.
106+
- uses: script
107+
with:
108+
run: |
109+
uv sync
110+
uv export --no-hashes -o src/requirements.txt
106111
- uses: azureAppService/zipDeploy
107112
with:
108-
artifactFolder: .
113+
artifactFolder: src
109114
ignoreFile: .webappignore
110115
# This example uses the env var thats generated by the arm/deploy action.
111116
# You can replace it with an existing Azure Resource ID or other

0 commit comments

Comments
 (0)