This repository serves as an example demonstrating the deployment of a typical .NET API project to the Azure platform, utilizing Azure Web App and Azure SQL Server.
-
Sign in to Azure Portal:
- Go to Azure Portal.
- Sign in with your Azure account.
-
Create a new SQL Database resource:
- Click on "Create a resource" in the top-left corner.
- Search for "SQL Database" and select it.
- Click "Create" to begin setting up a new SQL database.
-
Fill in the basic settings:
- Choose your subscription and create a new resource group.
- Specify the database name, region, and pricing tier.
-
Configure server parameters:
- Create a new SQL server by selecting "Create New".
- Provide a server name, administrative login, and password for the server.
-
Additional settings:
- Configure security, backup, and scaling options as needed.
- Click "Review + create" to finalize setup and create the SQL database.
-
Navigate to your SQL database:
- After creating the SQL database, go to its resource in the Azure portal.
-
Get the connection string:
- In the "Settings" section, select "Connection strings".
- Copy the ADO.NET connection string or any other suitable connection type.
-
Set connection string
- after the copy, you should set this connection string in
appsettings.json
"ConnectionStrings": { "AzureSql": "enter your connection string azure" }
- after the copy, you should set this connection string in
-
Prepare your project:
- Ensure your API project is configured to work with the SQL Server database.
-
Deploy the project to Azure:
- Return to the Azure portal and select your Azure Web App resource.
- In the "Deployment Center", choose your preferred deployment method (e.g., GitHub, Azure DevOps, FTP, etc.).
- Configure the deployment parameters, including specifying your API project repository.
-
Complete the deployment:
- Start the deployment process and wait for it to complete.
- After successful deployment, your API project will be accessible via the URL of your Azure Web App.
- Please consider starring the repository.
- You can donate on Patreon.
If you have any questions or suggestions, feel free to reach out to me.
This project is licensed under the MIT License.