%3CLINGO-SUB%20id%3D%22lingo-sub-1624008%22%20slang%3D%22en-US%22%3EConfiguring%20Dynamic%20Send%20Ports%20for%20Office%20365%20Outlook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1624008%22%20slang%3D%22en-US%22%3E%3CP%3EBizTalk%202020%20CU1%20introduced%20%3CFONT%20size%3D%224%22%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Fhelp%2F4566495%2Fimprovement-enables-the-dynamic-send-ports-in-biztalk-server-to-suppor%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Esupport%20for%20dynamic%20send%20ports%3C%2FA%3E%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Foffice365-adapters%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOffice%20365%20Outlook%20adapters%3C%2FA%3E.%20In%20this%20post%2C%20we%20go%20over%20this%20improvement%20into%20more%20details.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2014.0pt%3B%22%3E%3CFONT%20size%3D%224%22%20color%3D%22%230000FF%22%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3EPre-requisites%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2014.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3EMessages%20sent%20from%20a%20dynamic%20send%20port%20with%20transport%20type%20set%20to%20one%20of%20the%20Office%20365%20Outlook%20adapters%20need%20to%20provide%20the%20%3CEM%3EUserTokenIdentifier%20%3C%2FEM%3Econtext%20property.%20This%20identifier%20is%20created%20when%20the%20user%20signs%20in%20to%20Office%20365%2C%20which%20is%20done%20when%20creating%20a%20%3CEM%3Estatic%3C%2FEM%3E%20send%20port%2C%20in%20the%20transport%20properties%20of%20the%20Office%20365%20Outlook%20adapters%20as%20documented%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Foffice365-adapters%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOffice%20365%20Outlook%20adapters%20in%20BizTalk%3C%2FA%3E.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3EOnce%20a%20user%20is%20signed-in%2C%20the%20UserTokenIdentifier%20is%20retrieved%20from%20the%20bindings%2C%20as%20shown%20below%2C%20in%20the%20case%20of%20an%20exported%20Mail%20send%20port%20(placeholder%20nnnnnnnn-nnnn-nnnn-nnnnnnnnnnnn)%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-html%22%3E%3CCODE%3E%3CSENDPORT%20name%3D%22MailSendPort2%22%20isstatic%3D%22true%22%20istwoway%3D%22false%22%20bindingoption%3D%220%22%20analyticsenabled%3D%22false%22%3E%0A%20%20%20%20%20%20%3CDESCRIPTION%20nil%3D%22true%22%3E%3C%2FDESCRIPTION%3E%0A%20%20%20%20%20%20%3CTRANSMITPIPELINE%20name%3D%22Microsoft.BizTalk.DefaultPipelines.PassThruTransmit%22%20fullyqualifiedname%3D%22Microsoft.BizTalk.DefaultPipelines.PassThruTransmit%2C%20Microsoft.BizTalk.DefaultPipelines%2C%20Version%3D3.0.1.0%2C%20Culture%3Dneutral%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20PublicKeyToken%3D31bf3856ad364e35%22%20type%3D%222%22%20trackingoption%3D%22None%22%20description%3D%22%22%3E%3C%2FTRANSMITPIPELINE%3E%0A%20%20%20%20%20%20%3CPRIMARYTRANSPORT%3E%0A%20%20%20%20%20%20%20%20%3CADDRESS%3EO365Mail%3A%2F%2FBizTalkTestAccount1%40outlook.com%3C%2FADDRESS%3E%0A%20%20%20%20%20%20%20%20%3CTRANSPORTTYPE%20name%3D%22Office365%20Outlook%20Email%22%20capabilities%3D%2211%22%20configurationclsid%3D%2248b96e09-bd96-4f46-95ef-57accc55f23d%22%3E%3C%2FTRANSPORTTYPE%3E%0A%20%20%20%20%20%20%20%20%3CTRANSPORTTYPEDATA%3E%26amp%3Blt%3BCustomProps%26amp%3Bgt%3B%26amp%3Blt%3BDefaultCC%20vt%3D%228%22%20%2F%26amp%3Bgt%3B%26amp%3Blt%3BUserTokenIdentifier%20vt%3D%228%22%26amp%3Bgt%3Bnnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn%26amp%3Blt%3B%2FUserTokenIdentifier%26amp%3Bgt%3B%26amp%3Blt%3BFileAttachments%20vt%3D%228%22%20%2F%26amp%3Bgt%3B%26amp%3Blt%3BDefaultTo%20vt%3D%228%22%26amp%3Bgt%3BBizTalkTestAccount2%40outlook.com%26amp%3Blt%3B%2FDefaultTo%26amp%3Bgt%3B%26amp%3Blt%3BEmailAddress%20vt%3D%228%22%26amp%3Bgt%3BBizTalkTestAccount1%40outlook.com%26amp%3Blt%3B%2FEmailAddress%26amp%3Bgt%3B%26amp%3Blt%3BAttachBizTalkMessageParts%20vt%3D%2211%22%26amp%3Bgt%3B0%26amp%3Blt%3B%2FAttachBizTalkMessageParts%26amp%3Bgt%3B%26amp%3Blt%3BDefaultSubject%20vt%3D%228%22%26amp%3Bgt%3BHi%20from%20BizTalkTestAccount1%26amp%3Blt%3B%2FDefaultSubject%26amp%3Bgt%3B%26amp%3Blt%3BDefaultImportance%20vt%3D%228%22%26amp%3Bgt%3BNormal%26amp%3Blt%3B%2FDefaultImportance%26amp%3Bgt%3B%26amp%3Blt%3B%2FCustomProps%26amp%3Bgt%3B%3C%2FTRANSPORTTYPEDATA%3E%0A%3C%2FPRIMARYTRANSPORT%3E%3C%2FSENDPORT%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3ENote%20that%20the%20UserTokenIdentifier%20is%20tied%20to%20a%20signed-in%20account%20%3CI%3Eand%3C%2FI%3E%20a%20transport%20type.%26nbsp%3B%20A%20static%20send%20port%20needs%20to%20be%20created%20%3CI%3Efor%20each%20Office%20365%20transport%20type%3C%2FI%3E%20in%20order%20to%20get%20an%20identifier%20for%20each.%20For%20a%20given%20sign-in%2C%20the%20value%20of%20the%20UserTokenIdentifier%20may%20be%20the%20same%20for%20all%20Office%20365%20transport%20types%2C%20but%20static%20send%20ports%20need%20to%20be%20created%20for%20each%20transport%20type%20nonetheless.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3EOther%20important%20points%20to%20be%20aware%20of%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CFONT%20size%3D%224%22%3EStatic%20send%20ports%20can%20be%20deleted%20afterwards.%20They%20are%20not%20needed%20once%20the%20UserTokenIdentifiers%20are%20known.%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3E%3CFONT%20size%3D%224%22%3EUserTokenIdentifiers%20remain%20valid%20regardless%20of%20whether%20a%20dynamic%20or%20static%20send%20port%20exists%20or%20not%2C%20and%20after%20port%20deletions.%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3E%3CFONT%20size%3D%224%22%3EThe%20same%20UserTokenIdentifier%20can%20be%20used%20by%20multiple%20ports.%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2014.0pt%3B%22%3E%3CFONT%20size%3D%224%22%20color%3D%22%230000FF%22%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3EScenario%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2014.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3EThe%20demo%20scenario%20is%20based%20on%20a%20simple%20orchestration%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22O365DynPortOrch.JPG%22%20style%3D%22width%3A%20813px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F215692i2D0DC26114CFCEBB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22O365DynPortOrch.JPG%22%20alt%3D%22O365DynPortOrch.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3EReceived%20messages%20follow%20the%20schema%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22O365DynPortInputSchema.JPG%22%20style%3D%22width%3A%20216px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F215694i5C8E23AC865894E4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22O365DynPortInputSchema.JPG%22%20alt%3D%22O365DynPortInputSchema.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20style%3D%22direction%3A%20ltr%3B%22%3E%0A%3CTABLE%20style%3D%22direction%3A%20ltr%3B%20border-collapse%3A%20collapse%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%20title%3D%22%22%20border%3D%221%22%20summary%3D%22%22%20cellspacing%3D%220%22%20cellpadding%3D%220%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20style%3D%22background-color%3A%20%23d8d8d8%3B%20vertical-align%3A%20top%3B%20width%3A%201.4423in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3EElement%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22background-color%3A%20%23d8d8d8%3B%20vertical-align%3A%20top%3B%20width%3A%207.7826in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3EDescription%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20style%3D%22vertical-align%3A%20top%3B%20width%3A%201.4618in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3EUserTokenIdentifier%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22vertical-align%3A%20top%3B%20width%3A%207.7631in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3EValue%20of%20the%20UserTokenIdenfier%20acquired%20ahead%20of%20time%20by%20exporting%20the%20static%20ports.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CEM%3E%3CFONT%20size%3D%224%22%3EThe%20UserTokenIdentifier%20is%20provided%20by%20received%20messages.%20In%20the%20general%20case%2C%20the%20UserTokenIdentifier%20can%20come%20from%20any%20source.%20For%20instance%20one%20could%20keep%20a%20mapping%20of%20email%20addresses%20to%20UserTokenIdentifiers%20and%20make%20this%20mapping%20available%20for%20lookup%20at%20runtime.%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20style%3D%22vertical-align%3A%20top%3B%20width%3A%201.4423in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3EPortType%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22vertical-align%3A%20top%3B%20width%3A%207.7826in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3EName%20of%20the%20adapter%20transport%20type%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CUL%20style%3D%22margin-left%3A%20.375in%3B%20direction%3A%20ltr%3B%20unicode-bidi%3A%20embed%3B%20margin-top%3A%200in%3B%20margin-bottom%3A%200in%3B%22%20type%3D%22disc%22%3E%0A%3CLI%20style%3D%22margin-top%3A%200%3B%20margin-bottom%3A%200%3B%20vertical-align%3A%20middle%3B%22%3E%3CFONT%20size%3D%224%22%3E%3CSPAN%20style%3D%22font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3EOffice365%20Outlook%20Email%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-top%3A%200%3B%20margin-bottom%3A%200%3B%20vertical-align%3A%20middle%3B%22%3E%3CFONT%20size%3D%224%22%3E%3CSPAN%20style%3D%22font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3EOffice365%20Outlook%20Calendar%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-top%3A%200%3B%20margin-bottom%3A%200%3B%20vertical-align%3A%20middle%3B%22%3E%3CFONT%20size%3D%224%22%3E%3CSPAN%20style%3D%22font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3EOffice365%20Outlook%20Contact%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20style%3D%22vertical-align%3A%20top%3B%20width%3A%201.4423in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3EPortAddress%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22vertical-align%3A%20top%3B%20width%3A%207.852in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3EAny%20unique%20identifier%20for%20the%20dynamic%20send%20port.%20Typically%20it%20is%20a%20user-friendly%20string.%20Since%20we're%20using%20an%20Office%20365%20account%2C%20we%20used%20an%20email%20address%20(e.g.%2C%20BizTalkAccount1%40outlook.com).%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20style%3D%22vertical-align%3A%20top%3B%20width%3A%201.4423in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3ETo%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22vertical-align%3A%20top%3B%20width%3A%207.7826in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3E(only%20for%20O365%20Email)%20Email%20address%20to%20send%20mails%20to%2C%20if%20the%20transport%20type%20is%20Office%20365%20Outlook%20Email.%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20style%3D%22vertical-align%3A%20top%3B%20width%3A%201.4423in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3ESubject%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22vertical-align%3A%20top%3B%20width%3A%207.7826in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3E(only%20for%20O365%20Email)%20Email%20subject%20.%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20style%3D%22vertical-align%3A%20top%3B%20width%3A%201.4423in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3ECalendar%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22vertical-align%3A%20top%3B%20width%3A%207.8368in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3E(only%20for%20O365%20Calendar)%20Calendar%20where%20the%20calendar%20items%20are%20created%2C%20when%20using%20Office%20365%20Outlook%20Calendar%20transport%20type.%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20style%3D%22vertical-align%3A%20top%3B%20width%3A%201.4423in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3EPayload%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22vertical-align%3A%20top%3B%20width%3A%207.7826in%3B%20padding%3A%204pt%204pt%204pt%204pt%3B%20border%3A%201pt%20solid%20%23A3A3A3%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3E%26lt%3BSPAN%20style%3D%22font-style%3A%20italic%3B%22%26gt%3Bcontent%26lt%3B%2FSPAN%26gt%3B%5D%5D%20where%20content%20can%20be%20either%3A%26lt%3B%2FFONT%26gt%3B%26lt%3B%2FP%26gt%3B%0A%26lt%3BUL%20style%3D%22margin-left%3A%20.375in%3B%20direction%3A%20ltr%3B%20unicode-bidi%3A%20embed%3B%20margin-top%3A%200in%3B%20margin-bottom%3A%200in%3B%22%20type%3D%22disc%22%26gt%3B%0A%26lt%3BLI%20style%3D%22margin-top%3A%200%3B%20margin-bottom%3A%200%3B%20vertical-align%3A%20middle%3B%22%26gt%3B%26lt%3BFONT%20size%3D%224%22%26gt%3B%26lt%3BSPAN%20style%3D%22font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%26gt%3BEmail%20body%26lt%3B%2FSPAN%26gt%3B%26lt%3B%2FFONT%26gt%3B%26lt%3B%2FLI%26gt%3B%0A%26lt%3BLI%20style%3D%22margin-top%3A%200%3B%20margin-bottom%3A%200%3B%20vertical-align%3A%20middle%3B%22%26gt%3B%26lt%3BFONT%20size%3D%224%22%26gt%3B%26lt%3BSPAN%20style%3D%22font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%26gt%3BCalendar%20item%20in%20XML%20according%20to%20the%20Office365OutlookCalendarSend.xsd%20provided%20in%20the%20BizTalk%20installation%20folder%20under%20SDK%5CSchemas.%26lt%3B%2FSPAN%26gt%3B%26lt%3B%2FFONT%26gt%3B%26lt%3B%2FLI%26gt%3B%0A%26lt%3BLI%20style%3D%22margin-top%3A%200%3B%20margin-bottom%3A%200%3B%20vertical-align%3A%20middle%3B%22%26gt%3B%26lt%3BFONT%20size%3D%224%22%26gt%3B%26lt%3BSPAN%20style%3D%22font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%26gt%3BContact%20item%20in%20XML%20following%20the%20Office365OutlookContactSend.xsd%20in%20the%20same%20location.%26lt%3B%2FSPAN%26gt%3B%26lt%3B%2FFONT%26gt%3B%26lt%3B%2FLI%26gt%3B%0A%26lt%3B%2FUL%26gt%3B%0A%26lt%3BP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%26gt%3B%26lt%3BFONT%20size%3D%224%22%26gt%3BCDATA%20is%20used%20to%20make%20the%20XML%20payloads%20(calendar%20and%20contact)%20opaque%20to%20XML%20parsers%20on%20the%20receive%20side.%20The%20payloads%20are%20used%20on%20the%20send%20side.%26lt%3B%2FFONT%26gt%3B%26lt%3B%2FP%26gt%3B%0A%26lt%3B%2FTD%26gt%3B%0A%26lt%3B%2FTR%26gt%3B%0A%26lt%3B%2FTBODY%26gt%3B%0A%26lt%3B%2FTABLE%26gt%3B%0A%26lt%3BP%26gt%3B%26lt%3BFONT%20size%3D%224%22%26gt%3B%26nbsp%3B%26lt%3B%2FFONT%26gt%3B%26lt%3B%2FP%26gt%3B%0A%26lt%3BP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%26gt%3B%26lt%3BFONT%20size%3D%224%22%26gt%3BIn%20the%20case%20of%20calendar%20and%20contact%20items%2C%20the%20payloads%20are%20based%20on%20the%20schemas%20provided%20in%20the%20BizTalk%20installation%20folder%20under%20%26lt%3BSPAN%20style%3D%22font-style%3A%20italic%3B%22%26gt%3BC%3A%5CProgram%20Files%20(x86)%5CMicrosoft%20BizTalk%20Server%5CSDK%5CSchemas%20%26lt%3B%2FSPAN%26gt%3B(more%20info%20in%20%26lt%3BA%20href%3D%22%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Foffice-365-outlook-adapters-in-action%2Fba-p%2F1230054%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Foffice-365-outlook-adapters-in-action%2Fba-p%2F1230054%3C%2FA%3E%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%26gt%3BOffice%20365%20Outlook%20Adapters%20in%20Action%26lt%3B%2FA%26gt%3B).%26lt%3B%2FFONT%26gt%3B%26lt%3B%2FP%26gt%3B%0A%26lt%3BP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%26gt%3B%26nbsp%3B%26lt%3B%2FP%26gt%3B%0A%26lt%3BP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%26gt%3B%26lt%3BFONT%20size%3D%224%22%20color%3D%22%23000000%22%26gt%3B%26lt%3BSTRONG%26gt%3BExamples%26lt%3B%2FSTRONG%26gt%3B%26lt%3B%2FFONT%26gt%3B%26lt%3B%2FP%26gt%3B%0A%26lt%3BP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%26gt%3B%26nbsp%3B%26lt%3B%2FP%26gt%3B%0A%26lt%3BTABLE%20style%3D%22background-color%3A%20lightgrey%3B%22%26gt%3B%0A%26lt%3BTBODY%26gt%3B%0A%26lt%3BTR%26gt%3B%0A%26lt%3BTD%26gt%3B%0A%26lt%3BP%26gt%3B%26lt%3BFONT%20size%3D%224%22%26gt%3B%26lt%3BSTRONG%26gt%3BEmail%26lt%3B%2FSTRONG%26gt%3B%26lt%3B%2FFONT%26gt%3B%26lt%3B%2FP%26gt%3B%0A%26lt%3B%2FTD%26gt%3B%0A%26lt%3B%2FTR%26gt%3B%0A%26lt%3BTR%26gt%3B%0A%26lt%3BTD%26gt%3B%26lt%3Bpre%20class%3D%22lia-code-sample%20language-html%22%26gt%3B%26lt%3Bcode%26gt%3B%26lt%3Bns0%3ARoot%20xmlns%3Ans0%3D%22%3CA%20href%3D%22http%3A%2F%2FDynamicO365SendPort.ReceiveSchema%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttp%3A%2F%2FDynamicO365SendPort.ReceiveSchema%3C%2FA%3E%22%26gt%3B%0A%20%20%20%20%26lt%3BUserTokenIdentifier%26gt%3Bnnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn%26lt%3B%2FUserTokenIdentifier%26gt%3B%0A%20%20%20%20%26lt%3BPortType%26gt%3BOffice365%20Outlook%20Email%26lt%3B%2FPortType%26gt%3B%0A%20%20%20%20%26lt%3BPortAddress%26gt%3BBizTalkAccount1%40outlook.com%26lt%3B%2FPortAddress%26gt%3B%0A%20%20%20%20%26lt%3BTo%26gt%3BBizTalkAccount2%40outlook.com%26lt%3B%2FTo%26gt%3B%0A%20%20%20%20%26lt%3BSubject%26gt%3BHello%26lt%3B%2FSubject%26gt%3B%0A%20%20%20%20%26lt%3BPayload%26gt%3B%26lt%3B!%5BCDATA%5B%26lt%3B%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%26gt%3B%26lt%3BEmailBody%26gt%3Bbody%26lt%3B%2FEmailBody%26gt%3B%0A%0A%3C%2FFONT%3E%3C%2FP%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%20style%3D%22background-color%3A%20lightgrey%3B%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%3E%0A%3CP%3E%3CSTRONG%3ECalendar%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CPRE%20class%3D%22lia-code-sample%20language-html%22%3E%3CCODE%3E%3CROOT%20ns0%3D%22http%3A%2F%2FDynamicO365SendPort.ReceiveSchema%22%3E%0A%20%20%20%20%3CUSERTOKENIDENTIFIER%3Ennnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn%3C%2FUSERTOKENIDENTIFIER%3E%0A%20%20%20%20%3CPORTTYPE%3EOffice365%20Outlook%20Calendar%3C%2FPORTTYPE%3E%0A%20%20%20%20%3CPORTADDRESS%3EBizTalkAccount1%40outlook.com%3C%2FPORTADDRESS%3E%0A%20%20%20%20%3CTO%3EBizTalkAccount2%40outlook.com%3C%2FTO%3E%0A%20%20%20%20%3CSUBJECT%3EHello%3C%2FSUBJECT%3E%0A%20%20%20%20%3CCALENDAR%3ECalendar%3C%2FCALENDAR%3E%0A%20%20%20%20%3CPAYLOAD%3E%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bns0%3AEvent%20xmlns%3Ans0%3D%22http%3A%2F%2Fschemas.microsoft.com%2FBizTalk%2FOffice365OutlookCalendar%2FSend%22%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bsubject%26gt%3BLet's%20meet%26lt%3B%2Fsubject%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bbody%26gt%3B%26lt%3Bcontent%26gt%3BInfo%20for%20the%20upcoming%20meeting%26lt%3B%2Fcontent%26gt%3B%26lt%3B%2Fbody%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bstart%26gt%3B%26lt%3BdateTime%26gt%3B2020-06-25%26lt%3B%2FdateTime%26gt%3B%26lt%3BtimeZone%26gt%3BPacific%20Standard%20Time%26lt%3B%2FtimeZone%26gt%3B%26lt%3B%2Fstart%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bend%26gt%3B%26lt%3BdateTime%26gt%3B2020-06-25%26lt%3B%2FdateTime%26gt%3B%26lt%3BtimeZone%26gt%3BPacific%20Standard%20Time%26lt%3B%2FtimeZone%26gt%3B%26lt%3B%2Fend%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Battendees%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3BemailAddress%26gt%3B%26lt%3Baddress%26gt%3BBizTalkAccount2%40outlook.com%26lt%3B%2Faddress%26gt%3B%26lt%3Bname%26gt%3BBizTalkAccount2%26lt%3B%2Fname%26gt%3B%26lt%3B%2FemailAddress%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3B%2Fattendees%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%26lt%3B%2Fns0%3AEvent%26gt%3B%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%3C%2FPAYLOAD%3E%0A%3C%2FROOT%3E%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%20style%3D%22background-color%3A%20lightgrey%3B%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%3E%0A%3CP%3E%3CSTRONG%3EContact%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CPRE%20class%3D%22lia-code-sample%20language-html%22%3E%3CCODE%3E%3CROOT%20ns0%3D%22http%3A%2F%2FDynamicO365SendPort.ReceiveSchema%22%3E%0A%20%20%20%20%3CUSERTOKENIDENTIFIER%3Ennnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn%3C%2FUSERTOKENIDENTIFIER%3E%0A%20%20%20%20%3CPORTTYPE%3EOffice365%20Outlook%20Contact%3C%2FPORTTYPE%3E%0A%20%20%20%20%3CPORTADDRESS%3EBizTalkAccount1%40outlook.com%3C%2FPORTADDRESS%3E%0A%20%20%20%20%3CTO%3EBizTalkAccount2%40outlook.com%3C%2FTO%3E%0A%20%20%20%20%3CSUBJECT%3EHello%3C%2FSUBJECT%3E%0A%20%20%20%20%3CPAYLOAD%3E%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bns0%3AContact%20xmlns%3Ans0%3D%22http%3A%2F%2Fschemas.microsoft.com%2FBizTalk%2FOffice365OutlookContacts%2FSend%22%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3BdisplayName%26gt%3BdisplayName_3%26lt%3B%2FdisplayName%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20more%20contact%20fields%0A%20%20%20%20%20%20%20%20%20%20%20%26lt%3B%2Fns0%3AContact%26gt%3B%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%3C%2FPAYLOAD%3E%0A%3C%2FROOT%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20color%3D%22%230000FF%22%3E%3CSTRONG%3E%26nbsp%3B%3CFONT%20size%3D%224%22%3EDynamic%20Send%20Port%20Configuration%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3ETo%20keep%20things%20simple%2C%20an%20XML%20document%20is%20created%20on%20the%20fly%20and%20properties%20are%20added.%20The%20message%20creation%20expression%20is%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3EXMLMessage%20%3D%20new%20System.Xml.XmlDocument()%3B%0A%0A%2F%2F%20Payload%20from%20the%20CDATA%20section%20of%20received%20messages%0AXMLMessage.LoadXml(ReceivedMessage.Payload)%3B%0A%0A%2F%2F%20Token%20identifier%20(required)%0AXMLMessage(OfficeMail.UserTokenIdentifier)%20%3D%20ReceivedMessage.UserTokenIdentifier%3B%20%0AXMLMessage(OfficeCalendar.UserTokenIdentifier)%20%3D%20ReceivedMessage.UserTokenIdentifier%3B%0AXMLMessage(OfficeContact.UserTokenIdentifier)%20%3D%20ReceivedMessage.UserTokenIdentifier%3B%0A%0A%2F%2F%20Transport%20type%20(required)%0ASendPort(Microsoft.XLANGs.BaseTypes.TransportType)%20%3D%20ReceivedMessage.PortType%3B%0A%0A%2F%2F%20Port%20address%0ASendPort(Microsoft.XLANGs.BaseTypes.Address)%20%3D%20PortAddress%3B%20%2F%2F%20Generated%20in%20separate%20expression.%0A%0A%2F%2F%20Additional%20fields%20for%20Mail%20transport%20type%0AXMLMessage(OfficeMail.To)%20%3D%20ReceivedMessage.To%3B%0AXMLMessage(OfficeMail.Subject)%20%3D%20ReceivedMessage.Subject%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3E%3CEM%3ENote%3C%2FEM%3E%3A%20Additional%20promoted%20are%20available%20for%20Mail%20transport%20type%2C%20such%20as%20CC%2C%20importance%20and%20attached%20files%20(see%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Foffice365-mail-adapter%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOffice%20365%20Outlook%20Email%20Adapter%3C%2FA%3E).%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EThe%20port%20address%20is%20generated%20from%20received%20messages%20by%20using%20the%20following%20expression%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3Eif%20(ReceivedMessage.PortType%20%3D%3D%20%22Office365%20Outlook%20Email%22)%0A%7B%0A%20%20%20%20PortAddress%20%3D%20%22O365Mail%3A%2F%2F%22%20%2B%20ReceivedMessage.PortAddress%3B%0A%7D%0Aelse%20if%20(ReceivedMessage.PortType%20%3D%3D%20%22Office365%20Outlook%20Calendar%22)%0A%7B%0A%20%20%20%20PortAddress%20%3D%20%22O365Calendar%3A%2F%2F%22%20%2B%20ReceivedMessage.PortAddress%20%2B%20%22%2FMyCalendars%2F%22%20%2B%20ReceivedMessage.Calendar%3B%0A%7D%0Aelse%20if%20(ReceivedMessage.PortType%20%3D%3D%20%22Office365%20Outlook%20Contact%22)%0A%7B%0A%20%20%20%20PortAddress%20%3D%20%22O365Contact%3A%2F%2F%22%20%2B%20ReceivedMessage.PortAddress%3B%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%20color%3D%22%230000FF%22%3E%3CSTRONG%3EPutting%20it%20all%20together%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3EThe%20annotated%20view%20of%20the%20demo%20orchestration%20below%20illustrates%20the%20data%20flow.%20Received%20messages%20provide%20UserTokenIdentifiers%20and%20transport%20type%20to%20be%20used%20for%20the%20messages%20sent%20by%20the%20dynamic%20send%20port.%26nbsp%3B%3C%2FFONT%3E%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%22O365DynamicSPOrch.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F215701iEC1B1CAEE984A35D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22O365DynamicSPOrch.jpg%22%20alt%3D%22O365DynamicSPOrch.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%224%22%3EBizTalk%20code%20is%20attached%20to%20this%20post%20for%20reference.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1624008%22%20slang%3D%22en-US%22%3E%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3EBizTalk%202020%20CU1%20introduced%20%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Fhelp%2F4566495%2Fimprovement-enables-the-dynamic-send-ports-in-biztalk-server-to-suppor%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Esupport%20for%20dynamic%20send%20ports%3C%2FA%3E%20in%20the%20Office%20365%20Outlook%20adapters.%20In%20this%20post%2C%20we%20go%20into%20more%20details%20with%20code%20samples.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1624008%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBizTalk%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EBizTalk%20Adapters%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EBizTalk%20Server%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOrchestrations%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E

