Botframework-solutions: botskills (connect and update) needs to be able to target Azure Government

Created on 19 Dec 2019  Â·  7Comments  Â·  Source: microsoft/botframework-solutions

User Story

As a Azure Government developer
I want to be able to use "botskills connect" and "botskills update" (and any other subcommand that needs to target Azure Gov) to target Azure Gov cloud
so that I can connect an Azure Government Virtual Assistant Skill to its Virtual Assistant parent and also run "botskills update" when I need to update my skill after making changes in the Azure Gov portal

Acceptance Criteria

List your requirements.

  • [ ] - Working command - Its done when botskills connect and update work to target Azure Gov
  • [ ] ...
  • [ ] ...

Resources

Provide any screenshots or conversation mockups to support your request.
Learn how to mock up bot conversations with .chat files.

Notes

Provide any additional information.

P0 Backlog

All 7 comments

@batta32 - There are --gov or --cloud params on all of the cli commands for dispatch and luis that should enable this. The --cloud param needs to be set to "us" for gov and "com" for all others.

Thanks @lauren-mills! We are checking those params for all the CLI commands, and we will get back to you later 😊.

Hi @lauren-mills, we came up with some proposals in order to cover this scenario:
1. Check if the user is running a government cloud and, if it does, automatically add --gov for the CLI commands
2. Add the optional parameter --gov in the tool's commands (e.g. connect, update)

We believe the first option is the best one as it would be a transparent process for the user. To accomplish this would require the following steps in the execution of the botskills' commands:
1. Run az cloud list
2. Check if any of the governments cloud is active
3. If there is, add the parameter --gov for dispatch's commands.

We came up with this solution after looking up how Azure Government in implemented in Dispatch.

Also, we would be only using --gov, as --cloud is only used by LUIS but we have no use for it.

Finally, we will be working on the first proposal, but if you think otherwise please let us know.

Thank you.

Hi @managedcoder, @lauren-mills! :relaxed:. We created the PR #2850 which introduces the implementation of --gov.

Please use this PR to test if it works as we dont have a way to test this with an Azure Government account. You can test this simply by:

  1. After checking out the branch go to the folder botframework-solutions/tree/master/tools/botskills
  2. Run npm install
  3. Then run npm run build
  4. Afterwards run npm link
  5. Run botskills connect to connect a skill

The way it works is as following:

  1. A new AzUtil function was added: isCloudGovernment. It just run the command az cloud list and returns either true or false if AzureUSGovernment is active
  2. isCloudGovernment is called when either calling connectSkill or refreshSkill (through update or disconnect)
  3. If isCloudGovernment returns true we append the parameters --gov and true to the arrays of parameters to execute

Please let us know how it works,
Thank you

@Lauren MillsLauren.Mills@microsoft.com & solutions team,

I am attempting to test PR #2850https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fbotframework-solutions%2Fpull%2F2850&data=02%7C01%7Cruwill%40microsoft.com%7Cff898ab4a8dc4afd5d3308d78b11f692%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637130781579332482&sdata=eHQ4F%2B4cinMy4F9vnU7aiqYBoGKU8J2wvGc2xLp13ws%3D&reserved=0 but I’m blocked behind this basic bot authentication issue:

"System.AggregateException: Failed to acquire token for client credentials. (AADSTS700016: Application with identifier 'c84b25fc-ae0b-4fb4-b2ac-c36167049a48' was not found in the directory 'botframework.com'.
I get this same error for both the Assistant and Skill and I’ve seen this before where the bot is trying to authenticate and can’t since it targeting the wrong auth endpoint
 in this case it should be targeting ‘botframework.us’ instead of the ‘botframework.com’ in the error message.

@Lauren MillsLauren.Mills@microsoft.com, can you or someone on your team try to repo this error that’s blocking me? Basically the repo steps are:

  1. Use the gov2 branch and deploy the assistant into Azure Gov
  2. Use emulator to pass a “hello” message to bot to local or deployed bot. This step fails for me with the error described above so basically we need to establish basic bot functionality for both Assistant and Skill and then I can push on to test these other things.

I can’t succeed with botskills connect until I have a functioning bot since it needs to grab the manifest from the skill and http://.azurewebsites.net/api/skill/manifest/http://%3cYourSkill%3e.azurewebsites.net/api/skill/manifest/ does not produce a response which I think is affected by this authentication issue.

-Russ

