About This Page
This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.
Bias Analysis
Bias Types:
⚠️
windows_first
⚠️
missing_linux_example
⚠️
windows_tools
Summary:
The documentation is heavily oriented toward Windows development environments. All instructions and examples assume the use of Visual Studio (Windows-only for .NET Framework), and there is no mention of Linux or cross-platform development tools. The tutorial steps, screenshots, and project templates are all specific to Windows and Visual Studio, with no guidance for Linux users or those using cross-platform .NET Core/SDK tools.
Recommendations:
- Provide equivalent instructions for Linux users, including how to set up the development environment using .NET Core/SDK CLI tools (dotnet CLI) instead of Visual Studio.
- Include examples and steps for creating, building, and running the projects using cross-platform tools (e.g., VS Code, JetBrains Rider, or the dotnet CLI).
- Clarify which parts of the tutorial require Windows-specific technologies (such as WCF with .NET Framework) and suggest alternatives or workarounds for Linux users.
- Add notes or sections that explicitly address Linux/macOS users, including any limitations or required adaptations.
- Where possible, use .NET 6+ and cross-platform project types (such as ASP.NET Core) to maximize compatibility.
Create pull request
Flagged Code Snippets
<services>
<service name="ProductsServer.ProductsService">
<endpoint address="sb://yourServiceNamespace.servicebus.windows.net/products" binding="netTcpRelayBinding" contract="ProductsServer.IProducts" behaviorConfiguration="products"/>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="products">
<transportClientEndpointBehavior>
<tokenProvider>
<sharedAccessSignature keyName="RootManageSharedAccessKey" key="yourKey" />
</tokenProvider>
</transportClientEndpointBehavior>
</behavior>
</endpointBehaviors>
</behaviors>
namespace ProductsServer
{
using System;
using System.Linq;
using System.Collections.Generic;
using System.ServiceModel;
// Implement the IProducts interface.
class ProductsService : IProducts
{
// Populate array of products for display on website
ProductData[] products =
new []
{
new ProductData{ Id = "1", Name = "Rock",
Quantity = "1"},
new ProductData{ Id = "2", Name = "Paper",
Quantity = "3"},
new ProductData{ Id = "3", Name = "Scissors",
Quantity = "5"},
new ProductData{ Id = "4", Name = "Well",
Quantity = "2500"},
};
// Display a message in the service console application
// when the list of products is retrieved.
public IList<ProductData> GetProducts()
{
Console.WriteLine("GetProducts called.");
return products;
}
}
class Program
{
// Define the Main() function in the service application.
static void Main(string[] args)
{
var sh = new ServiceHost(typeof(ProductsService));
sh.Open();
Console.WriteLine("Press ENTER to close");
Console.ReadLine();
sh.Close();
}
}
}
namespace ProductsServer
{
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel;
// Define the data contract for the service
[DataContract]
// Declare the serializable properties.
public class ProductData
{
[DataMember]
public string Id { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public string Quantity { get; set; }
}
// Define the service contract.
[ServiceContract]
interface IProducts
{
[OperationContract]
IList<ProductData> GetProducts();
}
interface IProductsChannel : IProducts, IClientChannel
{
}
}
namespace ProductsWeb.Controllers
{
using System.Linq;
using System.ServiceModel;
using System.Web.Mvc;
using Microsoft.ServiceBus;
using Models;
using ProductsServer;
public class HomeController : Controller
{
// Declare the channel factory.
static ChannelFactory<IProductsChannel> channelFactory;
static HomeController()
{
// Create shared access signature token credentials for authentication.
channelFactory = new ChannelFactory<IProductsChannel>(new NetTcpRelayBinding(),
"sb://yourServiceNamespace.servicebus.windows.net/products");
channelFactory.Endpoint.Behaviors.Add(new TransportClientEndpointBehavior {
TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider(
"RootManageSharedAccessKey", "yourKey") });
}
public ActionResult Index()
{
using (IProductsChannel channel = channelFactory.CreateChannel())
{
// Return a view of the products inventory.
return this.View(from prod in channel.GetProducts()
select
new Product { Id = prod.Id, Name = prod.Name,
Quantity = prod.Quantity });
}
}
}
}