Skip to content

Latest commit

 

History

History
44 lines (44 loc) · 1.89 KB

cli.md

File metadata and controls

44 lines (44 loc) · 1.89 KB

Try the Sample with TeamsFx CLI

  1. Install Node.js (use the latest v14 LTS release)
  2. To install the TeamsFx CLI, use the npm package manager:
    npm install -g @microsoft/teamsfx-cli
    
  3. Create share-now project.
    teamsfx new template share-now
    
  4. Provision the project to azure. You will be asked to input admin name and password of SQL.
    teamsfx provision
    
  5. Deploy.
    teamsfx deploy
    
  6. 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
  7. Refer to manually add user to add user in database.
  8. 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 select Launch Remote (Edge) or Launch Remote (Chrome) in the dropdown list and Press F5 or green arrow button to open a browser.