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

[Spike] Deploy LB4 applications to Microsoft Azure #1466

Open
bajtos opened this issue Jun 25, 2018 · 8 comments
Open

[Spike] Deploy LB4 applications to Microsoft Azure #1466

bajtos opened this issue Jun 25, 2018 · 8 comments

Comments

@bajtos
Copy link
Member

bajtos commented Jun 25, 2018

Find out what's needed to deploy LB4 applications to Microsoft Azure and write a short document describing the steps.

See #1446 for more details and acceptance criteria.

@dhmlau
Copy link
Member

dhmlau commented Aug 7, 2018

Moving out of GA scope, keeping deploying to IBM Cloud as the first priority in the same epic.

@dhmlau dhmlau added post-GA and removed LB4 GA labels Aug 7, 2018
@dhmlau dhmlau removed the post-GA label Nov 2, 2018
@ericzon
Copy link

ericzon commented Aug 4, 2019

First of all, thanks for this nice work.
I was able to deploy a LB 4 API in Azure (connected with a CosmosDB nosql) as App Service.
During the process I found two main problems:

  • The password that azure generates to connect to db sometimes contains characters that are encoded during the process of initialize the conection in loopback mongodb connector.

  • When I connect this API to Azure API Manager, creating a controller with default CRUD operations, in the POST definition, having something like this:

@requestBody({
      content: {
        'application/json': {
          schema: getModelSchemaRef(MyData, {exclude: ['id']}),
        },
      },
    })

The "exclude" and "optional" keys generates an OpenAPI schema like "MyDataExcluding[id]" that contains brackets. These characters do not pass the validation when you try to add this new API
image
I got this message:
Parsing error(s): The key 'MyDataExcluding[id]' in 'schemas' of components MUST match the regular expression '^[a-zA-Z0-9.-_]+$'. [#/components]

I suggest you to modify the method build-schema.js / getTitleSuffix to use any valid value or at least make it configurable from the app.

If you need it, I can create ticket for these two issues.

@dhmlau
Copy link
Member

dhmlau commented Aug 4, 2019

@ericzon, thanks for trying out the deployment to Azure. :)
Seems like you were able to find the cause of the problem, are you interested in submitting a PR?

@ericzon
Copy link

ericzon commented Aug 4, 2019

Yes, @dhmlau there's my PR :)

@ghost
Copy link

ghost commented Aug 8, 2019

@ericzon Can you explain what steps you have used to deploy to azure app service on a windows web app?

I have tried multiple methods and it all seems to fail. Although I have gotten this to work on a linux web app.

@ghost
Copy link

ghost commented Aug 8, 2019

Deploying to Azure App Service Linux Web App

Inside the Azure Portal> Configuration > Application Settings add the following:
BUILD_FLAGS : Off

Inside the Azure Portal> Configuration > General Settings add the following to the Startup Command:
pm2 start --no-daemon index.js

@gagarine
Copy link

Is their a documentation to deploy LB4 on Azure? I'm using the provided github action but it fail. It was working using the quick&dirty deployement from VS code. I guess it's because now it use PM2 instead of only npm start.

@sadranyi
Copy link

I am also experiencing the same issue, it deploys with GitHub actions but trying the Classic Azure DevOps just fails
a guide on how to deploy it to Azure App Service or API management would really be helpful

@loopbackio loopbackio deleted a comment from stale bot Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants