Skip to content

Commit

Permalink
Moved C# Fluent API to public
Browse files Browse the repository at this point in the history
  • Loading branch information
Hovsep Mkrtchyan committed Sep 15, 2016
0 parents commit 5a8eaf1
Show file tree
Hide file tree
Showing 797 changed files with 124,202 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
*.bmp binary
*.dll binary
*.gif binary
*.jpg binary
*.png binary
*.snk binary
*.exe binary
*.wmv binary
*.mp4 binary
*.ismv binary
*.isma binary

*.ascx text
*.cmd text
*.config text
*.cs text diff=csharp
*.csproj text merge=union
*.edmx text

*.htm text
*.html text

*.js text
*.json text

*.msbuild text
*.nuspec text

*.resx text
*.ruleset text
*.StyleCop text
*.targets text
*.txt text
*.xml text

*.sln text eol=crlf merge=union
143 changes: 143 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# Auth files
*.auth
*.azureauth

# User-specific files
*.suo
*.user
*.sln.docstates
.vs/
*.lock.json
developer/

# Build results
binaries/
[Dd]ebug*/
[Rr]elease/
build/
src/NuGet.Config
tools/7-zip/

[Tt]est[Rr]esult
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
*.vssscc
.builds

*.pidb

*.log
*.scc
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf

# Visual Studio profiler
*.psess
*.vsp

# Code analysis
*.CodeAnalysisLog.xml

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/

*.[Rr]e[Ss]harper

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish

# Publish Web Output
*.Publish.xml

# Others
[Bb]in
[Oo]bj
TestResults
[Tt]est[Rr]esult*
*.Cache
ClientBin
[Ss]tyle[Cc]op.*
~$*
*.dbmdl
node_modules

*.[Pp]ublish.xml

Generated_Code #added for RIA/Silverlight projects

# Build tasks
tools/*.dll

# Sensitive files
*.keys
*.pfx

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML

# NuGet
packages
packages/repositories.config

# Mac development
.DS_Store

# Specification DLLs
*.Specification.dll

# Generated readme.txt files #
src/*/readme.txt

build.out
.nuget/

