Git Product home page Git Product logo

bikesharing360_backendservices's Introduction

BikeSharing360

During our Connect(); event this year we presented 15 demos in Scott Guthrie’s and Scott Hanselman’s keynotes. If you missed the keynotes, you can watch the recording in Channel 9.

This year, we built the technology stack for a fictional company named BikeSharing360, which allows users to rent bikes from one location to another.

BikeSharing360 is a fictitious example of a smart bike sharing system with 10,000 bikes distributed in 650 stations located throughout New York City and Seattle. Their vision is to provide a modern and personalized experience to riders and to run their business with intelligence.

In this demo scenario, we built several apps for both the enterprise and the consumer (bike riders). You can find all other BikeSharing360 repos in the following locations:

Connect() 2016 Demos - Microservices

This repo contains the backend microservices used in various Connect() demos (mainly the Xamarin apps).

Prerequisites

To create and deploy all microservices, you only need an active Azure Subscription and a Computer with the following software installed:

  1. Visual Studio 2015 Update 3. Microservices code are in netcore and nodejs. Netcore microservices are based on project.json not on csproj, so don't use Visual Studio 2017. If you want to use VS2017 RC use the VS2017-RC3 branch.
  2. Azure SDK .NET (2.9.6)
  3. NodeJS tools for Visual Studio
  4. NodeJs installed.

Note: The NodeJS version that comes with VS2015 is quite old, and still uses NPM 2. Using this version could lead you to the "Path too long" error. It is better to install a newer version of node (code was tested against NodeJs 6.4.0). After installing a new version of NodeJS you have to configure Visual Studio 2015 to use this newer version instead the previous one.

To configure VS2015 for using the new version of NodeJs, go to Tools->Options->Projects and solutions->External web tools and add the paths .\node_modules.bin and _C:\program files\nodejs_ to the top:

alt text

(This document assumes that you installed NodeJs in its default folder (C:\program files\nodejs). If you installed NodeJS in any other folder, update the path accordingly).

Deploying to Azure

Note: The branch VS2017 contains the same code ready to be loaded and compiled using VS2017 RC and the netcore tools in preview3 (no project.json).

Deploy to Azure

Open the solution BikeSharing.Services.Deploy.sln. This solution contains the Microservices code and one ARM project to deploy them on any Azure Subscription.

If needed, install the missing NPM packages for the project BikeSharing.Services.Rides. Go to Solution Explorer right click on the node npm of the BikeSharing.Services.Rides project, and select Install Missing npm Packages:

alt text

This will launch NPM and install all needed NPM packages for the project. Once this is completed just right click over the BikeSharing.Services.Deploy project and select Deploy -> New. A dialog box will appear, asking you for your account and allowing you to select the subscription to use:

alt text

You can select one resource group or create one new. A set of default parameters has been provided, but you can override them with your own values clicking the "Edit parameters" button:

alt text

You can choose database names, SKUs to use and some other values (database login and password).

Once you've finished setting the parameters you can just click the "OK" button and the Microservices and databases will be deployed on the choosen resource group.

Note: Microservices code is compiled when you run the script, and any compiler warning is treated by an error by the publishing script. Current code has 0 errors and 0 warnings, but we aware if you edit the microservices code. If any warning is shown, Visual Studio will tell you that the deployment to Azure failed.

Note: Databases are created with no data. To add data to the database follow the steps in the next section.

Adding data to databases

Once databases are created, you can run the SQL files to fill some sample data. You can use SQL Management studio or your preferred tool to run the SQL files provided.

The files are in /src/sql, and there is one sql file for each database (rides-data.sql, feedback-data.sql, profiles-data.sql, events-data.sql)

Note: The rides-data.sql is very big (around 0.5GB) because contains a lot of data. For that reason is zipped.

Resources created in Azure

ARM project creates the following resources in Azure:

  • 1 SQL server
  • 4 SQL Azure databases (one per each microservice)
  • 4 App Services (one per each microservice)
  • 1 Storage account

Also it deploys the code to the 4 appservices and the schema to the 4 databases.

Database projects

