Azure Application Insights - availability testing with basic auth? -


i trying setup availability testing (url ping test) azure application insights on endpoint requires basic authentication. seems standard approach https://username:password@myendpoint.com isn't accepted azure (error message says url malformed , maybe missing https/http @ beginning).

is there other way achieve except of using multi-step web test or azure functions, assuming want stay in azure ecosystem? :)

passing basic auth credentials in url has been deprecated rfc 3986 (here snippet rfc)

3.2.1. user information

the userinfo subcomponent may consist of user name and, optionally, scheme-specific information how gain authorization access resource. user information, if present, followed commercial at-sign ("@") delimits host.

  userinfo    = *( unreserved / pct-encoded / sub-delims / ":" ) 

use of format "user:password" in userinfo field deprecated.

the alternate use authorization header pass credentials. here snippet wikipedia (basic auth) on how header constructed.

the authorization field constructed follows:[6]

  1. the username , password combined single colon. (:)
  2. the resulting string encoded octet sequence.[7]
  3. the resulting string encoded using variant of base64.[8]
  4. the authorization method , space prepended encoded string, separated space (e.g. "basic ").

for example, if browser uses aladdin username , opensesame password, field's value base64-encoding of aladdin:opensesame, or qwxhzgrpbjppcgvuu2vzyw1l. authorization header appear as:

authorization: basic qwxhzgrpbjppcgvuu2vzyw1l 

you can create web test file in visual studio , upload in application insights , use that. refer doc: https://docs.microsoft.com/en-us/azure/application-insights/app-insights-monitor-web-app-availability

  1. in visual studio, can create webtest project.
  2. right click on project name , select add request. enter image description here
  3. now right click on link , select add header. enter image description here
  4. you can add headers per requirement. enter image description here
  5. when review .webtest file see headers section gets appended under requests.
<request>   <headers>     <header name="authorization" value="basic qwxhzgrpbjppcgvuu2vzyw1l" />   </headers> </request> 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -