Подія
Створення програм і агентів AI
17 бер., 21 - 21 бер., 10
Приєднайтеся до серії нарад, щоб створити масштабовані рішення зі ШІ на основі реальних випадків використання з колегами-розробниками та експертами.
Зареєструватися заразЦей браузер більше не підтримується.
Замініть його на Microsoft Edge, щоб користуватися перевагами найновіших функцій, оновлень безпеки та технічної підтримки.
The Azure Container Apps service enables you to run microservices and containerized applications on a serverless platform. With Container Apps, you enjoy the benefits of running containers while you leave behind the concerns of manually configuring cloud infrastructure and complex container orchestrators.
In this tutorial, you create a secure Container Apps environment and deploy your first container app.
Примітка
You can also deploy this app using the az containerapp up by following the instructions in the Quickstart: Deploy your first container app with containerapp up article. The az containerapp up
command is a fast and convenient way to build and deploy your app to Azure Container Apps using a single command. However, it doesn't provide the same level of customization for your container app.
To sign in to Azure from the CLI, run the following command and follow the prompts to complete the authentication process.
az login
To ensure you're running the latest version of the CLI, run the upgrade command.
az upgrade
Next, install or update the Azure Container Apps extension for the CLI.
If you receive errors about missing parameters when you run az containerapp
commands in Azure CLI or cmdlets from the Az.App
module in PowerShell, be sure you have the latest version of the Azure Container Apps extension installed.
az extension add --name containerapp --upgrade
Примітка
Starting in May 2024, Azure CLI extensions no longer enable preview features by default. To access Container Apps preview features, install the Container Apps extension with --allow-preview true
.
az extension add --name containerapp --upgrade --allow-preview true
Now that the current extension or module is installed, register the Microsoft.App
and Microsoft.OperationalInsights
namespaces.
az provider register --namespace Microsoft.App
az provider register --namespace Microsoft.OperationalInsights
Set the following environment variables. Replace the <PLACEHOLDERS>
with your values:
RESOURCE_GROUP="<RESOURCE_GROUP>"
LOCATION="<LOCATION>"
CONTAINERAPPS_ENVIRONMENT="<CONTAINERAPPS_ENVIRONMENT>"
Create a resource group to organize the services related to your container app deployment.
az group create \
--name $RESOURCE_GROUP \
--location "$LOCATION"
An environment in Azure Container Apps creates a secure boundary around a group of container apps. Container Apps deployed to the same environment are deployed in the same virtual network and write logs to the same Log Analytics workspace.
To create the environment, run the following command:
az containerapp env create \
--name $CONTAINERAPPS_ENVIRONMENT \
--resource-group $RESOURCE_GROUP \
--location "$LOCATION"
Now that you have an environment created, you can deploy your first container app. With the containerapp create
command, deploy a container image to Azure Container Apps.
az containerapp create \
--name my-container-app \
--resource-group $RESOURCE_GROUP \
--environment $CONTAINERAPPS_ENVIRONMENT \
--image mcr.microsoft.com/k8se/quickstart:latest \
--target-port 80 \
--ingress external \
--query properties.configuration.ingress.fqdn
Примітка
Make sure the value for the --image
parameter is in lower case.
By setting --ingress
to external
, you make the container app available to public requests.
The create
command returns the fully qualified domain name for the container app. Copy this location to a web browser.
The following message is displayed when the container app is deployed:
If you're not going to continue to use this application, run the following command to delete the resource group along with all the resources created in this tutorial.
Застереження
The following command deletes the specified resource group and all resources contained within it. If resources outside the scope of this tutorial exist in the specified resource group, they will also be deleted.
az group delete --name $RESOURCE_GROUP
Порада
Having issues? Let us know on GitHub by opening an issue in the Azure Container Apps repo.
Подія
Створення програм і агентів AI
17 бер., 21 - 21 бер., 10
Приєднайтеся до серії нарад, щоб створити масштабовані рішення зі ШІ на основі реальних випадків використання з колегами-розробниками та експертами.
Зареєструватися заразНавчання
Модуль
Настроювання програми-контейнера в програмах контейнера Azure - Training
Цей модуль допоможе користувачам створювати, настроюючи та керуючи програмами-контейнерами та їхніми середовищами. У ньому також розглядаються варіанти входу, масштабування, керування екземплярами та рекомендації з безпеки з рекомендаціями з настроювання програм контейнерів Azure.
Сертифікація
Microsoft Certified: Azure Developer Associate - Certifications
Створюйте насккладні рішення в Microsoft Azure, щоб створювати функції Azure, впроваджувати веб-програми та керувати ними, розробляти рішення, що використовують сховище Azure тощо.
Документація
Tutorial: Build and deploy your app to Azure Container Apps
Build and deploy your app to Azure Container Apps with az containerapp create command.
Deploy Azure Container Apps with the az containerapp up command
How to deploy a container app with the az containerapp up command
Code to cloud options in Azure Container Apps
Learn about the different options to deploy a container app directly from your development environment.