Azure-Samples/aci-docs-sample-python
Fork: 16 Star: 14 (更新于 2024-12-19 12:54:15)
license: MIT
Language: Python .
Python application demonstrating several common operations in Azure Container Instances (ACI). The code in this project backs one or more articles on docs.microsoft.com.
最后发布版本: 83704 ( 2019-09-13 08:33:40)
page_type: sample languages:
- python products:
- azure description: "This sample application demonstrates several common Azure Container Instances operations in Python using the Azure libraries for Python." urlFragment: aci-docs-sample-python
Azure Container Instances Python code samples for documentation
This sample application demonstrates several common Azure Container Instances operations in Python using the Azure libraries for Python.
The code in this project is ingested into one or more articles on docs.microsoft.com. Modifying the code in the sample source may impact the rendering of code snippets on docs.microsoft.com.
This sample has been tested as functional on Python versions 2.7.15rc1 and 3.6.5.
Features
The code in this sample project demonstrates the following operations:
- Authenticate with Azure
- Create resource group
- Create single- and multi-container container groups
- Expose application container to internet with public DNS name
- Multi-container group includes both application and sidecar containers
- Run a task-based container with custom command line and environment variables
- List container groups in resource group
- Get and print container group details
- Delete container groups
- Delete resource group
Getting Started
Prerequisites
- Azure subscription
- Python
- pip
- virtualenv (optional)
Run the sample
-
Optional but recommended, use virtualenv to create and activate a virtual environment for the project:
virtualenv ~/venv/aci-docs-sample-python source ~/venv/aci-docs-sample-python/bin/activate
-
Use the Azure CLI (or Cloud Shell) to generate an Azure credentials file (more authentication details)
az ad sp create-for-rbac --sdk-auth > my.azureauth
-
Set environment variable
AZURE_AUTH_LOCATION
to the full path of the credentials file -
git clone https://github.com/Azure-Samples/aci-docs-sample-python
-
cd aci-docs-sample-python
-
pip install -r src/requirements.txt
-
python src/aci_docs_sample.py
...sample runs...
-
Exit virtualenv (if using a virtual environment):
deactivate
Resources
最近版本更新:(数据更新于 2024-09-05 20:30:04)
2019-09-13 08:33:40 83704
Azure-Samples/aci-docs-sample-python同语言 Python最近更新仓库
2024-12-22 18:18:34 LeslieLeung/heimdallr
2024-12-22 09:03:32 ultralytics/ultralytics
2024-12-21 13:26:40 notepad-plus-plus/nppPluginList
2024-12-21 11:42:53 XiaoMi/ha_xiaomi_home
2024-12-21 04:33:22 comfyanonymous/ComfyUI
2024-12-20 18:47:56 home-assistant/core