title: Azure Static Web App NodeJS env variables
body: <p>I'm using Azure Static Web App service and Azure DevOps pipeline to deploy a NodeJS app. The pipeline and the build are going well. Now i have to define a URL for the backend using env variables, but without success.</p>
  <pre><code>trigger:
  - develop
  
  jobs:
    - job: JobTest
      pool:
        vmImage: ubuntu-latest
  
      variables:
      - name: BACKEND_URL
        value: https://&lt;some_url&gt;
      - name: System.Debug
        value: true
      steps:
      - task: AzureStaticWebApp@0
        inputs:
          app_location: &quot;/&quot; 
          api_location: &quot;&quot;
          output_location: &quot;dist&quot;
  
        env:
          BACKEND_URL: $(BACKEND_URL)
          azure_static_web_apps_api_token: $(deployment_token)
      - bash: echo $(BACKEND_URL)
      - bash: echo $PWD
  </code></pre>
  <p>and from the NodeJS code, in the &quot;/app/src/models/config.ts&quot; file i have the this:</p>
  <blockquote>
  <p>export const BACKEND_URL = process.env.BACKEND_URL</p>
  </blockquote>
  <p>If i change <strong>process.env.BACKEND_URL</strong> with the actual URL it will work.</p>
  <p>Also, from the Azure Pipeline this task is using the <a href="https://github.com/microsoft/Oryx" rel="nofollow noreferrer">https://github.com/microsoft/Oryx</a> build system.</p>
  <p>The question is how can i use env from the pipeline in the code?</p>