From: Victor Grycuk notifications@github.com
Sent: Friday, December 27, 2019 4:16 PM
To: microsoft/botframework-solutions botframework-solutions@noreply.github.com
Cc: Russ Williams ruwill@microsoft.com; Mention mention@noreply.github.com
Subject: Re: [microsoft/botframework-solutions] botskills (connect and update) needs to be able to target Azure Government (#2836)

Hi @managedcoderhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmanagedcoder&data=02%7C01%7Cruwill%40microsoft.com%7Cff898ab4a8dc4afd5d3308d78b11f692%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637130781579322486&sdata=9zDz%2FvpMAmFyVMQ0tYvi9OwDUHcgBnX8k%2ByLMZZzSLQ%3D&reserved=0, @lauren-millshttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Flauren-mills&data=02%7C01%7Cruwill%40microsoft.com%7Cff898ab4a8dc4afd5d3308d78b11f692%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637130781579322486&sdata=%2BrKpfSGfoOGAExoR8wH5eBxRTlcnM%2FtufLYx0jWr0ys%3D&reserved=0! â˜ș. We created the PR #2850https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fbotframework-solutions%2Fpull%2F2850&data=02%7C01%7Cruwill%40microsoft.com%7Cff898ab4a8dc4afd5d3308d78b11f692%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637130781579332482&sdata=eHQ4F%2B4cinMy4F9vnU7aiqYBoGKU8J2wvGc2xLp13ws%3D&reserved=0 which introduces the implementation of --gov.

Please use this PR to test if it works as we dont have a way to test this with an Azure Government account. You can test this simply by:

  1. After checking out the branch go to the folder botframework-solutions/tree/master/tools/botskills
  2. Run npm install
  3. Then run npm run build
  4. Afterwards run npm link
  5. Run botskills connect to connect a skill

The way it works is as following:

  1. A new AzUtil function was added: isCloudGovernment. It just run the command az cloud list and returns either true or false if AzureUSGovernment is active
  2. isCloudGovernment is called when either calling connectSkill or refreshSkill (through update or disconnect)
  3. If isCloudGovernment returns true we append the parameters --gov and true to the arrays of parameters to execute

Please let us know how it works,
Thank you

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fbotframework-solutions%2Fissues%2F2836%3Femail_source%3Dnotifications%26email_token%3DAEHSFYQG5NDOYLV4CGR3LLTQ2ZWAZA5CNFSM4J5PZCTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHXYXYA%23issuecomment-569347040&data=02%7C01%7Cruwill%40microsoft.com%7Cff898ab4a8dc4afd5d3308d78b11f692%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637130781579332482&sdata=EMFgIltQz8phXbYNast42jiDn%2B%2Fzh%2BFfCB2YuWucFtI%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAEHSFYUOU2CX7QQBOME3I6DQ2ZWAZANCNFSM4J5PZCTA&data=02%7C01%7Cruwill%40microsoft.com%7Cff898ab4a8dc4afd5d3308d78b11f692%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637130781579342475&sdata=2GWH8dd1JlGB2yYW%2BOKeJPPFZAjzwPMZyLsMckb%2BxJI%3D&reserved=0.

@VictorGrycuk - @managedcoder and I both tested the new tool and ran into the following error with dispatch:

PS > botskills connect -r https://**.azurewebsites.us/api/skill/manifest --luisFolder **\SkillSample\Deployment\Resources\LU\ --languages "en-us" --cs
Updating Dispatch
Adding skill to Dispatch
Parsing en-us SkillSample LU file
Executing dispatch add for the en-us SkillSample LU file
File: **\SkillSample\Deployment\Resources\LU\en-us\SkillSample.luis added to **.dispatch
Running dispatch refresh for **...
Executing dispatch refresh for the ** file
Exporting services for dispatch...
Exporting **_General LUIS application...

ERROR
One or more errors occurred. (No such host is known No such host is known)

****UNHANDLED EXCEPTION****
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Fuse.Core.Command.ConsoleApp.HandleWebError(WebException we) in D:\a\1\s\oss\core\Command\ConsoleApp.cs:line 285
   at Microsoft.Fuse.Core.Command.ConsoleApp.HandleError(Exception ex, Int32 recursionCount) in D:\a\1\s\oss\core\Command\ConsoleApp.cs:line 264
   at Microsoft.Fuse.Core.Command.ConsoleApp.HandleError(Exception ex, Int32 recursionCount) in D:\a\1\s\oss\core\Command\ConsoleApp.cs:line 275
   at Microsoft.Fuse.Core.Command.ConsoleApp.HandleError(Exception ex) in D:\a\1\s\oss\core\Command\ConsoleApp.cs:line 243
   at Microsoft.Fuse.Core.Command.ConsoleApp.Eval(String[] input) in D:\a\1\s\oss\core\Command\ConsoleApp.cs:line 167
   at Microsoft.Fuse.Core.Command.ConsoleApp.Run(String[] input) in D:\a\1\s\oss\core\Command\ConsoleApp.cs:line 129
   at Microsoft.Fuse.Dispatch.DispatchConsole.Main(String[] args) in D:\a\1\s\oss\Dispatch\Program.cs:line 51

Running LuisGen for **...
Executing luisgen for the ** file
Successfully refreshed Dispatch model
You need to re-publish your Virtual Assistant in order to have these changes available for Azure based testing
Appending 'SkillSample' manifest to your assistant's skills configuration file.
Successfully appended 'SkillSample' manifest to your assistant's skills configuration file!
Configuring bot auth settings
Checking for authentication settings ...
There are no authentication connections in your Skills manifest.

I tried the dispatch refresh command manually with --gov true and it completed successfully so might be an issue with that command.

Hi @lauren-mills!

We took a look at the log, and we have some questions to validate the scenario:

  1. We are assuming that you are using the changes of PR #2850 (which appends the --gov argument in the dispatch commands), is that right?
  2. Are you running the botskills' commands in pipelines?
  3. Does the user used to run the commands has access to the Azure Government account?
  4. Can you attach the log using the --verbose argument in the executed command? We'd like to verify if the --gov argument is being appended correctly in the dispatch command.

Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hansmbakker picture hansmbakker  Â·  3Comments

lauren-mills picture lauren-mills  Â·  3Comments

manish-95 picture manish-95  Â·  3Comments

darrenj picture darrenj  Â·  3Comments

ericmaino picture ericmaino  Â·  3Comments