Get rid of sas.ts
MODIFY
azure-ts-msi-keyvault-rbac/index.ts
azure-ts-msi-keyvault-rbac/index.ts
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
-import { signedBlobReadUrl } from "./sas";
import { execSync} from "child_process";
// Create a resource group
@@ -100,7 +99,7 @@ const vault = new azure.keyvault.KeyVault("vault", {
// Put the URL of the zip Blob to KV
const secret = new azure.keyvault.Secret("deployment-zip", {
keyVaultId: vault.id,
- value: signedBlobReadUrl(blob, storageAccount, storageContainer),
+ value: azure.storage.signedBlobReadUrl(blob, storageAccount),
});
const secretUri = pulumi.interpolate`${secret.vaultUri}secrets/${secret.name}/${secret.version}`;

DELETE
azure-ts-msi-keyvault-rbac/sas.ts
-import * as pulumi from "@pulumi/pulumi";
-import * as azure from "@pulumi/azure";
-
-import * as azurestorage from "azure-storage";
-
-// Given an Azure blob, create a SAS URL that can read it.
-export function signedBlobReadUrl(
- blob: azure.storage.Blob | azure.storage.ZipBlob,
- account: azure.storage.Account,
- container: azure.storage.Container,
-): pulumi.Output<string> {
- // Choose a fixed, far-future expiration date for signed blob URLs.
- // The shared access signature (SAS) we generate for the Azure storage blob must remain valid for as long as the
- // Function App is deployed, since new instances will download the code on startup. By using a fixed date, rather
- // than (e.g.) "today plus ten years", the signing operation is idempotent.
- const signatureExpiration = new Date(2100, 1);
-
- return pulumi.all([
- account.primaryConnectionString,
- container.name,
- blob.name,
- ]).apply(([connectionString, containerName, blobName]) => {
- let blobService = new azurestorage.BlobService(connectionString);
- let signature = blobService.generateSharedAccessSignature(
- containerName,
- blobName,
- {
- AccessPolicy: {
- Expiry: signatureExpiration,
- Permissions: azurestorage.BlobUtilities.SharedAccessPermissions.READ,
- },
- }
- );
-
- return blobService.getUrl(containerName, blobName, signature);
- });
-}

MODIFY
azure-ts-msi-keyvault-rbac/tsconfig.json
azure-ts-msi-keyvault-rbac/tsconfig.json
"strictNullChecks": true
},
"files": [
- "index.ts",
- "sas.ts"
+ "index.ts"
]
}

ADD
azure-ts-msi-keyvault-rbac/webapp/obj/Debug/netcoreapp2.2/webapp.AssemblyInfo.cs
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using System;
+using System.Reflection;
+
+[assembly: System.Reflection.AssemblyCompanyAttribute("webapp")]
+[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
+[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
+[assembly: System.Reflection.AssemblyProductAttribute("webapp")]
+[assembly: System.Reflection.AssemblyTitleAttribute("webapp")]
+[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
+
+// Generated by the MSBuild WriteCodeFragment class.
+

ADD
azure-ts-msi-keyvault-rbac/webapp/obj/Debug/netcoreapp2.2/webapp.AssemblyInfoInputs.cache
+86624970bd25b6b41308b5b2f8e1133d4e97c102

ADD
azure-ts-msi-keyvault-rbac/webapp/obj/Debug/netcoreapp2.2/webapp.csproj.CoreCompileInputs.cache
+7761c5af9aff012cded527e6450a097dfe4e60ba

Get rid of sas.ts