BizTalk 2020 CU1 introduced support for dynamic send ports in the Office 365 Outlook adapters. In this post, we go over this improvement into more details.

 

Pre-requisites

 

Messages sent from a dynamic send port with transport type set to one of the Office 365 Outlook adapters need to provide the UserTokenIdentifier context property. This identifier is created when the user signs in to Office 365, which is done when creating a static send port, in the transport properties of the Office 365 Outlook adapters as documented in Office 365 Outlook adapters in BizTalk.

 

Once a user is signed-in, the UserTokenIdentifier is retrieved from the bindings, as shown below, in the case of an exported Mail send port (placeholder nnnnnnnn-nnnn-nnnn-nnnnnnnnnnnn):

 

<SendPort Name="MailSendPort2" IsStatic="true" IsTwoWay="false" BindingOption="0" AnalyticsEnabled="false">
      <Description xsi:nil="true" />
      <TransmitPipeline 
           Name="Microsoft.BizTalk.DefaultPipelines.PassThruTransmit" 
           FullyQualifiedName="Microsoft.BizTalk.DefaultPipelines.PassThruTransmit, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral,                     
               PublicKeyToken=31bf3856ad364e35" Type="2" TrackingOption="None" Description="" />
      <PrimaryTransport>
        <Address>O365Mail://BizTalkTestAccount1@outlook.com</Address>
        <TransportType Name="Office365 Outlook Email" Capabilities="11" ConfigurationClsid="48b96e09-bd96-4f46-95ef-57accc55f23d" />
        <TransportTypeData>&lt;CustomProps&gt;&lt;DefaultCC vt="8" /&gt;&lt;UserTokenIdentifier vt="8"&gt;nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn&lt;/UserTokenIdentifier&gt;&lt;FileAttachments vt="8" /&gt;&lt;DefaultTo vt="8"&gt;BizTalkTestAccount2@outlook.com&lt;/DefaultTo&gt;&lt;EmailAddress vt="8"&gt;BizTalkTestAccount1@outlook.com&lt;/EmailAddress&gt;&lt;AttachBizTalkMessageParts vt="11"&gt;0&lt;/AttachBizTalkMessageParts&gt;&lt;DefaultSubject vt="8"&gt;Hi from BizTalkTestAccount1&lt;/DefaultSubject&gt;&lt;DefaultImportance vt="8"&gt;Normal&lt;/DefaultImportance&gt;&lt;/CustomProps&gt;</TransportTypeData>

 

 

