Skip to content

Commit 3f65200

Browse files
committed
Merge pull request #250 from markcowl/profilehelp
Fixing startup issue on new machines and RP registration issue
2 parents 84e4692 + 7d92474 commit 3f65200

File tree

124 files changed

+1247
-1231
lines changed

Some content is hidden

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

124 files changed

+1247
-1231
lines changed

setup/azurecmd.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
66
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>
77

8-
<?define version="0.8.15" ?>
8+
<?define version="0.8.15.1" ?>
99
<?define versionedStartMenuFolder="Microsoft Azure" ?>
1010
<?define staleStartMenuFolder="Windows Azure" ?>
1111

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
</Reference>
5959
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6060
<SpecificVersion>False</SpecificVersion>
61-
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.13-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
61+
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.15-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
6262
</Reference>
6363
<Reference Include="Microsoft.Azure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6464
<SpecificVersion>False</SpecificVersion>

src/Common/Commands.Common.Storage/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<packages>
33
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
44
<package id="Microsoft.Azure.Common" version="2.0.4" targetFramework="net45" />
5-
<package id="Microsoft.Azure.Common.Authentication" version="1.0.13-preview" targetFramework="net45" />
5+
<package id="Microsoft.Azure.Common.Authentication" version="1.0.15-preview" targetFramework="net45" />
66
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
77
<package id="Microsoft.Azure.Management.Resources" version="2.12.0-preview" targetFramework="net45" />
88
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
</Reference>
5858
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5959
<SpecificVersion>False</SpecificVersion>
60-
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.13-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
60+
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.15-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
6161
</Reference>
6262
<Reference Include="Microsoft.Azure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6363
<SpecificVersion>False</SpecificVersion>

src/Common/Commands.Common.Test/Mocks/MockClientFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public TClient CreateClient<TClient>(AzureContext context, AzureEnvironment.Endp
5555

5656
public TClient CreateClient<TClient>(AzureProfile profile, AzureEnvironment.Endpoint endpoint) where TClient : ServiceClient<TClient>
5757
{
58-
throw new NotImplementedException();
58+
return CreateClient<TClient>(profile, profile.Context.Subscription, endpoint);
5959
}
6060

6161
public TClient CreateClient<TClient>(AzureProfile profile, AzureSubscription subscription, AzureEnvironment.Endpoint endpoint) where TClient : ServiceClient<TClient>

src/Common/Commands.Common.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<packages>
33
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
44
<package id="Microsoft.Azure.Common" version="2.0.4" targetFramework="net45" />
5-
<package id="Microsoft.Azure.Common.Authentication" version="1.0.13-preview" targetFramework="net45" />
5+
<package id="Microsoft.Azure.Common.Authentication" version="1.0.15-preview" targetFramework="net45" />
66
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
77
<package id="Microsoft.Azure.Management.Resources" version="2.12.0-preview" targetFramework="net45" />
88
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5513.27084-prerelease" targetFramework="net45" />

src/Common/Commands.Common/AzurePSCmdlet.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ static AzurePSCmdlet()
7171
if (!TestMockSupport.RunningMocked)
7272
{
7373
InitializeTokenCaches();
74-
SetTokenCacheForProfile(CurrentProfile);
7574
AzureSession.DataStore = new DiskDataStore();
75+
SetTokenCacheForProfile(CurrentProfile);
7676
}
7777
}
7878

@@ -86,7 +86,8 @@ protected static AzureProfile InitializeDefaultProfile()
8686
{
8787
try
8888
{
89-
return new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile));
89+
GeneralUtilities.EnsureDefaultProfileDirectoryExists();
90+
return new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile));
9091
}
9192
catch
9293
{
@@ -117,6 +118,7 @@ protected static void InitializeTokenCaches()
117118
if (!string.IsNullOrWhiteSpace(AzureSession.ProfileDirectory) &&
118119
!string.IsNullOrWhiteSpace(AzureSession.TokenCacheFile))
119120
{
121+
GeneralUtilities.EnsureDefaultProfileDirectoryExists();
120122
DefaultDiskTokenCache = new ProtectedFileTokenCache(Path.Combine(AzureSession.ProfileDirectory, AzureSession.TokenCacheFile));
121123
}
122124
else

src/Common/Commands.Common/AzurePowerShell.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public class AzurePowerShell
2727

2828
public const string AssemblyCopyright = "Copyright © Microsoft";
2929

30-
public const string AssemblyVersion = "0.8.15";
30+
public const string AssemblyVersion = "0.8.15.1";
3131

32-
public const string AssemblyFileVersion = "0.8.15";
32+
public const string AssemblyFileVersion = "0.8.15.1";
3333

3434
public const string ProfileFile = "AzureProfile.json";
3535

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
</Reference>
6161
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6262
<SpecificVersion>False</SpecificVersion>
63-
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.13-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
63+
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.15-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
6464
</Reference>
6565
<Reference Include="Microsoft.Azure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6666
<SpecificVersion>False</SpecificVersion>

src/Common/Commands.Common/GeneralUtilities.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,5 +419,16 @@ public static string GenerateSeparator(int amount, string separator)
419419
while (amount-- != 0) result.Append(separator);
420420
return result.ToString();
421421
}
422+
423+
/// <summary>
424+
/// Ensure the default profile directory exists
425+
/// </summary>
426+
public static void EnsureDefaultProfileDirectoryExists()
427+
{
428+
if (!AzureSession.DataStore.DirectoryExists(AzureSession.ProfileDirectory))
429+
{
430+
AzureSession.DataStore.CreateDirectory(AzureSession.ProfileDirectory);
431+
}
432+
}
422433
}
423434
}

0 commit comments

Comments
 (0)