This information can be used with the samples from multiple chapters.
This will change with .NET Aspire Preview 4. Instructions created with .NET Aspire Preview 3 and Azure Developer CLI (azd) 1.6.1.
- Create an Azure App Insights resource (starting with chapter 11, not needed before that)
- With the AppHost, configure user secrets with this configuration:
{
"ApplicationInsightsConnectionString": <etner your intstrumentation connection string>
}
-
Change to the directory of the solution
-
Run
azd init
- Select
Use code in the current directory
- Confirm using Azure Container Apps
- Select bot, gameapis, and blazor (in the chapters available) to be reachable from the Internet
- Enter an environment name, e.g. codebreaker-dev
- Select
These files are generated:
- azure.yml -
- next-steps.md - documentation what can be done next
- .gitignore - ignoring the .azure folder because it can contain secrets
- .azure - folder with the generated files, configuration of environment variables, and exposed services
- Change to the directory of the solution
- Run
az up
- Select the subscription
- Select a location near you
- Wait some minutes until the resources are created
Issue with azd 1.6.1: After creating the resources, you might need to change the Ingress configuration to have the services previously specified. See Azure/azure-dev#3393
These resources are now available:
- Resource group
- Container Registry
- Log Analytics workspace
- Container Apps Environment
- Container App gameapis
- Container App bot
- Container App blazor (starting with chapter 12)
- Container App redis (starting with chapter 12)
For easier use, on starting the games API service, the SQL Server database is migrated to the new version. With Azure Cosmos DB, a container named GamesV3
with the partition key named /PartitionKey
is created.
Before preview 4: To use the Cosmos database in the local environment, install and start the Cosmos emulator outside of the games solution.
- Create a container named
GamesV3
- Specify the partition key name
/PartitionKey
After you don't need them anymore, delete the Azure resources using
azd down