Skip to content

Instantly share code, notes, and snippets.

@mikhailshilkov
Created February 7, 2020 13:30
Show Gist options
  • Save mikhailshilkov/3efa3fb93d936220a346ecfd4280e76f to your computer and use it in GitHub Desktop.
Save mikhailshilkov/3efa3fb93d936220a346ecfd4280e76f to your computer and use it in GitHub Desktop.
.NET API change
using Pulumi;
using Pulumi.Serialization;
using Pulumi.Azure.Core;
using Pulumi.Azure.Storage;
class MyStack : Stack
{
public MyStack()
{
// Create an Azure Resource Group
var resourceGroup = new ResourceGroup("resourceGroup");
// Create an Azure Storage Account
var storageAccount = new Account("storage", new AccountArgs
{
ResourceGroupName = resourceGroup.Name,
AccountReplicationType = "LRS",
AccountTier = "Standard",
});
// Export the connection string for the storage account
this.ConnectionString = storageAccount.PrimaryConnectionString;
}
[Output] public Output<string> ConnectionString { get; set; }
}
using System.Threading.Tasks;
using Pulumi;
class Program
{
static Task<int> Main() => Deployment.RunAsync<MyStack>();
}
using System.Collections.Generic;
using System.Threading.Tasks;
using Pulumi;
using Pulumi.Azure.Core;
using Pulumi.Azure.Storage;
class Program
{
static Task<int> Main()
{
return Deployment.RunAsync(() => {
// Create an Azure Resource Group
var resourceGroup = new ResourceGroup("resourceGroup");
// Create an Azure Storage Account
var storageAccount = new Account("storage", new AccountArgs
{
ResourceGroupName = resourceGroup.Name,
AccountReplicationType = "LRS",
AccountTier = "Standard",
});
// Export the connection string for the storage account
return new Dictionary<string, object>
{
{ "connectionString", storageAccount.PrimaryConnectionString },
};
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment