We have a bot deployed on Azure but we want to give it to a client so he can deploy it run it using his own resources. We need to give them a Powershell script that magically create and deploy all the resources needed for the bot to work. My bot architecture consists on the following parts:
My Questions are:
1) How to configure bots web api to connection strings parameters? (table storage, luis and qna service will be different when they re redeployed) Currently I am defining the conn. strings and api keys on the web.config, but as I said, this needs to be dynamic.
2) How to automate deployment for LUIS? Luis needs to have the Key of the Cognitive Services Account that should be created first. And I assume I have the exported model json file. I was thinking of using the LUIS API to do the app export and the publishing part. Would that be enough?
3) How to deploy qna services? I think currently is deployed somewhere magically so maybe I won't need to do anything with it.
Thanks!
Maybe a little bit late, but I just had to implement the very same thing, so here are the answers to your questions in hope they could be useful to others:
1) As JoyrexJ9 mentioned above, you can do this via an ARM template by setting the Application Settings of your App Service which will override the values in your Web.config. More about this here.
{
"type": "Microsoft.Web/sites",
"kind": "app",
"name": "MyWebApp",
"apiVersion": "2015-08-01",
"location": "westeurope",
"properties": {
"name": "MyWebApp",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'MyAppServicePlanName')]",
"siteConfig": {
"appSettings": [{
"name": "StorageConnectionString",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=','MyStorageAccountName',';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', 'MyStorageAccountName'), '2017-10-01').keys[0].value,';EndpointSuffix=core.windows.net')]"
}],
"cors": {
"allowedOrigins": [
"*"
]
}
}
},
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts/', 'MyStorageAccountName')]",
"[resourceId('Microsoft.Web/serverfarms', 'MyAppServicePlanName')]"
]
}
2) Unfortunately you cannot automate the provisioning of a LUIS app completely at the moment. You can create the resource in Azure via an ARM template and you can do the bulk of the rest of the work through the LUIS API, but for example you cannot assign the subscription key created by the ARM template to a LUIS app programmatically, because that API method is deprecated.
3) The QnA Maker service and it's hosting model changed significantly since you've submitted your questions. I wrote a full blog post about how to do the provisioning of it in the new system.
As JoyrexJ9 mentioned above, it's very important to point out that you won't be able to automate the bot registration fully even with a script, because there's no API for registering an application at https://apps.dev.microsoft.com/. You'll have to do that manually as well. Everything else (besides the things I mentioned above) can be fully automated either via ARM templates or scripts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With