@@ -67,6 +67,46 @@ describe("DurableTaskAzureManagedConnectionString", () => {
6767 "The connection string must contain a TaskHub property" ,
6868 ) ;
6969 } ) ;
70+
71+ it ( "should parse connection string with all-lowercase keys" , ( ) => {
72+ const connectionString = new DurableTaskAzureManagedConnectionString (
73+ "endpoint=https://example.com;authentication=ManagedIdentity;taskhub=myTaskHub" ,
74+ ) ;
75+
76+ expect ( connectionString . getEndpoint ( ) ) . toBe ( "https://example.com" ) ;
77+ expect ( connectionString . getAuthentication ( ) ) . toBe ( "ManagedIdentity" ) ;
78+ expect ( connectionString . getTaskHubName ( ) ) . toBe ( "myTaskHub" ) ;
79+ } ) ;
80+
81+ it ( "should parse connection string with all-uppercase keys" , ( ) => {
82+ const connectionString = new DurableTaskAzureManagedConnectionString (
83+ "ENDPOINT=https://example.com;AUTHENTICATION=ManagedIdentity;TASKHUB=myTaskHub" ,
84+ ) ;
85+
86+ expect ( connectionString . getEndpoint ( ) ) . toBe ( "https://example.com" ) ;
87+ expect ( connectionString . getAuthentication ( ) ) . toBe ( "ManagedIdentity" ) ;
88+ expect ( connectionString . getTaskHubName ( ) ) . toBe ( "myTaskHub" ) ;
89+ } ) ;
90+
91+ it ( "should parse connection string with mixed-case keys" , ( ) => {
92+ const connectionString = new DurableTaskAzureManagedConnectionString (
93+ "endPoint=https://example.com;AUTHENTICATION=ManagedIdentity;taskHub=myTaskHub" ,
94+ ) ;
95+
96+ expect ( connectionString . getEndpoint ( ) ) . toBe ( "https://example.com" ) ;
97+ expect ( connectionString . getAuthentication ( ) ) . toBe ( "ManagedIdentity" ) ;
98+ expect ( connectionString . getTaskHubName ( ) ) . toBe ( "myTaskHub" ) ;
99+ } ) ;
100+
101+ it ( "should preserve value casing with case-insensitive keys" , ( ) => {
102+ const connectionString = new DurableTaskAzureManagedConnectionString (
103+ "endpoint=https://MyHost.example.com;authentication=ManagedIdentity;taskhub=MyTaskHub;clientid=My-Client-ID" ,
104+ ) ;
105+
106+ expect ( connectionString . getEndpoint ( ) ) . toBe ( "https://MyHost.example.com" ) ;
107+ expect ( connectionString . getTaskHubName ( ) ) . toBe ( "MyTaskHub" ) ;
108+ expect ( connectionString . getClientId ( ) ) . toBe ( "My-Client-ID" ) ;
109+ } ) ;
70110 } ) ;
71111
72112 describe ( "getAdditionallyAllowedTenants" , ( ) => {
@@ -87,6 +127,16 @@ describe("DurableTaskAzureManagedConnectionString", () => {
87127
88128 expect ( connectionString . getAdditionallyAllowedTenants ( ) ) . toBeUndefined ( ) ;
89129 } ) ;
130+
131+ it ( "should match property name case-insensitively" , ( ) => {
132+ const connectionStringWithTenants =
133+ VALID_CONNECTION_STRING + ";additionallyallowedtenants=tenant1,tenant2" ;
134+
135+ const connectionString = new DurableTaskAzureManagedConnectionString ( connectionStringWithTenants ) ;
136+ const tenants = connectionString . getAdditionallyAllowedTenants ( ) ;
137+
138+ expect ( tenants ) . toEqual ( [ "tenant1" , "tenant2" ] ) ;
139+ } ) ;
90140 } ) ;
91141
92142 describe ( "getClientId" , ( ) => {
0 commit comments