jolly-stone-87333
05/22/2021, 11:59 AMvar exampleBlob = new Azure.Storage.Blob("blob-" + name, new Azure.Storage.BlobArgs
{
StorageAccountName = storageAccount.Name,
StorageContainerName = container.Name,
Type = "Block",
Source = new FileAsset(file),
}, new CustomResourceOptions() { Parent = this, DependsOn = new InputList<Resource>() { container, storageAccount } });
var exampleDatabase = new Azure.Sql.Database( name, new Azure.Sql.DatabaseArgs
{
MaxSizeGb = size.MaxSize,
Edition = size.Edition,
RequestedServiceObjectiveName = size.ServiceObjectiveLevel,
ResourceGroupName = ResourceGroup.Name,
ServerName = sqlServer.Name,
Import = new DatabaseImportArgs()
{
AdministratorLogin = username,
AdministratorLoginPassword = password,
AuthenticationType = "SQL",
StorageKey = storageAccount.PrimaryAccessKey,
StorageKeyType = "StorageAccessKey",
OperationMode = "Import",
StorageUri = exampleBlob.Url
},
Collation = DatabaseCollation
}, new CustomResourceOptions() { Parent = this, DependsOn = new InputList<Resource>() { sqlServer, storageAccount, exampleBlob } });
return Output.All(sqlServer.Name, exampleDatabase.Name, password).Apply(f=> $"Data Source={f[0]}.<http://database.windows.net;Initial|database.windows.net;Initial> Catalog={f[1]};User ID={username};Password={f[2]};");