The solution file BikeSharing.Services.sln contains the code of all microservices AND database projects. If you update the database schema, you can create a new DACPAC file using the dataase project.

Note: Database schema is deployed during the ARM project deployment by publishing DACPAC files. Those files were generated by these database projects (but just be aware that database projects are not compiled during the ARM deploy process. The ARM project has their own dacpac files in src/BikeSharing.Services.Deploy/Data/dacpac).

Testing code in local environment

For testing the code for local environment you need to create the databases. ** Best way to create databases is using the database projects**. Just load them with Visual Studio 2015 and then publish them into your local database.

Then update the config file of each microservice (appsettings.json) and set the needed values (DB connection strings.) The Rides service is different because is a nodejs microservice, so no appsettings.json file exists. Configuration is using environment variables. Best way to set them with VS2015 is via "Project -> Properties" and set the environment variables:

alt text

Valid values are:

  • database Name of the database (defaults to biksharing-services-rides)
  • databaseUserName User name of db server
  • databasePassword User password
  • databaseServer Database server name (defaults to localhost)
  • serverInstance Database instance name (only needed if not default instance is used)

SQL Server must be accessible via TCP protocol and has to have SQL authentication enabled.

Events Seed

You can populate the events database with a new set of events, instead of using the sql file provided.

For doing this, once the database schema is created you need to open the solution BikeSharing.Services.Events.Seed.sln and edit the configuration file (appsettings.json) located in src/BikeSharing.Services.Events.Seed. You need to provide a valid Tickermaster API key and a range of dates for the events. Please refer to the file src/BikeSharing.Services.Events.Seed/appsettings.json for more info.

The application BikeSharing.Services.Events.Seed is a netcore 1.0 console application that will connect to TicketMaster API, find events on the range of dates provided (this range defaults from today to today plus 10 days) and populate the events database. Not all events are fed, only events that meet certain requeriments (like having a nice image and specific location).

In order to find how to get a TicketMaster API refer to TicketMaster API documentation.

** Note ** This application is provided AS IS with no warranties. It is just provided to make easy for you to have a fresh & updated set of events. It is not intended to be production code (i. e. no error management)

** Note 2 ** This application has no VS2017 (preview3 tooling) version, so it is not included in the VS2017 branch.

Azure Functions code

The folder _/azure-functions/ contains the solution BikeSharing-Functions.sln with the code of the AvatarPhotoProcess Azure Function (showed by Beth Massi). Function is not published to Azure by the ARM project.

If you publish the function, then update the AzureWebJobsStorage setting of the FunctionApp to use the storage deployed in the ARM project. This will ensure that photos uploaded by mobile app are processed by the Azure function.

Also you need to do two manual things in your Azure subscription:

  1. Add a Cognitive API Services to your Azure Subscription (Face API)
  2. Create an AppSetting in the FunctionApp named Vision_API_Subscription_Key with the value of the API KEY of the Face API.

Note: Azure functions projects are only supported by VS2015 Update 3 and require the Visual Studio Tools for Azure Functions installed.

Final Notes

  • Password is not really validated on login. If login is correct any not-null password is valid. This is to avoid errors on demos and showcases
  • All APIs (except the rides one) have swagger enabled

How to sign up for Microsoft Azure

You need an Azure account to work with this demo code. You can:

  • Open an Azure account for free Azure subscription. You get credits that can be used to try out paid Azure services. Even after the credits are used up, you can keep the account and use free Azure services and features, such as the Web Apps feature in Azure App Service.
  • Activate Visual Studio subscriber benefits. Your Visual Studio subscription gives you credits every month that you can use for paid Azure services.
  • Not a Visual Studio subscriber? Get a $25 monthly Azure credit by joining Visual Studio Dev Essentials.

Blog posts

Here's links to blog posts related to this project:

Clean and Rebuild

If you see build issues when pulling updates from the repo, try cleaning and rebuilding the solution.

Copyright and license

  • Code and documentation copyright 2016 Microsoft Corp. Code released under the MIT license.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

bikesharing360_backendservices's People

Contributors

