Python용 Azure Web Apps 라이브러리

개요

Azure App Service를 사용하여 웹 사이트, 웹 애플리케이션, 서비스 및 REST API를 배포하고 크기 조정합니다.

Azure App Service를 시작하려면 Azure에서 Python 웹앱 만들기를 참조하세요.

관리 API

관리 API를 사용하여 Azure App Service에서 호스팅되는 요소를 배포, 관리 및 크기 조정합니다.

pip를 통해 라이브러리를 설치합니다.

pip install azure-mgmt-web

예제

GitHub 리포지토리에서 Azure Web App으로 웹앱을 배포합니다.

siteConfiguration = SiteConfig(
    python_version='3.4'
)

# create a web app
web_client.web_apps.create_or_update(
    RESOURCE_GROUP_NAME,
    WEB_APP_NAME,
    Site(
        location='eastus',
        server_farm_id=SERVICE_PLAN_ID,
        site_config=siteConfiguration
    )
)

# continuous deployment with GitHub
source_control_async_operation = web_client.web_apps.create_or_update_source_control(
    RESOURCE_GROUP_NAME,
    WEB_APP_NAME,
    SiteSourceControl(
        location='GitHub',
        repo_url='https://github.com/lisawong19/python-docs-hello-world',
        branch='master'
    )
)

샘플

웹 애플리케이션 샘플의 전체 목록을 봅니다.