Skip to content

Commit 22f978e

Browse files
committed
Merge pull request #60 from Azure/dev
.
2 parents a876bb7 + 01b2fcb commit 22f978e

File tree

296 files changed

+63509
-27153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

296 files changed

+63509
-27153
lines changed

ChangeLog.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2015.08.07 version 0.9.6
2+
* Azure Batch cmdlets
3+
* Cmdlets updated to use the general availability API. See http://blogs.technet.com/b/windowshpc/archive/2015/07/10/what-39-s-new-in-azure-batch-july-release-general-availability.aspx
4+
* Breaking changes to cmdlets resulting from API update:
5+
* Workitems have been removed.
6+
* If you were adding all tasks to a single job, use the New-AzureBatchJob cmdlet to directly create your job.
7+
* If you were managing workitems with a recurring schedule defined, use the AzureBatchJobSchedule cmdlets instead.
8+
* If you were using the AzureBatchVM cmdlets, use the AzureBatchComputeNode cmdlets instead.
9+
* The AzureBatchTaskFile and AzureBatchVMFile cmdlets have been consolidated into the AzureBatchNodeFile cmdlets.
10+
* The Name property on most entities has been replaced by an Id property.
11+
112
2015.07.17 version 0.9.5
213
* Azure SQL cmdlets
314
* Allowing to use of Storage V2 accounts in Auditing policies

setup/azurecmdfiles.wxi

Lines changed: 84 additions & 0 deletions
Large diffs are not rendered by default.

src/Common/Commands.Common/Commands.Common.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171
<Compile Include="AzurePSCmdlet.cs" />
172172
<Compile Include="CmdletExtensions.cs" />
173173
<Compile Include="ConfigurationConstants.cs" />
174+
<Compile Include="DiagnosticsHelper.cs" />
174175
<Compile Include="ErrorHelper.cs" />
175176
<Compile Include="IdnHelper.cs" />
176177
<Compile Include="ManagementOperationContext.cs" />
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.Common.Properties;
16+
using System;
17+
using System.Collections;
18+
using System.IO;
19+
using System.Linq;
20+
using System.Text;
21+
using System.Xml;
22+
using Newtonsoft.Json;
23+
24+
namespace Microsoft.WindowsAzure.Commands.Utilities.Common
25+
{
26+
public static class DiagnosticsHelper
27+
{
28+
private static string XmlNamespace = "http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration";
29+
private static string EncodedXmlCfg = "xmlCfg";
30+
private static string StorageAccount = "storageAccount";
31+
private static string Path = "path";
32+
private static string ExpandResourceDirectory = "expandResourceDirectory";
33+
private static string LocalResourceDirectory = "localResourceDirectory";
34+
private static string StorageAccountNameTag = "storageAccountName";
35+
private static string StorageAccountKeyTag = "storageAccountKey";
36+
private static string StorageAccountEndPointTag = "storageAccountEndPoint";
37+
38+
public static string GetJsonSerializedPublicDiagnosticsConfigurationFromFile(string configurationPath,
39+
string storageAccountName)
40+
{
41+
return
42+
JsonConvert.SerializeObject(
43+
DiagnosticsHelper.GetPublicDiagnosticsConfigurationFromFile(configurationPath, storageAccountName));
44+
}
45+
46+
public static Hashtable GetPublicDiagnosticsConfigurationFromFile(string configurationPath, string storageAccountName)
47+
{
48+
using (StreamReader reader = new StreamReader(configurationPath))
49+
{
50+
return GetPublicDiagnosticsConfiguration(reader.ReadToEnd(), storageAccountName);
51+
}
52+
}
53+
54+
public static Hashtable GetPublicDiagnosticsConfiguration(string config, string storageAccountName)
55+
{
56+
// find the <WadCfg> element and extract it
57+
int wadCfgBeginIndex = config.IndexOf("<WadCfg>");
58+
if (wadCfgBeginIndex == -1)
59+
{
60+
throw new ArgumentException(Resources.IaasDiagnosticsBadConfigNoWadCfg);
61+
}
62+
63+
int wadCfgEndIndex = config.IndexOf("</WadCfg>");
64+
if (wadCfgEndIndex == -1)
65+
{
66+
throw new ArgumentException(Resources.IaasDiagnosticsBadConfigNoEndWadCfg);
67+
}
68+
69+
if (wadCfgEndIndex <= wadCfgBeginIndex)
70+
{
71+
throw new ArgumentException(Resources.IaasDiagnosticsBadConfigNoMatchingWadCfg);
72+
}
73+
74+
string encodedConfiguration = Convert.ToBase64String(
75+
Encoding.UTF8.GetBytes(
76+
config.Substring(
77+
wadCfgBeginIndex, wadCfgEndIndex + "</WadCfg>".Length - wadCfgBeginIndex).ToCharArray()));
78+
79+
// Now extract the local resource directory element
80+
XmlDocument doc = new XmlDocument();
81+
XmlNamespaceManager ns = new XmlNamespaceManager(doc.NameTable);
82+
ns.AddNamespace("ns", XmlNamespace);
83+
doc.LoadXml(config);
84+
var node = doc.SelectSingleNode("//ns:LocalResourceDirectory", ns);
85+
string localDirectory = (node != null && node.Attributes != null) ? node.Attributes[Path].Value : null;
86+
string localDirectoryExpand = (node != null && node.Attributes != null)
87+
? node.Attributes["expandEnvironment"].Value
88+
: null;
89+
if (localDirectoryExpand == "0")
90+
{
91+
localDirectoryExpand = "false";
92+
}
93+
if (localDirectoryExpand == "1")
94+
{
95+
localDirectoryExpand = "true";
96+
}
97+
98+
var hashTable = new Hashtable();
99+
hashTable.Add(EncodedXmlCfg, encodedConfiguration);
100+
hashTable.Add(StorageAccount, storageAccountName);
101+
if (!string.IsNullOrEmpty(localDirectory))
102+
{
103+
var localDirectoryHashTable = new Hashtable();
104+
localDirectoryHashTable.Add(Path, localDirectory);
105+
localDirectoryHashTable.Add(ExpandResourceDirectory, localDirectoryExpand);
106+
hashTable.Add(LocalResourceDirectory, localDirectoryHashTable);
107+
}
108+
109+
return hashTable;
110+
}
111+
112+
public static string GetJsonSerializedPrivateDiagnosticsConfiguration(string storageAccountName,
113+
string storageKey, string endpoint)
114+
{
115+
return JsonConvert.SerializeObject(GetPrivateDiagnosticsConfiguration( storageAccountName, storageKey, endpoint));
116+
}
117+
118+
public static Hashtable GetPrivateDiagnosticsConfiguration(string storageAccountName, string storageKey, string endpoint)
119+
{
120+
var hashTable = new Hashtable();
121+
hashTable.Add(StorageAccountNameTag, storageAccountName);
122+
hashTable.Add(StorageAccountKeyTag, storageKey);
123+
hashTable.Add(StorageAccountEndPointTag, endpoint);
124+
return hashTable;
125+
}
126+
}
127+
}