bradygaster avatar eiximenis avatar erikaehrli avatar microsoft-github-policy-service[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bikesharing360_backendservices's Issues

Deployment failed

When I followed the directions for deployment of this project, I got an error in reading the njscsproj file. I have Node.JS installed, but the requirement should be to install Node.js Tools 1.2 for Visual Studio 2015 (https://marketplace.visualstudio.com/items?itemName=NodejsToolsforVisualStudio.NodejsTools12forVisualStudio2015). Not to be too picky, but it would be good to have all the readme.md's follow a template, listing out the requirements.

When deploying, I get the error message "15:31:38 - PowerShell deployment script c:\users\ken\documents\bikesharing360_backendservices\src\bikesharing.services.deploy\Scripts\Deploy-AzureResourceGroup.ps1 is missing.
15:31:38 - Deploying template using PowerShell script failed.". The file is in the location .../bikesharing.services.deploy/; there is no scripts/ subdirectory. I am using the master branch, last checkin at 13 Dec 3:03.

Problems with deploying VS2017 branch

Hello,

i'm trying to deploy the VS2017 branch, but i have some problems.

  1. the project BikeSharing.Services.Deploy is missing in the BikeSharing.Services.Deploy.sln, so i had to add it by hand

  2. VS2017 telle me that BikeSharing.Services.Rides is not compatible

  3. when i try to deploy it, i get these error message:

17:48:48 - Deploying DACPACs - Events
17:48:48 - Deploying .\dacpac\bikesharing-services-events.dacpac to Data Source=tcp:bikesharing360qjivhd6n3fygy.database.windows.net; Initial Catalog=bikesharing-services-eventsName; User ID=*****; Password=******
17:48:48 - Add-Type : Mindestens ein Typ in der Assembly kann nicht geladen werden. Rufen Sie die LoaderExceptions-Eigenschaft 
17:48:48 - ab, wenn Sie weitere Informationen ben”tigen.
17:48:48 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:48 - ploy\Data\DeployDacpac.ps1:22 Zeichen:1
17:48:48 - + Add-Type -Path "$PSScriptRoot\..\lib\Microsoft.SqlServer.Dac.1.0.3\li ...
17:48:48 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:48 -     + CategoryInfo          : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException
17:48:48 -     + FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeComma 
17:48:48 -    nd
17:48:48 -  
17:48:48 - New-Object : Ausnahme beim Aufrufen von ".ctor" mit 1 Argument(en):  "Der Typeninitialisierer f�r 
17:48:48 - "Microsoft.SqlServer.Dac.DacServices" hat eine Ausnahme verursacht."
17:48:48 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:48 - ploy\Data\DeployDacpac.ps1:28 Zeichen:16
17:48:48 - + $dacServices = New-Object Microsoft.SqlServer.Dac.DacServices $constr
17:48:48 - +                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:48 -     + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
17:48:48 -     + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
17:48:48 -  
17:48:48 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:48 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:48 - ploy\Data\DeployDacpac.ps1:39 Zeichen:35
17:48:48 - + Register-ObjectEvent -InputObject $dacServices -EventName "Message" - ...
17:48:48 - +                                   ~~~~~~~~~~~~
17:48:48 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:48 -     + FullyQualifiedErrorId : VariableIsUndefined
17:48:48 -  
17:48:48 - Ausnahme beim Aufrufen von "Load" mit 1 Argument(en):  "Der Typeninitialisierer f�r 
17:48:48 - "Microsoft.SqlServer.Dac.DacPackage" hat eine Ausnahme verursacht."
17:48:48 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:48 - ploy\Data\DeployDacpac.ps1:42 Zeichen:1
17:48:48 - + $dp = [Microsoft.SqlServer.Dac.DacPackage]::Load($dacpacname)
17:48:48 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:48 -     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
17:48:48 -     + FullyQualifiedErrorId : TypeInitializationException
17:48:48 -  
17:48:48 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:48 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:48 - ploy\Data\DeployDacpac.ps1:43 Zeichen:1
17:48:48 - + $dacServices.Deploy($dp, $dbname, $true, $deployOptions)
17:48:48 - + ~~~~~~~~~~~~
17:48:48 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:48 -     + FullyQualifiedErrorId : VariableIsUndefined
17:48:48 -  
17:48:49 - Deploying DACPACs - Rides
17:48:49 - Deploying .\dacpac\bikesharing-services-rides.dacpac to Data Source=tcp:bikesharing360qjivhd6n3fygy.database.windows.net; Initial Catalog=bikesharing-services-ridesName; User ID=******; Password=******
17:48:49 - Add-Type : Mindestens ein Typ in der Assembly kann nicht geladen werden. Rufen Sie die LoaderExceptions-Eigenschaft 
17:48:49 - ab, wenn Sie weitere Informationen ben”tigen.
17:48:49 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:49 - ploy\Data\DeployDacpac.ps1:22 Zeichen:1
17:48:49 - + Add-Type -Path "$PSScriptRoot\..\lib\Microsoft.SqlServer.Dac.1.0.3\li ...
17:48:49 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:49 -     + CategoryInfo          : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException
17:48:49 -     + FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeComma 
17:48:49 -    nd
17:48:49 -  
17:48:49 - New-Object : Ausnahme beim Aufrufen von ".ctor" mit 1 Argument(en):  "Der Typeninitialisierer f�r 
17:48:49 - "Microsoft.SqlServer.Dac.DacServices" hat eine Ausnahme verursacht."
17:48:49 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:49 - ploy\Data\DeployDacpac.ps1:28 Zeichen:16
17:48:49 - + $dacServices = New-Object Microsoft.SqlServer.Dac.DacServices $constr
17:48:49 - +                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:49 -     + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
17:48:49 -     + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
17:48:49 -  
17:48:49 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:49 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:49 - ploy\Data\DeployDacpac.ps1:39 Zeichen:35
17:48:49 - + Register-ObjectEvent -InputObject $dacServices -EventName "Message" - ...
17:48:49 - +                                   ~~~~~~~~~~~~
17:48:49 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:49 -     + FullyQualifiedErrorId : VariableIsUndefined
17:48:49 -  
17:48:49 - Ausnahme beim Aufrufen von "Load" mit 1 Argument(en):  "Der Typeninitialisierer f�r 
17:48:49 - "Microsoft.SqlServer.Dac.DacPackage" hat eine Ausnahme verursacht."
17:48:49 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:49 - ploy\Data\DeployDacpac.ps1:42 Zeichen:1
17:48:49 - + $dp = [Microsoft.SqlServer.Dac.DacPackage]::Load($dacpacname)
17:48:49 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:49 -     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
17:48:49 -     + FullyQualifiedErrorId : TypeInitializationException
17:48:49 -  
17:48:49 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:49 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:49 - ploy\Data\DeployDacpac.ps1:43 Zeichen:1
17:48:49 - + $dacServices.Deploy($dp, $dbname, $true, $deployOptions)
17:48:49 - + ~~~~~~~~~~~~
17:48:49 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:49 -     + FullyQualifiedErrorId : VariableIsUndefined
17:48:49 -  
17:48:50 - Deploying DACPACs - Feedback
17:48:50 - Deploying .\dacpac\bikesharing-services-feedback.dacpac to Data Source=tcp:bikesharing360qjivhd6n3fygy.database.windows.net; Initial Catalog=bikesharing-services-feedbackName; User ID=******; Password=******
17:48:50 - Add-Type : Mindestens ein Typ in der Assembly kann nicht geladen werden. Rufen Sie die LoaderExceptions-Eigenschaft 
17:48:50 - ab, wenn Sie weitere Informationen ben”tigen.
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:22 Zeichen:1
17:48:50 - + Add-Type -Path "$PSScriptRoot\..\lib\Microsoft.SqlServer.Dac.1.0.3\li ...
17:48:50 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException
17:48:50 -     + FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeComma 
17:48:50 -    nd
17:48:50 -  
17:48:50 - New-Object : Ausnahme beim Aufrufen von ".ctor" mit 1 Argument(en):  "Der Typeninitialisierer f�r 
17:48:50 - "Microsoft.SqlServer.Dac.DacServices" hat eine Ausnahme verursacht."
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:28 Zeichen:16
17:48:50 - + $dacServices = New-Object Microsoft.SqlServer.Dac.DacServices $constr
17:48:50 - +                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
17:48:50 -     + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
17:48:50 -  
17:48:50 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:39 Zeichen:35
17:48:50 - + Register-ObjectEvent -InputObject $dacServices -EventName "Message" - ...
17:48:50 - +                                   ~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:50 -     + FullyQualifiedErrorId : VariableIsUndefined
17:48:50 -  
17:48:50 - Ausnahme beim Aufrufen von "Load" mit 1 Argument(en):  "Der Typeninitialisierer f�r 
17:48:50 - "Microsoft.SqlServer.Dac.DacPackage" hat eine Ausnahme verursacht."
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:42 Zeichen:1
17:48:50 - + $dp = [Microsoft.SqlServer.Dac.DacPackage]::Load($dacpacname)
17:48:50 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
17:48:50 -     + FullyQualifiedErrorId : TypeInitializationException
17:48:50 -  
17:48:50 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:43 Zeichen:1
17:48:50 - + $dacServices.Deploy($dp, $dbname, $true, $deployOptions)
17:48:50 - + ~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:50 -     + FullyQualifiedErrorId : VariableIsUndefined
17:48:50 -  
17:48:50 - Deploying DACPACs - Events
17:48:50 - Deploying .\dacpac\bikesharing-services-profiles.dacpac to Data Source=tcp:bikesharing360qjivhd6n3fygy.database.windows.net; Initial Catalog=bikesharing-services-profilesName; User ID=******; Password=******
17:48:50 - Add-Type : Mindestens ein Typ in der Assembly kann nicht geladen werden. Rufen Sie die LoaderExceptions-Eigenschaft 
17:48:50 - ab, wenn Sie weitere Informationen ben”tigen.
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:22 Zeichen:1
17:48:50 - + Add-Type -Path "$PSScriptRoot\..\lib\Microsoft.SqlServer.Dac.1.0.3\li ...
17:48:50 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException
17:48:50 -     + FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeComma 
17:48:50 -    nd
17:48:50 -  
17:48:50 - New-Object : Ausnahme beim Aufrufen von ".ctor" mit 1 Argument(en):  "Der Typeninitialisierer f�r 
17:48:50 - "Microsoft.SqlServer.Dac.DacServices" hat eine Ausnahme verursacht."
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:28 Zeichen:16
17:48:50 - + $dacServices = New-Object Microsoft.SqlServer.Dac.DacServices $constr
17:48:50 - +                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
17:48:50 -     + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
17:48:50 -  
17:48:50 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:39 Zeichen:35
17:48:50 - + Register-ObjectEvent -InputObject $dacServices -EventName "Message" - ...
17:48:50 - +                                   ~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:50 -     + FullyQualifiedErrorId : VariableIsUndefined
17:48:50 -  
17:48:50 - Ausnahme beim Aufrufen von "Load" mit 1 Argument(en):  "Der Typeninitialisierer f�r 
17:48:50 - "Microsoft.SqlServer.Dac.DacPackage" hat eine Ausnahme verursacht."
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:42 Zeichen:1
17:48:50 - + $dp = [Microsoft.SqlServer.Dac.DacPackage]::Load($dacpacname)
17:48:50 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
17:48:50 -     + FullyQualifiedErrorId : TypeInitializationException
17:48:50 -  
17:48:50 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:43 Zeichen:1
17:48:50 - + $dacServices.Deploy($dp, $dbname, $true, $deployOptions)
17:48:50 - + ~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:50 -     + FullyQualifiedErrorId : VariableIsUndefined

Thanks for help in advance.

Readme needs some changes

Please make couple of changes to readme file

  1. Add Node.js VS tools as a requirement
  2. After installing Node.js VS tools and before deploying the ARM project - make sure you right click npm inside BikeSharing.Services.Rides.njsproj and click Install missing npm Packages. If you don't do this - the node_modules folder on the deployed web app will be empty and "rides" API will throw 500 errors (and the mobile app will throw "Communication error").
    image
  3. Make sure you don't clone the repository too far down the nested directory structure on your local machine (preferably just in the root of your c:\ or d:). I saw some errors with deployment about long file paths for some of the files. I'm not 100% sure if it completely fails to deploy or partially in this instance but keeping.
  4. For some reason, my deployment returned "failed" - although there was not a single error message in the whole log output. Not sure what was happening there.
22:51:06 - Deploying template using PowerShell script failed.
22:51:06 - Tell us about your experience at https://go.microsoft.com/fwlink/?LinkId=691202

SQL Server Deployment Fails

Hi,
When I tried to deploy the backend deployment project it fails at the SQL Server deployment step with (Bad Request) on the Azure deployment log.
The following status in the Azure failed deployment log:

{
"code": "45122",
"message": "''",
"target": null,
"details": [
{
"code": "45122",
"message": "''",
"target": null,
"severity": "16"
}
],
"innererror": []
}

Deployment fails with approot not found

Any help on this error?

01:48:55 - Warning: Skipping source contentPathLib (C:\dev\BS360_Backend\src\BikeSharing.S
01:48:55 - ervices.Deploy\bin\Debug\staging\BikeSharing.Services.Deploy\pubs\rides\approot
01:48:55 - ) because of rule SkipInvalidSource.
01:48:55 - Could not find file 'C:\dev\BS360_Backend\src\BikeSharing.Services.Deploy\bin\D
01:48:55 - ebug\staging\BikeSharing.Services.Deploy\pubs\rides\approot'. Learn more at: h
01:48:55 - ttp://go.microsoft.com/fwlink/?LinkId=221672#FileOrFolderNotFound.
01:48:55 - Info: Adding directory (bikesharing-services-rides3slpdvq65s476\node_modules\te
01:48:55 - rraformer.grunt\grunt-gh-pages\gh-pages\src\partials\index_partials\terraforme
01:48:55 - r_core).
01:48:55 -
01:48:56 -
01:48:56 -
01:48:56 -
01:48:56 - Deploying template using PowerShell script failed.

Path too long error

I have all of the latest updates, and everything goes fine until we hit this error publishing:

This is one of a LOT of the same error, for various paths.

Copy-Item : The specified path, file name, or both are too long. The fully
11:16:38 - [ERROR] qualified file name must be less than 260 characters, and the directory name
11:16:38 - [ERROR] must be less than 248 characters.
11:16:38 - [ERROR] At E:\apps\be\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Ser
11:16:38 - [ERROR] vices.Deploy\Deploy-AzureResourceGroup.ps1:183 char:3
11:16:38 - [ERROR] + Copy-Item "$PSScriptRoot............\src\BikeSharing.Se ...
11:16:38 - [ERROR] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11:16:38 - [ERROR] + CategoryInfo : WriteError: (E:\apps\be\src...dules\pseudomap:S
11:16:38 - [ERROR] tring) [Copy-Item], PathTooLongException
11:16:38 - [ERROR] + FullyQualifiedErrorId : CreateDirectoryIOError,Microsoft.PowerShell.Comm
11:16:38 - [ERROR] ands.CopyItemCommand

Visual Studio 2015, Windows 10.

At ideas? I can't really make the path any shorter :/

ride db cannot publish

When I trigger BikeSharing.Services.Rides.Database project to publish, encounter below error,

Creating [EventsReferenceData]...
(87,1): SQL72014: .Net SqlClient Data Provider: Msg 102, Level 15, State 1, Line 1 Incorrect syntax near 'EXTERNAL'.
(87,0): SQL72045: Script execution error. The executed script:
CREATE EXTERNAL DATA SOURCE [EventsReferenceData]
WITH (
TYPE = RDBMS,
LOCATION = N'(localdb)\MSSQLLocalDB.database.windows.net',
DATABASE_NAME = N'bikesharing-services-events',
CREDENTIAL = [SQL_Credential]
);

An error occurred while the batch was being executed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.