Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 94f1c93

Browse files
authored
Use Storage.Global service endpoint, add keyvault endpoint and minor refactor. (#674)
1 parent f44f857 commit 94f1c93

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed

src/deploy-cromwell-on-azure/Deployer.cs

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,8 +1293,6 @@ private Task AssignVmAsContributorToAppInsightsAsync(IIdentity managedIdentity,
12931293

12941294
vnetDefinition = vnetDefinition.DefineSubnet(configuration.BatchSubnetName)
12951295
.WithAddressPrefix(configuration.BatchNodesSubnetAddressSpace)
1296-
.WithAccessFromService(ServiceEndpointType.MicrosoftStorage)
1297-
.WithAccessFromService(ServiceEndpointType.MicrosoftSql)
12981296
.Attach();
12991297

13001298
var vnet = await vnetDefinition.CreateAsync();
@@ -1303,10 +1301,7 @@ private Task AssignVmAsContributorToAppInsightsAsync(IIdentity managedIdentity,
13031301
// Use the new ResourceManager sdk to add the ACR service endpoint since it is absent from the fluent sdk.
13041302
var armBatchSubnet = (await armClient.GetSubnetResource(new ResourceIdentifier(batchSubnet.Inner.Id)).GetAsync()).Value;
13051303

1306-
armBatchSubnet.Data.ServiceEndpoints.Add(new ServiceEndpointProperties()
1307-
{
1308-
Service = "Microsoft.ContainerRegistry",
1309-
});
1304+
AddServiceEndpointsToSubnet(armBatchSubnet.Data);
13101305

13111306
await armBatchSubnet.UpdateAsync(Azure.WaitUntil.Completed, armBatchSubnet.Data);
13121307

@@ -1825,27 +1820,37 @@ private Task<string> UpdateVnetWithBatchSubnet()
18251820
AddressPrefix = configuration.BatchNodesSubnetAddressSpace,
18261821
};
18271822

1828-
batchSubnet.ServiceEndpoints.Add(new ServiceEndpointProperties()
1829-
{
1830-
Service = "Microsoft.Storage",
1831-
});
1832-
1833-
batchSubnet.ServiceEndpoints.Add(new ServiceEndpointProperties()
1834-
{
1835-
Service = "Microsoft.Sql",
1836-
});
1837-
1838-
batchSubnet.ServiceEndpoints.Add(new ServiceEndpointProperties()
1839-
{
1840-
Service = "Microsoft.ContainerRegistry",
1841-
});
1823+
AddServiceEndpointsToSubnet(batchSubnet);
18421824

18431825
vnetData.Subnets.Add(batchSubnet);
18441826
var updatedVnet = (await vnetCollection.CreateOrUpdateAsync(Azure.WaitUntil.Completed, vnetData.Name, vnetData)).Value;
18451827

18461828
return (await updatedVnet.GetSubnetAsync(configuration.DefaultBatchSubnetName)).Value.Id.ToString();
18471829
});
18481830

1831+
private void AddServiceEndpointsToSubnet(SubnetData subnet)
1832+
{
1833+
subnet.ServiceEndpoints.Add(new ServiceEndpointProperties()
1834+
{
1835+
Service = "Microsoft.Storage.Global",
1836+
});
1837+
1838+
subnet.ServiceEndpoints.Add(new ServiceEndpointProperties()
1839+
{
1840+
Service = "Microsoft.Sql",
1841+
});
1842+
1843+
subnet.ServiceEndpoints.Add(new ServiceEndpointProperties()
1844+
{
1845+
Service = "Microsoft.ContainerRegistry",
1846+
});
1847+
1848+
subnet.ServiceEndpoints.Add(new ServiceEndpointProperties()
1849+
{
1850+
Service = "Microsoft.KeyVault",
1851+
});
1852+
}
1853+
18491854
private async Task ValidateVmAsync()
18501855
{
18511856
var computeSkus = (await generalRetryPolicy.ExecuteAsync(() =>

0 commit comments

Comments
 (0)