Skip to content

Commit 29b709f

Browse files
committed
Updating installer to use Container element of security.config instead of having the contain in the host path
1 parent c81f645 commit 29b709f

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

build/transforms/security.config.install.xdt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<service prefix="media/" name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web" xdt:Locator="Match(prefix, name, type)" xdt:Transform="Remove" />
55
<service prefix="media/" name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web" xdt:Locator="Match(prefix, name, type)" xdt:Transform="InsertIfMissing">
66
<settings xdt:Transform="InsertIfMissing">
7-
<setting key="Container" value="" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
7+
<setting key="Container" value="media" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
88
<setting key="MaxBytes" value="8194304" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
99
<setting key="Timeout" value="30000" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing"/>
10-
<setting key="Host" value="http://[myAccountName].blob.core.windows.net/media/" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing"/>
10+
<setting key="Host" value="http://[myAccountName].blob.core.windows.net" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing"/>
1111
</settings>
1212
</service>
1313
</services>

src/UmbracoFileSystemProviders.Azure.Installer/InstallerController.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,17 @@ internal static bool SaveBlobPathToImageProcessorSecurityXdt(string xdtPath, str
266266
return false;
267267
}
268268

269-
foreach (XmlElement setting in from XmlElement setting in rawSettings let key = setting.GetAttribute("key") where key == "Host" select setting)
269+
foreach (XmlElement setting in from XmlElement setting in rawSettings select setting)
270270
{
271-
setting.SetAttribute("value", $"{rootUrl}{containerName}/");
271+
if (setting.GetAttribute("key").InvariantEquals("Host"))
272+
{
273+
setting.SetAttribute("value", $"{rootUrl}");
274+
}
275+
276+
if (setting.GetAttribute("key").InvariantEquals("Container"))
277+
{
278+
setting.SetAttribute("value", $"{containerName}");
279+
}
272280
}
273281

274282
try

0 commit comments

Comments
 (0)