Deploy custom policies with Azure Pipelines changing the charset encoding

AB 156 Reputation points
2020-03-17T12:18:21.87+00:00

I'm following this article to deploy my custom policies. I have enabled localisation in policies and providing translations for English and Spanish. By deploying manually there is no issues. But while using pipeline to deploy, my Spanish translation getting some issue:

My actual text is 4681-1.png but after deployment it is 4691-2.png

I found that this statement is making the issue:

$response = Invoke-RestMethod -Uri $graphuri -Method Put -Body $policycontent -Headers $headers  

So tried to pass content-type as utf-8 in header too, but that doesn't worked. When i generate the file and stores into a blob storage everything is fine, i have the text without any problem.

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,639 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Anonymous
    2020-03-17T12:30:22.457+00:00

    I also had this issue. However, using the new Azure Powershell cmdlets worked as expected.


  2. Pradeep Kumar 1 Reputation point
    2021-04-28T05:41:52.957+00:00

    Hi

    I also had same issue while deploying with Azure Pipelines.
    Have you got any solution? can anyone please help me on this.....

    0 comments No comments

  3. Pradeep Kumar 1 Reputation point
    2021-05-25T10:52:02.833+00:00

    Hi All,

    I got a solution for this after doing trail and error method on deployment script.

    I have changed the line in the script below.

    from
    $response = Invoke-RestMethod -Uri $graphuri -Method Put -Body $policycontent -Headers $headers

    To
    $response = Invoke-RestMethod -Uri $graphuri -Method Put -Body $policycontent -Headers $headers -ContentType "application/xml; charset=utf-8"

    This change fixed the issue.

    0 comments No comments

  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  5. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more