src/Common/Commands.Common/Properties/Resources.Designer.cs

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Common/Commands.Common/Properties/Resources.resx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,4 +1443,13 @@ The file needs to be a PowerShell script (.ps1 or .psm1).</value>
14431443
<value>Cannot delete '{0}': {1}</value>
14441444
<comment>{0} is the path of a file, {1} is an error message</comment>
14451445
</data>
1446+
<data name="IaasDiagnosticsBadConfigNoEndWadCfg" xml:space="preserve">
1447+
<value>Cannot find the WadCfg end element in the config.</value>
1448+
</data>
1449+
<data name="IaasDiagnosticsBadConfigNoMatchingWadCfg" xml:space="preserve">
1450+
<value>WadCfg start element in the config is not matching the end element.</value>
1451+
</data>
1452+
<data name="IaasDiagnosticsBadConfigNoWadCfg" xml:space="preserve">
1453+
<value>Cannot find the WadCfg element in the config.</value>
1454+
</data>
14461455
</root>

src/ResourceManager.sln

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ Global
149149
{DEA446A1-84E2-46CC-B780-EB4AFDE2460E}.Debug|Any CPU.Build.0 = Debug|Any CPU
150150
{DEA446A1-84E2-46CC-B780-EB4AFDE2460E}.Release|Any CPU.ActiveCfg = Release|Any CPU
151151
{DEA446A1-84E2-46CC-B780-EB4AFDE2460E}.Release|Any CPU.Build.0 = Release|Any CPU
152-
{127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
153-
{127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
154-
{127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
155-
{127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6}.Release|Any CPU.Build.0 = Release|Any CPU
152+
{59D1B5DC-9175-43EC-90C6-CBA601B3565F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
153+
{59D1B5DC-9175-43EC-90C6-CBA601B3565F}.Debug|Any CPU.Build.0 = Debug|Any CPU
154+
{59D1B5DC-9175-43EC-90C6-CBA601B3565F}.Release|Any CPU.ActiveCfg = Release|Any CPU
155+
{59D1B5DC-9175-43EC-90C6-CBA601B3565F}.Release|Any CPU.Build.0 = Release|Any CPU
156156
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
157157
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Debug|Any CPU.Build.0 = Debug|Any CPU
158158
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -198,7 +198,6 @@ Global
198198
{080B0477-7E52-4455-90AB-23BD13D1B1CE} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
199199
{56ED8C97-53B9-4DF6-ACB5-7E6800105BF8} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
200200
{7E6683BE-ECFF-4709-89EB-1325E9E70512} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
201-
{127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
202201
{13E031E4-8A43-4B87-9D72-D70180C31C11} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
203202
{469F20E0-9D40-41AD-94C3-B47AD15A4C00} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
204203
{133561EC-99AF-4ADC-AF41-39C4D3AD323B} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}

0 commit comments

Comments
 (0)