%3CLINGO-SUB%20id%3D%22lingo-sub-1741060%22%20slang%3D%22en-US%22%3EProactive%20Messaging%20in%20Microsoft%20Teams%20from%20Healthcare%20Bot%20service%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1741060%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20are%20many%20use%20cases%20in%20which%20organizations%20send%20push%20notifications%20to%20nudge%20their%20users%20to%20take%20an%20assessment%20or%20reply%20to%20a%20questionnaire.%26nbsp%3BThe%20Proactive%20Scenario%20API%20in%20Healthcare%20Bot%20service%20allows%20to%20initiate%20a%20scenario%20proactively.%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fhealthbot%2Fintegrations%2Fproactive%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EThis%20documentation%3C%2FA%3E%26nbsp%3Bexplains%20how%20to%20proactively%20invoke%20a%20scenario%20using%20Twilio%20SMS%20channel.%20Using%20the%20same%20principles%2C%20we%20will%20walkthrough%20the%20different%20steps%20to%20configure%20proactive%20messaging%20in%20Teams.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20configuration%20is%20done%20in%202%20steps%20-%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EStep%201%3A%20Register%20User%20ID%20and%20Teams%20Address%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EStep%202%3A%20Invoke%20scenario%20programmatically%20for%20all%20registered%20users%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EBelow%20is%20a%20visual%20of%20the%20two%20necessary%20steps%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22edited%20teaser.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223816i2A0B20845A78F89A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22edited%20teaser.png%22%20alt%3D%22edited%20teaser.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1240965616%22%20id%3D%22toc-hId--1240965616%22%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3EPre-requisites%3A%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3EAzure%20subscription%2C%20you%20will%20need%20to%20create%20additional%20Azure%20services%20to%20complete%20the%20configuration%2C%20ensure%20to%20have%20necessary%20access%20rights%20in%20your%20subscription.%20Login%20to%20%3CA%20href%3D%22https%3A%2F%2Fportal.azure.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fportal.azure.com%3C%2FA%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3EMicrosoft%20Healthcare%20Bot%20service%20%E2%80%93%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fhealthbot%2Fquickstart-createyourhealthcarebot%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECreate%20a%20healthcare%20bot%3C%2FA%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3EA%20good%20understanding%20of%20creating%20Azure%20Functions%20and%20binding%20with%20data%20platforms%20such%20as%20Azure%20Table%20storage%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20class%3D%22lia-align-center%22%20id%3D%22toc-hId-1246547217%22%20id%3D%22toc-hId-1246547217%22%3E%3CSTRONG%3EStep%201%3A%20Register%20User%20ID%20and%20Teams%20Address%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20Login%20to%20%3CA%20href%3D%22https%3A%2F%2Fportal.azure.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EAzure%20portal%3C%2FA%3E.%20Create%20a%20table%20to%20store%20-%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EUser%20ID%20%3D%20Azure%20AD%20Object%20ID%20in%20case%20of%20Teams%3C%2FLI%3E%0A%3CLI%3EAddress%20%3D%20Teams%20Address%20unique%20to%20each%20user%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3ETo%20save%20these%202%20key-value%20pairs%2C%20there%20are%20many%20options%20available%20in%20Azure%20data%20platform%20including%20Table%20in%20Azure%20Data%20Lake%20storage%20Gen2%2C%20Cosmos%20DB%20Table%20API%2C%20Azure%20Cache%20for%20Redis%20and%20Azure%20SQL%20Database.%20We%E2%80%99ll%20create%20a%20%3CSTRONG%3ETable%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fcommon%2Fstorage-account-create%3Ftabs%3Dazure-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EADLS%20Gen2%3C%2FA%3E%3C%2FSTRONG%3E%20with%3C%2FP%3E%0A%3COL%20class%3D%22lia-list-style-type-lower-roman%22%3E%0A%3CLI%3EPartition%20key%20%3D%20Azure%20AD%20Object%20ID%2C%3C%2FLI%3E%0A%3CLI%3ERow%20key%20%3D%20%3CANY%20random%3D%22%22%20string%3D%22%22%3E%20(teamsAddress%20as%20seen%20in%20screenshot%20below)%20%3CEM%3ENote%3A%20Address%20could%20not%20be%20stored%20in%20Row%20key%20because%20of%20limitation%20of%20255%20byte%20size%3C%2FEM%3E%26nbsp%3B%3C%2FANY%3E%3C%2FLI%3E%0A%3CLI%3EAddress%20%3D%20unique%20Teams%20Address%3C%2FLI%3E%0A%3CLI%3ETimestamp%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EThis%20is%20a%20screenshot%20of%20a%20table%20in%20ADLS%20Gen2%20viewed%20in%20Azure%20Storage%20Explorer.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22tablestorage.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223817i64D411E381FC122B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22tablestorage.png%22%20alt%3D%22tablestorage.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2.%20In%20Healthcare%20Bot%20service%2C%20enable%20Teams%20as%20UI%20channel%20using%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fhealthbot%2Fchannels%2Fteams%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ethis%20link%3C%2FA%3E%20and%20test%20the%20bot%20in%20Teams.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3.%20In%20Healthcare%20bot%2C%20create%20a%20scenario%20with%20write%20function%20to%20the%20table%20created%20in%20step%201%20above.%20A%20sample%20scenario%20can%20be%20found%20at%20this%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnikitapitliya006%2FHealthcareBotScenarios%2Fblob%2Fmain%2FRegister%2520userID%2520and%2520teamsAddress%2520to%2520storage.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGitHub%20link%3C%2FA%3E.%20Basically%20you%20need%20two%20scenario%20elements%20in%20the%20scenario%20as%20shown%20below%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22hcbscenario.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223848i15F98ED4F1CED1F6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22hcbscenario.png%22%20alt%3D%22hcbscenario.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CSTRONG%3EScenario%20element%201%3A%3C%2FSTRONG%3E%3C%2FEM%3E%20Init%20Action%20to%20extract%20Teams%20Address%2C%20Azure%20AD%20Object%20ID%20and%20generate%20a%20Timestamp%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22initaction.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223847i5E2129154EE1CC22%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22initaction.png%22%20alt%3D%22initaction.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CSTRONG%3EScenario%20element%202%3A%20%3C%2FSTRONG%3E%3C%2FEM%3EIngest%20to%20table%20storage%20using%20table's%20endpoint%20in%20the%20form%20-%26nbsp%3B%3C%2FP%3E%0A%3CDIV%3E%0A%3CDIV%3E%3CEM%3Ehttps%3A%2F%2F%3CSTORAGEACCOUNTNAME%3E.table.core.windows.net%2F%3CTABLENAME%3E%3F%3CSAS-AUTHENTICATION-KEY%3E%3C%2FSAS-AUTHENTICATION-KEY%3E%3C%2FTABLENAME%3E%3C%2FSTORAGEACCOUNTNAME%3E%3C%2FEM%3E%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ingesttable.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223849i07674C62B00FE55D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22ingesttable.png%22%20alt%3D%22ingesttable.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E4.%20Manually%20invoke%20by%20writing%20'begin%20registeruser'%20in%20Teams%20channel%20or%20you%20call%20healthcare%20bot%20from%20another%20bot%20in%20Teams.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22registerTeams.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223852i2B445D688DE261C2%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22registerTeams.png%22%20alt%3D%22registerTeams.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20class%3D%22lia-align-center%22%20id%3D%22toc-hId--560907246%22%20id%3D%22toc-hId--560907246%22%3EStep%202%3A%20Invoke%20scenario%20programmatically%20for%20all%20registered%20users%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3E%3CSPAN%20class%3D%22TextRun%20%20BCX9%20SCXW101577791%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20%20BCX9%20SCXW101577791%22%3EOnce%20you%20have%20all%20of%20the%20user%20IDs%20and%20Teams%20addresses%2C%20an%20organization's%20administrator%20can%20create%20an%20Azure%20function%20for%20Step%202%20to%20set%20up%20a%20POST%20call%20trigger%20to%20send%20daily%2Fregular%20notifications%20to%20registered%20users%20in%20Teams.%26nbsp%3B%3CSPAN%20class%3D%22TextRun%20SCXW9128921%20BCX9%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW9128921%20BCX9%22%3EYou%20will%20need%20the%20POST%20call%2C%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW9128921%20BCX9%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW9128921%20BCX9%22%3Eauthorization%20token%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW9128921%20BCX9%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW9128921%20BCX9%22%3E%2C%20and%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW9128921%20BCX9%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW9128921%20BCX9%22%3Ebody%20of%20the%20post%20call%20-%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW9128921%20BCX9%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW9128921%20BCX9%22%3E%26nbsp%3Ball%3CSPAN%3E%26nbsp%3Bof%20which%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20AdvancedProofingIssueV2%20SCXW9128921%20BCX9%22%3Ehave%20to%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW9128921%20BCX9%22%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ebe%20created%20in%20an%20Azure%20function.%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3E%3CEM%3E%3CSTRONG%3E%3CSPAN%20class%3D%22TextRun%20%20BCX9%20SCXW101577791%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20%20BCX9%20SCXW101577791%22%3E%3CSPAN%20class%3D%22TextRun%20SCXW9128921%20BCX9%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW9128921%20BCX9%22%3ENote%3A%20A%20sample%20code%20is%20available%20in%20this%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fcovid19-BackToWork%2Fblob%2Fmaster%2FAzureFunctionsCodebase%2FSelfMonitoring%2FTriggerTeamsNotification.cs%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGitHub%20link%3C%2FA%3E%26nbsp%3B-%20this%20file%20is%20part%20of%20COVID-19%20Back%20to%20Work%20solution%20and%20writes%20required%20User%20ID%20and%20Teams%20Addresses%20to%20Azure%20SQL%20database.%20We%20are%20using%20this%20repository%20for%20reference%20of%20Azure%20function.%20Use%20the%20code%20with%20caution%20and%20customize%20it%20to%20the%20Azure%20storage%20platform%20you%20chose%20in%20above%20step.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20In%20this%20step%2C%20gather%20all%20information%20required%20for%20the%20POST%20request%20API%20call%20-%26nbsp%3B%3C%2FP%3E%0A%3COL%20class%3D%22lia-list-style-type-lower-roman%22%3E%0A%3CLI%3EHealthbot%20Trigger%20Call%20-%20choose%20based%20on%20your%20closest%20region%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CUL%3E%0A%3CLI%3EUS%20tenants%20-%26nbsp%3B%3CA%20style%3D%22font-family%3A%20inherit%3B%20background-color%3A%20%23ffffff%3B%22%20href%3D%22https%3A%2F%2Fbot-us.healthbot.microsoft.com%2Fapi%2Ftenants%2F%26lt%3BtenantName%26gt%3B%2FbeginScenario%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fbot-us.healthbot.microsoft.com%2Fapi%2Ftenants%2F%3CTENANTNAME%3E%2FbeginScenario%3C%2FTENANTNAME%3E%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EEU%20tenants%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fbot-eu.healthbot.microsoft.com%2Fapi%2Ftenants%2F%26lt%3BtenantName%26gt%3B%2FbeginScenario%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fbot-eu.healthbot.microsoft.com%2Fapi%2Ftenants%2F%3CTENANTNAME%3E%2FbeginScenario%3C%2FTENANTNAME%3E%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3Eii.%20Healthbot%20Tenant%20Name%20-%20Healthcare%20bot%20admin%20portal%20%26gt%3B%20Integration%20%26gt%3B%20Secrets%20%26gt%3B%20tenant%20name%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3Eiii.%20Healthbot%20API_JWT_SECRET_KEY%20-%26nbsp%3BIntegration%20%26gt%3B%20Secrets%20%26gt%3B%20API_JWT_Secret%20Key%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3Eiv.%20Healthbot%20ScenarioId%20-%26nbsp%3BScenarios%20%26gt%3B%20Manage%20page.%20Find%20the%20relevant%20scenario%20and%20copy%20its%20Scenario%20ID%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20you%20have%20these%20values%20handy%2C%20save%20them%20in%20Azure%20Function%20App's%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-functions%2Ffunctions-how-to-use-azure-function-app-settings%23get-started-in-the-azure-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EApplication%20Settings%3C%2FA%3E.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2.%20JWT%20token%20for%20authentication%20in%20POST%20request%20header%20(GitHub%20-%20function%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fcovid19-BackToWork%2Fblob%2Fmaster%2FAzureFunctionsCodebase%2FSelfMonitoring%2FHelper%2FProgrammaticTrigger.cs%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGetJwtToken%3C%2FA%3E)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3.%20Read%20Teams%20Address%20of%20each%20recipient%20required%20in%20POST%20request%20body%20from%20Table%20storage.%20Create%20a%20binding%20between%20Azure%20function%20and%20Table%20storage%20using%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-functions%2Ffunctions-bindings-storage-table%3Ftabs%3Dcsharp%23input%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ethis%20link%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E4.%20Execute%20the%20Http%20or%20Timer%20Trigger%20POST%20call%20in%20Function%20App%20(GitHub%20-%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fcovid19-BackToWork%2Fblob%2Fmaster%2FAzureFunctionsCodebase%2FSelfMonitoring%2FTriggerTeamsNotification.cs%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ETriggerTeamsNotification.cs%3C%2FA%3E)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20class%3D%22lia-align-center%22%20id%3D%22toc-hId-1926605587%22%20id%3D%22toc-hId-1926605587%22%3EAdditional%20Resources%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3EFor%20using%20Azure%20Functions%20full%20codebase%20related%20to%20proactive%20messaging%20and%20using%20Azure%20SQL%20database%20as%20data%20source%20-%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fcovid19-BackToWork%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECOVID-19%20Back-to-Work%20solution%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EFor%20getting%20started%20on%20Healthcare%20Bot%20and%20COVID-19%20templates%20-%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fhealthcare-and-life-sciences%2Fupdated-on-5-24-2020-quick-start-setting-up-your-covid-19%2Fba-p%2F1230537%3F_lrsc%3D6c7bb47f-50aa-460b-85e0-dd9a1ca23fb3%22%20target%3D%22_blank%22%3EQuick%20Start%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20reading%20and%20let%20us%20know%20how%20else%20we%20can%20help!%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Nikita_LinkedIn.jfif%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F180770i08B1EB22654DCABD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Nikita_LinkedIn.jfif%22%20alt%3D%22Nikita_LinkedIn.jfif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.linkedin.com%2Fin%2Fnikitapitliya%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ENikita%20Pitliya%3C%2FA%3E%2C%20Microsoft%20Senior%20Solutions%20Architect%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1741060%22%20slang%3D%22en-US%22%3E%3CP%3E%E2%80%83%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22teaser%20image.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223814i5FB46D0732D9B48C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22teaser%20image.png%22%20alt%3D%22teaser%20image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20article%20explains%20sending%20automated%20proactive%20message%20notifications%20to%20Microsoft%20Teams%20from%20a%20Healthcare%20bot%20to%20allow%20a%20user%20to%20interact%20with%20the%20bot%20in%20Teams.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1741060%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHealthcare%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHealthcare%20Bot%20Service%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELife%20Sciences%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EModern%20Workplace%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETeams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

 

