You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add support for Subscription, updates ResourceSuffix and general tool improvement
* Fix ConfigureAppSettings typos
Co-authored-by: Gabo Gilabert <[email protected]>
Configure AppSettings file with DirectLine Secrets gathered from Azure Bot Resources based on the Resource Group and Resource Suffix provided by the user.
9
+
Configure AppSettings file with DirectLine Secrets gathered from Azure Bot Resources based on the Resource Group, Resource Suffix and Subscription provided by the user.
10
10
11
11
.PARAMETERResourceGroup
12
-
Specifies the name for the specific Resource Group where the resources are deployed at.
12
+
Specifies the Name for the specific Resource Group where the resources are deployed. For each specific language will concatenate (DotNet, JS and Python). Default (BFFN).
13
13
14
14
.PARAMETERResourceSuffix
15
-
Specifies the suffix the resources name are built with.
15
+
Specifies the Suffix used to concatenate at the end of the Resource Name followed up by the ResourceSuffixSeparator.
16
+
17
+
.PARAMETERSubscription
18
+
Specifies the Name or Id of the Subscription where the resources are located. Default (current Subscription).
19
+
20
+
.PARAMETERResourceSuffixSeparator
21
+
Specifies the separator used for the Suffix to split the Resource Name from the ResourceSuffix. Default (-).
$DirectLine= (az bot directline show --name $Resource--resource-group $ResourceGroup--with-secrets true 2>$null|ConvertFrom-Json).properties.properties.sites.key;
277
+
$DirectLine= (az bot directline show --name $Resource--resource-group $ResourceGroup--subscription $Subscription--with-secrets true 2>$null|ConvertFrom-Json).properties.properties.sites.key;
Copy file name to clipboardExpand all lines: Tests/SkillFunctionalTests/Utils/README.md
+51-13Lines changed: 51 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,21 +2,59 @@
2
2
3
3
## ConfigureAppSettings
4
4
5
-
This script configures the _appsettings.Development.json_ file from the SkillsFunctionalTest project to be able to run the tests locally connecting them with bots deployed in Azure. Its behavior consists on gathering the DirectLine Secrets from the deployed Azure Bot Resources and configure this file with them. For its purpose it uses the '**ResourceGroup**' and '**ResourceSuffix**' provided by the user when running it.
5
+
### Description
6
6
7
-
>**ResourceGroup**: the specific Resource Group where the Azure Resource Bots are deployed in. The default value is 'BFFN'. _Eg: bffnbots_
8
-
>
9
-
>**ResourceSuffix**: the suffix the resources name is built with. It will be a combination of the suffix itself and the build id where the resource was created. _Eg: gitali-218_
7
+
This script configures the `appsettings.Development.json` file from the SkillsFunctionalTest project to be able to run the tests locally, connecting them with bots deployed in Azure. Its behavior consists on gathering the DirectLine Secrets from the deployed Azure Bot Resources and configure this file with them.
10
8
11
-
The user can execute the script providing one or both parameters and the process will start automatically, or execute it without parameters and provide them using the prompt.
9
+
For the process to be able to find the resources, the following inputs must be provided.
The script will communicate with Azure through the **azure-cli** tool and gather the DirectLine secrets from each Azure Resource Bot deployed in the Resource Group resultant from the combination of the provided one with the language (DotNet, JS or Python) extracted from the _HostBotClientOptions_ keys, and '**ResourceSuffix**' parameter.
13
+
-[Azure CLI][azure-cli]
14
+
-[PowerShell 7+][powershell]
18
15
19
-
Here you can see the entire process being executed
| ResourceGroup | The Name for the specific Resource Group where the resources are deployed. For each specific language will concatenate (DotNet, JS and Python). | Required | BFFN | "bffnbots" |
21
+
| ResourceSuffix | The Suffix used to concatenate at the end of the Resource Name followed up by the ResourceSuffixSeparator. | Required || "microsoft-396" |
22
+
| Subscription | The Name or Id of the Subscription where the resources are located. | Optional | Current Subscription | "00000000-0000-0000-0000-000000000000" or "bffnbots-subscription" |
23
+
| ResourceSuffixSeparator | The separator used for the Suffix to split the Resource Name from the ResourceSuffix. <br> **Note:**_Only available when providing it through `parameters`_. | Optional | - | "" or "-microsoft-" |
24
+
25
+
### The inputs can be provided as `prompts` or `parameters`
26
+
27
+
1. When using `prompts`, it will ask for the `required` inputs to be provided. When no input is entered, it will use the `default (...)` value instead. For more information about, see [Inputs][inputs].
28
+
29
+
![prompts][prompts]
30
+
31
+
2. When using `parameters`, all listed inputs can be provided before executing the script. When no input is entered, it will use the `default` value instead. For more information, see [Inputs][inputs].
32
+
33
+
![parameters][parameters]
34
+
35
+
### Result
36
+
37
+
After providing the desired [Inputs][inputs], the script will start looking for the Bot Resources, followed up by gathering each DirectLine Secret from the Azure Bot Resource and set it in the `appsettings.Development.json`. Moreover, all steps will be shown in the terminal as well as the result with each DirectLine Secret set for each Bot.
38
+
39
+
![sample][sample]
40
+
41
+
> **Note:** When no `appsettings.Development.json` file is found, it will proceed by generating a copy from the `appsettings.json` baseline file.
42
+
43
+
> **Note:** Applies to `Subscription` input. When multiple Subscriptions are detected, a prompt to choose the desired one will appear. `Can be entered by Number (#), Name or Id`, otherwise the `default` one will be used instead.
44
+
45
+
> **Note:** Applies to all `Inputs`. A mix between the two ways (`prompts` and `parameters`) to provide the inputs can be used. _E.g. prompts: ResourceSuffix and ResourceGroup, parameters: Subscription and ResourceSuffixSeparator_.
0 commit comments