Note that the UserTokenIdentifier is tied to a signed-in account and a transport type.  A static send port needs to be created for each Office 365 transport type in order to get an identifier for each. For a given sign-in, the value of the UserTokenIdentifier may be the same for all Office 365 transport types, but static send ports need to be created for each transport type nonetheless.

 

Other important points to be aware of:

  • Static send ports can be deleted afterwards. They are not needed once the UserTokenIdentifiers are known.
  • UserTokenIdentifiers remain valid regardless of whether a dynamic or static send port exists or not, and after port deletions.
  • The same UserTokenIdentifier can be used by multiple ports.

 

Scenario

 

The demo scenario is based on a simple orchestration:

 

O365DynPortOrch.JPG

 

Received messages follow the schema:

 

O365DynPortInputSchema.JPG

 

Element

Description

UserTokenIdentifier

Value of the UserTokenIdenfier acquired ahead of time by exporting the static ports.

The UserTokenIdentifier is provided by received messages. In the general case, the UserTokenIdentifier can come from any source. For instance one could keep a mapping of email addresses to UserTokenIdentifiers and make this mapping available for lookup at runtime.

PortType

Name of the adapter transport type:

  • Office365 Outlook Email
  • Office365 Outlook Calendar
  • Office365 Outlook Contact

PortAddress