There are many use cases in which organizations send push notifications to nudge their users to take an assessment or reply to a questionnaire. The Proactive Scenario API in Healthcare Bot service allows to initiate a scenario proactively. This documentation explains how to proactively invoke a scenario using Twilio SMS channel. Using the same principles, we will walkthrough the different steps to configure proactive messaging in Teams.

 

The configuration is done in 2 steps - 

Step 1: Register User ID and Teams Address

Step 2: Invoke scenario programmatically for all registered users

Below is a visual of the two necessary steps: 

 

edited teaser.png

 

Pre-requisites:

  • Azure subscription, you will need to create additional Azure services to complete the configuration, ensure to have necessary access rights in your subscription. Login to https://portal.azure.com
  • Microsoft Healthcare Bot service – Create a healthcare bot 
  • A good understanding of creating Azure Functions and binding with data platforms such as Azure Table storage

 

Step 1: Register User ID and Teams Address

 

1. Login to Azure portal. Create a table to store - 

  • User ID = Azure AD Object ID in case of Teams
  • Address = Teams Address unique to each user

To save these 2 key-value pairs, there are many options available in Azure data platform including Table in Azure Data Lake storage Gen2, Cosmos DB Table API, Azure Cache for Redis and Azure SQL Database. We’ll create a Table in ADLS Gen2 with

  1. Partition key = Azure AD Object ID,
  2. Row key = <any random string> (teamsAddress as seen in screenshot below) Note: Address could not be stored in Row key because of limitation of 255 byte size 
  3. Address = unique Teams Address
  4. Timestamp

