I also had this issue. However, using the new Azure Powershell cmdlets worked as expected.
Deploy custom policies with Azure Pipelines changing the charset encoding
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 but after deployment it is
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.
5 answers
Sort by: Most helpful
-
-
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..... -
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 $headersTo
$response = Invoke-RestMethod -Uri $graphuri -Method Put -Body $policycontent -Headers $headers -ContentType "application/xml; charset=utf-8"This change fixed the issue.
-
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
-
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