Any unique identifier for the dynamic send port. Typically it is a user-friendly string. Since we're using an Office 365 account, we used an email address (e.g., BizTalkAccount1@outlook.com).

To

(only for O365 Email) Email address to send mails to, if the transport type is Office 365 Outlook Email.

Subject

(only for O365 Email) Email subject .

Calendar

(only for O365 Calendar) Calendar where the calendar items are created, when using Office 365 Outlook Calendar transport type.

Payload

<![CDATA[content]] where content can be either:

  • Email body
  • Calendar item in XML according to the Office365OutlookCalendarSend.xsd provided in the BizTalk installation folder under SDK\Schemas.
  • Contact item in XML following the Office365OutlookContactSend.xsd in the same location.

CDATA is used to make the XML payloads (calendar and contact) opaque to XML parsers on the receive side. The payloads are used on the send side.

 

In the case of calendar and contact items, the payloads are based on the schemas provided in the BizTalk installation folder under C:\Program Files (x86)\Microsoft BizTalk Server\SDK\Schemas (more info in Office 365 Outlook Adapters in Action).

 

Examples

 

Email

<ns0:Root xmlns:ns0="http://DynamicO365SendPort.ReceiveSchema">
    <UserTokenIdentifier>nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn</UserTokenIdentifier>
    <PortType>Office365 Outlook Email</PortType>
    <PortAddress>BizTalkAccount1@outlook.com</PortAddress>
    <To>BizTalkAccount2@outlook.com</To>
    <Subject>Hello</Subject>
    <Payload><![CDATA[<?xml version="1.0" encoding="utf-8"?><EmailBody>body</EmailBody>]]></Payload>
