Not sure if my previous comment was posted successfully, so reposting here: I think we might still have a problem with the editor on Azure Portal. Now when using Named Values in a Policy, the online Editor complains that we need to include an @ before an Expression. However, for Named Values used in a policy, the documentation does not specify this and it makes sense. For example:
<set-backend-service id="apim-generated-policy" backend-id="ECHO_{{Backend-ENV-ID}}" />
(above is NOT accepted in the Azure Portal Editor)
is not the same as
<set-backend-service id="apim-generated-policy" backend-id="ECHO_@{{Backend-ENV-ID}}" />
(above is accepted in the Azure Portal Editor)
We are able to successfully use Set-AzApiManagementPolicy to upload a policy without the @ before {{}} when specifying a Named Value.