How to fix deployement issues of final solution

Eric Bardes 50 Reputation points
2024-09-07T03:47:26.65+00:00

Hello,

I have been following the exercise runbooks of module "Enable real-time updates in a web application using Azure Functions and SignalR Service" unit 7: Exercise - Use a storage account to host a static website and I'd got errors while building the static web app for deployement and client app wasn't working at the end.

After several back and forth reviewing steps, code, troubleshouting the environment and looking at solution code and I figured out that there are several missing instructions in the runbook.

Second step "Update the client .env": is pretty useless as it is as we are not trying to run the client locally on the other hand we need to create a helper file ./start/client/src/env.js to expose BACKEND_URL env variable with bellow code

const BACKEND_URL = process.env.BACKEND_URL;

console.log(`CLIENT ENV BACKEND_URL: ${BACKEND_URL}`);

export {
	BACKEND_URL
};

Also amend the ./start/client/webpack.config.js to modify

plugins: [
        new Dotenv({
          systemvars: true,
        }),
        new CopyWebpackPlugin({
            patterns: [
              { from: './src/style.css', to: './' },
              { from: './src/favicon.ico', to: './' },
              { from: './index.html', to: './'}
            ],
          }),
    ]

into

plugins: [
        new Dotenv({
          systemvars: true,
        }),
        new CopyWebpackPlugin({
            patterns: [
              { from: './src/style.css', to: './' },
              { from: './src/favicon.ico', to: './' },
              { from: './index.html', to: './'}
            ],
          }),
    ]

This will allow in the next step to have Github Actions workflow to load BACKEND_URL from secret variables rather than from the missing .env file which is not uploaded in git repository (.gitignore)With those two additional steps the exercise can run smoothly.

Regards

This question is related to the following Learning Module

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,700 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pradeep M 3,830 Reputation points Microsoft Vendor
    2024-10-03T08:58:14.1766667+00:00

    Hi Eric Bardes,

    Thank you for bringing this issue to our attention.

    Our team is aware of the problem and is actively working on a solution.

    In the meantime, we kindly ask that you proceed with the Learning Paths without completing the exercise modules. We will provide updates as soon as we have more information.

    Thank you for your patience and understanding.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.