- Visual Studio 2022 (with Data Storage and Processing workload installed)
- Azure Subscription
- Go to the Azure Portal.
- In the left-hand menu, select Create a resource, then search for SQL Database.
- Click Create, and fill in the necessary details:Resource Group: Create a new or select an existing one.Database Name: Enter a unique name for your database.Server: Choose an existing SQL server or create a new one.Compute + Storage: Select your desired performance tier (e.g., Basic or Standard).
- Click Review + Create and then Create to deploy your database.
- Open Visual Studio 2022 and go to File > New > Project.
- Search for SQL Server Database Project in the project templates, select it, and click Next.
- Name the project and choose a directory to save it, then click Create.
- In the newly created project, right-click on the project in Solution Explorer, and select Add > New Item.
- Choose Table or other SQL objects, define the schema, and save the file.
- Right-click on your project in Solution Explorer, then click Publish.
- In the Publish Database window, click on Edit next to Target database connection.
- In the Connect to Server window:Select Azure under the Server Type section.Sign in to your Azure account and select the Azure SQL Server you created earlier.Choose the correct database and test the connection. Click OK.
- Back in the Publish Database window, click Publish.
- Once the deployment completes, open SQL Server Object Explorer in Visual Studio.
- Connect to the Azure SQL Database, and verify that the tables or objects you created are successfully deployed.