# Azure Project
csx/
*.GhostDoc.xml
pingme.txt
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: csharp
sudo: required
dist: trusty
addons:
apt:
sources:
packages:
install:
- sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
- sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
- sudo apt-get update
- sudo apt-get install dotnet-dev-1.0.0-preview2-003121 -y
script:
- ./test_on_linux.sh
after_script:
- echo "========== Server log: ============"
- pwd
- ls -al
- ls -al TestResults
- cat TestResults/*.log
notifications:
slack:
secure: d0PFVLcyqcMxNtmZ8JaEpIBzXbUbZCgKs8QtBB5qEIXDnxflSR3AhczlILNhTBKtMEBlwVzsz65yP09XcmvB6xpAfJbHqSRzk2frKa5viPcAD8Wr/NYamt9/UiTCsnql8MqzjVy0tLdMscXKRmsUey4YF570zl0b7gAbq7XTqxM=
45 changes: 45 additions & 0 deletions Documentation/AuthConflictsBetweenSDKs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Bridging gap between old and new SDKs

Authentication conflicts can happen due to mixing old SDKs* and new SDKs*. SDKs that depend on The credential types created by the new authentication library (Microsoft.Rest.ClientRuntime.Azure.Authentication, type = ServiceClientCredentials) are incompatible with the credential types used in older SDKs (Microsoft.Azure.Common, type = SubscriptionCloudCredentials). The problem is that using two different authentication libraries will require you to authenticate twice, which is a painful experience.

Recommended solution
To bridge this gap, the following adapter allows you to use the new credentials with clients that require the older credential type.

Here’s the code for adapter
```
public class SubscriptionCredentialsAdapter : SubscriptionCloudCredentials
{
ServiceClientCredentials _credentials;
string _subscriptionId;
 
public SubscriptionCredentialsAdapter(ServiceClientCredentials wrapped, string subscriptionId)
{
_credentials = wrapped;
_subscriptionId = subscriptionId;
}
public override string SubscriptionId
{
get { return _subscriptionId; }
}
 
public override Task ProcessHttpRequestAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
return _credentials.ProcessHttpRequestAsync(request, cancellationToken);
}
}
```

Here is how you can use the adapter
```
var creds = UserTokenProvider.LoginWithPromptAsync(new ActiveDirectoryClientSettings(ClientId, new Uri(RedirectUri))).GetAwaiter().GetResult();
var subClient = new SubscriptionClient(creds);
var subscriptions = subClient.Subscriptions.List();
var insightClient = new HDInsightManagementClient(new SubscriptionCredentialsAdapter(creds, subscriptions.First().SubscriptionId));
var clusters = insightClient.Clusters.List();
```

Another solution would be to use the version of resource manager library that is based on Microsoft.Azure.Common. It can be found [here](https://www.nuget.org/packages/Microsoft.Azure.Management.Resources/).

* Old SDKs - The SDKs that depend on Microsoft.Azure.Common
* New SDKs - The SDKs that depend on Microsoft.Rest.ClientRuntime.Azure
59 changes: 59 additions & 0 deletions Documentation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Microsoft Azure SDK for .NET Documentation

The following services have SDKs that are generated from AutoRest

** Old SDKs (as of August 2016)
These SDKs depend on Microsoft.Azure.Common

| Service Name | Nuget Package |
| ------------ | --------------|
| Api Management | Microsoft.Azure.Management.ApiManagement |
| Automation | Microsoft.WindowsAzure.Management.Automation |
| Azure Backup | Microsoft.Azure.Management.BackupServices |
| Azure Stack | Microsoft.AzureStack.Management, Microsoft.AzureStack.Management.Storage |
| Commerce | Microsoft.Azure.Commerce.UsageAggregates |
| DataFactory | Microsoft.Azure.Management.DataFactories |
| DataLake | Microsoft.Azure.Management.DataLake.AnalyticsCatalog, Microsoft.Azure.Management.DataLake.AnalyticsJob, Microsoft.Azure.Management.DataLake.StoreFileSystem |
| ExpressRoute | Microsoft.WindowsAzure.Management.ExpressRoute |
| HdInsight | Microsoft.Azure.Management.HDInsight, Microsoft.Azure.Management.HDInsight.Job |
| Insights | Microsoft.Azure.Insights |
| Media Services | Microsoft.WindowsAzure.Management.MediaServices |
| Monitoring | Microsoft.WindowsAzure.Management.Monitoring |
| Operational Insights | Microsoft.Azure.Management.OperationalInsights |
| Recovery Services | Microsoft.Azure.Management.RecoveryServices, Microsoft.Azure.Management.RecoveryServices.Backup |
| ServerManagement | Microsoft.Azure.Management.ServerManagement |
| Site Recovery | Microsoft.Azure.Management.SiteRecovery |
| Sql | Microsoft.Azure.Management.Sql, Microsoft.WindowsAzure.Management.Sql |
| Stream Analytics | Microsoft.Azure.Management.StreamAnalytics |

* New SDKs (as of August 2016)
These SDKs depend on Microsoft.Rest.ClientRuntime.Azure

| Service Name | Nuget Package |
| ------------ | ------------- |
| Authorization | Microsoft.Azure.Management.Authorization |
| Batch | Azure.Batch |
| Cdn | Microsoft.Azure.Management.Cdn |
| Cognitive Services | Microsoft.Azure.Management.CognitiveServices |
| Compute | Microsoft.Azure.Management.Compute |
| DataLake Analytics | Microsoft.Azure.Management.DataLake.Analytics, Microsoft.Azure.Management.DataLake.Store |
| DevTestLabs | Microsoft.Azure.Management.DevTestLabs |
| Graph.RBAC | Microsoft.Azure.Graph.RBAC |
| Intune | Microsoft.Azure.Management.Intune |
| KeyVault | Microsoft.Azure.KeyVault, Microsoft.Azure.Management.KeyVault |
| Logic | Microsoft.Azure.Management.Logic |
| Machine Learning | Microsoft.Azure.Management.MachineLearning |
| Network | Microsoft.Azure.Management.Network |
| NotificationHubs | Microsoft.Azure.Management.NotificationHubs |
| PowerBI | Microsoft.Azure.Management.PowerBIEmbedded |
| Redis Cache | Microsoft.Azure.Management.Redis |
| Resource Manager (ARM) | Microsoft.Azure.Management.ResourceManager |
| Scheduler | Microsoft.WindowsAzure.Management.Scheduler |
| Search | Microsoft.Azure.Search |
| Storage | Microsoft.Azure.Management.Storage |
| Traffic Manager | Microsoft.Azure.Management.TrafficManager |
| Websites | Microsoft.Azure.Management.WebSites |

Please see at [Azure documentation](https://azure.microsoft.com/en-us/documentation/api/) for more details


21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 7 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!-- To Enable LocalFeed for testing uncomment the following line -->
<!-- <add key="Local" value="./tools/LocalFeed" /> -->
</packageSources>
</configuration>
Loading

0 comments on commit 5a8eaf1

Please sign in to comment.