Dela via


Azure Web Apps-bibliotek för Python

Översikt

Distribuera och skala webbplatser, webbprogram, tjänster och REST-API:er med Azure App Service.

Information om hur du kommer igång med Azure App Service finns i Skapa en Python-webbapp i Azure.

Hanterings-API

Distribuera, hantera och skala element som finns i Azure App Service med hanterings-API:et.

Installera biblioteket via pip.

pip install azure-mgmt-web

Exempel

Distribuera en webbapp från en GitHub-lagringsplats till 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'
    )
)

Exempel

Visa den fullständiga listan över webbprogramexempel.