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

Forward slashes replaced by backslash for within inline hook scripts #2365

Closed
wbreza opened this issue Jun 6, 2023 · 0 comments · Fixed by #2366
Closed

Forward slashes replaced by backslash for within inline hook scripts #2365

wbreza opened this issue Jun 6, 2023 · 0 comments · Fixed by #2366
Assignees
Labels
bug Something isn't working

Comments

@wbreza
Copy link
Contributor

wbreza commented Jun 6, 2023

When defining an azd inline script hook (command or service) forward slashes are mistakenly replaced by back slashes causing scripts to failed unexpectedly. Inline scripts should not be modified.

Repro

  1. Create azure.yaml with the below snipped:
  2. Run azd package command or whichever command hook is configured for
  3. Hook will fail about an invalid hostname

azure.yaml

# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json

name: todo-nodejs-mongo-aca
metadata:
  template: todo-nodejs-mongo-aca@0.0.1-beta
hooks:
  prepackage:
    shell: pwsh
    run: Invoke-WebRequest -Uri "https://sample.com/sample.json" -OutFile "out.json"
services:
  web:
    project: ./src/web
    language: js
    host: containerapp
  api:
    project: ./src/api
    language: js
    host: containerapp

Expected

Hook should run and invoke the web request without any issues

Actual

Hook fails with message

@wbreza wbreza added the bug Something isn't working label Jun 6, 2023
@wbreza wbreza added this to the July 2023 - 1.1.0 milestone Jun 6, 2023
@wbreza wbreza self-assigned this Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant