Skip to content

Instantly share code, notes, and snippets.

@TechWatching
Created February 21, 2020 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TechWatching/a49e0f450600b3f5db17dcea8d2e4a7b to your computer and use it in GitHub Desktop.
Save TechWatching/a49e0f450600b3f5db17dcea8d2e4a7b to your computer and use it in GitHub Desktop.
Code to reproduce issue with state using azure provider in pulumi..
using System.Collections.Generic;
using System.Threading.Tasks;
using Pulumi;
using Pulumi.Azure.AppInsights;
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("testpulumi");
var appInsights = new Insights("appInsights", new InsightsArgs
{
ApplicationType = "web",
ResourceGroupName = resourceGroup.Name,
});
var appInsightApiKey = new ApiKey("ai", new ApiKeyArgs
{
ApplicationInsightsId = appInsights.Id,
ReadPermissions = "api"
});
// Export the connection string for the storage account
return new Dictionary<string, object?>
{
{ "AppInsightKey", appInsightApiKey.Key }
};
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment