Skip to content

Commit

Permalink
Update Azure/docker examples to 2.1 (pulumi#604)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhailshilkov authored Mar 17, 2020
1 parent d825b81 commit 40ca13e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
12 changes: 6 additions & 6 deletions azure-cs-cosmosapp-component/ArchiveFunctionApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public class ArchiveFunctionApp : ComponentResource
{
public Output<string> AppId { get; private set; } = null!;

public ArchiveFunctionApp(string name, ArchiveFunctionAppArgs args, ResourceOptions? options = null)
public ArchiveFunctionApp(string name, ArchiveFunctionAppArgs args, ComponentResourceOptions? options = null)
: base("examples:azure:ArchiveFunctionApp", name, options)
{
var opts = CustomResourceOptions.Merge(options, new CustomResourceOptions { Parent = this });
var opts = new CustomResourceOptions { Parent = this };

var storageAccount = new Account($"sa{args.Location}", new AccountArgs
{
Expand Down Expand Up @@ -42,12 +42,12 @@ public ArchiveFunctionApp(string name, ArchiveFunctionAppArgs args, ResourceOpti
ContainerAccessType = "private",
}, opts);

var blob = new ZipBlob($"zip-{args.Location}", new ZipBlobArgs
var blob = new Blob($"zip-{args.Location}", new BlobArgs
{
StorageAccountName = storageAccount.Name,
StorageContainerName = container.Name,
Type = "block",
Content = args.Archive,
Type = "Block",
Source = args.Archive,
}, opts);

var codeBlobUrl = SharedAccessSignature.SignedBlobReadUrl(blob, storageAccount);
Expand All @@ -73,7 +73,7 @@ public class ArchiveFunctionAppArgs
{
public Input<string> ResourceGroupName { get; set; } = null!;
public string Location { get; set; } = null!;
public Input<Archive> Archive { get; set; } = null!;
public Input<AssetOrArchive> Archive { get; set; } = null!;

private InputMap<string>? _appSettings;
public InputMap<string> AppSettings
Expand Down
4 changes: 2 additions & 2 deletions azure-cs-cosmosapp-component/Azure.CosmosAppComponent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pulumi.Azure" Version="1.14.0-preview" />
<PackageReference Include="Pulumi.Docker" Version="1.2.0-preview" />
<PackageReference Include="Pulumi.Azure" Version="2.1.0-preview" />
<PackageReference Include="Pulumi.Docker" Version="1.4.0-preview" />
</ItemGroup>

<PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions azure-cs-cosmosapp-component/CosmosApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public CosmosApp(string name, CosmosAppArgs args, ComponentResourceOptions? opti
var resourceGroup = args.ResourceGroup;
var locations = args.Locations;
var primaryLocation = locations[0];
var parentOptions = (CustomResourceOptions)ResourceOptions.Merge(new CustomResourceOptions { Parent = this }, options);
var parentOptions = new CustomResourceOptions { Parent = this };

// Cosmos DB Account with multiple replicas
var cosmosAccount = new Account($"cosmos-{name}",
Expand Down Expand Up @@ -154,7 +154,7 @@ public CosmosApp(string name, CosmosAppArgs args, ComponentResourceOptions? opti

var globalContext = new GlobalContext(resourceGroup, cosmosAccount, database, container, parentOptions);
var buildLocation = args.Factory(globalContext);
var endpointOptions = (CustomResourceOptions)ResourceOptions.Merge(options, new CustomResourceOptions { Parent = profile, DeleteBeforeReplace = true });
var endpointOptions = new CustomResourceOptions { Parent = profile, DeleteBeforeReplace = true };

var endpoints = locations.Select(location =>
{
Expand Down
6 changes: 3 additions & 3 deletions azure-cs-cosmosapp-component/Functions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ public static IDictionary<string, object> Run()
{
ResourceGroupName = resourceGroup.Name,
Location = region.Location,
Archive = new FileArchive("./app/bin/Debug/netcoreapp2.2/publish"),
Archive = new FileArchive("./app/bin/Debug/netcoreapp3.1/publish"),
AppSettings =
{
{ "CosmosDBConnection", connectionString },
},
},
global.Options);
new ComponentResourceOptions { Parent = global.Options.Parent } );

return new AzureEndpoint(func.AppId);
},
Expand All @@ -49,4 +49,4 @@ public static IDictionary<string, object> Run()
{ "functionsEndpoint", Output.Format($"{app.Endpoint}/cosmos") }
};
}
}
}
6 changes: 3 additions & 3 deletions azure-cs-cosmosapp-component/VmScaleSets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Builder(ResourceGroup resourceGroup)

public Func<RegionalContext, IRegionalEndpoint> BuildVMScaleSetApp(GlobalContext context)
{
var options = (CustomResourceOptions)ResourceOptions.Merge(context.Options, new CustomResourceOptions { DeleteBeforeReplace = true });
var options = CustomResourceOptions.Merge(context.Options, new CustomResourceOptions { DeleteBeforeReplace = true });
var file = File.ReadAllText("./vm/vmCustomData.yaml");
return (RegionalContext region) =>
{
Expand Down Expand Up @@ -198,7 +198,7 @@ public Func<RegionalContext, IRegionalEndpoint> BuildVMScaleSetApp(GlobalContext
},
UpgradePolicyMode = "Automatic",
},
(CustomResourceOptions)ResourceOptions.Merge(options, new ResourceOptions { DependsOn = { bpepool, rule } }));
CustomResourceOptions.Merge(options, new CustomResourceOptions { DependsOn = { bpepool, rule } }));

var autoscale = new AutoscaleSetting($"as-{location}", new AutoscaleSettingArgs
{
Expand Down Expand Up @@ -280,4 +280,4 @@ public Func<RegionalContext, IRegionalEndpoint> BuildVMScaleSetApp(GlobalContext

}
}
}
}
6 changes: 3 additions & 3 deletions azure-cs-cosmosapp-component/app/Functions.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AzureFunctionsVersion>v2</AzureFunctionsVersion>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.CosmosDB" Version="3.0.5" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.29" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions azure-fs-aci/Azure.Aci.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Pulumi.FSharp" Version="1.5.2-preview" />
<PackageReference Include="Pulumi.Azure" Version="1.4.0-preview" />
<PackageReference Include="Pulumi.Docker" Version="1.2.0-preview" />
<PackageReference Include="Pulumi.FSharp" Version="1.12.1-preview" />
<PackageReference Include="Pulumi.Azure" Version="2.1.0-preview" />
<PackageReference Include="Pulumi.Docker" Version="1.4.0-preview" />
</ItemGroup>

</Project>

0 comments on commit 40ca13e

Please sign in to comment.