Question 126 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question 126 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question

HOTSPOT - You are working for Contoso, Ltd.

You define an API Policy object by using the following XML markup:

<set-variable name= “bodySize” value="@ (context Request .Headers[“Content-Length”] [0])”/>
<choose>
<when condition= “@(int.Parse (context.Variables.GetValueOrDefault<string> (“bodySize”) )<512000)”>
</when>
<otherwise>
<rewrite-uri template= ‘/put”/>
<set-backend-service base-url= “http://contoso.com/api/9.1/"/>
</otherwise>
</choose>

For each of the following statements, select Yes if the statement is true.

Otherwise, select No.

NOTE: Each correct selection is worth one point.

Hot Area:

Answer Area

Statement Yes
The XML segment belongs in the <inbound> section of the policy. °
If the body size is >256k, an error will occur. fe)

If the request is http://contoso.com/api/9.2/, the policy will retain the higher version. O

No

Explanations

Answer Area

Statement Yes
The XML segment belongs in the <inbound> section of the policy. [0
If the body size is >256k, an error will occur. fe)

If the request is http://contoso.com/api/9.2/, the policy will retain the higher version. O

Box 1: Yes - Use the set-backend-service policy to redirect an incoming request to a different backend than the one specified in the API settings for that operation.

Syntax: &amp;lt;set-backend-service base-url="base URL of the backend service" /&amp;gt; Box 2: No - The condition is on 512k, not on 256k.

Box 3: No - The set-backend-service policy changes the backend service base URL of the incoming request to the one specified in the policy.

https://docs.microsoft.com/en-us/azure/api-management/api-management-transformation-policies