</ns0:Root>

 

Calendar

<ns0:Root xmlns:ns0="http://DynamicO365SendPort.ReceiveSchema">
    <UserTokenIdentifier>nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn</UserTokenIdentifier>
    <PortType>Office365 Outlook Calendar</PortType>
    <PortAddress>BizTalkAccount1@outlook.com</PortAddress>
    <To>BizTalkAccount2@outlook.com</To>
    <Subject>Hello</Subject>
    <Calendar>Calendar</Calendar>
    <Payload>
        <![CDATA[
            <ns0:Event xmlns:ns0="http://schemas.microsoft.com/BizTalk/Office365OutlookCalendar/Send">
                <subject>Let's meet</subject>
                <body><content>Info for the upcoming meeting</content></body>
                <start><dateTime>2020-06-25</dateTime><timeZone>Pacific Standard Time</timeZone></start>
                <end><dateTime>2020-06-25</dateTime><timeZone>Pacific Standard Time</timeZone></end>
                <attendees>
                    <emailAddress><address>BizTalkAccount2@outlook.com</address><name>BizTalkAccount2</name></emailAddress>
                </attendees>
           </ns0:Event>
        ]]>
    </Payload>
</ns0:Root>

 

Contact

<ns0:Root xmlns:ns0="http://DynamicO365SendPort.ReceiveSchema">
    <UserTokenIdentifier>nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn</UserTokenIdentifier>
    <PortType>Office365 Outlook Contact</PortType>
    <PortAddress>BizTalkAccount1@outlook.com</PortAddress>
    <To>BizTalkAccount2@outlook.com</To>
    <Subject>Hello</Subject>
    <Payload>
        <![CDATA[
            <ns0:Contact xmlns:ns0="http://schemas.microsoft.com/BizTalk/Office365OutlookContacts/Send">
                <displayName>displayName_3</displayName>
                more contact fields
           </ns0:Contact>
        ]]>
    </Payload>
