We will be sunsetting Advisor during Jan, 2026 and will instead be providing information in Snyk Security DB.

You can begin to take advantage of Snyk Security DB today for a unified, package-centric experience.

How to use the @pulumi/azure.storage function in @pulumi/azure

To help you get started, we’ve selected a few @pulumi/azure examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pulumi / examples / azure-ts-dynamicresource / index.ts View on Github external
location: location,
});

// Create an Azure resource (Storage Account) so we can point the CDN endpoint to it.
const storageAccount = new azure.storage.Account("storageAccount", {
    resourceGroupName: resourceGroup.name,
    accountTier: "Standard",
    accountReplicationType: "LRS",
});

/**
 * Create a Blob container in the storage account,
 * to store any static files. The CDN endpoint will be pointed at the
 * endpoint for this blob container.
 */
const blobContainer = new azure.storage.Container("blobContainer", {
    storageAccountName: storageAccount.name,
    // Make each "blob" in the container publicly accessible.
    // DO NOT set this property if you are going to store sensitive files!
    containerAccessType: "blob",
});

const cdnProfile = new azure.cdn.Profile("cdnProfile", {
    resourceGroupName: resourceGroup.name,
    // Choose an appropriate SKU to use.
    // https://docs.microsoft.com/en-us/azure/cdn/cdn-features
    sku: "Standard_Akamai",
});

