Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<base />
<!-- Retrieve the secret from Key Vault using a managed identity -->
<send-request mode="new" response-variable-name="secretResponse" timeout="20" ignore-error="false">
<authentication-managed-identity resource="" />
<!-- Place the secret into a local variable -->
<set-variable name="secret" value="@{
var secret = ((IResponse)context.Variables["secretResponse"]).Body.As<JObject>();
return secret["value"].ToString();
}" />
<!-- Remove the subscription key from the header -->
<set-header name="Ocp-Apim-Subscription-Key" exists-action="delete" />
<!-- Use the password in the header -->
<authentication-basic username="zohan" password="@((string)context.Variables["secret"])" />
<rewrite-uri template="?item={id}" />
<set-backend-service base-url="" />
<base />
<base />
<base />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment