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]
- the username , password combined single colon. (:)
- the resulting string encoded octet sequence.[7]
- the resulting string encoded using variant of base64.[8]
- 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
- in visual studio, can create webtest project.
- right click on project name , select add request.
- now right click on link , select add header.
- you can add headers per requirement.
- when review .webtest file see headers section gets appended under requests.
<request> <headers> <header name="authorization" value="basic qwxhzgrpbjppcgvuu2vzyw1l" /> </headers> </request>
Comments
Post a Comment