const cdnEndpoint = new azure.cdn.Endpoint("cdnEndpoint", {
    /**
     * Specify a well-known name for the endpoint name,
github pulumi / examples / azure-ts-msi-keyvault-rbac / index.ts View on Github external
type: "block",
    source: "./README.md",
});

// A plan to host the App Service
const appServicePlan = new azure.appservice.Plan("asp", {
    resourceGroupName: resourceGroup.name,
    kind: "App",
    sku: {
        tier: "Basic",
        size: "B1",
    },
});

// ASP.NET deployment package
const blob = new azure.storage.ZipBlob("zip", {
    storageAccountName: storageAccount.name,
    storageContainerName: storageContainer.name,
    type: "block",

    content: new pulumi.asset.FileArchive("./webapp/bin/Debug/netcoreapp2.2/publish"),
});

const clientConfig = azure.core.getClientConfig({ async: true });
const tenantId = clientConfig.then(config => config.tenantId);
const currentPrincipal = clientConfig.then(config => config.objectId);

// Key Vault to store secrets (e.g. Blob URL with SAS)
const vault = new azure.keyvault.KeyVault("vault", {
    resourceGroupName: resourceGroup.name,
    skuName: "standard",
    tenantId: tenantId,
github pulumi / examples / azure-ts-aks-keda / index.ts View on Github external
// Create an AKS K8s cluster
const aks = new AksCluster("keda-cluster", {
    resourceGroupName: resourceGroup.name,
    kubernetesVersion: "1.13.5",
    vmSize: "Standard_B2s",
    vmCount: 3,
});

// Deploy shared components of KEDA (container registry, kedacore/keda-edge Helm chart)
const service = new KedaService("keda-edge", {
    resourceGroup,
    k8sProvider: aks.provider,
});

// Create the storage account and the storage queue to listen to
const storageAccount = new azure.storage.Account("kedapulumi", {
    resourceGroupName: resourceGroup.name,
    accountTier: "Standard",
    accountReplicationType: "LRS",
});
const queue = new azure.storage.Queue("kedaqueue", {
    storageAccountName: storageAccount.name,
});

// Deploy a Function App which subscribes to the Storage Queue
const app = new KedaStorageQueueHandler("queue-handler", {
    resourceGroup,
    service,
    storageAccount,
    queue,
    path: "./functionapp",
});
github pulumi / examples / azure-ts-aks-keda / index.ts View on Github external
vmCount: 3,
});

// Deploy shared components of KEDA (container registry, kedacore/keda-edge Helm chart)
const service = new KedaService("keda-edge", {
    resourceGroup,
    k8sProvider: aks.provider,
});

// Create the storage account and the storage queue to listen to
const storageAccount = new azure.storage.Account("kedapulumi", {
    resourceGroupName: resourceGroup.name,
    accountTier: "Standard",
    accountReplicationType: "LRS",
});
const queue = new azure.storage.Queue("kedaqueue", {
    storageAccountName: storageAccount.name,
});

// Deploy a Function App which subscribes to the Storage Queue
const app = new KedaStorageQueueHandler("queue-handler", {
    resourceGroup,
    service,
    storageAccount,
    queue,
    path: "./functionapp",
});

// Output the cluster name and .kube/config
export const clusterName = aks.cluster.name;
export const kubeConfig = aks.cluster.kubeConfigRaw;
export const storageAccountName = storageAccount.name;
github pulumi / examples / azure-ts-cosmosdb-logicapp / index.ts View on Github external
// Copyright 2016-2019, Pulumi Corporation.  All rights reserved.

import * as azure from "@pulumi/azure";
import * as pulumi from "@pulumi/pulumi";

// Create an Azure Resource Group
const resourceGroup = new azure.core.ResourceGroup("logicappdemo-rg");

// Create an Azure resource (Storage Account)
const storageAccount = new azure.storage.Account("logicappdemosa", {
    resourceGroupName: resourceGroup.name,
    accountReplicationType: "LRS",
    accountTier: "Standard",
    accountKind: "StorageV2",
});

// Cosmos DB Account
const cosmosdbAccount = new azure.cosmosdb.Account("logicappdemo-cdb", {
    resourceGroupName: resourceGroup.name,
    location: resourceGroup.location,
    offerType: "Standard",
    geoLocations: [{ location: resourceGroup.location, failoverPriority: 0 }],
    consistencyPolicy: {
        consistencyLevel: "Session",
    },
});
github pulumi / examples / azure-ts-appservice-devops / infra / index.ts View on Github external
// use first 10 characters of the stackname as prefix for resource names
const prefix = pulumi.getStack().substring(0, 9);

const resourceGroup = new azure.core.ResourceGroup(`${prefix}-rg`, {
        location: azure.Locations.WestUS2,
    });

const resourceGroupArgs = {
    resourceGroupName: resourceGroup.name,
    location: resourceGroup.location,
};

// Storage Account name must be lowercase and cannot have any dash characters
const storageAccountName = `${prefix.toLowerCase().replace(/-/g, "")}sa`;
const storageAccount = new azure.storage.Account(storageAccountName, {
    ...resourceGroupArgs,

    accountKind: "StorageV2",
    accountTier: "Standard",
    accountReplicationType: "LRS",
});


const appServicePlan = new azure.appservice.Plan(`${prefix}-asp`, {
    ...resourceGroupArgs,

    kind: "App",

    sku: {
        tier: "Basic",
        size: "B1",
github pulumi / pulumi-cloud / azure / shared.ts View on Github external
function getOrCreateGlobalStorageAccount(): azure.storage.Account {
    const storageAccountId = azureConfig.get("storageAccountId");
    if (storageAccountId) {
        return azure.storage.Account.get("global", storageAccountId);
    }

    // Account name must be 24 chars or less and must be lowercase.
    // https://docs.microsoft.com/en-us/azure/architecture/best-practices/naming-conventions#storage
    const storageAccountName = makeSafeStorageAccountName(
        createNameWithStackInfo("global" + sha1hash(pulumi.getStack()), 24, /*delim*/ ""));

    return new azure.storage.Account("global", {
        resourceGroupName: globalResourceGroupName,
        location: location,
        name: storageAccountName,
        accountKind: "StorageV2",
        accountTier: "Standard",
        accountReplicationType: "LRS",
    }, { parent: getGlobalInfrastructureResource() });
}
github pulumi / examples / azure-ts-functions / azureFunction.ts View on Github external
this.storageContainer = new azure.storage.Container(`${name}-c`, {
            resourceGroupName: this.resourceGroup.name,
            storageAccountName: this.storageAccount.name,
            containerAccessType: "private",
        }, parentArgs);

        this.blob = new azure.storage.ZipBlob(`${name}-b`, {
            resourceGroupName: this.resourceGroup.name,
            storageAccountName: this.storageAccount.name,
            storageContainerName: this.storageContainer.name,
            type: "block",
        
            content: new pulumi.asset.AssetArchive(blobContent(name, handler)),
        }, parentArgs);

        this.codeBlobUrl = azure.storage.signedBlobReadUrl(this.blob, this.storageAccount);

        this.appServicePlan = new azure.appservice.Plan(`${name}-p`, {
            ...resourceGroupArgs,
        
            kind: "FunctionApp",
        
            // https://social.msdn.microsoft.com/Forums/azure/en-US/665c365d-2b86-4a77-8cea-72ccffef216c
            sku: {
                tier: "Dynamic",
                size: "Y1",
            },
        }, parentArgs);

        this.functionApp = new azure.appservice.FunctionApp(`${name}-app`, {
            ...resourceGroupArgs,
github pulumi / pulumi-cloud / azure / shared.ts View on Github external
function getOrCreateGlobalStorageAccount(): azure.storage.Account {
    const storageAccountId = azureConfig.get("storageAccountId");
    if (storageAccountId) {
        return azure.storage.Account.get("global", storageAccountId);
    }

    // Account name must be 24 chars or less and must be lowercase.
    // https://docs.microsoft.com/en-us/azure/architecture/best-practices/naming-conventions#storage
    const storageAccountName = makeSafeStorageAccountName(
        createNameWithStackInfo("global" + sha1hash(pulumi.getStack()), 24, /*delim*/ ""));

    return new azure.storage.Account("global", {
        resourceGroupName: globalResourceGroupName,
        location: location,
        name: storageAccountName,
        accountKind: "StorageV2",
        accountTier: "Standard",
        accountReplicationType: "LRS",
    }, { parent: getGlobalInfrastructureResource() });
}
github pulumi / examples / azure-ts-static-website / index.ts View on Github external
["index.html", "404.html"].map(name =>
    new azure.storage.Blob(name, {
        name,
        resourceGroupName: resourceGroup.name,
        storageAccountName: storageAccount.name,
        storageContainerName: staticWebsite.webContainerName,
        type: "block",
        source: `./wwwroot/${name}`,
        contentType: "text/html",
    }),
);

@pulumi/azure

A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Nat

Apache-2.0
Latest version published 1 month ago

Package Health Score

87 / 100
Full package analysis