</ns0:Root>

 

 Dynamic Send Port Configuration

 

To keep things simple, an XML document is created on the fly and properties are added. The message creation expression is:

XMLMessage = new System.Xml.XmlDocument();

// Payload from the CDATA section of received messages
XMLMessage.LoadXml(ReceivedMessage.Payload);

// Token identifier (required)
XMLMessage(OfficeMail.UserTokenIdentifier) = ReceivedMessage.UserTokenIdentifier; 
XMLMessage(OfficeCalendar.UserTokenIdentifier) = ReceivedMessage.UserTokenIdentifier;
XMLMessage(OfficeContact.UserTokenIdentifier) = ReceivedMessage.UserTokenIdentifier;

// Transport type (required)
SendPort(Microsoft.XLANGs.BaseTypes.TransportType) = ReceivedMessage.PortType;

// Port address
SendPort(Microsoft.XLANGs.BaseTypes.Address) = PortAddress; // Generated in separate expression.

// Additional fields for Mail transport type
XMLMessage(OfficeMail.To) = ReceivedMessage.To;
XMLMessage(OfficeMail.Subject) = ReceivedMessage.Subject;

Note: Additional promoted are available for Mail transport type, such as CC, importance and attached files (see Office 365 Outlook Email Adapter).

 

The port address is generated from received messages by using the following expression:

if (ReceivedMessage.PortType == "Office365 Outlook Email")
{
    PortAddress = "O365Mail://" + ReceivedMessage.PortAddress;
}
else if (ReceivedMessage.PortType == "Office365 Outlook Calendar")
{
    PortAddress = "O365Calendar://" + ReceivedMessage.PortAddress + "/MyCalendars/" + ReceivedMessage.Calendar;
}
else if (ReceivedMessage.PortType == "Office365 Outlook Contact")
{
    PortAddress = "O365Contact://" + ReceivedMessage.PortAddress;
}

 

Putting it all together

 

The annotated view of the demo orchestration below illustrates the data flow. Received messages provide UserTokenIdentifiers and transport type to be used for the messages sent by the dynamic send port. 

 

O365DynamicSPOrch.jpg

 

BizTalk code is attached to this post for reference.