Open bajtos opened 6 years ago
Moving out of GA scope, keeping deploying to IBM Cloud as the first priority in the same epic.
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
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.
@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?
Yes, @dhmlau there's my PR :)
@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.
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
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.
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
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.