Commit b644c7d
authored
✨ Implement Azure App Service and SQL Server configuration in AppHost (#202)
🔥 Merged without review
This pull request introduces significant improvements to Azure
deployment support and infrastructure configuration, along with some
minor documentation and naming updates. The main changes include adding
Azure-specific packages and resources, refactoring the distributed
application setup to use the Aspire Azure hosting model, and updating
naming conventions for database connection strings and contexts.
**Azure Deployment & Infrastructure Enhancements:**
* Added Azure-specific package references
(`Aspire.Hosting.Azure.ApplicationInsights`,
`Aspire.Hosting.Azure.AppService`, `Aspire.Hosting.Azure.Sql`) to both
`Directory.Packages.props` and `tools/AppHost/AppHost.csproj` to enable
Azure resource provisioning.
[[1]](diffhunk://#diff-5baf5f9e448ad54ab25a091adee0da05d4d228481c9200518fcb1b53a65d4156R6-R8)
[[2]](diffhunk://#diff-cda82b6742843f6c1767221e433612d9fa582a55058b1f5ee6a5563151ba4656R13-R15)
* Refactored the distributed application setup in
`tools/AppHost/AppHost.cs` to use Azure App Service, Azure SQL Server,
Application Insights, and Log Analytics, including configuration for
local and publish modes.
* Implemented a new extension method `WithDropDatabaseCommand` for Azure
SQL databases in `tools/AppHost/Commands/SqlServerCommandExt.cs`,
replacing the previous implementation for local SQL Server databases and
supporting Azure-native operations.
[[1]](diffhunk://#diff-0c530e56451cfeca684c61f595b381fa8f2e1df518c3e435e1a7f03f8720599bR1-R30)
[[2]](diffhunk://#diff-f7dbe3d8251b808d699d5786c9229041916af26d475bf23b34311ee77b385f3eL1-L40)
* Removed the old program setup in `tools/AppHost/Program.cs` in favor
of the new Azure-oriented configuration.
**Naming & Consistency Updates:**
* Standardized database connection string and context names from
`"app-db"` to `"AppDb"` across infrastructure registration and test
configuration files for consistency with Azure resource naming.
(`src/WebApi/Common/Persistence/DependencyInjection.cs`,
`tests/WebApi.IntegrationTests/Common/Infrastructure/Web/WebApiTestFactory.cs`,
`tools/MigrationService/Program.cs`)
[[1]](diffhunk://#diff-87636dbcff301e838a1382effcf2568766855b5a0cd02f8d46e12b3ae66939ceL16-R16)
[[2]](diffhunk://#diff-50cf933f50db73c5b021cfdf9e67b3ed988d49aa11fcc492be8f2a94d2daeff3L31-R31)
[[3]](diffhunk://#diff-b89afcf1c319e2f2497507ca4d2a43d2ac1633c94c1ac7e042ee454fcbe8b1d6L24-R24)
**Documentation Improvements:**
* Updated `README.md` to include detailed Azure deployment instructions
using the Azure Developer CLI (AZD), and improved formatting for notes
and versioning information.
[[1]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L173-L175)
[[2]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L211-R254)
These changes collectively modernize the project's deployment workflow,
making it easier to provision and manage resources in Azure while
ensuring consistency and clarity throughout the codebase and
documentation.1 parent 10d07f2 commit b644c7d
File tree
10 files changed
+159
-71
lines changed- src/WebApi/Common/Persistence
- tests/WebApi.IntegrationTests/Common/Infrastructure/Web
- tools
- AppHost
- Commands
- Extensions
- MigrationService
10 files changed
+159
-71
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
174 | 218 | | |
175 | | - | |
176 | 219 | | |
177 | 220 | | |
178 | 221 | | |
| |||
208 | 251 | | |
209 | 252 | | |
210 | 253 | | |
211 | | - | |
| 254 | + | |
212 | 255 | | |
213 | 256 | | |
214 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
0 commit comments