コード例 #1
0
            list=False,
            add=False,
            create=False,
        ))
    return f"https://{args[0]}.blob.core.windows.net/{args[2]}/{args[3]}{blob_sas.sas}"


http_signed_blob_url = Output.all(
    http_storage_account.name, http_storage_account.primary_connection_string,
    http_container.name, http_zib_blob.name).apply(get_sas)

http_plan = appservice.Plan(
    "http",
    resource_group_name=resource_group.name,
    kind="Linux",
    sku=appservice.PlanSkuArgs(tier="Dynamic", size="Y1"),
    reserved=True,
)

http_function_app = appservice.FunctionApp(
    "http",
    resource_group_name=resource_group.name,
    app_service_plan_id=http_plan.id,
    storage_account_name=http_storage_account.name,
    storage_account_access_key=http_storage_account.primary_access_key,
    version="~3",
    app_settings={
        "FUNCTIONS_WORKER_RUNTIME": "python",
        "WEBSITE_RUN_FROM_PACKAGE": http_signed_blob_url,
    },
)
コード例 #2
0
ファイル: __main__.py プロジェクト: GreenstoneCS/examples
                        server_name=sql_server.name,
                        requested_service_objective_name="S0")

connection_string = Output.all(sql_server.name, database.name) \
    .apply(lambda args: f"Server=tcp:{args[0]}.database.windows.net;Database={args[1]};") or "1111"

text_blob = storage.Blob("text",
                         storage_account_name=storage_account.name,
                         storage_container_name=container.name,
                         type="Block",
                         source=asset.FileAsset("./README.md"))

app_service_plan = appservice.Plan("asp",
                                   resource_group_name=resource_group.name,
                                   kind="App",
                                   sku=appservice.PlanSkuArgs(tier="Basic",
                                                              size="B1"))

blob = storage.Blob(
    "zip",
    storage_account_name=storage_account.name,
    storage_container_name=container.name,
    type="Block",
    source=asset.FileArchive("./webapp/bin/Debug/netcoreapp3.1/publish"))

client_config = core.get_client_config()
tenant_id = client_config.tenant_id
current_principal = client_config.object_id

vault = keyvault.KeyVault(
    "vault",
    resource_group_name=resource_group.name,
コード例 #3
0
import pulumi
from pulumi_azure import core, storage, appservice

# Resource Group
pulumi_rg = core.ResourceGroup('pulumi_rg')

# App Service Plan
pulumi_plan = appservice.Plan("pulumiPlan",
                              location=pulumi_rg.location,
                              resource_group_name=pulumi_rg.name,
                              sku=appservice.PlanSkuArgs(
                                  tier="Standard",
                                  size="S1",
                              ))

# Web App
pulumi_app_service = appservice.AppService(
    "pulumiAppService",
    location=pulumi_rg.location,
    resource_group_name=pulumi_rg.name,
    app_service_plan_id=pulumi_plan.id,
    app_settings={
        "ENVIRONMENT": "dev",
    },
)

# Export the hostname for the web app
pulumi.export('hostname', pulumi_app_service.default_site_hostname)