This is a screenshot of a table in ADLS Gen2 viewed in Azure Storage Explorer.

tablestorage.png

 

2. In Healthcare Bot service, enable Teams as UI channel using this link and test the bot in Teams.

 

3. In Healthcare bot, create a scenario with write function to the table created in step 1 above. A sample scenario can be found at this GitHub link. Basically you need two scenario elements in the scenario as shown below:

hcbscenario.png

 

Scenario element 1: Init Action to extract Teams Address, Azure AD Object ID and generate a Timestamp

initaction.png

 

Scenario element 2: Ingest to table storage using table's endpoint in the form - 

https://<storageaccountname>.table.core.windows.net/<tablename>?<sas-authentication-key>

ingesttable.png

 

4. Manually invoke by writing 'begin registeruser' in Teams channel or you call healthcare bot from another bot in Teams. 

 

registerTeams.png

 

Step 2: Invoke scenario programmatically for all registered users

 

Once you have all of the user IDs and Teams addresses, an organization's administrator can create an Azure function for Step 2 to set up a POST call trigger to send daily/regular notifications to registered users in Teams. You will need the POST call, the authorization token, and the body of the post call - all of which have to be created in an Azure function.

 

Note: A sample code is available in this GitHub link - this file is part of COVID-19 Back to Work solution and writes required User ID and Teams Addresses to Azure SQL database. We are using this repository for reference of Azure function. Use the code with caution and customize it to the Azure storage platform you chose in above step.

 

1. In this step, gather all information required for the POST request API call - 

  1. Healthbot Trigger Call - choose based on your closest region

ii. Healthbot Tenant Name - Healthcare bot admin portal > Integration > Secrets > tenant name

iii. Healthbot API_JWT_SECRET_KEY - Integration > Secrets > API_JWT_Secret Key

iv. Healthbot ScenarioId - Scenarios > Manage page. Find the relevant scenario and copy its Scenario ID

 

Once you have these values handy, save them in Azure Function App's Application Settings

 

2. JWT token for authentication in POST request header (GitHub - function GetJwtToken)

 

3. Read Teams Address of each recipient required in POST request body from Table storage. Create a binding between Azure function and Table storage using this link

 

4. Execute the Http or Timer Trigger POST call in Function App (GitHub - TriggerTeamsNotification.cs)

 

Additional Resources

  • For using Azure Functions full codebase related to proactive messaging and using Azure SQL database as data source - COVID-19 Back-to-Work solution
  • For getting started on Healthcare Bot and COVID-19 templates - Quick Start

 

Thanks for reading and let us know how else we can help!

Nikita_LinkedIn.jfif

Nikita Pitliya, Microsoft Senior Solutions Architect