หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
This diagnostic occurs when you assign a value of a mismatched data type.
Description
Expected a value of type <data-type> but the provided value is of type <data-type>.
Level
Warning / Error
Solution
Use the expected data type. If the provided value is a token, enclose it in the any() function to mitigate the issue.
Examples
The following example raises the diagnostic because the expected data type is a string. The actual provided value is an integer:
var myValue = 5
output myString string = myValue
You can fix the diagnostic by providing a string value:
var myValue = '5'
output myString string = myValue
Next steps
For more information about Bicep diagnostics, see Bicep core diagnostics.