- Install Node.js (use the latest v14 LTS release)
- To install the TeamsFx CLI, use the npm package manager:
npm install -g @microsoft/teamsfx-cli
- Create share-now project.
teamsfx new template share-now
- Provision the project to azure. You will be asked to input admin name and password of SQL.
teamsfx provision
- Deploy.
teamsfx deploy
- Open .fx/states/state.dev.json file, you could get the database name in
databaseName
setting. In Azure portal, find the database and use query editor with below query to create tables:CREATE TABLE [TeamPostEntity]( [PostID] [int] PRIMARY KEY IDENTITY, [ContentUrl] [nvarchar](400) NOT NULL, [CreatedByName] [nvarchar](50) NOT NULL, [CreatedDate] [datetime] NOT NULL, [Description] [nvarchar](500) NOT NULL, [IsRemoved] [bit] NOT NULL, [Tags] [nvarchar](100) NULL, [Title] [nvarchar](100) NOT NULL, [TotalVotes] [int] NOT NULL, [Type] [int] NOT NULL, [UpdatedDate] [datetime] NOT NULL, [UserID] [uniqueidentifier] NOT NULL, ) GO CREATE TABLE [UserVoteEntity]( [VoteID] [int] PRIMARY KEY IDENTITY, [PostID] [int] NOT NULL, [UserID] [uniqueidentifier] NOT NULL, ) GO
- Refer to manually add user to add user in database.
- Once you have successfully created DB Tables and added user, you can now try previewing the app running in Azure. In Visual Studio Code, open
Run and Debug
and selectLaunch Remote (Edge)
orLaunch Remote (Chrome)
in the dropdown list and PressF5
or green arrow button to open a browser.