Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
type: "block",
source: `./wwwroot/${name}`,
contentType: "text/html",
}),
);
// Web endpoint to the website
export const staticEndpoint = staticWebsite.endpoint;
// Optionally, we can add a CDN in front of the website
const cdn = new azure.cdn.Profile("website-cdn", {
resourceGroupName: resourceGroup.name,
sku: "Standard_Microsoft",
});
const endpoint = new azure.cdn.Endpoint("website-cdn-ep", {
resourceGroupName: resourceGroup.name,
profileName: cdn.name,
originHostHeader: staticWebsite.hostName,
origins: [{
name: "blobstorage",
hostName: staticWebsite.hostName,
}],
});
// CDN endpoint to the website.
// Allow it some time after the deployment to get ready.
export const cdnEndpoint = pulumi.interpolate`https://${endpoint.hostName}/`;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,
* so you can add a CNAME record for your custom domain
* pointing to this CDN endpoint to it.
*
* For example, the URL for this CDN endpoint when it is created
* would be `my-cdn-endpoint.azureedge.net`.
*/
name: "my-cdn-endpoint",*/
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,
* so you can add a CNAME record for your custom domain
* pointing to this CDN endpoint to it.
*
* For example, the URL for this CDN endpoint when it is created
* would be `my-cdn-endpoint.azureedge.net`.
*/
name: "my-cdn-endpoint",
resourceGroupName: resourceGroup.name,
profileName: cdnProfile.name,
isHttpsAllowed: true,
isHttpAllowed: false,
isCompressionEnabled: true,
originHostHeader: storageAccount.primaryBlobHost,
contentTypesToCompresses: [new azure.storage.Blob(name, {
name,
resourceGroupName: resourceGroup.name,
storageAccountName: storageAccount.name,
storageContainerName: staticWebsite.webContainerName,
type: "block",
source: `./wwwroot/${name}`,
contentType: "text/html",
}),
);
// Web endpoint to the website
export const staticEndpoint = staticWebsite.endpoint;
// Optionally, we can add a CDN in front of the website
const cdn = new azure.cdn.Profile("website-cdn", {
resourceGroupName: resourceGroup.name,
sku: "Standard_Microsoft",
});
const endpoint = new azure.cdn.Endpoint("website-cdn-ep", {
resourceGroupName: resourceGroup.name,
profileName: cdn.name,
originHostHeader: staticWebsite.hostName,
origins: [{
name: "blobstorage",
hostName: staticWebsite.hostName,
}],
});
// CDN endpoint to the website.
// Allow it some time after the deployment to get ready.