Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when deploying with Mac, looks like some wrong character ruining the whole thing #2157

Open
jariolavilehtonen opened this issue Nov 15, 2024 · 1 comment

Comments

@jariolavilehtonen
Copy link

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

try to deploy with Mac

Any log messages given by the failure

ERROR: error executing step command 'provision': deployment failed: error deploying infrastructure: starting deployment to subscription: PUT https://management.azure.com/subscriptions/41e5cecb-e8cf-4f36-9645-cd33273e8f40/providers/Microsoft.Resources/deployments/searchopenaienvone-1731680497


RESPONSE 400: 400 Bad Request
ERROR CODE: InvalidTemplate

{
"error": {
"code": "InvalidTemplate",
"message": "Deployment template language expression evaluation failed: 'The language expression 'if(not(equals(parameters('numberOfWorkers'), −1)), parameters('numberOfWorkers'), null())' is not valid: the string character '−' at position '45' is not expected.'. Please see https://aka.ms/arm-functions for usage details.",
"additionalInfo": [
{
"type": "TemplateViolation",
"info": {
"lineNumber": 0,
"linePosition": 0,
"path": ""
}
}
]
}
}

Expected/desired behavior

OS and Version?

macOS

ProductName: macOS
ProductVersion: 14.5
BuildVersion: 23F79

azd version?

run azd version and copy paste here.
azd version 1.11.0 (commit 5b92e0687e1fa96dfc8292f4b900c0c58610b6a5)

Versions

Mention any other details that might be useful

Suspected cause: The template contains a special character "−" (Unicode minus sign, U+2212) instead of a regular hyphen "-" (ASCII code 45). This often happens if the code was copied from a document or a PDF where the characters are automatically replaced.

Tried solution: Replacing the Unicode Minus Sign with a Regular Hyphen:
Change the character − (Unicode minus sign) to - (ASCII hyphen).

I changed that and tried to update also some others but the error persisted.


Thanks! We'll be in touch soon.

@pamelafox
Copy link
Collaborator

I wonder if your Bicep is out of date? I'm on a Mac as well and have not seen that issue.

Can you run az bicep version and tell me what version you see? I wonder if its either very new or very old.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants